From d0e5def3dabe4fc18fb1b4394945b6626840688b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 19:44:56 +0000 Subject: [PATCH 01/99] 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 0000000..ac9a2e7 --- /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 0000000..bbeb30b --- /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 0000000..4029396 --- /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 0000000..8779740 --- /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 0000000..43077b2 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.9.18 diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 0000000..7728de3 --- /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 0000000..492ca37 --- /dev/null +++ b/Brewfile @@ -0,0 +1,2 @@ +brew "rye" + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..42c71aa --- /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 0000000..4d4c7f9 --- /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 c2b730a..767efa3 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 0000000..0985c82 --- /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 0000000..b202ebb --- /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 0000000..05bfccb --- /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 0000000..d8c73e9 --- /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 0000000..333d91d --- /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 0000000..53bca7f --- /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 0000000..e01fa1d --- /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 0000000..f2da231 --- /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 0000000..aabc471 --- /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 0000000..8c5c60e --- /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 0000000..667ec2d --- /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 0000000..491fd6b --- /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 0000000..d2814ae --- /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 0000000..4fa5698 --- /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 0000000..37b3d94 --- /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 0000000..bf8d4c3 --- /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 0000000..064ec56 --- /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 0000000..1774727 --- /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 0000000..d89920d --- /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 0000000..a2ac3b6 --- /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 0000000..9377835 --- /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 0000000..715cc20 --- /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 0000000..42551b7 --- /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 0000000..274320c --- /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 0000000..7447644 --- /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 0000000..095cb42 --- /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 0000000..deacb4d --- /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 0000000..08a9539 --- /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 0000000..3efe66c --- /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 0000000..229b952 --- /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 0000000..ffd883e --- /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 0000000..89aa712 --- /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 0000000..f4a0208 --- /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 0000000..d0d8103 --- /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 0000000..47e262a --- /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 0000000..c036991 --- /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 0000000..0bba17c --- /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 0000000..e706ccb --- /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 0000000..5e2c99f --- /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 0000000..e69de29 diff --git a/src/gitpod/resources/__init__.py b/src/gitpod/resources/__init__.py new file mode 100644 index 0000000..51c3127 --- /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 0000000..b3b1c6f --- /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 0000000..499d699 --- /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 0000000..db0fddb --- /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 0000000..30799d8 --- /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 0000000..7b79a67 --- /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 0000000..8f56906 --- /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 0000000..7d2e747 --- /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 0000000..c8f898a --- /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 0000000..a7e31bb --- /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 0000000..439e89d --- /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 0000000..c1b4b70 --- /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 0000000..e7dee9f --- /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 0000000..9c7ef93 --- /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 0000000..019b79b --- /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 0000000..d4a1dbf --- /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 0000000..990dea1 --- /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 0000000..3ee6024 --- /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 0000000..dc1cf36 --- /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 0000000..eb374fe --- /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 0000000..fb9308f --- /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 0000000..f19aa8f --- /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 0000000..af3e5fa --- /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 0000000..4a28603 --- /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 0000000..4bd52c9 --- /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 0000000..30bfad7 --- /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 0000000..1cc9c8e --- /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 0000000..75b19c9 --- /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 0000000..03ac96d --- /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 0000000..8fad4d9 --- /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 0000000..d67db56 --- /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 0000000..158e737 --- /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 0000000..70841c4 --- /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 0000000..f2ea748 --- /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 0000000..49148f1 --- /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 0000000..dad7844 --- /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 0000000..df76068 --- /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 0000000..20d1c6d --- /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 0000000..601844e --- /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 0000000..fdf76ae --- /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 0000000..25d40d7 --- /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 0000000..24926cb --- /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 0000000..d969500 --- /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 0000000..057567b --- /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 0000000..5a0ca7b --- /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 0000000..dcc6cf7 --- /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 0000000..4b201f8 --- /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 0000000..c109c67 --- /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 0000000..1e81e27 --- /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 0000000..dc7659c --- /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 0000000..f74ba3d --- /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 0000000..e73d0fe --- /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 0000000..9324c00 --- /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 0000000..d54b380 --- /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 0000000..c4658fc --- /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 0000000..3e56259 --- /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 0000000..0bec031 --- /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 0000000..bea4167 --- /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 0000000..4c36249 --- /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 0000000..c1b47db --- /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 0000000..c622ca3 --- /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 0000000..e5be700 --- /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 0000000..110ddb5 --- /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 0000000..a06329a --- /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 0000000..fc2eab0 --- /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 0000000..7827114 --- /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 0000000..4fe19ee --- /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 0000000..fbd1064 --- /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 0000000..615aa15 --- /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 0000000..24698ae --- /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 0000000..86f4793 --- /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 0000000..38200c0 --- /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 0000000..1cd14a5 --- /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 0000000..fb0cbba --- /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 0000000..fbbeaa6 --- /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 0000000..ea2cbb0 --- /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 0000000..958c715 --- /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 0000000..137d135 --- /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 0000000..39d6441 --- /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 0000000..9a5d90d --- /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 0000000..e8e845d --- /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 0000000..477cbbd --- /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 0000000..3bf6e1b --- /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 0000000..03fcad0 --- /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 0000000..9727874 --- /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 0000000..9ebcf75 --- /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 0000000..df9cb4a --- /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 0000000..67322e1 --- /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 0000000..38f8b97 --- /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 0000000..5f440dc --- /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 0000000..040bb7f --- /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 0000000..bab7e5c --- /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 0000000..b8cb816 --- /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 0000000..88c94ca --- /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 0000000..4ba5ac3 --- /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 0000000..03cdbf6 --- /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 0000000..28f92ab --- /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 0000000..68e5d17 --- /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 0000000..b4d6d8a --- /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 0000000..fb34ff7 --- /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 0000000..1ce9bac --- /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 0000000..05eaa72 --- /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 0000000..5c9c596 --- /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 0000000..93f1b00 --- /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 0000000..21eda2d --- /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 0000000..cd4d8a2 --- /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 0000000..adf4dd1 --- /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 0000000..456f8f7 --- /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 0000000..c2a3461 --- /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 0000000..6dfedea --- /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 0000000..4888ede --- /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 0000000..da185a2 --- /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 0000000..c74f578 --- /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 0000000..005bf36 --- /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 0000000..3079471 --- /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 0000000..9598eb2 --- /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 0000000..e95c495 --- /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 0000000..ad28e81 --- /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 0000000..cb8e8b3 --- /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 0000000..907917e --- /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 0000000..7d26ea0 --- /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 0000000..5a41a1f --- /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 0000000..23eb230 --- /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 0000000..e6a747a --- /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 0000000..68ebd41 --- /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 0000000..ea94fed --- /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 0000000..1efc752 --- /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 0000000..7a8ffc7 --- /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 0000000..fb803be --- /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 0000000..ae3666c --- /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 0000000..d8022bb --- /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 0000000..504d854 --- /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 0000000..f178ffc --- /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 0000000..a7bf953 --- /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 0000000..9294c99 --- /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 0000000..012c7c0 --- /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 0000000..e6dbbb3 --- /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 0000000..09f823d --- /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 0000000..c131a24 --- /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 0000000..f51e857 --- /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 0000000..b748bd5 --- /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 0000000..3f3c18b --- /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 0000000..cafdbec --- /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 0000000..19b3cdb --- /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 0000000..f6945b8 --- /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 0000000..730960c --- /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 0000000..274244b --- /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 0000000..1a5eb59 --- /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 0000000..81bfb8c --- /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 0000000..619baec --- /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 0000000..4250621 --- /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 0000000..c552b27 --- /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 0000000..d69f3cd --- /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 0000000..e56003e --- /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 0000000..5911ed6 --- /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 0000000..3bdbef5 --- /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 0000000..9171f20 --- /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 0000000..4a6599f --- /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 0000000..7c5553e --- /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 0000000..9ce9379 --- /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 0000000..fd8019a --- /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 0000000..fd8019a --- /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 0000000..fd8019a --- /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 0000000..6bf94ee --- /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 0000000..843f007 --- /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 0000000..fd8019a --- /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 0000000..fd8019a --- /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 0000000..efed9ad --- /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 0000000..52a7e80 --- /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 0000000..7477de2 --- /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 0000000..fd8019a --- /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 0000000..dbb54e4 --- /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 0000000..2d2d96e --- /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 0000000..dd8a5f5 --- /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 0000000..d5311fb --- /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 0000000..fd8019a --- /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 0000000..1898f8f --- /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 0000000..4cda0e6 --- /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 0000000..fd8019a --- /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 0000000..f4b93e2 --- /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 0000000..fed1b11 --- /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 0000000..3343294 --- /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 0000000..281063f --- /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 0000000..db5f3ce --- /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 0000000..3b4591e --- /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 0000000..4ada66d --- /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 0000000..04dcaf3 --- /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 0000000..cfb45e2 --- /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 0000000..8fe3176 --- /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 0000000..9f9a7e4 --- /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 0000000..9bb0341 --- /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 0000000..115968e --- /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 0000000..f0a4ea0 --- /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 0000000..ef7ca2c --- /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 0000000..af5626b --- /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 0000000..a5df55d --- /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 0000000..c498f53 --- /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 0000000..0ca5a8d --- /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 0000000..efde0d4 --- /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 0000000..49f7dd6 --- /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 0000000..0ca7188 --- /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 0000000..84527ed --- /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 0000000..8e6ccd7 --- /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 0000000..7dedcf3 --- /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 0000000..53bb72d --- /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 0000000..a646569 --- /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 0000000..18d4ff6 --- /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 0000000..0a80aa6 --- /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 02/99] 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 b202ebb..a7db6ef 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 1774727..6d7ffc3 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 51c3127..3290b9e 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 7b79a67..c1ced3a 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 4bd52c9..6f7456f 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 1cc9c8e..617f816 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 75b19c9..6d74805 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 f2ea748..e33aeb7 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 20d1c6d..ddf0450 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 0000000..dda988a --- /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 6bf94ee..271d1b6 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 4cda0e6..1f03bf4 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 9f9a7e4..5a73d53 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 03/99] 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 767efa3..d58829a 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 e01fa1d..36c8c1c 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 f2da231..7125730 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 d89920d..4794129 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 42551b7..6cb469e 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 3efe66c..a7cff3c 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 47e262a..d7c0534 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 0bba17c..e5811bb 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 499d699..0000000 --- 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 4a28603..0000000 --- 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 30bfad7..0000000 --- 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 df76068..0000000 --- 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 1898f8f..0000000 --- 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 3343294..0000000 --- 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 8fe3176..0000000 --- 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 a5df55d..edce69c 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 49f7dd6..9217b51 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 53bb72d..6382db3 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 04/99] 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 d7c0534..a6b62ca 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 05/99] 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 271d1b6..1d40c2a 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 843f007..804d10a 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 1f03bf4..aa13dda 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 fed1b11..ac65320 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 db5f3ce..2703867 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 4ada66d..42b2680 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 04dcaf3..c06e96d 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 5a73d53..87605b0 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 9bb0341..53d6aa1 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 115968e..cc347f6 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 f0a4ea0..1e59c29 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 06/99] 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 36c8c1c..68f5599 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 7125730..afa9adb 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 d0d8103..8b3aaf2 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 edce69c..753b0fe 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 07/99] 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 4794129..df173f8 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 9217b51..b9bf37e 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 08/99] 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 d58829a..6a85cb5 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 09/99] 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 68f5599..e8242fe 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 df173f8..92d9ee6 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 10/99] 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 333d91d..cdf75b3 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 11/99] 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 064ec56..92ad9e5 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 12/99] 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 afa9adb..f569dc1 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 13/99] 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 bf8d4c3..4bba6eb 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 14/99] 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 f569dc1..3c057bc 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 aabc471..7e0380a 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 08a9539..618f188 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 15/99] 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 6a85cb5..0d12171 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 16/99] 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 e8242fe..4b41b83 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 3c057bc..d047e25 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 6cb469e..7a547ce 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 095cb42..73b2ce0 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 a7cff3c..d4fda26 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 c036991..278749b 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 b9bf37e..e2f4b78 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 0a80aa6..d7dbee6 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 17/99] 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 6d7ffc3..35976ab 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 019b79b..5f0d93f 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 18/99] 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 35976ab..6d7ffc3 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 5f0d93f..019b79b 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 19/99] 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 019b79b..5f0d93f 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 20/99] 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 6d7ffc3..35976ab 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 21/99] 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 0d12171..c08d217 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 22/99] 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 753b0fe..f49d0d3 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 23/99] chore(internal): codegen related update --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 4d4c7f9..01fd4f2 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 24/99] 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 7a547ce..d56ea1d 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 25/99] 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 4b41b83..dec24b0 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 d047e25..8ce360c 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 7e0380a..2699011 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 26/99] 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 2703867..171140a 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 27/99] 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 92ad9e5..6e59c86 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 28/99] docs: fix typos --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c08d217..149ff9a 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 29/99] chore(internal): codegen related update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 149ff9a..04e3188 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 30/99] 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 fb9308f..15eec02 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 f19aa8f..bc7eecd 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 6d74805..d4e1f9d 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 fdf76ae..bb3c3d4 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 d969500..8550a45 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 5a0ca7b..d26a33b 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 4b201f8..60048a2 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 1e81e27..2da79f5 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 dda988a..9fa2482 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 e73d0fe..1ef850b 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 d54b380..415e447 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 c4658fc..b89872f 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 bea4167..b4269a0 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 4c36249..4cc0629 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 c1b47db..1b11b97 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 c622ca3..ca2b1df 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 110ddb5..bb11b14 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 fc2eab0..c603be0 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 3bf6e1b..6a9e0ca 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 03fcad0..83d88cb 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 9727874..2ca765f 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 df9cb4a..524e615 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 5f440dc..b6b1921 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 040bb7f..2684921 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 88c94ca..0222e25 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 03cdbf6..ac96d70 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 b4d6d8a..fbd48e5 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 5c9c596..e8141dc 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 adf4dd1..5dd0c59 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 456f8f7..f9fcee8 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 e6a747a..1314f47 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 ea94fed..9f1c24c 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 fb803be..4b56dcf 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 ae3666c..c2502df 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 f178ffc..aca7c7c 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 9294c99..9c47a9b 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 cafdbec..6295fc6 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 81bfb8c..e9d3190 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 4250621..2057aa8 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 e56003e..b9ec55c 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 5911ed6..797a037 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 3bdbef5..374bef4 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 4a6599f..b79cd80 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 9ce9379..5d18b57 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 dd8a5f5..622647b 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 171140a..3935be5 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 c06e96d..42bc296 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 cfb45e2..97f21bc 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 87605b0..2179d56 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 1e59c29..e12ce11 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 31/99] 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 d56ea1d..9a918aa 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 e2f4b78..c581777 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 32/99] 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 cdf75b3..e2d1320 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 8ce360c..a3778f9 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 73b2ce0..4ecb06d 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 33/99] 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 1d40c2a..89b6349 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 2d2d96e..f6b8871 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 d5311fb..cab9981 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 3935be5..8152ace 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 42bc296..3c29197 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 97f21bc..203cdb3 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 2179d56..a662af6 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 53d6aa1..103743f 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 e12ce11..6bdacef 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 34/99] 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 b3b1c6f..0fc4f32 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 30799d8..69047e6 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 c1ced3a..e127edc 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 8f56906..c9d7e65 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 7d2e747..47793c0 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 c8f898a..376502a 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 c1b4b70..aa334ca 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 e7dee9f..de8a1ac 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 9c7ef93..bb8b607 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 5f0d93f..b218c61 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 d4a1dbf..4c13f95 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 990dea1..214b5b3 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 dc1cf36..720f511 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 eb374fe..1b078bd 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 15eec02..55b796f 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 bc7eecd..63b1bf9 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 af3e5fa..faf0f97 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 617f816..e194ddc 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 d4e1f9d..3757ceb 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 8fad4d9..057d92a 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 d67db56..d011ddc 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 158e737..67f5166 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 70841c4..cc8ddf9 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 35/99] 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 f49d0d3..60d6c31 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 36/99] chore(internal): avoid pytest-asyncio deprecation warning --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index dec24b0..1a28968 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 37/99] 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 4ecb06d..9ffc616 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 38/99] 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 4029396..c8a8a4f 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 8c5c60e..e84fe62 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 491fd6b..6a98ee4 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 39/99] 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 89b6349..1d40c2a 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 f6b8871..2d2d96e 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 cab9981..d5311fb 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 8152ace..3935be5 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 3c29197..42bc296 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 203cdb3..97f21bc 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 a662af6..2179d56 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 103743f..53d6aa1 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 6bdacef..e12ce11 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 40/99] 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 7728de3..e5a41ec 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 a7db6ef..76f2eb4 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 35976ab..2d71f5e 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 3290b9e..9fe24e8 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 0000000..1d6829f --- /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 e127edc..cc506cc 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 c9d7e65..a0143da 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 214b5b3..42a6c69 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 720f511..b7579ba 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 55b796f..d11201a 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 3757ceb..731708e 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 d011ddc..16d0c4b 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 67f5166..08b46fa 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 cc8ddf9..64ea8c5 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 e33aeb7..86aae49 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 49148f1..af2ad03 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 1a5eb59..610436c 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 0000000..683f2a2 --- /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 0000000..633fa6f --- /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 0000000..68e452b --- /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 619baec..a0a1e57 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 0000000..774b3d0 --- /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 ddf0450..d1000b3 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 601844e..0000000 --- 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 bb3c3d4..0000000 --- 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 24926cb..0000000 --- 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 8550a45..0000000 --- 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 d26a33b..8c4be18 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 dcc6cf7..d730d88 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 60048a2..1498e42 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 c109c67..f18d67d 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 2da79f5..960aeac 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 f74ba3d..44679a8 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 1ef850b..b460a4f 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 415e447..8a20139 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 b89872f..8f740ab 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 b4269a0..c331911 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 4cc0629..233bb62 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 1b11b97..ceb052e 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 ca2b1df..a2f8df5 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 e5be700..d0f5b6e 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 bb11b14..1e36318 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 c603be0..6806cc5 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 137d135..85ae8a9 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 83d88cb..259bd60 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 9ebcf75..0000000 --- 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 524e615..0000000 --- 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 38f8b97..fe73a2a 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 bab7e5c..8e730de 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 4ba5ac3..0000000 --- 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 ac96d70..0000000 --- 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 1ce9bac..0ddfb65 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 93f1b00..3347a5e 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 21eda2d..0000000 --- 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 cd4d8a2..0000000 --- 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 6dfedea..4e37b01 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 4888ede..46747b0 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 9598eb2..b03fcf1 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 ad28e81..ecfaf69 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 aca7c7c..65e80b0 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 9c47a9b..19d0d97 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 012c7c0..56bb0f2 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 e6dbbb3..e6b35d2 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 09f823d..66f0ce7 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 b748bd5..0000000 --- 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 3f3c18b..0000000 --- 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 e9d3190..0000000 --- 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 2057aa8..0000000 --- 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 b9ec55c..49e1d27 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 797a037..f981475 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 374bef4..6711bbd 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 b79cd80..579e609 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 7c5553e..0000000 --- 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 5d18b57..0000000 --- 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 1d40c2a..96eae4f 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 804d10a..d9002a9 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 dbb54e4..f945950 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 622647b..1f40316 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 aa13dda..dd607a2 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 ac65320..7de778a 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 0000000..049029b --- /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 3935be5..5921333 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 42bc296..2fa50bf 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 2179d56..735ae81 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 53d6aa1..f708a3c 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 cc347f6..e5abe09 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 e12ce11..41c234e 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 41/99] 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 e5a41ec..98c4a5a 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 76f2eb4..9a5dcc2 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 2d71f5e..475b362 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 9fe24e8..f87409f 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 db0fddb..0000000 --- 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 69047e6..0000000 --- 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 cc506cc..0000000 --- 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 6f7456f..8390b0a 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 0000000..cd4b0ca --- /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 0000000..68f0404 --- /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 08b46fa..24e8998 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 a0143da..b74c0a7 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 376502a..6b744c7 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 e194ddc..0000000 --- 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 731708e..0000000 --- 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 64ea8c5..0000000 --- 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 86aae49..d3764a1 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 d1000b3..0000000 --- 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 057567b..0000000 --- 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 8c4be18..0000000 --- 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 d730d88..0000000 --- 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 1498e42..0000000 --- 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 f18d67d..0000000 --- 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 960aeac..0000000 --- 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 dc7659c..0000000 --- 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 9fa2482..0000000 --- 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 0000000..f8ee8b1 --- /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 0000000..ee7c957 --- /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 274244b..11a2198 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 504d854..40ddeee 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 0000000..52ddbe1 --- /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 c552b27..69eee8a 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 d69f3cd..a86b414 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 49e1d27..623a064 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 f981475..d45c4d9 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 6711bbd..fa0f55e 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 25d40d7..2c11ff0 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 44679a8..e44966c 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 b460a4f..742b3c5 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 9324c00..222ca23 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 8a20139..4e4e9df 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 8f740ab..19c461b 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 e95c495..0000000 --- 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 ecfaf69..0000000 --- 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 cb8e8b3..0000000 --- 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 907917e..0000000 --- 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 7d26ea0..0000000 --- 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 5a41a1f..0000000 --- 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 23eb230..0000000 --- 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 1314f47..0000000 --- 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 68ebd41..0000000 --- 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 9f1c24c..0000000 --- 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 1efc752..0000000 --- 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 7a8ffc7..0000000 --- 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 4b56dcf..0000000 --- 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 c2502df..0000000 --- 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 d8022bb..0000000 --- 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 65e80b0..0000000 --- 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 a7bf953..0000000 --- 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 19d0d97..0000000 --- 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 56bb0f2..0000000 --- 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 9171f20..0000000 --- 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 579e609..0000000 --- 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 96eae4f..0000000 --- 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 e5abe09..febc172 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 d9002a9..bddf67f 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 dd607a2..0000000 --- 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 735ae81..0000000 --- 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 41c234e..0000000 --- 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 42/99] 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 04e3188..4bcacec 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 475b362..d018194 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 ef7ca2c..e83791a 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 60d6c31..ee17c4f 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 43/99] 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 d018194..102ca18 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 44/99] 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 102ca18..74b9b40 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 45/99] 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 98c4a5a..fda0493 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 9a5dcc2..f273f89 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 74b9b40..d7a1637 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 f87409f..80d277b 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 0000000..1dd95ed --- /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 d3764a1..f082231 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 0000000..bb8becb --- /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 0000000..c101adb --- /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 0000000..457fe1f --- /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 0000000..fb9635b --- /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 0000000..7291a3b --- /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 0000000..e327e68 --- /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 0000000..ae92d5e --- /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 46/99] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fda0493..47f9df9 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 47/99] 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 47f9df9..caf4ddc 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 4bcacec..04e3188 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 f273f89..27079ea 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 d7a1637..b1c0e7f 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 80d277b..d8a1578 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 0fc4f32..0000000 --- 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 47793c0..23a78c0 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 cd4b0ca..c761c0b 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 68f0404..8d618ab 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 24e8998..6769413 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 1d6829f..cb17125 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 b74c0a7..13345d5 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 6b744c7..0bf7506 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 1dd95ed..0000000 --- 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 de8a1ac..d2f030a 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 42a6c69..686d3ca 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 b7579ba..102168b 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 1b078bd..0a2bbb2 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 d11201a..43d226f 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 63b1bf9..92482d9 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 16d0c4b..d35f2d9 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 f082231..26e3f71 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 610436c..0000000 --- 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 683f2a2..0000000 --- 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 633fa6f..0000000 --- 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 68e452b..0000000 --- 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 774b3d0..0000000 --- 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 3e56259..3c2c3a7 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 0bec031..d90c634 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 c331911..4a26e70 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 233bb62..c15fc51 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 ceb052e..068e97b 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 a2f8df5..6b9ce0c 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 d0f5b6e..69fc3b4 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 1e36318..a057159 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 6806cc5..343f1a2 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 f8ee8b1..ec2c91c 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 af2ad03..afd240e 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 dad7844..f01ae1b 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 ee7c957..b6f6483 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 40ddeee..2866c3f 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 52ddbe1..d63169f 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 623a064..6cad65f 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 d45c4d9..487041f 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 fa0f55e..1c7b59b 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 0000000..78c3e7b --- /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 0000000..4995f69 --- /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 7291a3b..b13b311 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 0000000..79bd6e4 --- /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 457fe1f..eeb7a92 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 0000000..1d09883 --- /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 e44966c..763a6df 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 742b3c5..fc9945a 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 0000000..b0d4d35 --- /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 0000000..324e1e0 --- /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 4e4e9df..59a79a8 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 c101adb..0000000 --- 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 fb9635b..0000000 --- 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 e327e68..0000000 --- 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 fb0cbba..f277e67 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 ea2cbb0..1b2a121 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 958c715..943327a 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 85ae8a9..f615f04 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 9a5d90d..2cca516 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 e8e845d..4b755ef 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 6a9e0ca..989a385 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 2ca765f..805963c 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 bb8becb..42abf44 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 0000000..20c86c6 --- /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 8e730de..bab7e5c 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 0000000..d8ca669 --- /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 0000000..ac96d70 --- /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 28f92ab..c31f077 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 68e5d17..43a1b68 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 0ddfb65..490adf7 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 e8141dc..907435a 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 3347a5e..7be80fe 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 0000000..82d0758 --- /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 0000000..b0f7be1 --- /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 46747b0..0a2e92b 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 b03fcf1..cda7e27 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 e6b35d2..4155c49 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 66f0ce7..2c0da5a 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 a0a1e57..786b07d 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 0000000..b4ca023 --- /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 f6945b8..af0ca92 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 730960c..452fe18 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 0000000..d3e7442 --- /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 bddf67f..2c05eed 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 7de778a..2f6ccfe 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 f945950..c3ec095 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 1f40316..03d373c 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 049029b..0000000 --- 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 5921333..61b6404 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 ae92d5e..0000000 --- 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 2fa50bf..05dd31b 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 f708a3c..fc18a89 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 e83791a..ef7ca2c 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 ee17c4f..60d6c31 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 48/99] 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 04e3188..dc9f51d 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 b1c0e7f..9674ef4 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 ef7ca2c..d7bb7fa 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 60d6c31..289b035 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 49/99] 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 caf4ddc..77a06ef 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 27079ea..92e9168 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 9674ef4..6501485 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 d8a1578..a132d98 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 0000000..1dd95ed --- /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 26e3f71..e184d63 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 0000000..bb8becb --- /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 0000000..c101adb --- /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 0000000..457fe1f --- /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 0000000..fb9635b --- /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 0000000..7291a3b --- /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 0000000..e327e68 --- /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 0000000..ae92d5e --- /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 50/99] 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 23a78c0..b7c9133 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 686d3ca..f675798 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 0a2bbb2..c1ecfdd 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 3c2c3a7..0b6e8bf 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 afd240e..1be42d0 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 d63169f..54e3a7c 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 487041f..73e3a89 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 1c7b59b..1456b53 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 fc9945a..4fad3a9 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 324e1e0..b79d2e3 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 989a385..7159733 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 259bd60..daabb2b 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 805963c..d5247b6 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 20c86c6..127cef1 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 c31f077..c348fd4 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 febc172..e32257c 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 d3e7442..e3ac1d5 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 2c05eed..e893858 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 7477de2..bb5da0f 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 2d2d96e..c1e7c53 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 03d373c..8120572 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 f4b93e2..410b9ad 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 281063f..9be76d4 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 61b6404..b608353 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 42b2680..734793b 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 fc18a89..d58877b 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 51/99] 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 77a06ef..c91205c 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 92e9168..17d10f0 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 b7c9133..54e7fff 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 cb17125..f8c0c3c 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 a7e31bb..aa07d9b 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 bb8b607..0000000 --- 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 b218c61..c081923 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 f675798..cb1195a 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 c1ecfdd..a5a6732 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 43d226f..09b5444 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 92482d9..1b3a287 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 faf0f97..3a801fa 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 d35f2d9..c0042ba 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 e184d63..449a944 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 0b6e8bf..82acdd2 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 4a26e70..3886c64 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 c15fc51..d047640 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 068e97b..e45f4aa 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 6b9ce0c..d33eede 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 a057159..f3e5bc1 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 343f1a2..8ec16fb 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 1be42d0..3285979 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 54e3a7c..3ee8763 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 6cad65f..e31fb35 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 73e3a89..a1d9bf6 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 1456b53..3a91f48 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 4995f69..192e7f7 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 79bd6e4..dc0a5dc 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 1d09883..6b28601 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 4fad3a9..eebde11 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 b79d2e3..a9b4c05 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 59a79a8..ff5ebb4 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 19c461b..adb1ba2 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 943327a..77441c3 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 f615f04..63fcc10 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 615aa15..7230e49 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 7159733..2929960 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 daabb2b..0e9a1c4 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 d5247b6..dfec43d 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 127cef1..5744cec 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 b6b1921..830bdab 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 2684921..6eb4fcc 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 0222e25..0cee49c 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 ac96d70..52e9052 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 c348fd4..9cbaf8f 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 fbd48e5..f26ca51 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 907435a..7d1cb30 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 5dd0c59..eb360a3 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 f9fcee8..d32fee9 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 6295fc6..c875054 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 e32257c..338ad17 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 e3ac1d5..f7d6356 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 e893858..febb4ef 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 2f6ccfe..cf302b0 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 bb5da0f..0000000 --- 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 c1e7c53..14f6251 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 8120572..baff330 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 d5311fb..e83be4b 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 9be76d4..8ee23ac 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 b608353..a949657 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 3b4591e..58d19c5 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 05dd31b..5529ac0 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 97f21bc..3457037 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 d58877b..ffb4d2b 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 52/99] 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 dc9f51d..151820a 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 6501485..7b80453 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 54e7fff..4dd9e00 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 8d618ab..1e125a2 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 6769413..926f671 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 f8c0c3c..9da3603 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 13345d5..594d5f9 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 0bf7506..734419d 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 1dd95ed..893f759 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 aa334ca..d8a6b16 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 d2f030a..29433ad 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 c081923..af2717b 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 4c13f95..dcd2f3a 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 cb1195a..07e928f 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 102168b..bf56b71 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 a5a6732..83d86e3 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 09b5444..79ad965 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 1b3a287..5a272cc 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 3a801fa..db9262f 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 057d92a..e299e14 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 c0042ba..76a1b1c 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 82acdd2..b12968e 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 3886c64..4750f3b 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 e45f4aa..34eff02 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 69fc3b4..a9dfe22 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 a06329a..7be510e 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 7827114..83fe0a4 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 3285979..7810ea2 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 11a2198..2fc5f3d 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 2866c3f..5ef181d 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 69eee8a..237ab1e 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 a86b414..fcb5e25 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 e31fb35..7e31293 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 a1d9bf6..976165e 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 2c11ff0..d1e4073 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 78c3e7b..47c7982 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 b13b311..356e9b2 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 eeb7a92..3bb2999 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 6b28601..428719a 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 763a6df..af1afb5 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 b0d4d35..acd7ec7 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 222ca23..e9b4703 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 adb1ba2..8ac5aae 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 bb8becb..e9114bd 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 457fe1f..43dd951 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 7291a3b..e1d4c82 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 4fe19ee..c2c2993 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 77441c3..8ce2f9f 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 fbd1064..1a81fb4 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 86f4793..6a17886 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 1cd14a5..7caa9f4 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 fbbeaa6..3a6a5fd 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 39d6441..bcd3775 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 2cca516..301968b 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 477cbbd..17da3e4 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 0e9a1c4..0f4dcfe 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 42abf44..0160fa6 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 67322e1..c3a5db4 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 830bdab..21266e5 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 b8cb816..e7e60ee 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 d8ca669..4425cec 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 9cbaf8f..62a00f0 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 f26ca51..e5df284 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 fb34ff7..f3c7a10 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 05eaa72..f7de02b 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 7d1cb30..718524b 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 82d0758..c544285 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 eb360a3..b352d95 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 d32fee9..4e8e6ff 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 4e37b01..7c10ca8 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 da185a2..8bf7b70 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 005bf36..0d1668a 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 3079471..b7a1cb1 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 4155c49..cfeff67 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 c131a24..986d37b 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 786b07d..409766f 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 c875054..d7562f6 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 af0ca92..69b8c0b 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 338ad17..a113567 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 f7d6356..9875b72 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 febb4ef..e73825e 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 cf302b0..6a61c29 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 efed9ad..d364307 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 52a7e80..9adf95c 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 c3ec095..5d6a4ff 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 14f6251..c082c59 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 baff330..904c020 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 e83be4b..17180f3 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 410b9ad..59d1efd 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 8ee23ac..fd17217 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 a949657..0ece6d7 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 ae92d5e..bdd08d3 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 58d19c5..457813b 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 734793b..4dfef7c 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 5529ac0..3e67559 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 3457037..acc9ced 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 ffb4d2b..3df6d52 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 d7bb7fa..b061ad5 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 289b035..97b1fff 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 53/99] 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 151820a..9d64ee9 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 7b80453..56365ac 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 b061ad5..51e5090 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 97b1fff..f49ffc4 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 54/99] 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 9d64ee9..dc9f51d 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 56365ac..6501485 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 0000000..f3baede --- /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 4dd9e00..54e7fff 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 1e125a2..8d618ab 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 926f671..6769413 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 9da3603..f8c0c3c 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 594d5f9..13345d5 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 734419d..0bf7506 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 893f759..1dd95ed 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 d8a6b16..aa334ca 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 29433ad..d2f030a 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 af2717b..c081923 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 dcd2f3a..4c13f95 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 07e928f..cb1195a 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 bf56b71..102168b 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 83d86e3..a5a6732 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 79ad965..09b5444 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 5a272cc..1b3a287 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 db9262f..3a801fa 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 e299e14..057d92a 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 76a1b1c..c0042ba 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 b12968e..82acdd2 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 4750f3b..3886c64 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 34eff02..e45f4aa 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 a9dfe22..69fc3b4 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 7be510e..a06329a 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 83fe0a4..7827114 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 7810ea2..3285979 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 2fc5f3d..11a2198 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 5ef181d..2866c3f 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 237ab1e..69eee8a 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 fcb5e25..a86b414 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 7e31293..e31fb35 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 976165e..a1d9bf6 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 d1e4073..2c11ff0 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 47c7982..78c3e7b 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 356e9b2..b13b311 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 3bb2999..eeb7a92 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 428719a..6b28601 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 af1afb5..763a6df 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 acd7ec7..b0d4d35 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 e9b4703..222ca23 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 8ac5aae..adb1ba2 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 e9114bd..bb8becb 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 43dd951..457fe1f 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 e1d4c82..7291a3b 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 c2c2993..4fe19ee 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 8ce2f9f..77441c3 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 1a81fb4..fbd1064 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 6a17886..86f4793 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 7caa9f4..1cd14a5 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 3a6a5fd..fbbeaa6 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 bcd3775..39d6441 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 301968b..2cca516 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 17da3e4..477cbbd 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 0f4dcfe..0e9a1c4 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 0160fa6..42abf44 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 c3a5db4..67322e1 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 21266e5..830bdab 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 e7e60ee..b8cb816 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 4425cec..d8ca669 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 62a00f0..9cbaf8f 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 e5df284..f26ca51 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 f3c7a10..fb34ff7 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 f7de02b..05eaa72 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 718524b..7d1cb30 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 c544285..82d0758 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 b352d95..eb360a3 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 4e8e6ff..d32fee9 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 7c10ca8..4e37b01 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 8bf7b70..da185a2 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 0d1668a..005bf36 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 b7a1cb1..3079471 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 cfeff67..4155c49 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 986d37b..c131a24 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 409766f..786b07d 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 d7562f6..c875054 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 69b8c0b..af0ca92 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 a113567..338ad17 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 9875b72..f7d6356 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 e73825e..febb4ef 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 6a61c29..cf302b0 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 d364307..efed9ad 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 9adf95c..52a7e80 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 5d6a4ff..c3ec095 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 c082c59..14f6251 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 904c020..baff330 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 17180f3..e83be4b 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 59d1efd..410b9ad 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 fd17217..8ee23ac 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 0ece6d7..a949657 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 bdd08d3..ae92d5e 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 457813b..58d19c5 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 4dfef7c..734793b 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 3e67559..5529ac0 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 acc9ced..3457037 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 3df6d52..ffb4d2b 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 51e5090..d7bb7fa 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 f49ffc4..289b035 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 55/99] 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 c91205c..ef35b8b 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 17d10f0..c5d60f2 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 6501485..3fad133 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 f3baede..0000000 --- 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 a132d98..1e169c2 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 0000000..a81cb70 --- /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 0000000..1b4779a --- /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 8390b0a..854ce71 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 c761c0b..a9f609d 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 8d618ab..0fe73d8 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 6769413..dec0277 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 0000000..5c1a049 --- /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 0000000..a6206e0 --- /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 13345d5..40e8a3d 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 54e7fff..b272a36 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 0bf7506..edba88c 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 0000000..4dc3ff5 --- /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 0000000..8bfb6a6 --- /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 1dd95ed..66ece2e 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 aa07d9b..164bee2 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 439e89d..0000000 --- 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 aa334ca..0000000 --- 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 cb1195a..81e26e8 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 c081923..04dddd1 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 0000000..986668a --- /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 4c13f95..0000000 --- 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 0000000..da8b964 --- /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 f8c0c3c..ee4a482 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 0000000..b9a7513 --- /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 3ee6024..0000000 --- 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 3a801fa..0000000 --- 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 03ac96d..27ce34c 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 0000000..848f99c --- /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 1b3a287..0e6273c 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 a5a6732..e7a3e50 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 09b5444..13ed925 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 d2f030a..347bf5d 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 0000000..8c00274 --- /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 057d92a..582d4f9 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 c0042ba..f06bc67 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 0000000..8e50019 --- /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 0000000..c138e0b --- /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 0000000..3edadb7 --- /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 102168b..e016457 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 449a944..9644e1c 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 3079471..753b0f3 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 0000000..0c39c77 --- /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 0000000..e0cb613 --- /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 0000000..6d2dc4d --- /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 0000000..987cfec --- /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 0000000..9330e5a --- /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 0000000..d0dffe2 --- /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 0000000..b241f1b --- /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 0000000..a4355f0 --- /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 0000000..9338071 --- /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 0000000..b0ee8eb --- /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 0000000..68bde29 --- /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 0000000..774b3d0 --- /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 82acdd2..0000000 --- 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 3886c64..4413cb6 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 d047640..fac2dc9 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 0000000..9933a9b --- /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 0000000..fb1aca3 --- /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 e45f4aa..7b8da70 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 d33eede..0573ca9 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 0000000..bc66b2b --- /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 69fc3b4..a9449f0 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 f3e5bc1..16e8fa8 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 0000000..bbab16b --- /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 a06329a..8079b8a 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 8ec16fb..f4b32cc 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 0000000..5f2b96a --- /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 0000000..be559eb --- /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 ec2c91c..240da5e 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 b6f6483..58ee02d 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 0000000..386d562 --- /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 0000000..2ae3f28 --- /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 2866c3f..f368c31 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 0000000..37b1cc1 --- /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 0000000..70832cb --- /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 78c3e7b..0000000 --- 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 6b28601..0000000 --- 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 763a6df..4a4900b 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 b0d4d35..ea568b4 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 ff5ebb4..35d969e 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 0000000..fd37332 --- /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 0000000..824e42e --- /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 192e7f7..8a862ec 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 0000000..f10cdf3 --- /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 dc0a5dc..b42c9e3 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 b13b311..496a5e8 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 0000000..e7ee63f --- /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 43a1b68..b097e92 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 0000000..2a529ee --- /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 0000000..a47dd0a --- /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 0000000..1303a6a --- /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 0000000..ec289a8 --- /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 0000000..f10ea98 --- /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 0000000..c07f53d --- /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 457fe1f..1c9f8e4 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 0000000..e21c4e1 --- /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 0000000..4d0e78c --- /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 0000000..1c08ed3 --- /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 0000000..4055079 --- /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 0000000..3ea1469 --- /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 77441c3..ab47dac 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 0000000..2daac43 --- /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 0000000..8232fcc --- /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 0000000..5fb3aea --- /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 0000000..998839c --- /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 0000000..51f2345 --- /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 0000000..314e1e8 --- /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 7230e49..0cc2d0e 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 24698ae..0000000 --- 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 0000000..38befbf --- /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 38200c0..16c355a 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 0000000..3056bf1 --- /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 0000000..6909b0e --- /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 b8cb816..d7301f3 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 0000000..16d4faa --- /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 0000000..f0e66af --- /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 0000000..6f72339 --- /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 0000000..c5b31cf --- /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 0000000..b550a13 --- /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 2cca516..0000000 --- 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 2929960..c9e9529 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 0e9a1c4..708cecd 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 dfec43d..96ecc71 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 0000000..8004da1 --- /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 0000000..df0843b --- /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 0000000..da32fdb --- /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 42abf44..121cff2 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 5744cec..b8c2c73 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 0000000..c8ac42c --- /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 0000000..f90b85b --- /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 0000000..7bea3a6 --- /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 0000000..dcbee1c --- /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 0000000..217faeb --- /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 82d0758..28c08ec 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 0000000..527570b --- /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 0000000..33a9fac --- /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 0000000..fd763d6 --- /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 0000000..5a5a9c8 --- /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 830bdab..0000000 --- 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 0cee49c..0000000 --- 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 9cbaf8f..0000000 --- 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 7d1cb30..0000000 --- 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 005bf36..a3e0101 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 4155c49..a1f3821 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 786b07d..bff2558 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 0000000..28bcc60 --- /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 c875054..0000000 --- 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 19b3cdb..aa75098 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 0000000..03cc356 --- /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 6eb4fcc..a16f687 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 bab7e5c..d614bb2 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 0000000..28287cd --- /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 0000000..47198a0 --- /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 0000000..b8aa929 --- /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 d90c634..1a0b950 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 0000000..56caf95 --- /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 0000000..eafeed5 --- /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 f26ca51..7bcfd5f 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 0000000..feba485 --- /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 490adf7..f3c4aeb 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 05eaa72..cc74f92 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 0000000..4c46172 --- /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 7be80fe..63f9525 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 0000000..c0c1092 --- /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 b0f7be1..92fca92 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 eb360a3..9979ef2 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 0000000..64bc845 --- /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 52e9052..8ebcad6 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 d32fee9..fad0a6b 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 c2a3461..b71bc66 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 eeb7a92..7fb7d75 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 0000000..53cabab --- /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 0000000..7b1fc5e --- /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 0000000..4f26afc --- /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 0000000..619b46d --- /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 0000000..00c0d0f --- /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 0000000..b0c6aa6 --- /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 0000000..5ab2ef2 --- /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 d8ca669..0f6af17 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 af0ca92..527570b 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 0000000..b8e23b9 --- /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 0000000..15e3918 --- /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 0000000..ea4f7a1 --- /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 0000000..53a103b --- /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 fb34ff7..c7cd3ad 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 0000000..7b5a866 --- /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 0000000..80a70ac --- /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 0000000..e546a63 --- /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 0000000..7bbbf13 --- /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 0000000..a38e7c4 --- /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 0000000..010f08d --- /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 0000000..7b2d2f9 --- /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 86f4793..a3719c4 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 0000000..c5d40ad --- /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 39d6441..f307dac 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 0000000..bad3d23 --- /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 cda7e27..8b46880 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 0000000..a28b33e --- /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 4b755ef..944942e 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 0000000..2f9f561 --- /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 338ad17..d523efc 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 f7d6356..0000000 --- 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 febb4ef..1ccf9ff 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 8ee23ac..861d3bb 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 52a7e80..246a07d 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 0000000..fc90584 --- /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 0000000..4cd564a --- /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 c3ec095..0000000 --- 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 e83be4b..0000000 --- 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 0000000..fd8019a --- /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 14f6251..41ce113 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 baff330..1153fe3 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 efed9ad..87f404a 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 0000000..c22ad98 --- /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 3457037..30cbd66 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 410b9ad..3ca7e01 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 0000000..c32b438 --- /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 0000000..776748c --- /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 a949657..6c117e9 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 0000000..f539a4b --- /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 0000000..a7c2f9b --- /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 ae92d5e..a7d9310 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 58d19c5..9caa1fe 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 734793b..0000000 --- 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 5529ac0..0ecb83c 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 ffb4d2b..9bfb347 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 0000000..a1936fa --- /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 0000000..84d9bfa --- /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 0000000..fd8019a --- /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 0000000..cd34d91 --- /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 56/99] 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 0000000..f3baede --- /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 57/99] 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 f3baede..c9ab21f 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 58/99] 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 ef35b8b..dc33012 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 edba88c..4960954 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 4dc3ff5..b7ecd01 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 04dddd1..7048378 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 986668a..4dc3e3c 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 b9a7513..4a9da9b 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 0e6273c..ce13d00 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 e7a3e50..8441045 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 13ed925..bdb2737 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 8c00274..aa1d1f0 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 f06bc67..9f099a5 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 8e50019..03b2b30 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 d0dffe2..b181205 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 a4355f0..3af4fa8 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 774b3d0..a6896ce 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 4413cb6..f18ebb6 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 fac2dc9..805cf82 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 7b8da70..48f448e 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 0573ca9..5debb71 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 16e8fa8..459782f 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 f4b32cc..c2c065c 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 be559eb..108189b 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 3285979..4b36e6a 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 386d562..d575602 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 2ae3f28..ccf0ba2 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 3ee8763..9041204 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 70832cb..49c792d 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 e31fb35..6cad65f 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 a1d9bf6..32cdb0e 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 3a91f48..e3ce966 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 eebde11..4d3881c 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 a9b4c05..866e543 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 35d969e..7575b51 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 adb1ba2..19c461b 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 8a862ec..bf26a88 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 b42c9e3..22437f9 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 1303a6a..bc1fdbb 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 4055079..cdc8f4d 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 51f2345..9cd2753 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 b550a13..d315b1f 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 c9e9529..f4f2277 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 708cecd..c9fe81c 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 96ecc71..6e7065b 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 da32fdb..db8dffd 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 b8c2c73..c7a33db 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 c8ac42c..f5df394 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 f90b85b..b413047 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 4e37b01..cd56000 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 0a2e92b..5591848 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 2c0da5a..0012aca 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 b4ca023..d1a7072 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 28bcc60..662314e 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 03cc356..5a41830 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 a16f687..0e4d918 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 7bcfd5f..2300427 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 9979ef2..2abc362 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 8ebcad6..bd3a4e7 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 fad0a6b..4640545 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 7b1fc5e..0840c28 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 619b46d..1f4e7e5 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 00c0d0f..53798b9 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 ea4f7a1..ed91020 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 53a103b..3b95c81 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 7bbbf13..eb9f46d 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 d523efc..a0a50e0 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 1ccf9ff..85c01b8 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 fc90584..e3871d6 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 41ce113..bf6b49c 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 1153fe3..75187e6 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 c22ad98..c7ce295 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 30cbd66..28a64c3 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 6c117e9..46a127e 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 f539a4b..5f8aa01 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 9caa1fe..3466663 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 0ecb83c..7aaef4d 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 9bfb347..1cfbd44 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 a1936fa..443c6f7 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 59/99] 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 dc33012..fdef86a 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 4960954..edba88c 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 b7ecd01..4dc3ff5 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 7048378..04dddd1 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 4dc3e3c..986668a 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 4a9da9b..b9a7513 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 ce13d00..0e6273c 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 8441045..e7a3e50 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 bdb2737..13ed925 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 aa1d1f0..8c00274 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 9f099a5..d8d7edf 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 03b2b30..8e50019 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 b181205..d0dffe2 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 f18ebb6..4413cb6 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 805cf82..fac2dc9 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 48f448e..7b8da70 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 5debb71..0573ca9 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 459782f..16e8fa8 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 c2c065c..f4b32cc 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 108189b..be559eb 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 4b36e6a..3285979 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 d575602..386d562 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 ccf0ba2..2ae3f28 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 9041204..3ee8763 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 49c792d..70832cb 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 6cad65f..e31fb35 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 32cdb0e..a1d9bf6 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 e3ce966..3a91f48 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 4d3881c..eebde11 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 866e543..a9b4c05 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 7575b51..35d969e 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 19c461b..adb1ba2 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 bf26a88..8a862ec 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 22437f9..b42c9e3 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 bc1fdbb..1303a6a 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 cdc8f4d..4055079 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 9cd2753..51f2345 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 d315b1f..b550a13 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 f4f2277..c9e9529 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 c9fe81c..708cecd 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 6e7065b..96ecc71 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 db8dffd..da32fdb 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 c7a33db..b8c2c73 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 f5df394..c8ac42c 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 b413047..f90b85b 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 662314e..28bcc60 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 5a41830..03cc356 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 0e4d918..a16f687 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 2300427..7bcfd5f 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 2abc362..9979ef2 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 bd3a4e7..8ebcad6 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 4640545..fad0a6b 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 0840c28..7b1fc5e 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 1f4e7e5..619b46d 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 53798b9..00c0d0f 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 ed91020..ea4f7a1 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 3b95c81..53a103b 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 eb9f46d..7bbbf13 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 a0a50e0..d523efc 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 85c01b8..1ccf9ff 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 e3871d6..fc90584 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 bf6b49c..41ce113 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 75187e6..1153fe3 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 c7ce295..c22ad98 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 28a64c3..30cbd66 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 46a127e..6c117e9 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 5f8aa01..f539a4b 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 3466663..9caa1fe 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 7aaef4d..0ecb83c 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 1cfbd44..ecb141d 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 443c6f7..a1936fa 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 60/99] 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 c9ab21f..a149247 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 61/99] 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 c5d60f2..320dc6f 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 a81cb70..8246a68 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 1b4779a..0f41191 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 dec0277..f3e82f2 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 a6206e0..e3f0557 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 40e8a3d..15d4794 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 edba88c..5400fae 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 66ece2e..1dd95ed 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 81e26e8..7f5333f 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 04dddd1..9597f1f 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 986668a..d3207ff 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 b9a7513..d62320e 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 e7a3e50..63025cc 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 13ed925..ebf8f41 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 347bf5d..5bb5cff 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 8c00274..19f8d77 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 d8d7edf..5d6ff28 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 8e50019..e2a7da0 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 3edadb7..766fe0a 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 e016457..04174ae 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 0c39c77..adf2e06 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 9330e5a..2ec77f4 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 68bde29..a0a1e57 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 8079b8a..a06329a 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 37b1cc1..247621f 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 ea568b4..b0d4d35 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 f10cdf3..2d751ff 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 1c9f8e4..457fe1f 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 5fb3aea..f9526f6 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 38befbf..33c941d 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 6f72339..c679072 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 121cff2..42abf44 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 bff2558..786b07d 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 56caf95..de55e41 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 c0c1092..7933cb2 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 64bc845..b69e510 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 4f26afc..093d3d6 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 7b5a866..3b18313 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 010f08d..2b7ca60 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 bad3d23..b57c119 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 2f9f561..d277123 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 d523efc..2f8c9b1 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 1ccf9ff..b8c7fef 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 246a07d..877e888 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 fc90584..8a7cede 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 41ce113..2e292f1 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 1153fe3..1cc1de4 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 87f404a..502a547 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 c22ad98..a42ff10 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 c32b438..3a8ce5a 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 776748c..ae3e02f 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 6c117e9..fd55df7 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 a7d9310..ae92d5e 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 9caa1fe..73fee22 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 0ecb83c..a607e84 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 ecb141d..cc69754 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 a1936fa..a7a0be4 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 84d9bfa..edef99a 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 cd34d91..1904dc1 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 62/99] 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 a2ac3b6..6ddf2c7 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 63/99] 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 1a28968..4fb1f51 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 a3778f9..a050918 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 37b3d94..0cf2bd2 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 9a918aa..12c34b7 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 64/99] 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 fdef86a..f1e1d64 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 320dc6f..894da1c 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 0000000..e9d29a1 --- /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 9ffc616..de6c36a 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 4dc3ff5..508d773 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 f539a4b..d24091b 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 65/99] 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 a149247..cfbe661 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 66/99] 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 dc9f51d..fff0727 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 289b035..1662840 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 67/99] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f1e1d64..aa87812 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 68/99] 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 cfbe661..7f903e8 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 69/99] 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 aa87812..54b5007 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 fff0727..b43b2f8 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 894da1c..b209491 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 7f903e8..cfbe661 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 8246a68..1d70bbd 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 0f41191..fa1c787 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 0fe73d8..92069a0 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 f3e82f2..ce3490f 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 e3f0557..fa40eef 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 15d4794..0e9e8e6 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 b272a36..1e8ed9e 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 5400fae..d66c497 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 508d773..f2f9805 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 8bfb6a6..b0d965e 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 1dd95ed..893f759 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 7f5333f..872373d 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 9597f1f..b0e93c4 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 d3207ff..414ae66 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 ee4a482..70f043f 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 d62320e..2c77a8b 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 0e6273c..d5317a1 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 63025cc..216bacb 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 ebf8f41..c816544 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 5bb5cff..c1f555c 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 19f8d77..7108e73 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 582d4f9..b235507 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 5d6ff28..82f8e86 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 e2a7da0..72b1004 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 766fe0a..17474a1 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 04174ae..e79311c 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 753b0f3..93e5bf1 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 adf2e06..5c5f85d 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 6d2dc4d..e7c5da7 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 987cfec..231fb82 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 2ec77f4..ad9497e 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 b241f1b..1318467 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 3af4fa8..9c4e96f 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 9338071..a4a34df 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 a0a1e57..9b01102 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 4413cb6..819fea6 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 fac2dc9..b4ab8c6 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 9933a9b..ba9f17e 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 7b8da70..ee192d9 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 0573ca9..22377c6 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 bc66b2b..20ce84f 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 a9449f0..29a2601 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 16e8fa8..b193d66 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 bbab16b..c88cd10 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 a06329a..7be510e 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 f4b32cc..5c40bae 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 7827114..83fe0a4 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 5f2b96a..885db41 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 be559eb..332cd62 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 3285979..6c32b86 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 386d562..5b50327 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 2ae3f28..5e01ca6 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 11a2198..2fc5f3d 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 f368c31..c2c08b0 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 3ee8763..6eb25a7 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 247621f..857888a 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 70832cb..6a83eb9 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 69eee8a..237ab1e 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 a86b414..fcb5e25 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 e31fb35..d45d4ce 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 a1d9bf6..f745490 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 3a91f48..22c1db5 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 2c11ff0..d1e4073 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 4a4900b..7afc694 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 eebde11..e27ba17 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 b0d4d35..acd7ec7 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 a9b4c05..cd0c4d6 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 222ca23..e9b4703 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 35d969e..9aee77c 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 adb1ba2..8ac5aae 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 824e42e..37ad255 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 8a862ec..74fc66a 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 2d751ff..85fa9fc 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 b42c9e3..99ff029 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 496a5e8..9a5188e 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 e7ee63f..ca0eaf4 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 b097e92..3152499 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 2a529ee..7339620 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 a47dd0a..58f31f1 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 1303a6a..77d3092 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 f10ea98..9b7e7e8 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 c07f53d..7a6ab45 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 bb8becb..e9114bd 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 457fe1f..43dd951 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 7291a3b..e1d4c82 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 e21c4e1..d31cc89 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 4d0e78c..c4ff11e 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 1c08ed3..c391556 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 4055079..f70703f 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 3ea1469..da8cff5 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 4fe19ee..c2c2993 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 ab47dac..9c03562 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 63fcc10..5fce990 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 2daac43..34b6434 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 8232fcc..753f469 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 f9526f6..6994719 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 998839c..b645736 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 fbd1064..1a81fb4 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 51f2345..096c594 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 314e1e8..c3a2f97 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 1cd14a5..7caa9f4 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 f277e67..fb0cbba 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 33c941d..9cbd5c9 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 fbbeaa6..3a6a5fd 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 1b2a121..ea2cbb0 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 3056bf1..7257b9b 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 d7301f3..889b543 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 16d4faa..3174a67 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 f0e66af..149af0b 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 c679072..a8afe6e 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 b550a13..47698ca 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 477cbbd..17da3e4 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 c9e9529..5fc8cf4 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 708cecd..47f1619 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 96ecc71..06cfd52 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 8004da1..8e7e188 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 df0843b..3d2202d 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 da32fdb..4516741 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 42abf44..0160fa6 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 b8c2c73..788d1eb 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 c8ac42c..e826452 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 f90b85b..c01a502 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 dcbee1c..fb0bdf2 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 28c08ec..bd51f1a 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 527570b..9f86088 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 33a9fac..5f642f6 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 fd763d6..e9b4348 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 67322e1..c3a5db4 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 cd56000..787f46b 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 5591848..35c8678 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 da185a2..8bf7b70 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 a3e0101..a532268 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 a1f3821..8963496 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 0012aca..18c5401 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 c131a24..986d37b 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 786b07d..409766f 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 d1a7072..c2f7320 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 28bcc60..d13d613 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 03cc356..0bb99fa 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 28287cd..659e64e 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 b8aa929..ce42b41 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 1a0b950..81eb2d6 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 de55e41..51b92e1 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 eafeed5..fd91634 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 7bcfd5f..53006f3 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 feba485..ae8e98b 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 f3c4aeb..fe368a6 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 cc74f92..f7de02b 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 4c46172..77b971f 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 63f9525..7e7b78a 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 7933cb2..c544285 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 92fca92..85cb946 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 9979ef2..aea852e 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 b69e510..2988a4a 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 fad0a6b..1bbfe2b 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 7fb7d75..f2b72fb 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 53cabab..649b18a 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 7b1fc5e..e7e6b3e 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 093d3d6..d39fe2e 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 00c0d0f..2732ed1 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 b0c6aa6..c79c1ef 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 0f6af17..d77deca 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 527570b..8317d42 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 452fe18..730960c 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 b8e23b9..9f44d6b 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 ea4f7a1..b11ca47 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 c7cd3ad..99d8bb6 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 3b18313..7fbab3d 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 e546a63..a0d7593 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 7bbbf13..6fd44ba 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 a38e7c4..0195afc 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 2b7ca60..0f1f105 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 7b2d2f9..5dc0b4f 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 a3719c4..1a4e3d9 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 f307dac..990e660 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 b57c119..6851c57 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 8b46880..8616d1a 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 a28b33e..b03f6d6 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 944942e..aaf9d27 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 d277123..cae56ad 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 2f8c9b1..e88629c 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 b8c7fef..13a3270 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 cf302b0..5b0f7c2 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 861d3bb..490d4f8 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 877e888..0f80a2a 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 8a7cede..66627b9 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 4cd564a..88f5b1f 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 2e292f1..5e1d3df 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 1cc1de4..a827e1a 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 502a547..4760118 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 a42ff10..a733f13 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 30cbd66..b64232a 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 3ca7e01..2d35e44 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 3a8ce5a..cccf566 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 ae3e02f..1b71aa2 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 fd55df7..13b033f 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 d24091b..ad43b45 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 a7c2f9b..449a34f 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 ae92d5e..bdd08d3 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 73fee22..cbb2605 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 a607e84..869f880 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 cc69754..b752f18 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 a7a0be4..8d14e62 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 edef99a..a358d83 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 1904dc1..c0fa515 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 1662840..10ecf0c 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 70/99] 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 cfbe661..03c4e81 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 71/99] fix: pagination example --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/README.md b/README.md index b43b2f8..643125f 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 72/99] 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 643125f..c3987aa 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 b209491..4732300 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 03c4e81..9bf11c1 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 1d70bbd..b849395 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 fa1c787..4653739 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 ce3490f..ecd3613 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 fa40eef..4b0defa 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 0e9e8e6..29d9e18 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 1e8ed9e..99c3428 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 d66c497..4b1b366 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 f2f9805..2293eac 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 b0d965e..42b262f 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 b0e93c4..9323dc3 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 414ae66..54b6e3c 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 70f043f..d1a008f 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 2c77a8b..90dab12 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 216bacb..915532f 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 c816544..8321f34 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 7108e73..5159613 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 b235507..4f703c1 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 82f8e86..85b041d 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 72b1004..8740065 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 17474a1..53e07a7 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 9c4e96f..d9482a8 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 b193d66..02c45aa 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 6eb25a7..e436698 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 e27ba17..cd4131a 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 58f31f1..b49844c 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 7a6ab45..3a44f28 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 5fce990..f95c22a 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 753f469..1bb91db 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 4516741..8f42ed7 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 5f642f6..12ef5fd 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 18c5401..a3029d6 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 7e7b78a..03cdca9 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 e7e6b3e..50b1110 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 730960c..e69b114 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 6fd44ba..ab94527 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 cae56ad..e86f5b2 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 e88629c..40f9a7b 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 13a3270..3138f43 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 490d4f8..0cb6b9d 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 66627b9..d25686d 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 88f5b1f..84f3f9a 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 5e1d3df..437a54d 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 a827e1a..6e1752b 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 a733f13..4f404ea 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 2d35e44..11a2f95 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 cccf566..f68516d 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 1b71aa2..10f3a75 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 13b033f..6008798 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 ad43b45..975597b 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 449a34f..bf2e4b1 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 cbb2605..3a01747 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 869f880..ea12d99 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 b752f18..cf3bc97 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 8d14e62..2ffe816 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 c0fa515..600b29f 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 73/99] 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 9bf11c1..14f5856 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 74/99] 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 4732300..b630551 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 14f5856..393e2f8 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 b849395..4fde3b3 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 4b0defa..796bc06 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 99c3428..7b9cebd 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 54b6e3c..aadadb2 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 915532f..eacd540 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 53e07a7..17474a1 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 231fb82..825d987 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 74fc66a..cc11074 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 3152499..59606af 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 149af0b..92917a1 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 81eb2d6..a5d220d 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 aaf9d27..ec1e95b 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 e86f5b2..43dc6d0 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 0cb6b9d..7ef88fa 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 d25686d..e23cf09 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 437a54d..50c8598 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 f68516d..93aa779 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 600b29f..c0fa515 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 75/99] 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 0000000..9ac9412 --- /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 0000000..7def838 --- /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 0000000..c476280 --- /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 42c71aa..bf30b35 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 c3987aa..d4f6ef5 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 0000000..374fdae --- /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 4fb1f51..d6cb8e7 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 0000000..024bdf6 --- /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 e706ccb..47f502d 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 4fde3b3..5035b3a 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 4653739..19cfc8a 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 92069a0..ea521a1 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 ecd3613..f958352 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 796bc06..d34f9ec 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 29d9e18..f3e00a6 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 7b9cebd..c4289d4 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 4b1b366..6d9d991 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 2293eac..df67d31 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 42b262f..bf614f1 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 893f759..07b9632 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 872373d..8475f63 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 9323dc3..afd94cb 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 aadadb2..cb3b97c 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 d1a008f..5c51df7 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 90dab12..a87ec1a 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 d5317a1..a9a8500 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 eacd540..8594abc 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 8321f34..b12a760 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 c1f555c..76f4a91 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 5159613..a7be1d2 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 4f703c1..c303ce4 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 85b041d..e41444a 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 8740065..bc2b858 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 17474a1..3165c3b 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 e79311c..e6f2969 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 76/99] 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 43dc6d0..136a011 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 40f9a7b..f6a1893 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 3138f43..381d28f 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 5b0f7c2..e4c8ffd 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 7ef88fa..3b525f3 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 0f80a2a..b158bc4 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 e23cf09..04d19db 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 84f3f9a..c066dcb 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 50c8598..d08bb88 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 6e1752b..1520b2a 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 4760118..3fce8e3 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 4f404ea..e827e39 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 b64232a..833058d 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 11a2f95..bd75557 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 93aa779..ab0d94f 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 10f3a75..d3de302 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 6008798..08dc463 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 975597b..b3fdfdd 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 bf2e4b1..2d4abe9 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 bdd08d3..e5021da 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 3a01747..1c0c5af 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 ea12d99..754f439 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 cf3bc97..6c510f2 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 2ffe816..07fd383 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 a358d83..cd94f2b 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 c0fa515..d20704e 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 77/99] 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 54b5007..a152869 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 5035b3a..71a9da1 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 07b9632..f5b4f0d 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 e6f2969..f9294b7 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 ad9497e..68642eb 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 43dd951..2ed3b1f 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 0f1f105..2b65cbb 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 136a011..43dc6d0 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 f6a1893..40f9a7b 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 381d28f..3138f43 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 e4c8ffd..5b0f7c2 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 3b525f3..7ef88fa 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 b158bc4..0f80a2a 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 04d19db..e23cf09 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 c066dcb..84f3f9a 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 d08bb88..50c8598 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 1520b2a..6e1752b 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 3fce8e3..4760118 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 e827e39..4f404ea 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 833058d..b64232a 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 bd75557..11a2f95 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 ab0d94f..485ed4f 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 d3de302..10f3a75 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 08dc463..6008798 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 b3fdfdd..975597b 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 2d4abe9..bf2e4b1 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 e5021da..e17719d 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 1c0c5af..3a01747 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 754f439..ea12d99 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 6c510f2..cf3bc97 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 07fd383..2ffe816 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 cd94f2b..13a6e56 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 d20704e..c0fa515 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 78/99] 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 43dc6d0..136a011 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 40f9a7b..f6a1893 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 3138f43..381d28f 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 5b0f7c2..e4c8ffd 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 7ef88fa..3b525f3 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 0f80a2a..b158bc4 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 e23cf09..04d19db 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 84f3f9a..c066dcb 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 50c8598..d08bb88 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 6e1752b..1520b2a 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 4760118..3fce8e3 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 4f404ea..e827e39 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 b64232a..833058d 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 11a2f95..bd75557 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 485ed4f..54d712e 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 10f3a75..d3de302 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 6008798..08dc463 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 975597b..b3fdfdd 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 bf2e4b1..2d4abe9 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 e17719d..2991dc8 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 3a01747..1c0c5af 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 ea12d99..754f439 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 cf3bc97..6c510f2 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 2ffe816..07fd383 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 13a6e56..f3707ef 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 c0fa515..d20704e 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 79/99] 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 6e59c86..eb601ba 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 80/99] 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 a6b62ca..18afd9d 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 6382db3..816139f 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 81/99] 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 a152869..d135c04 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 6d9d991..c63cbbf 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 332cd62..7d93627 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 08dc463..b954bf5 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 82/99] 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 12c34b7..c4401ff 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 83/99] 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 d135c04..1b7c986 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 b630551..40b1aea 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 71a9da1..e344dc9 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 19cfc8a..17733f6 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 ea521a1..f9c6d9b 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 f958352..adea3c2 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 d34f9ec..7b831a7 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 f3e00a6..2687f1b 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 c4289d4..a68c661 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 c63cbbf..13c6fec 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 df67d31..b1539f7 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 bf614f1..9b6f47b 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 afd94cb..6532613 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 cb3b97c..62a4197 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 5c51df7..b856a2d 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 a87ec1a..0857162 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 a9a8500..68b2e38 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 8594abc..5c41695 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 b12a760..74bb251 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 a7be1d2..36a4bbc 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 c303ce4..28bd078 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 e41444a..1757c10 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 bc2b858..c335a99 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 3165c3b..1632e33 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 9644e1c..1ff00e1 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 0000000..417f6c8 --- /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 5c5f85d..7689a8d 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 0000000..c0e606d --- /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 d0dffe2..529e42b 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 0000000..40ee48d --- /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 d9482a8..b5ea9d0 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 a6896ce..4f962cd 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 0000000..0be34ff --- /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 0000000..ea825be --- /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 0000000..d097493 --- /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 819fea6..d8d6092 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 b4ab8c6..55275c1 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 ee192d9..33e65d8 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 22377c6..3fb02bb 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 0000000..8630b15 --- /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 0000000..32b0a64 --- /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 29a2601..90bd40b 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 02c45aa..0000000 --- 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 c88cd10..8e2cbce 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 0000000..412b7ae --- /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 0000000..817644d --- /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 5c40bae..1c55b33 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 0000000..96ea049 --- /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 0000000..2c1d714 --- /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 0000000..6fd1a83 --- /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 7d93627..9768d6b 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 240da5e..2a0fe22 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 6c32b86..754ae89 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 58ee02d..11a40e6 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 0000000..337562b --- /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 5b50327..248cd55 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 5e01ca6..1242a11 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 e436698..0000000 --- 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 0000000..b21e2c6 --- /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 0000000..8599c69 --- /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 0000000..df4c820 --- /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 6a83eb9..e916c00 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 0000000..7e160fe --- /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 0000000..469be0e --- /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 0000000..cfda3ec --- /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 d45d4ce..80a22fb 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 0000000..01d91d1 --- /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 f745490..331519b 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 22c1db5..511677b 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 cd4131a..f99f98e 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 0000000..9331c97 --- /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 cd0c4d6..557ccce 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 0000000..3d1d0f1 --- /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 0000000..bf0c629 --- /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 9aee77c..3b7caf2 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 8ac5aae..4b0d59a 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 fd37332..f6dd9ac 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 37ad255..0441fb5 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 cc11074..0000000 --- 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 99ff029..40f3dc4 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 0000000..e2c0a7e --- /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 ca0eaf4..046d982 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 7339620..f444df6 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 b49844c..ce8fb8b 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 77d3092..0465a09 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 ec289a8..9780ee1 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 3a44f28..a98b80b 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 fb9635b..f04ad09 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 0000000..32a0c7f --- /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 0000000..d38601a --- /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 0000000..f2fa957 --- /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 825d987..1a3b194 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 1bb91db..4fd832b 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 c4ff11e..a716cae 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 f70703f..25f8223 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 da8cff5..880a93d 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 34b6434..edecdc2 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 f95c22a..b1a0109 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 b645736..4cb085e 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 1a81fb4..fd565ec 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 096c594..90e4d51 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 c3a2f97..fed05e6 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 0cc2d0e..ce9a399 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 fb0cbba..95c8bd7 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 ea2cbb0..bbdcdc8 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 0000000..d31f882 --- /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 0000000..a5691eb --- /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 92917a1..fec9955 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 6909b0e..962038c 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 c5b31cf..20aa128 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 0000000..e866445 --- /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 47698ca..129ce2c 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 0000000..9fc31a9 --- /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 5fc8cf4..5076ce2 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 47f1619..cb04ea5 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 06cfd52..81a0d7e 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 0000000..a969845 --- /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 0000000..c6e2918 --- /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 8f42ed7..5a39bda 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 788d1eb..066a721 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 e826452..c22d35e 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 c01a502..b426723 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 7bea3a6..f6f8d0b 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 fb0bdf2..1b72ad6 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 217faeb..0d79a48 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 e9b4348..c53cb50 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 5a5a9c8..96b4cce 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 e69b114..dfeb4e9 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 0000000..b2a6261 --- /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 0000000..3527c79 --- /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 0000000..c34eaea --- /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 0000000..505ab36 --- /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 0000000..256e893 --- /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 0000000..ebb3336 --- /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 0000000..3f3b95b --- /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 787f46b..fc5580f 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 35c8678..7a2bbd4 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 c74f578..0f793a3 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 0000000..2302dbe --- /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 8963496..7d2a986 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 0000000..b7cd3e9 --- /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 0000000..371260b --- /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 0000000..c85e07a --- /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 c2f7320..6877822 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 0000000..9fb4811 --- /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 0000000..c356eb3 --- /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 0000000..e516dcb --- /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 d13d613..975f069 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 aa75098..4d19ee2 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 0bb99fa..df2d65e 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 a16f687..3009132 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 d614bb2..5a36d94 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 659e64e..1f624b0 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 ce42b41..c5c59b1 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 a5d220d..0000000 --- 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 fd91634..36ad250 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 53006f3..e161361 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 03cdca9..6ebf74a 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 ae8e98b..f0ba68e 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 fe368a6..b351bfe 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 77b971f..2576f40 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 85cb946..50e478b 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 0000000..c610d07 --- /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 aea852e..50dfcd2 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 0000000..fff9b91 --- /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 8ebcad6..64f13c7 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 50b1110..05841dc 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 1bbfe2b..9713c07 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 0000000..bda03c2 --- /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 619b46d..d19d32d 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 2732ed1..94e14e0 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 0000000..3b7e146 --- /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 0000000..6db05ce --- /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 c79c1ef..5391627 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 5ab2ef2..0520b58 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 9f44d6b..71066d2 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 15e3918..b5c96d6 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 12ef5fd..c107db4 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 0000000..b4e95a1 --- /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 0000000..3a99c80 --- /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 0000000..0f1bd71 --- /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 0000000..13e91d3 --- /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 b11ca47..99447e0 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 53a103b..bf7c768 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 ab94527..0000000 --- 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 0000000..4911a8a --- /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 0000000..2b5eba3 --- /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 59606af..24f66bb 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 0000000..90a9019 --- /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 0000000..202e7a3 --- /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 0000000..bd0a3b9 --- /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 0000000..7702279 --- /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 0000000..88a258c --- /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 0000000..072f66c --- /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 a3029d6..b0e28c9 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 0000000..84b6f31 --- /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 0000000..923f5f6 --- /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 0000000..b5ab03a --- /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 0000000..d13e58c --- /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 0000000..d98911f --- /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 0000000..173dff4 --- /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 0000000..17e43a4 --- /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 0000000..05f28c1 --- /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 0000000..1c3d4f1 --- /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 0000000..1f2e22e --- /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 0000000..55a079f --- /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 0000000..1c1293b --- /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 0000000..60b1bc3 --- /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 0000000..47c3be9 --- /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 5dc0b4f..7760c4a 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 c5d40ad..b54651e 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 8616d1a..6be85d5 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 ec1e95b..c094c3c 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 136a011..45ce226 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 f6a1893..9c90a24 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 381d28f..4cee7ae 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 3b525f3..f097f89 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 04d19db..c8f45ad 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 c066dcb..cf0a4f4 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 d08bb88..de30bc1 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 1520b2a..27694ae 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 e827e39..41ee4a5 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 833058d..e917ea8 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 bd75557..f0bcafa 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 54d712e..94b1a9f 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 d3de302..9ef5526 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 b954bf5..992d3b2 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 b3fdfdd..11a2ab9 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 2d4abe9..00bfe68 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 1c0c5af..8dbf451 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 754f439..4a57297 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 6c510f2..3829f7d 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 07fd383..ce95778 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 d20704e..bf3ea01 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 84/99] 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 e9d29a1..ac5ac74 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 85/99] 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 de6c36a..38a11e6 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 86/99] 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 9ac9412..df62ae1 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 7def838..f7fa281 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 bf30b35..63af707 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 d4f6ef5..d093a21 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 d6cb8e7..90e98ed 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 e344dc9..1712f20 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 17733f6..1a910b7 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 f9c6d9b..16cacc4 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 adea3c2..9fe9716 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 7b831a7..a2a887e 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 2687f1b..1e0b197 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 a68c661..1a64f8a 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 13c6fec..d535188 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 b1539f7..8a7ebdd 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 9b6f47b..233e4b0 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 f5b4f0d..6635c4b 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 8475f63..131a39b 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 6532613..d10cb52 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 62a4197..ab984fe 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 b856a2d..ffac162 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 0857162..b3cd146 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 68b2e38..135c788 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 5c41695..50e5f95 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 74bb251..4f49af8 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 76f4a91..4d3f3e5 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 36a4bbc..97aa260 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 28bd078..09de7ed 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 1757c10..66fc4e7 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 c335a99..374b4c8 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 1632e33..a276f0e 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 f9294b7..03d30ab 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 87/99] 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 c476280..ba6c348 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 90e98ed..a62739f 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 47f502d..8ed9927 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 88/99] 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 d093a21..7cb4c28 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 a62739f..6c133f8 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 a050918..cc60f65 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 2699011..65e7618 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 89/99] 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 1b7c986..7b2ebfa 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 d535188..091b00c 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 374b4c8..14c6bb4 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 90bd40b..4fe1e4c 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 96ea049..d65c166 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 2c1d714..cad8f65 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 046d982..1abb82c 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 b2a6261..e488d52 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 c34eaea..ed64eee 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 c5c59b1..14cdf32 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 13e91d3..e994fa7 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 99447e0..81da5d9 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 f097f89..ba3893e 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 de30bc1..0c47b39 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 992d3b2..811daf8 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 ce95778..439581a 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 90/99] 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 7b2ebfa..87b67de 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 40b1aea..d7e5d8e 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 393e2f8..a8e74f8 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 164bee2..3b7cf4e 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 0000000..3761289 --- /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 d10cb52..8707b72 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 ce9a399..83301d7 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 0000000..04d9847 --- /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 0000000..317c158 --- /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 0000000..c42eb64 --- /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 0000000..15025b9 --- /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 0000000..dfa94c2 --- /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 0000000..c471720 --- /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 0000000..06d2737 --- /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 0000000..cc7a6d8 --- /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 0000000..7f96c20 --- /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 0000000..91c0053 --- /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 0000000..9a170cf --- /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 91/99] 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 d7e5d8e..d6933bf 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 1e0b197..9858163 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 1ff00e1..03e376b 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 11a40e6..d6c647a 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 331519b..5bb8916 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 511677b..4845e6b 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 557ccce..0f01e7b 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 4911a8a..ba0e256 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 01d91d1..95e8566 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 923f5f6..17a4bff 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 f99f98e..23e6c2c 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 3d1d0f1..c69815f 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 d98911f..51915e7 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 9331c97..50ffda7 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 bf0c629..5f40eef 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 4cee7ae..adcf14f 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 92/99] 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 ba6c348..f14b480 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 6c133f8..7c84667 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 8ed9927..ad57910 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 93/99] 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 7cb4c28..bb967ed 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 10ecf0c..8eff504 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 94/99] 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 d6933bf..dfcf5a9 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 03e376b..2f59c86 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 b21e2c6..15d0d3f 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 8599c69..614e053 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 80a22fb..1465e67 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 4b0d59a..5c6c0e1 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 ba0e256..4e32020 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 2b5eba3..0aa1987 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 23e6c2c..7365a70 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 51915e7..0b7a205 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 173dff4..772b75e 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 50ffda7..afd8788 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 95/99] 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 dfcf5a9..d6933bf 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 2f59c86..03e376b 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 15d0d3f..b21e2c6 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 614e053..8599c69 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 1465e67..80a22fb 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 5c6c0e1..4b0d59a 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 4e32020..ba0e256 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 0aa1987..2b5eba3 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 7365a70..23e6c2c 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 0b7a205..51915e7 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 772b75e..173dff4 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 afd8788..50ffda7 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 96/99] 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 8eff504..b6dadcf 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 97/99] 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 87b67de..031a738 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 1a910b7..78e0ba2 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 b5ea9d0..6395cc7 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 a4a34df..de698ba 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 b0ee8eb..f22f8cb 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 9b01102..f9f5194 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 4f962cd..fa5bbe9 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 9ef5526..c8aa524 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 98/99] 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 031a738..c57d3dc 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 1712f20..aa8d501 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 1a64f8a..ffe58db 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 091b00c..c5e250f 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 3761289..079f837 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 131a39b..2c080ce 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 8707b72..b7e0957 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 ab984fe..57a8010 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 50e5f95..e790fe7 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 417f6c8..251e6bd 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 93e5bf1..a049132 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 7689a8d..4551e59 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 e0cb613..192a5fc 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 c0e606d..cd27512 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 529e42b..2768a2d 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 7be510e..f470b6c 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 f2fa957..3368601 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 1a3b194..7ff022b 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 4fd832b..4d5eaee 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 d31cc89..8251342 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 a716cae..51cb8f7 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 c391556..8402335 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 880a93d..f6a4f3d 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 c2c2993..f875644 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 9c03562..aa85f58 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 b1a0109..6745f0b 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 6994719..e81f1f3 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 4cb085e..064ba4a 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 fd565ec..9c9d4b8 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 90e4d51..b6018bf 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 fed05e6..f5fcb1b 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 04d9847..693e613 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 317c158..cfd882a 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 c42eb64..548d08a 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 15025b9..d8f6a81 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 dfa94c2..26573f6 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 c471720..7910e1f 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 06d2737..88577d6 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 7f96c20..1f0c3e8 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 91c0053..8d2c649 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 7caa9f4..32455ba 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 95c8bd7..36297d0 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 9cbd5c9..5b57656 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 16c355a..786ae36 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 3a6a5fd..a181214 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 bbdcdc8..aa4239f 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 d31f882..3f8e7f1 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 fec9955..c12bf7c 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 7257b9b..cd14f5c 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 962038c..0a2da39 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 889b543..0e3f7b0 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 3174a67..1f4b3a6 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 a8afe6e..25aa634 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 20aa128..9a1da1a 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 129ce2c..4af2dab 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 9a170cf..2b12ebf 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 b158bc4..2b426d6 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 c8f45ad..09f440f 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 94b1a9f..c9f4d5a 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 811daf8..3441d9f 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 8dbf451..d869861 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 f595cb6b7e019078b4130de94bb33ed19df8789e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 11:59:37 +0000 Subject: [PATCH 99/99] feat(api): Overview page updates --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb967ed..d89ac53 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