From d71ec2b25120546304e332c4c4ce2007498e2d7c 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:14 +0000 Subject: [PATCH] feat(api): manual updates --- .stats.yml | 2 +- .../resources/environments/environments.py | 8 ------- src/gitpod/resources/secrets.py | 18 +++++++++++++++ src/gitpod/types/environment_list_params.py | 3 --- src/gitpod/types/environment_spec.py | 6 +++++ src/gitpod/types/environment_spec_param.py | 6 +++++ .../types/environments/class_list_params.py | 22 +++++++++++++++++++ src/gitpod/types/projects/project_role.py | 4 +++- src/gitpod/types/resource_type.py | 1 + .../environment_class_list_params.py | 22 +++++++++++++++++++ src/gitpod/types/secret.py | 3 +++ src/gitpod/types/secret_create_params.py | 10 +++++++++ .../environments/test_classes.py | 6 +++++ .../test_environment_classes.py | 6 +++++ tests/api_resources/test_environments.py | 6 +++-- tests/api_resources/test_secrets.py | 2 ++ 16 files changed, 110 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1b7c9868..7b2ebfa9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index d5351884..091b00c5 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -248,7 +248,6 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -261,8 +260,6 @@ def list( ListEnvironments returns a list of environments that match the query. Args: - organization_id: organization_id is the ID of the organization that contains the environments - pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -279,7 +276,6 @@ def list( body=maybe_transform( { "filter": filter, - "organization_id": organization_id, "pagination": pagination, }, environment_list_params.EnvironmentListParams, @@ -739,7 +735,6 @@ def list( token: str | NotGiven = NOT_GIVEN, page_size: int | NotGiven = NOT_GIVEN, filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -752,8 +747,6 @@ def list( ListEnvironments returns a list of environments that match the query. Args: - organization_id: organization_id is the ID of the organization that contains the environments - pagination: pagination contains the pagination options for listing environments extra_headers: Send extra headers @@ -770,7 +763,6 @@ def list( body=maybe_transform( { "filter": filter, - "organization_id": organization_id, "pagination": pagination, }, environment_list_params.EnvironmentListParams, diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 374b4c8f..14c6bb4d 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -56,6 +56,7 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: def create( self, *, + container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, environment_variable: bool | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -72,6 +73,13 @@ def create( CreateSecret creates a new secret. Args: + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") + ``` + environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -98,6 +106,7 @@ def create( "/gitpod.v1.SecretService/CreateSecret", body=maybe_transform( { + "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, "name": name, @@ -297,6 +306,7 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: async def create( self, *, + container_registry_basic_auth_host: str | NotGiven = NOT_GIVEN, environment_variable: bool | NotGiven = NOT_GIVEN, file_path: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -313,6 +323,13 @@ async def create( CreateSecret creates a new secret. Args: + container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches("^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$") + ``` + environment_variable: secret will be created as an Environment Variable with the same name as the secret @@ -339,6 +356,7 @@ async def create( "/gitpod.v1.SecretService/CreateSecret", body=await async_maybe_transform( { + "container_registry_basic_auth_host": container_registry_basic_auth_host, "environment_variable": environment_variable, "file_path": file_path, "name": name, diff --git a/src/gitpod/types/environment_list_params.py b/src/gitpod/types/environment_list_params.py index 90bd40b4..4fe1e4c0 100644 --- a/src/gitpod/types/environment_list_params.py +++ b/src/gitpod/types/environment_list_params.py @@ -19,9 +19,6 @@ class EnvironmentListParams(TypedDict, total=False): filter: Filter - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] - """organization_id is the ID of the organization that contains the environments""" - pagination: Pagination """pagination contains the pagination options for listing environments""" diff --git a/src/gitpod/types/environment_spec.py b/src/gitpod/types/environment_spec.py index 96ea0496..d65c166f 100644 --- a/src/gitpod/types/environment_spec.py +++ b/src/gitpod/types/environment_spec.py @@ -83,6 +83,12 @@ class Port(BaseModel): class Secret(BaseModel): + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) + """ + container_registry_basic_auth_host is the hostname of the container registry + that supports basic auth + """ + environment_variable: Optional[str] = FieldInfo(alias="environmentVariable", default=None) file_path: Optional[str] = FieldInfo(alias="filePath", default=None) diff --git a/src/gitpod/types/environment_spec_param.py b/src/gitpod/types/environment_spec_param.py index 2c1d714e..cad8f657 100644 --- a/src/gitpod/types/environment_spec_param.py +++ b/src/gitpod/types/environment_spec_param.py @@ -90,6 +90,12 @@ class Port(TypedDict, total=False): class Secret(TypedDict, total=False): + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] + """ + container_registry_basic_auth_host is the hostname of the container registry + that supports basic auth + """ + environment_variable: Annotated[str, PropertyInfo(alias="environmentVariable")] file_path: Annotated[str, PropertyInfo(alias="filePath")] diff --git a/src/gitpod/types/environments/class_list_params.py b/src/gitpod/types/environments/class_list_params.py index 046d982c..1abb82c8 100644 --- a/src/gitpod/types/environments/class_list_params.py +++ b/src/gitpod/types/environments/class_list_params.py @@ -6,6 +6,8 @@ from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from ..runner_kind import RunnerKind +from ..runner_provider import RunnerProvider __all__ = ["ClassListParams", "Filter", "Pagination"] @@ -22,6 +24,14 @@ class ClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")] + """ + can_create_environments filters the response to only environment classes that + can be used to create new environments by the caller. Unlike enabled, which + indicates general availability, this ensures the caller only sees environment + classes they are allowed to use. + """ + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False): runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] + """ + runner_kind filters the response to only environment classes from runners of + these kinds. + """ + + runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")] + """ + runner_providers filters the response to only environment classes from runners + of these providers. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/projects/project_role.py b/src/gitpod/types/projects/project_role.py index b2a6261c..e488d522 100644 --- a/src/gitpod/types/projects/project_role.py +++ b/src/gitpod/types/projects/project_role.py @@ -4,4 +4,6 @@ __all__ = ["ProjectRole"] -ProjectRole: TypeAlias = Literal["PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER"] +ProjectRole: TypeAlias = Literal[ + "PROJECT_ROLE_UNSPECIFIED", "PROJECT_ROLE_ADMIN", "PROJECT_ROLE_USER", "PROJECT_ROLE_EDITOR" +] diff --git a/src/gitpod/types/resource_type.py b/src/gitpod/types/resource_type.py index c34eaea7..ed64eeeb 100644 --- a/src/gitpod/types/resource_type.py +++ b/src/gitpod/types/resource_type.py @@ -23,4 +23,5 @@ "RESOURCE_TYPE_SERVICE_ACCOUNT", "RESOURCE_TYPE_SECRET", "RESOURCE_TYPE_SSO_CONFIG", + "RESOURCE_TYPE_DOMAIN_VERIFICATION", ] diff --git a/src/gitpod/types/runners/configurations/environment_class_list_params.py b/src/gitpod/types/runners/configurations/environment_class_list_params.py index c5c59b15..14cdf32d 100644 --- a/src/gitpod/types/runners/configurations/environment_class_list_params.py +++ b/src/gitpod/types/runners/configurations/environment_class_list_params.py @@ -6,6 +6,8 @@ from typing_extensions import Annotated, TypedDict from ...._utils import PropertyInfo +from ...runner_kind import RunnerKind +from ...runner_provider import RunnerProvider __all__ = ["EnvironmentClassListParams", "Filter", "Pagination"] @@ -22,6 +24,14 @@ class EnvironmentClassListParams(TypedDict, total=False): class Filter(TypedDict, total=False): + can_create_environments: Annotated[Optional[bool], PropertyInfo(alias="canCreateEnvironments")] + """ + can_create_environments filters the response to only environment classes that + can be used to create new environments by the caller. Unlike enabled, which + indicates general availability, this ensures the caller only sees environment + classes they are allowed to use. + """ + enabled: Optional[bool] """ enabled filters the response to only enabled or disabled environment classes. If @@ -31,6 +41,18 @@ class Filter(TypedDict, total=False): runner_ids: Annotated[List[str], PropertyInfo(alias="runnerIds")] """runner_ids filters the response to only EnvironmentClasses of these Runner IDs""" + runner_kinds: Annotated[List[RunnerKind], PropertyInfo(alias="runnerKinds")] + """ + runner_kind filters the response to only environment classes from runners of + these kinds. + """ + + runner_providers: Annotated[List[RunnerProvider], PropertyInfo(alias="runnerProviders")] + """ + runner_providers filters the response to only environment classes from runners + of these providers. + """ + class Pagination(TypedDict, total=False): token: str diff --git a/src/gitpod/types/secret.py b/src/gitpod/types/secret.py index 13e91d3a..e994fa73 100644 --- a/src/gitpod/types/secret.py +++ b/src/gitpod/types/secret.py @@ -14,6 +14,9 @@ class Secret(BaseModel): id: Optional[str] = None + container_registry_basic_auth_host: Optional[str] = FieldInfo(alias="containerRegistryBasicAuthHost", default=None) + """secret will be mounted as a registry secret""" + created_at: Optional[datetime] = FieldInfo(alias="createdAt", default=None) """ A Timestamp represents a point in time independent of any time zone or local diff --git a/src/gitpod/types/secret_create_params.py b/src/gitpod/types/secret_create_params.py index 99447e01..81da5d9f 100644 --- a/src/gitpod/types/secret_create_params.py +++ b/src/gitpod/types/secret_create_params.py @@ -10,6 +10,16 @@ class SecretCreateParams(TypedDict, total=False): + container_registry_basic_auth_host: Annotated[str, PropertyInfo(alias="containerRegistryBasicAuthHost")] + """ + secret will be mounted as a docker config in the environment VM, mount will have + the docker host value must be a valid registry hostname with optional port: + + ``` + this.matches('^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$') + ``` + """ + environment_variable: Annotated[bool, PropertyInfo(alias="environmentVariable")] """ secret will be created as an Environment Variable with the same name as the diff --git a/tests/api_resources/environments/test_classes.py b/tests/api_resources/environments/test_classes.py index f097f89b..ba3893e4 100644 --- a/tests/api_resources/environments/test_classes.py +++ b/tests/api_resources/environments/test_classes.py @@ -31,8 +31,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", @@ -80,8 +83,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", diff --git a/tests/api_resources/runners/configurations/test_environment_classes.py b/tests/api_resources/runners/configurations/test_environment_classes.py index de30bc15..0c47b397 100644 --- a/tests/api_resources/runners/configurations/test_environment_classes.py +++ b/tests/api_resources/runners/configurations/test_environment_classes.py @@ -154,8 +154,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", @@ -324,8 +327,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N token="token", page_size=0, filter={ + "can_create_environments": True, "enabled": True, "runner_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], + "runner_providers": ["RUNNER_PROVIDER_UNSPECIFIED"], }, pagination={ "token": "token", diff --git a/tests/api_resources/test_environments.py b/tests/api_resources/test_environments.py index 992d3b26..811daf89 100644 --- a/tests/api_resources/test_environments.py +++ b/tests/api_resources/test_environments.py @@ -78,6 +78,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None: ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -256,7 +257,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None: "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -377,6 +377,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -625,6 +626,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", @@ -803,7 +805,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N "runner_kinds": ["RUNNER_KIND_UNSPECIFIED"], "status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"], }, - organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", pagination={ "token": "token", "page_size": 100, @@ -924,6 +925,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As ], "secrets": [ { + "container_registry_basic_auth_host": "containerRegistryBasicAuthHost", "environment_variable": "environmentVariable", "file_path": "filePath", "git_credential_host": "gitCredentialHost", diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index ce957788..439581a3 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -32,6 +32,7 @@ def test_method_create(self, client: Gitpod) -> None: @parametrize def test_method_create_with_all_params(self, client: Gitpod) -> None: secret = client.secrets.create( + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="name", @@ -227,6 +228,7 @@ async def test_method_create(self, async_client: AsyncGitpod) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGitpod) -> None: secret = await async_client.secrets.create( + container_registry_basic_auth_host="containerRegistryBasicAuthHost", environment_variable=True, file_path="filePath", name="name",