From 7bf82f9c645a7c5b21232ca6522ebd941a41cdc0 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:14 +0000 Subject: [PATCH] feat(api): try to fix updateenvironmentrequest --- .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"