Skip to content

Commit 4d8e7c2

Browse files
feat(api): try to fix updateenvironmentrequest (#8)
1 parent 86cea9d commit 4d8e7c2

File tree

4 files changed

+109
-244
lines changed

4 files changed

+109
-244
lines changed

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 106
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e2df4ddd41d8f2552c00f0f93c8b655c7bfb039bd62e654dd7ace9cdd8f9a9f.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2410f189970eeb715e79976f13eeca7259b602809e27a84820da8c794dcf00cb.yml

Diff for: src/gitpod/resources/environments/environments.py

+13-84
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import overload
5+
from typing import Optional
66

77
import httpx
88

@@ -28,7 +28,6 @@
2828
)
2929
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
3030
from ..._utils import (
31-
required_args,
3231
maybe_transform,
3332
async_maybe_transform,
3433
)
@@ -161,11 +160,12 @@ def retrieve(
161160
cast_to=EnvironmentRetrieveResponse,
162161
)
163162

164-
@overload
165163
def update(
166164
self,
167165
*,
168-
metadata: object,
166+
environment_id: str | NotGiven = NOT_GIVEN,
167+
metadata: Optional[object] | NotGiven = NOT_GIVEN,
168+
spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN,
169169
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
170170
# The extra values given here take precedence over values defined on the client or passed to this method.
171171
extra_headers: Headers | None = None,
@@ -177,32 +177,10 @@ def update(
177177
UpdateEnvironment updates the environment partially.
178178
179179
Args:
180-
extra_headers: Send extra headers
181-
182-
extra_query: Add additional query parameters to the request
183-
184-
extra_body: Add additional JSON properties to the request
185-
186-
timeout: Override the client-level default timeout for this request, in seconds
187-
"""
188-
...
180+
environment_id: environment_id specifies which environment should be updated.
189181
190-
@overload
191-
def update(
192-
self,
193-
*,
194-
spec: environment_update_params.Variant1Spec,
195-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
196-
# The extra values given here take precedence over values defined on the client or passed to this method.
197-
extra_headers: Headers | None = None,
198-
extra_query: Query | None = None,
199-
extra_body: Body | None = None,
200-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
201-
) -> object:
202-
"""
203-
UpdateEnvironment updates the environment partially.
182+
+required
204183
205-
Args:
206184
extra_headers: Send extra headers
207185
208186
extra_query: Add additional query parameters to the request
@@ -211,25 +189,11 @@ def update(
211189
212190
timeout: Override the client-level default timeout for this request, in seconds
213191
"""
214-
...
215-
216-
@required_args(["metadata"], ["spec"])
217-
def update(
218-
self,
219-
*,
220-
metadata: object | NotGiven = NOT_GIVEN,
221-
spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN,
222-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
223-
# The extra values given here take precedence over values defined on the client or passed to this method.
224-
extra_headers: Headers | None = None,
225-
extra_query: Query | None = None,
226-
extra_body: Body | None = None,
227-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
228-
) -> object:
229192
return self._post(
230193
"/gitpod.v1.EnvironmentService/UpdateEnvironment",
231194
body=maybe_transform(
232195
{
196+
"environment_id": environment_id,
233197
"metadata": metadata,
234198
"spec": spec,
235199
},
@@ -652,11 +616,12 @@ async def retrieve(
652616
cast_to=EnvironmentRetrieveResponse,
653617
)
654618

655-
@overload
656619
async def update(
657620
self,
658621
*,
659-
metadata: object,
622+
environment_id: str | NotGiven = NOT_GIVEN,
623+
metadata: Optional[object] | NotGiven = NOT_GIVEN,
624+
spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN,
660625
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
661626
# The extra values given here take precedence over values defined on the client or passed to this method.
662627
extra_headers: Headers | None = None,
@@ -668,32 +633,10 @@ async def update(
668633
UpdateEnvironment updates the environment partially.
669634
670635
Args:
671-
extra_headers: Send extra headers
672-
673-
extra_query: Add additional query parameters to the request
674-
675-
extra_body: Add additional JSON properties to the request
676-
677-
timeout: Override the client-level default timeout for this request, in seconds
678-
"""
679-
...
636+
environment_id: environment_id specifies which environment should be updated.
680637
681-
@overload
682-
async def update(
683-
self,
684-
*,
685-
spec: environment_update_params.Variant1Spec,
686-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
687-
# The extra values given here take precedence over values defined on the client or passed to this method.
688-
extra_headers: Headers | None = None,
689-
extra_query: Query | None = None,
690-
extra_body: Body | None = None,
691-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
692-
) -> object:
693-
"""
694-
UpdateEnvironment updates the environment partially.
638+
+required
695639
696-
Args:
697640
extra_headers: Send extra headers
698641
699642
extra_query: Add additional query parameters to the request
@@ -702,25 +645,11 @@ async def update(
702645
703646
timeout: Override the client-level default timeout for this request, in seconds
704647
"""
705-
...
706-
707-
@required_args(["metadata"], ["spec"])
708-
async def update(
709-
self,
710-
*,
711-
metadata: object | NotGiven = NOT_GIVEN,
712-
spec: environment_update_params.Variant1Spec | NotGiven = NOT_GIVEN,
713-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
714-
# The extra values given here take precedence over values defined on the client or passed to this method.
715-
extra_headers: Headers | None = None,
716-
extra_query: Query | None = None,
717-
extra_body: Body | None = None,
718-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
719-
) -> object:
720648
return await self._post(
721649
"/gitpod.v1.EnvironmentService/UpdateEnvironment",
722650
body=await async_maybe_transform(
723651
{
652+
"environment_id": environment_id,
724653
"metadata": metadata,
725654
"spec": spec,
726655
},

0 commit comments

Comments
 (0)