Skip to content

feat(api): try to fix updateenvironmentrequest #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
97 changes: 13 additions & 84 deletions src/gitpod/resources/environments/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing_extensions import overload
from typing import Optional

import httpx

Expand All @@ -28,7 +28,6 @@
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
required_args,
maybe_transform,
async_maybe_transform,
)
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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,
},
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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,
},
Expand Down
Loading