From 986fdbaf9c668a21f87ab6b1368fb1f9b4dca9fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:13:32 +0000 Subject: [PATCH 01/18] chore(internal): update pydantic dependency --- requirements-dev.lock | 10 ++++++---- requirements.lock | 7 +++++-- src/gitpod/_models.py | 14 ++++++++++---- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 191d3255..71fb40f5 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -103,12 +103,11 @@ pluggy==1.5.0 propcache==0.3.1 # via aiohttp # via yarl +pydantic==2.11.9 + # via anthropic pycparser==2.22 # via cffi -pydantic==2.10.3 - # via anthropic - # via gitpod-sdk -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic pygments==2.18.0 # via rich @@ -149,6 +148,9 @@ typing-extensions==4.12.2 # via pydantic # via pydantic-core # via pyright + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic virtualenv==20.24.5 # via nox yarl==1.20.0 diff --git a/requirements.lock b/requirements.lock index c0455c90..e1664d85 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,9 +55,9 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via gitpod-sdk -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 # via anyio @@ -68,5 +68,8 @@ typing-extensions==4.12.2 # via multidict # via pydantic # via pydantic-core + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic yarl==1.20.0 # via aiohttp diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 3a6017ef..6a3cd1d2 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -256,7 +256,7 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, @@ -264,6 +264,7 @@ def model_dump( warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, serialize_as_any: bool = False, + fallback: Callable[[Any], Any] | None = None, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -295,10 +296,12 @@ 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") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, @@ -313,13 +316,14 @@ def model_dump_json( indent: int | None = None, include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, 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, + fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json @@ -348,11 +352,13 @@ def model_dump_json( 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") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, From 84fa3bc8257f8cad24ae9bb7e9f0c5ec42f11787 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:23:19 +0000 Subject: [PATCH 02/18] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d2b21929..9333247e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 119 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 -config_hash: 6e0a070326b83dc6e5544baae3d14bbb +config_hash: 7fb76543ceafd4a116473f647f8d63b1 From efa6bd70aed63ff891300fc1529575c76a18f104 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:57:15 +0000 Subject: [PATCH 03/18] chore(types): change optional parameter type from NotGiven to Omit --- src/gitpod/__init__.py | 4 +- src/gitpod/_base_client.py | 18 +-- src/gitpod/_client.py | 16 +-- src/gitpod/_qs.py | 14 +- src/gitpod/_types.py | 29 +++-- src/gitpod/_utils/_transform.py | 4 +- src/gitpod/_utils/_utils.py | 8 +- src/gitpod/resources/accounts.py | 58 ++++----- src/gitpod/resources/editors.py | 30 ++--- .../environments/automations/automations.py | 14 +- .../environments/automations/services.py | 94 +++++++------- .../automations/tasks/executions.py | 38 +++--- .../environments/automations/tasks/tasks.py | 86 ++++++------ src/gitpod/resources/environments/classes.py | 22 ++-- .../resources/environments/environments.py | 122 +++++++++--------- src/gitpod/resources/events.py | 34 ++--- src/gitpod/resources/gateways.py | 18 +-- src/gitpod/resources/groups.py | 18 +-- src/gitpod/resources/identity.py | 30 ++--- .../organizations/domain_verifications.py | 34 ++--- src/gitpod/resources/organizations/invites.py | 14 +- .../resources/organizations/organizations.py | 74 +++++------ .../resources/organizations/policies.py | 50 +++---- .../organizations/sso_configurations.py | 58 ++++----- src/gitpod/resources/projects/policies.py | 66 +++++----- src/gitpod/resources/projects/projects.py | 102 +++++++-------- .../runners/configurations/configurations.py | 18 +-- .../configurations/environment_classes.py | 70 +++++----- .../host_authentication_tokens.py | 90 ++++++------- .../runners/configurations/schema.py | 10 +- .../configurations/scm_integrations.py | 94 +++++++------- src/gitpod/resources/runners/policies.py | 66 +++++----- src/gitpod/resources/runners/runners.py | 114 ++++++++-------- src/gitpod/resources/secrets.py | 82 ++++++------ src/gitpod/resources/usage.py | 22 ++-- src/gitpod/resources/users/dotfiles.py | 18 +-- src/gitpod/resources/users/pats.py | 38 +++--- src/gitpod/resources/users/users.py | 22 ++-- tests/test_transform.py | 11 +- 39 files changed, 863 insertions(+), 847 deletions(-) diff --git a/src/gitpod/__init__.py b/src/gitpod/__init__.py index f2a5eb27..64437d6c 100644 --- a/src/gitpod/__init__.py +++ b/src/gitpod/__init__.py @@ -3,7 +3,7 @@ import typing as _t from . import types -from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given from ._utils import file_from_path from ._client import Client, Gitpod, Stream, Timeout, Transport, AsyncClient, AsyncGitpod, AsyncStream, RequestOptions from ._models import BaseModel @@ -38,7 +38,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "GitpodError", "APIError", "APIStatusError", diff --git a/src/gitpod/_base_client.py b/src/gitpod/_base_client.py index 14ac3c4c..e817a04e 100644 --- a/src/gitpod/_base_client.py +++ b/src/gitpod/_base_client.py @@ -42,7 +42,6 @@ from ._qs import Querystring from ._files import to_httpx_files, async_to_httpx_files from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -57,6 +56,7 @@ RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, + not_given, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping from ._compat import PYDANTIC_V1, model_copy, model_dump @@ -145,9 +145,9 @@ def __init__( def __init__( self, *, - url: URL | NotGiven = NOT_GIVEN, - json: Body | NotGiven = NOT_GIVEN, - params: Query | NotGiven = NOT_GIVEN, + url: URL | NotGiven = not_given, + json: Body | NotGiven = not_given, + params: Query | NotGiven = not_given, ) -> None: self.url = url self.json = json @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques # 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) + 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) @@ -825,7 +825,7 @@ def __init__( version: str, base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1356,7 +1356,7 @@ def __init__( base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1818,8 +1818,8 @@ def make_request_options( 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, + 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 = {} diff --git a/src/gitpod/_client.py b/src/gitpod/_client.py index dd0ccc22..d3675ad8 100644 --- a/src/gitpod/_client.py +++ b/src/gitpod/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Union, Mapping +from typing import Any, Mapping from typing_extensions import Self, override import httpx @@ -11,13 +11,13 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Omit, Timeout, NotGiven, Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._version import __version__ @@ -63,7 +63,7 @@ def __init__( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: 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, @@ -150,9 +150,9 @@ def copy( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + 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, @@ -255,7 +255,7 @@ def __init__( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: 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, @@ -342,9 +342,9 @@ def copy( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + 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, diff --git a/src/gitpod/_qs.py b/src/gitpod/_qs.py index 274320ca..ada6fd3f 100644 --- a/src/gitpod/_qs.py +++ b/src/gitpod/_qs.py @@ -4,7 +4,7 @@ from urllib.parse import parse_qs, urlencode from typing_extensions import Literal, get_args -from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._types import NotGiven, not_given from ._utils import flatten _T = TypeVar("_T") @@ -41,8 +41,8 @@ def stringify( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> str: return urlencode( self.stringify_items( @@ -56,8 +56,8 @@ def stringify_items( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> list[tuple[str, str]]: opts = Options( qs=self, @@ -143,8 +143,8 @@ def __init__( self, qs: Querystring = _qs, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = 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/_types.py b/src/gitpod/_types.py index b5c5d596..a4e7196a 100644 --- a/src/gitpod/_types.py +++ b/src/gitpod/_types.py @@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False): # 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 parameters with a meaningful None value, we need to distinguish between + the user explicitly passing None, and the user not passing the parameter at + all. + + User code shouldn't need to use not_given directly. For example: ```py - def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... + def create(timeout: Timeout | None | NotGiven = not_given): ... - get(timeout=1) # 1s timeout - get(timeout=None) # No timeout - get() # Default timeout behavior, which may not be statically known at the method definition. + create(timeout=1) # 1s timeout + create(timeout=None) # No timeout + create() # Default timeout behavior ``` """ @@ -140,13 +143,14 @@ def __repr__(self) -> str: return "NOT_GIVEN" -NotGivenOr = Union[_T, NotGiven] +not_given = NotGiven() +# for backwards compatibility: 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: + """ + To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json` that will be sent @@ -156,8 +160,8 @@ class Omit: # 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()}) + # instead you can remove the default `application/json` header by passing omit + client.post(..., headers={"Content-Type": omit}) ``` """ @@ -165,6 +169,9 @@ def __bool__(self) -> Literal[False]: return False +omit = Omit() + + @runtime_checkable class ModelBuilderProtocol(Protocol): @classmethod diff --git a/src/gitpod/_utils/_transform.py b/src/gitpod/_utils/_transform.py index c19124f0..52075492 100644 --- a/src/gitpod/_utils/_transform.py +++ b/src/gitpod/_utils/_transform.py @@ -268,7 +268,7 @@ def _transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue @@ -434,7 +434,7 @@ async def _async_transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py index f0818595..50d59269 100644 --- a/src/gitpod/_utils/_utils.py +++ b/src/gitpod/_utils/_utils.py @@ -21,7 +21,7 @@ import sniffio -from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._types import Omit, NotGiven, FileTypes, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -63,7 +63,7 @@ def _extract_items( try: key = path[index] except IndexError: - if isinstance(obj, NotGiven): + if not is_given(obj): # no value was provided - we can safely ignore return [] @@ -126,8 +126,8 @@ def _extract_items( return [] -def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: - return not isinstance(obj, NotGiven) +def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) and not isinstance(obj, Omit) # Type safe methods for narrowing types with TypeVars. diff --git a/src/gitpod/resources/accounts.py b/src/gitpod/resources/accounts.py index e756632b..664b3f80 100644 --- a/src/gitpod/resources/accounts.py +++ b/src/gitpod/resources/accounts.py @@ -13,7 +13,7 @@ account_list_login_providers_params, account_list_joinable_organizations_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -56,13 +56,13 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse: def retrieve( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountRetrieveResponse: """ Gets information about the currently authenticated account. @@ -111,7 +111,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an account permanently. @@ -156,13 +156,13 @@ def get_sso_login_url( self, *, email: str, - return_to: Optional[str] | NotGiven = NOT_GIVEN, + return_to: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountGetSSOLoginURLResponse: """ Gets the SSO login URL for a specific email domain. @@ -223,15 +223,15 @@ def get_sso_login_url( def list_joinable_organizations( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - empty: bool | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountListJoinableOrganizationsResponse: """ Lists organizations that the currently authenticated account can join. @@ -285,16 +285,16 @@ def list_joinable_organizations( def list_login_providers( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: account_list_login_providers_params.Filter | Omit = omit, + pagination: account_list_login_providers_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncLoginProvidersPage[LoginProvider]: """ Lists available login providers with optional filtering. @@ -391,13 +391,13 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse: async def retrieve( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountRetrieveResponse: """ Gets information about the currently authenticated account. @@ -446,7 +446,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an account permanently. @@ -491,13 +491,13 @@ async def get_sso_login_url( self, *, email: str, - return_to: Optional[str] | NotGiven = NOT_GIVEN, + return_to: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountGetSSOLoginURLResponse: """ Gets the SSO login URL for a specific email domain. @@ -558,15 +558,15 @@ async def get_sso_login_url( async def list_joinable_organizations( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - empty: bool | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountListJoinableOrganizationsResponse: """ Lists organizations that the currently authenticated account can join. @@ -620,16 +620,16 @@ async def list_joinable_organizations( def list_login_providers( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: account_list_login_providers_params.Filter | Omit = omit, + pagination: account_list_login_providers_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[LoginProvider, AsyncLoginProvidersPage[LoginProvider]]: """ Lists available login providers with optional filtering. diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 3c3075f2..a66b33f4 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -5,7 +5,7 @@ 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 .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -53,7 +53,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorRetrieveResponse: """ Gets details about a specific editor. @@ -96,16 +96,16 @@ def retrieve( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: editor_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: editor_list_params.Filter | Omit = omit, + pagination: editor_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEditorsPage[Editor]: """ Lists all available code editors, optionally filtered to those allowed in an @@ -192,7 +192,7 @@ def resolve_url( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorResolveURLResponse: """ Resolves the URL for accessing an editor in a specific environment. @@ -277,7 +277,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorRetrieveResponse: """ Gets details about a specific editor. @@ -320,16 +320,16 @@ async def retrieve( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: editor_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: editor_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: editor_list_params.Filter | Omit = omit, + pagination: editor_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Editor, AsyncEditorsPage[Editor]]: """ Lists all available code editors, optionally filtered to those allowed in an @@ -416,7 +416,7 @@ async def resolve_url( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EditorResolveURLResponse: """ Resolves the URL for accessing an editor in a specific environment. diff --git a/src/gitpod/resources/environments/automations/automations.py b/src/gitpod/resources/environments/automations/automations.py index 9eda852d..f2c08556 100644 --- a/src/gitpod/resources/environments/automations/automations.py +++ b/src/gitpod/resources/environments/automations/automations.py @@ -12,7 +12,7 @@ ServicesResourceWithStreamingResponse, AsyncServicesResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from .tasks.tasks import ( @@ -69,14 +69,14 @@ def with_streaming_response(self) -> AutomationsResourceWithStreamingResponse: def upsert( self, *, - automations_file: AutomationsFileParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + automations_file: AutomationsFileParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomationUpsertResponse: """ Upserts the automations file for the given environment. @@ -175,14 +175,14 @@ def with_streaming_response(self) -> AsyncAutomationsResourceWithStreamingRespon async def upsert( self, *, - automations_file: AutomationsFileParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + automations_file: AutomationsFileParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomationUpsertResponse: """ Upserts the automations file for the given environment. diff --git a/src/gitpod/resources/environments/automations/services.py b/src/gitpod/resources/environments/automations/services.py index 0083cfbb..f5d5440d 100644 --- a/src/gitpod/resources/environments/automations/services.py +++ b/src/gitpod/resources/environments/automations/services.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -57,15 +57,15 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: def create( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: ServiceMetadataParam | NotGiven = NOT_GIVEN, - spec: ServiceSpecParam | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: ServiceMetadataParam | Omit = omit, + spec: ServiceSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceCreateResponse: """ Creates a new automation service for an environment. @@ -143,13 +143,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceRetrieveResponse: """ Gets details about a specific automation service. @@ -192,16 +192,16 @@ def retrieve( def update( self, *, - 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, + id: str | Omit = omit, + metadata: service_update_params.Metadata | Omit = omit, + spec: service_update_params.Spec | Omit = omit, + status: service_update_params.Status | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation service configuration. @@ -277,16 +277,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: service_list_params.Filter | Omit = omit, + pagination: service_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncServicesPage[Service]: """ Lists automation services with optional filtering. @@ -364,14 +364,14 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Deletes an automation service. @@ -431,13 +431,13 @@ def delete( def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Starts an automation service. @@ -482,13 +482,13 @@ def start( def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Stops an automation service. @@ -554,15 +554,15 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: async def create( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: ServiceMetadataParam | NotGiven = NOT_GIVEN, - spec: ServiceSpecParam | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: ServiceMetadataParam | Omit = omit, + spec: ServiceSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceCreateResponse: """ Creates a new automation service for an environment. @@ -640,13 +640,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceRetrieveResponse: """ Gets details about a specific automation service. @@ -689,16 +689,16 @@ async def retrieve( async def update( self, *, - 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, + id: str | Omit = omit, + metadata: service_update_params.Metadata | Omit = omit, + spec: service_update_params.Spec | Omit = omit, + status: service_update_params.Status | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation service configuration. @@ -774,16 +774,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: service_list_params.Filter | Omit = omit, + pagination: service_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Service, AsyncServicesPage[Service]]: """ Lists automation services with optional filtering. @@ -861,14 +861,14 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Deletes an automation service. @@ -928,13 +928,13 @@ async def delete( async def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Starts an automation service. @@ -979,13 +979,13 @@ async def start( async def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Stops an automation service. diff --git a/src/gitpod/resources/environments/automations/tasks/executions.py b/src/gitpod/resources/environments/automations/tasks/executions.py index 3fff1115..d834d48a 100644 --- a/src/gitpod/resources/environments/automations/tasks/executions.py +++ b/src/gitpod/resources/environments/automations/tasks/executions.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -50,13 +50,13 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExecutionRetrieveResponse: """ Gets details about a specific task execution. @@ -99,16 +99,16 @@ def retrieve( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: execution_list_params.Filter | Omit = omit, + pagination: execution_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncTaskExecutionsPage[TaskExecution]: """ Lists executions of automation tasks. @@ -186,13 +186,13 @@ def list( def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running task execution. @@ -255,13 +255,13 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ExecutionRetrieveResponse: """ Gets details about a specific task execution. @@ -304,16 +304,16 @@ async def retrieve( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: execution_list_params.Filter | Omit = omit, + pagination: execution_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TaskExecution, AsyncTaskExecutionsPage[TaskExecution]]: """ Lists executions of automation tasks. @@ -391,13 +391,13 @@ def list( async def stop( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running task execution. diff --git a/src/gitpod/resources/environments/automations/tasks/tasks.py b/src/gitpod/resources/environments/automations/tasks/tasks.py index 6723fe8a..c1758248 100644 --- a/src/gitpod/resources/environments/automations/tasks/tasks.py +++ b/src/gitpod/resources/environments/automations/tasks/tasks.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from .executions import ( ExecutionsResource, @@ -69,16 +69,16 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse: def create( self, *, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadata | NotGiven = NOT_GIVEN, - spec: TaskSpec | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | Omit = omit, + environment_id: str | Omit = omit, + metadata: TaskMetadata | Omit = omit, + spec: TaskSpec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskCreateResponse: """ Creates a new automation task. @@ -152,13 +152,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskRetrieveResponse: """ Gets details about a specific automation task. @@ -200,16 +200,16 @@ def retrieve( def update( self, *, - id: str | NotGiven = NOT_GIVEN, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_update_params.Spec | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + depends_on: SequenceNotStr[str] | Omit = omit, + metadata: task_update_params.Metadata | Omit = omit, + spec: task_update_params.Spec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation task configuration. @@ -276,16 +276,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: task_list_params.Filter | Omit = omit, + pagination: task_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncTasksPage[Task]: """ Lists automation tasks with optional filtering. @@ -363,13 +363,13 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an automation task. @@ -411,13 +411,13 @@ def delete( def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskStartResponse: """Starts a task by creating a new task execution. @@ -486,16 +486,16 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: async def create( self, *, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: TaskMetadata | NotGiven = NOT_GIVEN, - spec: TaskSpec | NotGiven = NOT_GIVEN, + depends_on: SequenceNotStr[str] | Omit = omit, + environment_id: str | Omit = omit, + metadata: TaskMetadata | Omit = omit, + spec: TaskSpec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskCreateResponse: """ Creates a new automation task. @@ -569,13 +569,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskRetrieveResponse: """ Gets details about a specific automation task. @@ -617,16 +617,16 @@ async def retrieve( async def update( self, *, - id: str | NotGiven = NOT_GIVEN, - depends_on: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - metadata: task_update_params.Metadata | NotGiven = NOT_GIVEN, - spec: task_update_params.Spec | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + depends_on: SequenceNotStr[str] | Omit = omit, + metadata: task_update_params.Metadata | Omit = omit, + spec: task_update_params.Spec | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an automation task configuration. @@ -693,16 +693,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: task_list_params.Filter | Omit = omit, + pagination: task_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Task, AsyncTasksPage[Task]]: """ Lists automation tasks with optional filtering. @@ -780,13 +780,13 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an automation task. @@ -828,13 +828,13 @@ async def delete( async def start( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TaskStartResponse: """Starts a task by creating a new task execution. diff --git a/src/gitpod/resources/environments/classes.py b/src/gitpod/resources/environments/classes.py index ffe58db6..a61eb67e 100644 --- a/src/gitpod/resources/environments/classes.py +++ b/src/gitpod/resources/environments/classes.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -45,16 +45,16 @@ def with_streaming_response(self) -> ClassesResourceWithStreamingResponse: def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: class_list_params.Filter | Omit = omit, + pagination: class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ Lists available environment classes with their specifications and resource @@ -138,16 +138,16 @@ def with_streaming_response(self) -> AsyncClassesResourceWithStreamingResponse: def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: class_list_params.Filter | Omit = omit, + pagination: class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ Lists available environment classes with their specifications and resource diff --git a/src/gitpod/resources/environments/environments.py b/src/gitpod/resources/environments/environments.py index e57316b8..6de9f762 100644 --- a/src/gitpod/resources/environments/environments.py +++ b/src/gitpod/resources/environments/environments.py @@ -28,7 +28,7 @@ ClassesResourceWithStreamingResponse, AsyncClassesResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -91,13 +91,13 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateResponse: """Creates a development environment from a context URL (e.g. @@ -193,7 +193,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentRetrieveResponse: """ Gets details about a specific environment including its status, configuration, @@ -242,15 +242,15 @@ def retrieve( def update( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: Optional[environment_update_params.Metadata] | NotGiven = NOT_GIVEN, - spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: Optional[environment_update_params.Metadata] | Omit = omit, + spec: Optional[environment_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment's configuration while it is running. @@ -336,16 +336,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_list_params.Filter | Omit = omit, + pagination: environment_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEnvironmentsPage[Environment]: """ Lists all environments matching the specified criteria. @@ -427,14 +427,14 @@ def list( def delete( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an environment. @@ -504,7 +504,7 @@ def create_environment_token( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateEnvironmentTokenResponse: """ Creates an access token for the environment. @@ -549,14 +549,14 @@ def create_environment_token( def create_from_project( self, *, - project_id: str | NotGiven = NOT_GIVEN, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateFromProjectResponse: """ Creates an environment from an existing project configuration and starts it. @@ -621,13 +621,13 @@ def create_from_project( def create_logs_token( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateLogsTokenResponse: """ Creates an access token for retrieving environment logs. @@ -674,14 +674,14 @@ def create_logs_token( def mark_active( self, *, - activity_signal: EnvironmentActivitySignalParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + activity_signal: EnvironmentActivitySignalParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Records environment activity to prevent automatic shutdown. @@ -733,13 +733,13 @@ def mark_active( def start( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Starts a stopped environment. @@ -781,13 +781,13 @@ def start( def stop( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running environment. @@ -830,13 +830,13 @@ def stop( def unarchive( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Unarchives an environment. @@ -905,13 +905,13 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateResponse: """Creates a development environment from a context URL (e.g. @@ -1007,7 +1007,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentRetrieveResponse: """ Gets details about a specific environment including its status, configuration, @@ -1056,15 +1056,15 @@ async def retrieve( async def update( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - metadata: Optional[environment_update_params.Metadata] | NotGiven = NOT_GIVEN, - spec: Optional[environment_update_params.Spec] | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + metadata: Optional[environment_update_params.Metadata] | Omit = omit, + spec: Optional[environment_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment's configuration while it is running. @@ -1150,16 +1150,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: environment_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: environment_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_list_params.Filter | Omit = omit, + pagination: environment_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Environment, AsyncEnvironmentsPage[Environment]]: """ Lists all environments matching the specified criteria. @@ -1241,14 +1241,14 @@ def list( async def delete( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an environment. @@ -1318,7 +1318,7 @@ async def create_environment_token( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateEnvironmentTokenResponse: """ Creates an access token for the environment. @@ -1363,14 +1363,14 @@ async def create_environment_token( async def create_from_project( self, *, - project_id: str | NotGiven = NOT_GIVEN, - spec: EnvironmentSpecParam | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, + spec: EnvironmentSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateFromProjectResponse: """ Creates an environment from an existing project configuration and starts it. @@ -1435,13 +1435,13 @@ async def create_from_project( async def create_logs_token( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentCreateLogsTokenResponse: """ Creates an access token for retrieving environment logs. @@ -1488,14 +1488,14 @@ async def create_logs_token( async def mark_active( self, *, - activity_signal: EnvironmentActivitySignalParam | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, + activity_signal: EnvironmentActivitySignalParam | Omit = omit, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Records environment activity to prevent automatic shutdown. @@ -1547,13 +1547,13 @@ async def mark_active( async def start( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Starts a stopped environment. @@ -1597,13 +1597,13 @@ async def start( async def stop( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Stops a running environment. @@ -1648,13 +1648,13 @@ async def stop( async def unarchive( self, *, - environment_id: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Unarchives an environment. diff --git a/src/gitpod/resources/events.py b/src/gitpod/resources/events.py index b28929f1..a37c2a27 100644 --- a/src/gitpod/resources/events.py +++ b/src/gitpod/resources/events.py @@ -5,7 +5,7 @@ import httpx from ..types import event_list_params, event_watch_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -47,16 +47,16 @@ def with_streaming_response(self) -> EventsResourceWithStreamingResponse: def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: event_list_params.Filter | Omit = omit, + pagination: event_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEntriesPage[EventListResponse]: """ Lists audit logs with filtering and pagination options. @@ -127,14 +127,14 @@ def list( def watch( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JSONLDecoder[EventWatchResponse]: """ Streams events for all projects, runners, environments, tasks, and services @@ -212,16 +212,16 @@ def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: event_list_params.Filter | Omit = omit, + pagination: event_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EventListResponse, AsyncEntriesPage[EventListResponse]]: """ Lists audit logs with filtering and pagination options. @@ -292,14 +292,14 @@ def list( async def watch( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - organization: bool | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncJSONLDecoder[EventWatchResponse]: """ Streams events for all projects, runners, environments, tasks, and services diff --git a/src/gitpod/resources/gateways.py b/src/gitpod/resources/gateways.py index 9351d6a9..77ded7ed 100644 --- a/src/gitpod/resources/gateways.py +++ b/src/gitpod/resources/gateways.py @@ -5,7 +5,7 @@ import httpx from ..types import gateway_list_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -45,15 +45,15 @@ def with_streaming_response(self) -> GatewaysResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: gateway_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: gateway_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncGatewaysPage[Gateway]: """ ListGateways @@ -114,15 +114,15 @@ def with_streaming_response(self) -> AsyncGatewaysResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: gateway_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: gateway_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Gateway, AsyncGatewaysPage[Gateway]]: """ ListGateways diff --git a/src/gitpod/resources/groups.py b/src/gitpod/resources/groups.py index 56c681f2..36e2ed43 100644 --- a/src/gitpod/resources/groups.py +++ b/src/gitpod/resources/groups.py @@ -5,7 +5,7 @@ import httpx from ..types import group_list_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -45,15 +45,15 @@ def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: group_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncGroupsPage[Group]: """ Lists groups with optional pagination. @@ -142,15 +142,15 @@ def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: group_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: group_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Group, AsyncGroupsPage[Group]]: """ Lists groups with optional pagination. diff --git a/src/gitpod/resources/identity.py b/src/gitpod/resources/identity.py index dc4b0c30..4ad7f4fa 100644 --- a/src/gitpod/resources/identity.py +++ b/src/gitpod/resources/identity.py @@ -10,7 +10,7 @@ identity_exchange_token_params, identity_get_authenticated_identity_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -52,13 +52,13 @@ def with_streaming_response(self) -> IdentityResourceWithStreamingResponse: def exchange_token( self, *, - exchange_token: str | NotGiven = NOT_GIVEN, + exchange_token: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityExchangeTokenResponse: """ Exchanges an exchange token for a new access token. @@ -104,13 +104,13 @@ def exchange_token( def get_authenticated_identity( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetAuthenticatedIdentityResponse: """ Retrieves information about the currently authenticated identity. @@ -155,14 +155,14 @@ def get_authenticated_identity( def get_id_token( self, *, - audience: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - version: IDTokenVersion | NotGiven = NOT_GIVEN, + audience: SequenceNotStr[str] | Omit = omit, + version: IDTokenVersion | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetIDTokenResponse: """ Gets an ID token for authenticating with other services. @@ -244,13 +244,13 @@ def with_streaming_response(self) -> AsyncIdentityResourceWithStreamingResponse: async def exchange_token( self, *, - exchange_token: str | NotGiven = NOT_GIVEN, + exchange_token: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityExchangeTokenResponse: """ Exchanges an exchange token for a new access token. @@ -296,13 +296,13 @@ async def exchange_token( async def get_authenticated_identity( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetAuthenticatedIdentityResponse: """ Retrieves information about the currently authenticated identity. @@ -347,14 +347,14 @@ async def get_authenticated_identity( async def get_id_token( self, *, - audience: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - version: IDTokenVersion | NotGiven = NOT_GIVEN, + audience: SequenceNotStr[str] | Omit = omit, + version: IDTokenVersion | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IdentityGetIDTokenResponse: """ Gets an ID token for authenticating with other services. diff --git a/src/gitpod/resources/organizations/domain_verifications.py b/src/gitpod/resources/organizations/domain_verifications.py index 5468ac8d..6d97f6d1 100644 --- a/src/gitpod/resources/organizations/domain_verifications.py +++ b/src/gitpod/resources/organizations/domain_verifications.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -61,7 +61,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationCreateResponse: """ Initiates domain verification process to enable organization features. @@ -126,7 +126,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationRetrieveResponse: """ Retrieves the status of a domain verification request. @@ -172,15 +172,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: domain_verification_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDomainVerificationsPage[DomainVerification]: """ Lists and monitors domain verification status across an organization. @@ -260,7 +260,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a domain verification request. @@ -311,7 +311,7 @@ def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationVerifyResponse: """ Verifies domain ownership for an organization. @@ -384,7 +384,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationCreateResponse: """ Initiates domain verification process to enable organization features. @@ -449,7 +449,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationRetrieveResponse: """ Retrieves the status of a domain verification request. @@ -495,15 +495,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: domain_verification_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: domain_verification_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DomainVerification, AsyncDomainVerificationsPage[DomainVerification]]: """ Lists and monitors domain verification status across an organization. @@ -583,7 +583,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a domain verification request. @@ -634,7 +634,7 @@ async def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainVerificationVerifyResponse: """ Verifies domain ownership for an organization. diff --git a/src/gitpod/resources/organizations/invites.py b/src/gitpod/resources/organizations/invites.py index 8ed2e02c..140f8524 100644 --- a/src/gitpod/resources/organizations/invites.py +++ b/src/gitpod/resources/organizations/invites.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteCreateResponse: """Creates an invite link for joining an organization. @@ -102,7 +102,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteRetrieveResponse: """ GetOrganizationInvite @@ -134,7 +134,7 @@ def get_summary( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteGetSummaryResponse: """ Retrieves organization details and membership info based on an invite link. @@ -204,7 +204,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteCreateResponse: """Creates an invite link for joining an organization. @@ -256,7 +256,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteRetrieveResponse: """ GetOrganizationInvite @@ -290,7 +290,7 @@ async def get_summary( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InviteGetSummaryResponse: """ Retrieves organization details and membership info based on an invite link. diff --git a/src/gitpod/resources/organizations/organizations.py b/src/gitpod/resources/organizations/organizations.py index 0e989d83..28312caa 100644 --- a/src/gitpod/resources/organizations/organizations.py +++ b/src/gitpod/resources/organizations/organizations.py @@ -24,7 +24,7 @@ InvitesResourceWithStreamingResponse, AsyncInvitesResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -111,14 +111,14 @@ def create( self, *, name: str, - invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, - join_organization: bool | NotGiven = NOT_GIVEN, + invite_accounts_with_matching_domain: bool | Omit = omit, + join_organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationCreateResponse: """ Creates a new organization with the specified name and settings. @@ -193,7 +193,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationRetrieveResponse: """ Gets details about a specific organization. @@ -240,14 +240,14 @@ def update( self, *, organization_id: str, - invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + invite_domains: Optional[InviteDomainsParam] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationUpdateResponse: """ Updates an organization's settings including name, invite domains, and member @@ -325,7 +325,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an organization. @@ -371,14 +371,14 @@ def delete( def join( self, *, - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + invite_id: str | Omit = omit, + organization_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationJoinResponse: """ Allows users to join an organization through direct ID, invite link, or @@ -445,7 +445,7 @@ def leave( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a user from an organization while preserving organization data. @@ -491,15 +491,15 @@ def list_members( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: organization_list_members_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncMembersPage[OrganizationMember]: """ Lists and filters organization members with optional pagination. @@ -578,13 +578,13 @@ def set_role( *, organization_id: str, user_id: str, - role: OrganizationRole | NotGiven = NOT_GIVEN, + role: OrganizationRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Manages organization membership and roles by setting a user's role within the @@ -684,14 +684,14 @@ async def create( self, *, name: str, - invite_accounts_with_matching_domain: bool | NotGiven = NOT_GIVEN, - join_organization: bool | NotGiven = NOT_GIVEN, + invite_accounts_with_matching_domain: bool | Omit = omit, + join_organization: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationCreateResponse: """ Creates a new organization with the specified name and settings. @@ -766,7 +766,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationRetrieveResponse: """ Gets details about a specific organization. @@ -813,14 +813,14 @@ async def update( self, *, organization_id: str, - invite_domains: Optional[InviteDomainsParam] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + invite_domains: Optional[InviteDomainsParam] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationUpdateResponse: """ Updates an organization's settings including name, invite domains, and member @@ -898,7 +898,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Permanently deletes an organization. @@ -944,14 +944,14 @@ async def delete( async def join( self, *, - invite_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + invite_id: str | Omit = omit, + organization_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationJoinResponse: """ Allows users to join an organization through direct ID, invite link, or @@ -1018,7 +1018,7 @@ async def leave( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a user from an organization while preserving organization data. @@ -1064,15 +1064,15 @@ def list_members( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: organization_list_members_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: organization_list_members_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OrganizationMember, AsyncMembersPage[OrganizationMember]]: """ Lists and filters organization members with optional pagination. @@ -1151,13 +1151,13 @@ async def set_role( *, organization_id: str, user_id: str, - role: OrganizationRole | NotGiven = NOT_GIVEN, + role: OrganizationRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Manages organization membership and roles by setting a user's role within the diff --git a/src/gitpod/resources/organizations/policies.py b/src/gitpod/resources/organizations/policies.py index 60124dc6..70d3b52d 100644 --- a/src/gitpod/resources/organizations/policies.py +++ b/src/gitpod/resources/organizations/policies.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyRetrieveResponse: """ Gets organization policy settings by organization ID. @@ -97,22 +97,22 @@ def update( self, *, organization_id: str, - allowed_editor_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, - default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, - default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environment_timeout: Optional[str] | NotGiven = NOT_GIVEN, - maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, - members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, - port_sharing_disabled: Optional[bool] | NotGiven = NOT_GIVEN, + allowed_editor_ids: SequenceNotStr[str] | Omit = omit, + allow_local_runners: Optional[bool] | Omit = omit, + default_editor_id: Optional[str] | Omit = omit, + default_environment_image: Optional[str] | Omit = omit, + maximum_environments_per_user: Optional[str] | Omit = omit, + maximum_environment_timeout: Optional[str] | Omit = omit, + maximum_running_environments_per_user: Optional[str] | Omit = omit, + members_create_projects: Optional[bool] | Omit = omit, + members_require_projects: Optional[bool] | Omit = omit, + port_sharing_disabled: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates organization policy settings. @@ -244,7 +244,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyRetrieveResponse: """ Gets organization policy settings by organization ID. @@ -291,22 +291,22 @@ async def update( self, *, organization_id: str, - allowed_editor_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - allow_local_runners: Optional[bool] | NotGiven = NOT_GIVEN, - default_editor_id: Optional[str] | NotGiven = NOT_GIVEN, - default_environment_image: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - maximum_environment_timeout: Optional[str] | NotGiven = NOT_GIVEN, - maximum_running_environments_per_user: Optional[str] | NotGiven = NOT_GIVEN, - members_create_projects: Optional[bool] | NotGiven = NOT_GIVEN, - members_require_projects: Optional[bool] | NotGiven = NOT_GIVEN, - port_sharing_disabled: Optional[bool] | NotGiven = NOT_GIVEN, + allowed_editor_ids: SequenceNotStr[str] | Omit = omit, + allow_local_runners: Optional[bool] | Omit = omit, + default_editor_id: Optional[str] | Omit = omit, + default_environment_image: Optional[str] | Omit = omit, + maximum_environments_per_user: Optional[str] | Omit = omit, + maximum_environment_timeout: Optional[str] | Omit = omit, + maximum_running_environments_per_user: Optional[str] | Omit = omit, + members_create_projects: Optional[bool] | Omit = omit, + members_require_projects: Optional[bool] | Omit = omit, + port_sharing_disabled: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates organization policy settings. diff --git a/src/gitpod/resources/organizations/sso_configurations.py b/src/gitpod/resources/organizations/sso_configurations.py index 6cdb528a..c0f1dad1 100644 --- a/src/gitpod/resources/organizations/sso_configurations.py +++ b/src/gitpod/resources/organizations/sso_configurations.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -67,7 +67,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationCreateResponse: """ Creates or updates SSO configuration for organizational authentication. @@ -149,7 +149,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationRetrieveResponse: """ Retrieves a specific SSO configuration. @@ -197,18 +197,18 @@ 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, - state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, + claims: Dict[str, str] | Omit = omit, + client_id: Optional[str] | Omit = omit, + client_secret: Optional[str] | Omit = omit, + email_domain: Optional[str] | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates SSO provider settings and authentication rules. @@ -287,15 +287,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: sso_configuration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSSOConfigurationsPage[SSOConfiguration]: """ Lists and filters SSO configurations for an organization. @@ -377,7 +377,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes an SSO configuration from an organization. @@ -453,7 +453,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationCreateResponse: """ Creates or updates SSO configuration for organizational authentication. @@ -535,7 +535,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SSOConfigurationRetrieveResponse: """ Retrieves a specific SSO configuration. @@ -583,18 +583,18 @@ 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, - state: Optional[SSOConfigurationState] | NotGiven = NOT_GIVEN, + claims: Dict[str, str] | Omit = omit, + client_id: Optional[str] | Omit = omit, + client_secret: Optional[str] | Omit = omit, + email_domain: Optional[str] | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + state: Optional[SSOConfigurationState] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates SSO provider settings and authentication rules. @@ -673,15 +673,15 @@ def list( self, *, organization_id: str, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - pagination: sso_configuration_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: sso_configuration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SSOConfiguration, AsyncSSOConfigurationsPage[SSOConfiguration]]: """ Lists and filters SSO configurations for an organization. @@ -763,7 +763,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes an SSO configuration from an organization. diff --git a/src/gitpod/resources/projects/policies.py b/src/gitpod/resources/projects/policies.py index fc12621f..0c873cc8 100644 --- a/src/gitpod/resources/projects/policies.py +++ b/src/gitpod/resources/projects/policies.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,15 +54,15 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a project. @@ -117,15 +117,15 @@ def create( def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing project policy. @@ -180,16 +180,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncPoliciesPage[ProjectPolicy]: """ Lists policies for a project. @@ -255,14 +255,14 @@ def list( def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project policy. @@ -336,15 +336,15 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a project. @@ -399,15 +399,15 @@ async def create( async def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - role: ProjectRole | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, + role: ProjectRole | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing project policy. @@ -462,16 +462,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ProjectPolicy, AsyncPoliciesPage[ProjectPolicy]]: """ Lists policies for a project. @@ -537,14 +537,14 @@ def list( async def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project policy. diff --git a/src/gitpod/resources/projects/projects.py b/src/gitpod/resources/projects/projects.py index 2c8e6375..d8d61de5 100644 --- a/src/gitpod/resources/projects/projects.py +++ b/src/gitpod/resources/projects/projects.py @@ -14,7 +14,7 @@ project_retrieve_params, project_create_from_environment_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -74,16 +74,16 @@ def create( *, environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - technical_description: str | NotGiven = NOT_GIVEN, + automations_file_path: str | Omit = omit, + devcontainer_file_path: str | Omit = omit, + name: str | Omit = omit, + technical_description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateResponse: """ Creates a new project with specified configuration. @@ -177,13 +177,13 @@ def create( def retrieve( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectRetrieveResponse: """ Gets details about a specific project. @@ -227,19 +227,19 @@ def retrieve( def update( self, *, - 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, - technical_description: Optional[str] | NotGiven = NOT_GIVEN, + automations_file_path: Optional[str] | Omit = omit, + devcontainer_file_path: Optional[str] | Omit = omit, + environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, + initializer: Optional[EnvironmentInitializerParam] | Omit = omit, + name: Optional[str] | Omit = omit, + project_id: str | Omit = omit, + technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectUpdateResponse: """ Updates a project's configuration. @@ -325,16 +325,16 @@ def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: project_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: project_list_params.Filter | Omit = omit, + pagination: project_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncProjectsPage[Project]: """ Lists projects with optional filtering. @@ -397,13 +397,13 @@ def list( def delete( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project permanently. @@ -447,14 +447,14 @@ def delete( def create_from_environment( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateFromEnvironmentResponse: """ Creates a new project using an existing environment as a template. @@ -532,16 +532,16 @@ async def create( *, environment_class: ProjectEnvironmentClassParam, initializer: EnvironmentInitializerParam, - automations_file_path: str | NotGiven = NOT_GIVEN, - devcontainer_file_path: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - technical_description: str | NotGiven = NOT_GIVEN, + automations_file_path: str | Omit = omit, + devcontainer_file_path: str | Omit = omit, + name: str | Omit = omit, + technical_description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateResponse: """ Creates a new project with specified configuration. @@ -635,13 +635,13 @@ async def create( async def retrieve( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectRetrieveResponse: """ Gets details about a specific project. @@ -685,19 +685,19 @@ async def retrieve( async def update( self, *, - 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, - technical_description: Optional[str] | NotGiven = NOT_GIVEN, + automations_file_path: Optional[str] | Omit = omit, + devcontainer_file_path: Optional[str] | Omit = omit, + environment_class: Optional[ProjectEnvironmentClassParam] | Omit = omit, + initializer: Optional[EnvironmentInitializerParam] | Omit = omit, + name: Optional[str] | Omit = omit, + project_id: str | Omit = omit, + technical_description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectUpdateResponse: """ Updates a project's configuration. @@ -783,16 +783,16 @@ async def update( def list( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: project_list_params.Filter | NotGiven = NOT_GIVEN, - pagination: project_list_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: project_list_params.Filter | Omit = omit, + pagination: project_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Project, AsyncProjectsPage[Project]]: """ Lists projects with optional filtering. @@ -855,13 +855,13 @@ def list( async def delete( self, *, - project_id: str | NotGiven = NOT_GIVEN, + project_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a project permanently. @@ -905,14 +905,14 @@ async def delete( async def create_from_environment( self, *, - environment_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + environment_id: str | Omit = omit, + name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProjectCreateFromEnvironmentResponse: """ Creates a new project using an existing environment as a template. diff --git a/src/gitpod/resources/runners/configurations/configurations.py b/src/gitpod/resources/runners/configurations/configurations.py index b9b2c27c..e2506ec0 100644 --- a/src/gitpod/resources/runners/configurations/configurations.py +++ b/src/gitpod/resources/runners/configurations/configurations.py @@ -12,7 +12,7 @@ SchemaResourceWithStreamingResponse, AsyncSchemaResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -93,15 +93,15 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse def validate( self, *, - environment_class: EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.ScmIntegration | NotGiven = NOT_GIVEN, + environment_class: EnvironmentClass | Omit = omit, + runner_id: str | Omit = omit, + scm_integration: configuration_validate_params.ScmIntegration | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigurationValidateResponse: """ Validates a runner configuration. @@ -193,15 +193,15 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes async def validate( self, *, - environment_class: EnvironmentClass | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - scm_integration: configuration_validate_params.ScmIntegration | NotGiven = NOT_GIVEN, + environment_class: EnvironmentClass | Omit = omit, + runner_id: str | Omit = omit, + scm_integration: configuration_validate_params.ScmIntegration | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigurationValidateResponse: """ Validates a runner configuration. diff --git a/src/gitpod/resources/runners/configurations/environment_classes.py b/src/gitpod/resources/runners/configurations/environment_classes.py index ba2137ce..5ad80efe 100644 --- a/src/gitpod/resources/runners/configurations/environment_classes.py +++ b/src/gitpod/resources/runners/configurations/environment_classes.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -55,16 +55,16 @@ def with_streaming_response(self) -> EnvironmentClassesResourceWithStreamingResp def create( self, *, - configuration: Iterable[FieldValue] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + configuration: Iterable[FieldValue] | Omit = omit, + description: str | Omit = omit, + display_name: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassCreateResponse: """ Creates a new environment class for a runner. @@ -121,13 +121,13 @@ def create( def retrieve( self, *, - environment_class_id: str | NotGiven = NOT_GIVEN, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassRetrieveResponse: """ Gets details about a specific environment class. @@ -172,16 +172,16 @@ def retrieve( def update( self, *, - 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, + description: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, + enabled: Optional[bool] | Omit = omit, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment class. @@ -234,16 +234,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_class_list_params.Filter | Omit = omit, + pagination: environment_class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncEnvironmentClassesPage[EnvironmentClass]: """ Lists environment classes with optional filtering. @@ -340,16 +340,16 @@ def with_streaming_response(self) -> AsyncEnvironmentClassesResourceWithStreamin async def create( self, *, - configuration: Iterable[FieldValue] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - display_name: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + configuration: Iterable[FieldValue] | Omit = omit, + description: str | Omit = omit, + display_name: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassCreateResponse: """ Creates a new environment class for a runner. @@ -406,13 +406,13 @@ async def create( async def retrieve( self, *, - environment_class_id: str | NotGiven = NOT_GIVEN, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnvironmentClassRetrieveResponse: """ Gets details about a specific environment class. @@ -457,16 +457,16 @@ async def retrieve( async def update( self, *, - 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, + description: Optional[str] | Omit = omit, + display_name: Optional[str] | Omit = omit, + enabled: Optional[bool] | Omit = omit, + environment_class_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an environment class. @@ -519,16 +519,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: environment_class_list_params.Filter | Omit = omit, + pagination: environment_class_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EnvironmentClass, AsyncEnvironmentClassesPage[EnvironmentClass]]: """ Lists environment classes with optional filtering. diff --git a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py index af044ec5..1c77a680 100644 --- a/src/gitpod/resources/runners/configurations/host_authentication_tokens.py +++ b/src/gitpod/resources/runners/configurations/host_authentication_tokens.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -62,19 +62,19 @@ def with_streaming_response(self) -> HostAuthenticationTokensResourceWithStreami def create( self, *, - 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: HostAuthenticationTokenSource | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + expires_at: Union[str, datetime] | Omit = omit, + host: str | Omit = omit, + refresh_token: str | Omit = omit, + runner_id: str | Omit = omit, + source: HostAuthenticationTokenSource | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenCreateResponse: """ Creates a new authentication token for accessing remote hosts. @@ -222,13 +222,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenRetrieveResponse: """ Gets details about a specific host authentication token. @@ -272,16 +272,16 @@ def retrieve( def update( self, *, - 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, + id: str | Omit = omit, + token: Optional[str] | Omit = omit, + expires_at: Union[str, datetime, None] | Omit = omit, + refresh_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing host authentication token. @@ -423,16 +423,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: host_authentication_token_list_params.Filter | Omit = omit, + pagination: host_authentication_token_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncTokensPage[HostAuthenticationToken]: """ Lists host authentication tokens with optional filtering. @@ -504,13 +504,13 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a host authentication token. @@ -575,19 +575,19 @@ def with_streaming_response(self) -> AsyncHostAuthenticationTokensResourceWithSt async def create( self, *, - 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: HostAuthenticationTokenSource | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + expires_at: Union[str, datetime] | Omit = omit, + host: str | Omit = omit, + refresh_token: str | Omit = omit, + runner_id: str | Omit = omit, + source: HostAuthenticationTokenSource | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenCreateResponse: """ Creates a new authentication token for accessing remote hosts. @@ -735,13 +735,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HostAuthenticationTokenRetrieveResponse: """ Gets details about a specific host authentication token. @@ -785,16 +785,16 @@ async def retrieve( async def update( self, *, - 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, + id: str | Omit = omit, + token: Optional[str] | Omit = omit, + expires_at: Union[str, datetime, None] | Omit = omit, + refresh_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing host authentication token. @@ -936,16 +936,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: host_authentication_token_list_params.Filter | Omit = omit, + pagination: host_authentication_token_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[HostAuthenticationToken, AsyncTokensPage[HostAuthenticationToken]]: """ Lists host authentication tokens with optional filtering. @@ -1017,13 +1017,13 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a host authentication token. diff --git a/src/gitpod/resources/runners/configurations/schema.py b/src/gitpod/resources/runners/configurations/schema.py index 06963e11..958f2a95 100644 --- a/src/gitpod/resources/runners/configurations/schema.py +++ b/src/gitpod/resources/runners/configurations/schema.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -44,13 +44,13 @@ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse: def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaRetrieveResponse: """ Gets the latest runner configuration schema. @@ -113,13 +113,13 @@ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse: async def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaRetrieveResponse: """ Gets the latest runner configuration schema. diff --git a/src/gitpod/resources/runners/configurations/scm_integrations.py b/src/gitpod/resources/runners/configurations/scm_integrations.py index 2947b2e7..2f5f82ad 100644 --- a/src/gitpod/resources/runners/configurations/scm_integrations.py +++ b/src/gitpod/resources/runners/configurations/scm_integrations.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -55,19 +55,19 @@ def with_streaming_response(self) -> ScmIntegrationsResourceWithStreamingRespons def create( self, *, - host: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[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, + host: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: bool | Omit = omit, + runner_id: str | Omit = omit, + scm_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationCreateResponse: """ Creates a new SCM integration for a runner. @@ -136,13 +136,13 @@ def create( def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationRetrieveResponse: """ Gets details about a specific SCM integration. @@ -184,17 +184,17 @@ def retrieve( def update( self, *, - id: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[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, + id: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing SCM integration. @@ -267,16 +267,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: scm_integration_list_params.Filter | Omit = omit, + pagination: scm_integration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncIntegrationsPage[ScmIntegration]: """ Lists SCM integrations for a runner. @@ -341,13 +341,13 @@ def list( def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an SCM integration. @@ -410,19 +410,19 @@ def with_streaming_response(self) -> AsyncScmIntegrationsResourceWithStreamingRe async def create( self, *, - host: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[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, + host: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: bool | Omit = omit, + runner_id: str | Omit = omit, + scm_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationCreateResponse: """ Creates a new SCM integration for a runner. @@ -491,13 +491,13 @@ async def create( async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScmIntegrationRetrieveResponse: """ Gets details about a specific SCM integration. @@ -539,17 +539,17 @@ async def retrieve( async def update( self, *, - id: str | NotGiven = NOT_GIVEN, - issuer_url: Optional[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, + id: str | Omit = omit, + issuer_url: Optional[str] | Omit = omit, + oauth_client_id: Optional[str] | Omit = omit, + oauth_plaintext_client_secret: Optional[str] | Omit = omit, + pat: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates an existing SCM integration. @@ -622,16 +622,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: scm_integration_list_params.Filter | Omit = omit, + pagination: scm_integration_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ScmIntegration, AsyncIntegrationsPage[ScmIntegration]]: """ Lists SCM integrations for a runner. @@ -696,13 +696,13 @@ def list( async def delete( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an SCM integration. diff --git a/src/gitpod/resources/runners/policies.py b/src/gitpod/resources/runners/policies.py index 4ce6cc35..934a8a70 100644 --- a/src/gitpod/resources/runners/policies.py +++ b/src/gitpod/resources/runners/policies.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,15 +54,15 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a runner. @@ -117,15 +117,15 @@ def create( def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing runner policy. @@ -180,16 +180,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncPoliciesPage[RunnerPolicy]: """ Lists policies for a runner. @@ -255,14 +255,14 @@ def list( def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner policy. @@ -336,15 +336,15 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyCreateResponse: """ Creates a new policy for a runner. @@ -399,15 +399,15 @@ async def create( async def update( self, *, - group_id: str | NotGiven = NOT_GIVEN, - role: RunnerRole | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + role: RunnerRole | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyUpdateResponse: """ Updates an existing runner policy. @@ -462,16 +462,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + pagination: policy_list_params.Pagination | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RunnerPolicy, AsyncPoliciesPage[RunnerPolicy]]: """ Lists policies for a runner. @@ -537,14 +537,14 @@ def list( async def delete( self, *, - group_id: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + group_id: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner policy. diff --git a/src/gitpod/resources/runners/runners.py b/src/gitpod/resources/runners/runners.py index 876c5293..5b44c562 100644 --- a/src/gitpod/resources/runners/runners.py +++ b/src/gitpod/resources/runners/runners.py @@ -18,7 +18,7 @@ runner_create_runner_token_params, runner_check_authentication_for_host_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -90,17 +90,17 @@ def with_streaming_response(self) -> RunnersResourceWithStreamingResponse: def create( self, *, - kind: RunnerKind | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - provider: RunnerProvider | NotGiven = NOT_GIVEN, - runner_manager_id: str | NotGiven = NOT_GIVEN, - spec: RunnerSpecParam | NotGiven = NOT_GIVEN, + kind: RunnerKind | Omit = omit, + name: str | Omit = omit, + provider: RunnerProvider | Omit = omit, + runner_manager_id: str | Omit = omit, + spec: RunnerSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateResponse: """Creates a new runner registration with the server. @@ -188,13 +188,13 @@ def create( def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerRetrieveResponse: """ Gets details about a specific runner. @@ -237,15 +237,15 @@ def retrieve( def update( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - spec: Optional[runner_update_params.Spec] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + runner_id: str | Omit = omit, + spec: Optional[runner_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates a runner's configuration. @@ -306,16 +306,16 @@ def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: runner_list_params.Filter | Omit = omit, + pagination: runner_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncRunnersPage[Runner]: """ Lists all registered runners with optional filtering. @@ -390,14 +390,14 @@ def list( def delete( self, *, - force: bool | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + force: bool | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner permanently. @@ -450,14 +450,14 @@ def delete( def check_authentication_for_host( self, *, - host: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCheckAuthenticationForHostResponse: """ Checks if a user is authenticated for a specific host. @@ -505,13 +505,13 @@ def check_authentication_for_host( def create_runner_token( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateRunnerTokenResponse: """ Creates a new authentication token for a runner. @@ -557,14 +557,14 @@ def create_runner_token( def parse_context_url( self, *, - context_url: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + context_url: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerParseContextURLResponse: """ Parses a context URL and returns the parsed result. @@ -648,17 +648,17 @@ def with_streaming_response(self) -> AsyncRunnersResourceWithStreamingResponse: async def create( self, *, - kind: RunnerKind | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - provider: RunnerProvider | NotGiven = NOT_GIVEN, - runner_manager_id: str | NotGiven = NOT_GIVEN, - spec: RunnerSpecParam | NotGiven = NOT_GIVEN, + kind: RunnerKind | Omit = omit, + name: str | Omit = omit, + provider: RunnerProvider | Omit = omit, + runner_manager_id: str | Omit = omit, + spec: RunnerSpecParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateResponse: """Creates a new runner registration with the server. @@ -746,13 +746,13 @@ async def create( async def retrieve( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerRetrieveResponse: """ Gets details about a specific runner. @@ -795,15 +795,15 @@ async def retrieve( async def update( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, - spec: Optional[runner_update_params.Spec] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, + runner_id: str | Omit = omit, + spec: Optional[runner_update_params.Spec] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates a runner's configuration. @@ -864,16 +864,16 @@ async def update( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: runner_list_params.Filter | Omit = omit, + pagination: runner_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Runner, AsyncRunnersPage[Runner]]: """ Lists all registered runners with optional filtering. @@ -948,14 +948,14 @@ def list( async def delete( self, *, - force: bool | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + force: bool | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a runner permanently. @@ -1008,14 +1008,14 @@ async def delete( async def check_authentication_for_host( self, *, - host: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCheckAuthenticationForHostResponse: """ Checks if a user is authenticated for a specific host. @@ -1063,13 +1063,13 @@ async def check_authentication_for_host( async def create_runner_token( self, *, - runner_id: str | NotGiven = NOT_GIVEN, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerCreateRunnerTokenResponse: """ Creates a new authentication token for a runner. @@ -1115,14 +1115,14 @@ async def create_runner_token( async def parse_context_url( self, *, - context_url: str | NotGiven = NOT_GIVEN, - runner_id: str | NotGiven = NOT_GIVEN, + context_url: str | Omit = omit, + runner_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RunnerParseContextURLResponse: """ Parses a context URL and returns the parsed result. diff --git a/src/gitpod/resources/secrets.py b/src/gitpod/resources/secrets.py index 42c84854..16dcd675 100644 --- a/src/gitpod/resources/secrets.py +++ b/src/gitpod/resources/secrets.py @@ -11,7 +11,7 @@ secret_get_value_params, secret_update_value_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -54,19 +54,19 @@ 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, - project_id: str | NotGiven = NOT_GIVEN, - scope: SecretScopeParam | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + container_registry_basic_auth_host: str | Omit = omit, + environment_variable: bool | Omit = omit, + file_path: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + scope: SecretScopeParam | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretCreateResponse: """ Creates a new secret for a project. @@ -164,16 +164,16 @@ def create( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: secret_list_params.Filter | Omit = omit, + pagination: secret_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSecretsPage[Secret]: """ Lists secrets @@ -250,13 +250,13 @@ def list( def delete( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a secret permanently. @@ -297,13 +297,13 @@ def delete( def get_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretGetValueResponse: """Gets the value of a secret. @@ -346,14 +346,14 @@ def get_value( def update_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates the value of an existing secret. @@ -424,19 +424,19 @@ 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, - project_id: str | NotGiven = NOT_GIVEN, - scope: SecretScopeParam | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + container_registry_basic_auth_host: str | Omit = omit, + environment_variable: bool | Omit = omit, + file_path: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + scope: SecretScopeParam | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretCreateResponse: """ Creates a new secret for a project. @@ -534,16 +534,16 @@ async def create( def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: secret_list_params.Filter | Omit = omit, + pagination: secret_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Secret, AsyncSecretsPage[Secret]]: """ Lists secrets @@ -620,13 +620,13 @@ def list( async def delete( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a secret permanently. @@ -667,13 +667,13 @@ async def delete( async def get_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretGetValueResponse: """Gets the value of a secret. @@ -716,14 +716,14 @@ async def get_value( async def update_value( self, *, - secret_id: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + secret_id: str | Omit = omit, + value: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Updates the value of an existing secret. diff --git a/src/gitpod/resources/usage.py b/src/gitpod/resources/usage.py index 71c698eb..2b98af15 100644 --- a/src/gitpod/resources/usage.py +++ b/src/gitpod/resources/usage.py @@ -5,7 +5,7 @@ import httpx from ..types import usage_list_environment_runtime_records_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -45,16 +45,16 @@ def with_streaming_response(self) -> UsageResourceWithStreamingResponse: def list_environment_runtime_records( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: usage_list_environment_runtime_records_params.Filter | NotGiven = NOT_GIVEN, - pagination: usage_list_environment_runtime_records_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: usage_list_environment_runtime_records_params.Filter | Omit = omit, + pagination: usage_list_environment_runtime_records_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncRecordsPage[EnvironmentUsageRecord]: """ Lists completed environment runtime records within a specified date range. @@ -145,16 +145,16 @@ def with_streaming_response(self) -> AsyncUsageResourceWithStreamingResponse: def list_environment_runtime_records( self, *, - token: str | NotGiven = NOT_GIVEN, - page_size: int | NotGiven = NOT_GIVEN, - filter: usage_list_environment_runtime_records_params.Filter | NotGiven = NOT_GIVEN, - pagination: usage_list_environment_runtime_records_params.Pagination | NotGiven = NOT_GIVEN, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: usage_list_environment_runtime_records_params.Filter | Omit = omit, + pagination: usage_list_environment_runtime_records_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EnvironmentUsageRecord, AsyncRecordsPage[EnvironmentUsageRecord]]: """ Lists completed environment runtime records within a specified date range. diff --git a/src/gitpod/resources/users/dotfiles.py b/src/gitpod/resources/users/dotfiles.py index 6e14987b..8e02290a 100644 --- a/src/gitpod/resources/users/dotfiles.py +++ b/src/gitpod/resources/users/dotfiles.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -44,13 +44,13 @@ def with_streaming_response(self) -> DotfilesResourceWithStreamingResponse: def get( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DotfileGetResponse: """ Gets the dotfiles for a user. @@ -90,13 +90,13 @@ def get( def set( self, *, - repository: str | NotGiven = NOT_GIVEN, + repository: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets the dotfiles configuration for a user. @@ -166,13 +166,13 @@ def with_streaming_response(self) -> AsyncDotfilesResourceWithStreamingResponse: async def get( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DotfileGetResponse: """ Gets the dotfiles for a user. @@ -212,13 +212,13 @@ async def get( async def set( self, *, - repository: str | NotGiven = NOT_GIVEN, + repository: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets the dotfiles configuration for a user. diff --git a/src/gitpod/resources/users/pats.py b/src/gitpod/resources/users/pats.py index 95511b8b..972111bc 100644 --- a/src/gitpod/resources/users/pats.py +++ b/src/gitpod/resources/users/pats.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -46,16 +46,16 @@ def with_streaming_response(self) -> PatsResourceWithStreamingResponse: def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: pat_list_params.Filter | Omit = omit, + pagination: pat_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncPersonalAccessTokensPage[PersonalAccessToken]: """ Lists personal access tokens with optional filtering. @@ -118,13 +118,13 @@ def list( def delete( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a personal access token. @@ -168,13 +168,13 @@ def delete( def get( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PatGetResponse: """ Gets details about a specific personal access token. @@ -237,16 +237,16 @@ def with_streaming_response(self) -> AsyncPatsResourceWithStreamingResponse: def list( self, *, - 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, + token: str | Omit = omit, + page_size: int | Omit = omit, + filter: pat_list_params.Filter | Omit = omit, + pagination: pat_list_params.Pagination | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PersonalAccessToken, AsyncPersonalAccessTokensPage[PersonalAccessToken]]: """ Lists personal access tokens with optional filtering. @@ -309,13 +309,13 @@ def list( async def delete( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a personal access token. @@ -359,13 +359,13 @@ async def delete( async def get( self, *, - personal_access_token_id: str | NotGiven = NOT_GIVEN, + personal_access_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PatGetResponse: """ Gets details about a specific personal access token. diff --git a/src/gitpod/resources/users/users.py b/src/gitpod/resources/users/users.py index 0ffe276a..2fae4522 100644 --- a/src/gitpod/resources/users/users.py +++ b/src/gitpod/resources/users/users.py @@ -13,7 +13,7 @@ AsyncPatsResourceWithStreamingResponse, ) from ...types import user_set_suspended_params, user_get_authenticated_user_params -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .dotfiles import ( DotfilesResource, @@ -68,13 +68,13 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: def get_authenticated_user( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserGetAuthenticatedUserResponse: """ Gets information about the currently authenticated user. @@ -117,14 +117,14 @@ def get_authenticated_user( def set_suspended( self, *, - suspended: bool | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + suspended: bool | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets whether a user account is suspended. @@ -211,13 +211,13 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: async def get_authenticated_user( self, *, - empty: bool | NotGiven = NOT_GIVEN, + empty: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserGetAuthenticatedUserResponse: """ Gets information about the currently authenticated user. @@ -262,14 +262,14 @@ async def get_authenticated_user( async def set_suspended( self, *, - suspended: bool | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + suspended: bool | Omit = omit, + user_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Sets whether a user account is suspended. diff --git a/tests/test_transform.py b/tests/test_transform.py index d3c756e2..1d6e3fec 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from gitpod._types import NOT_GIVEN, Base64FileInput +from gitpod._types import Base64FileInput, omit, not_given from gitpod._utils import ( PropertyInfo, transform as _transform, @@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None: @pytest.mark.asyncio async def test_strips_notgiven(use_async: bool) -> None: assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} - assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {} + assert await transform({"foo_bar": not_given}, Foo1, use_async) == {} + + +@parametrize +@pytest.mark.asyncio +async def test_strips_omit(use_async: bool) -> None: + assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} + assert await transform({"foo_bar": omit}, Foo1, use_async) == {} From 3fd8de42107e3941274833b72c4d17d3829dc6b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 17:43:45 +0000 Subject: [PATCH 04/18] chore: do not install brew dependencies in ./scripts/bootstrap by default --- scripts/bootstrap | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index e84fe62c..b430fee3 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi From 98e718fd584a66b1cf64cf37baf4904935833b6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 08:49:40 +0000 Subject: [PATCH 05/18] chore(internal): detect missing future annotations with ruff --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 72a55206..d7d5a39f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -227,6 +227,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -249,6 +251,8 @@ unfixable = [ "T203", ] +extend-safe-fixes = ["FA102"] + [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" From 0581279f1c20a01fd1b741fc56a5d66b724a8f66 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 10:20:53 +0000 Subject: [PATCH 06/18] chore: bump `httpx-aiohttp` version to 0.1.9 --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- requirements.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d7d5a39f..2dbcca1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/gitpod-io/gitpod-sdk-python" Repository = "https://github.com/gitpod-io/gitpod-sdk-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 71fb40f5..7c6ba0a3 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -68,7 +68,7 @@ httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gitpod-sdk idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index e1664d85..201981e7 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via gitpod-sdk # via httpx-aiohttp -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gitpod-sdk idna==3.4 # via anyio From 597eb34a2f9f94a0ac4b6a8efd626ee253c7266f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:43:36 +0000 Subject: [PATCH 07/18] fix(client): close streams without requiring full consumption --- src/gitpod/_streaming.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gitpod/_streaming.py b/src/gitpod/_streaming.py index deacb4d4..4a34a6b0 100644 --- a/src/gitpod/_streaming.py +++ b/src/gitpod/_streaming.py @@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]: 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: - ... + # As we might not fully consume the response stream, we need to close it explicitly + response.close() def __enter__(self) -> Self: return self @@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]: 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: - ... + # As we might not fully consume the response stream, we need to close it explicitly + await response.aclose() async def __aenter__(self) -> Self: return self From 23160102a1df2cbcc7c9b4ab60f64860fca75af5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:03:16 +0000 Subject: [PATCH 08/18] chore(internal/tests): avoid race condition with implicit client cleanup --- tests/test_client.py | 362 +++++++++++++++++++++++-------------------- 1 file changed, 198 insertions(+), 164 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index cb493a90..f948b8a0 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -59,51 +59,49 @@ def _get_open_connections(client: Gitpod | AsyncGitpod) -> int: class TestGitpod: - 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: + def test_raw_response(self, respx_mock: MockRouter, client: Gitpod) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.post("/foo", cast_to=httpx.Response) + response = 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: + def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Gitpod) -> 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) + response = 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(self, client: Gitpod) -> None: + copied = client.copy() + assert id(copied) != id(client) - copied = self.client.copy(bearer_token="another My Bearer Token") + copied = client.copy(bearer_token="another My Bearer Token") assert copied.bearer_token == "another My Bearer Token" - assert self.client.bearer_token == "My Bearer Token" + assert client.bearer_token == "My Bearer Token" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, client: Gitpod) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert 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 isinstance(client.timeout, httpx.Timeout) + copied = client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: client = Gitpod( @@ -141,6 +139,7 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + client.close() def test_copy_default_query(self) -> None: client = Gitpod( @@ -178,13 +177,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + client.close() + + def test_copy_signature(self, client: Gitpod) -> 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] + client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -195,12 +196,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, client: Gitpod) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -257,14 +258,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + def test_request_timeout(self, client: Gitpod) -> None: + request = 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)) - ) + request = 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) @@ -277,6 +276,8 @@ def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + client.close() + 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: @@ -288,6 +289,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + client.close() + # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: client = Gitpod( @@ -298,6 +301,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + client.close() + # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = Gitpod( @@ -308,6 +313,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + client.close() + async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: @@ -319,17 +326,17 @@ async def test_invalid_http_client(self) -> None: ) def test_default_headers_option(self) -> None: - client = Gitpod( + test_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")) + request = test_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( + test_client2 = Gitpod( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, @@ -338,10 +345,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_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" + test_client.close() + test_client2.close() + 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")) @@ -373,8 +383,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + client.close() + + def test_request_extra_json(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -385,7 +397,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -396,7 +408,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -407,8 +419,8 @@ def test_request_extra_json(self) -> 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( + def test_request_extra_headers(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -418,7 +430,7 @@ def test_request_extra_headers(self) -> None: 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( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -429,8 +441,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -443,7 +455,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -457,7 +469,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -500,7 +512,7 @@ def test_multipart_repeating_array(self, client: Gitpod) -> None: ] @pytest.mark.respx(base_url=base_url) - def test_basic_union_response(self, respx_mock: MockRouter) -> None: + def test_basic_union_response(self, respx_mock: MockRouter, client: Gitpod) -> None: class Model1(BaseModel): name: str @@ -509,12 +521,12 @@ class Model2(BaseModel): 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])) + response = 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: + def test_union_response_different_types(self, respx_mock: MockRouter, client: Gitpod) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -525,18 +537,18 @@ class Model2(BaseModel): 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])) + response = 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])) + response = 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: + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: Gitpod) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -552,7 +564,7 @@ class Model(BaseModel): ) ) - response = self.client.get("/foo", cast_to=Model) + response = client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 @@ -566,6 +578,8 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" + client.close() + 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) @@ -597,6 +611,7 @@ def test_base_url_trailing_slash(self, client: Gitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -624,6 +639,7 @@ def test_base_url_no_trailing_slash(self, client: Gitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -651,35 +667,36 @@ def test_absolute_request_url(self, client: Gitpod) -> None: ), ) assert request.url == "https://myapi.com/foo" + client.close() def test_copied_client_does_not_close_http(self) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - assert not client.is_closed() + test_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied - assert not client.is_closed() + assert not test_client.is_closed() def test_client_context_manager(self) -> None: - client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - with client as c2: - assert c2 is client + test_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + def test_client_response_validation_error(self, respx_mock: MockRouter, client: Gitpod) -> 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) + client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -704,11 +721,14 @@ class Model(BaseModel): 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) + non_strict_client = Gitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) - response = client.get("/foo", cast_to=Model) + response = non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + strict_client.close() + non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -731,9 +751,9 @@ 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) - + def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, client: Gitpod + ) -> None: 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) @@ -749,7 +769,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien with pytest.raises(APITimeoutError): client.identity.with_streaming_response.get_authenticated_identity().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -758,7 +778,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client with pytest.raises(APIStatusError): client.identity.with_streaming_response.get_authenticated_identity().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -864,83 +884,77 @@ def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - def test_follow_redirects(self, respx_mock: MockRouter) -> None: + def test_follow_redirects(self, respx_mock: MockRouter, client: Gitpod) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Gitpod) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - self.client.post( - "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response - ) + client.post("/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response) assert exc_info.value.response.status_code == 302 assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" class TestAsyncGitpod: - client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response(self, respx_mock: MockRouter) -> None: + async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_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: + async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> 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) + response = await async_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(self, async_client: AsyncGitpod) -> None: + copied = async_client.copy() + assert id(copied) != id(async_client) - copied = self.client.copy(bearer_token="another My Bearer Token") + copied = async_client.copy(bearer_token="another My Bearer Token") assert copied.bearer_token == "another My Bearer Token" - assert self.client.bearer_token == "My Bearer Token" + assert async_client.bearer_token == "My Bearer Token" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, async_client: AsyncGitpod) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = async_client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert async_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 isinstance(async_client.timeout, httpx.Timeout) + copied = async_client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(async_client.timeout, httpx.Timeout) - def test_copy_default_headers(self) -> None: + async def test_copy_default_headers(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, @@ -976,8 +990,9 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + await client.close() - def test_copy_default_query(self) -> None: + async 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"} ) @@ -1013,13 +1028,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + await client.close() + + def test_copy_signature(self, async_client: AsyncGitpod) -> 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] + async_client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(async_client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -1030,12 +1047,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, async_client: AsyncGitpod) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = async_client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -1092,12 +1109,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - async def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + async def test_request_timeout(self, async_client: AsyncGitpod) -> None: + request = async_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( + request = async_client._build_request( FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) ) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1112,6 +1129,8 @@ async def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + await client.close() + 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: @@ -1123,6 +1142,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + await client.close() + # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: client = AsyncGitpod( @@ -1133,6 +1154,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + await client.close() + # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = AsyncGitpod( @@ -1143,6 +1166,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + await client.close() + def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: @@ -1153,18 +1178,18 @@ def test_invalid_http_client(self) -> None: http_client=cast(Any, http_client), ) - def test_default_headers_option(self) -> None: - client = AsyncGitpod( + async def test_default_headers_option(self) -> None: + test_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")) + request = test_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( + test_client2 = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, @@ -1173,10 +1198,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_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" + await test_client.close() + await test_client2.close() + 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")) @@ -1187,7 +1215,7 @@ def test_validate_headers(self) -> None: client2 = AsyncGitpod(base_url=base_url, bearer_token=None, _strict_response_validation=True) _ = client2 - def test_default_query_option(self) -> None: + async def test_default_query_option(self) -> None: client = AsyncGitpod( base_url=base_url, bearer_token=bearer_token, @@ -1208,8 +1236,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + await client.close() + + def test_request_extra_json(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1220,7 +1250,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1231,7 +1261,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1242,8 +1272,8 @@ def test_request_extra_json(self) -> 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( + def test_request_extra_headers(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1253,7 +1283,7 @@ def test_request_extra_headers(self) -> None: 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( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1264,8 +1294,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Gitpod) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1278,7 +1308,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1292,7 +1322,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1335,7 +1365,7 @@ def test_multipart_repeating_array(self, async_client: AsyncGitpod) -> None: ] @pytest.mark.respx(base_url=base_url) - async def test_basic_union_response(self, respx_mock: MockRouter) -> None: + async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: class Model1(BaseModel): name: str @@ -1344,12 +1374,12 @@ class Model2(BaseModel): 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])) + response = await async_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: + async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1360,18 +1390,20 @@ class Model2(BaseModel): 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])) + response = await async_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])) + response = await async_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: + async def test_non_application_json_content_type_for_json_data( + self, respx_mock: MockRouter, async_client: AsyncGitpod + ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -1387,11 +1419,11 @@ class Model(BaseModel): ) ) - response = await self.client.get("/foo", cast_to=Model) + response = await async_client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 - def test_base_url_setter(self) -> None: + async def test_base_url_setter(self) -> None: client = AsyncGitpod( base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True ) @@ -1401,7 +1433,9 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" - def test_base_url_env(self) -> None: + await client.close() + + async 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) assert client.base_url == "http://localhost:5000/from/env/" @@ -1423,7 +1457,7 @@ def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: + async def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1432,6 +1466,7 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1450,7 +1485,7 @@ def test_base_url_trailing_slash(self, client: AsyncGitpod) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: + async def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1459,6 +1494,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1477,7 +1513,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncGitpod) -> None: ], ids=["standard", "custom http client"], ) - def test_absolute_request_url(self, client: AsyncGitpod) -> None: + async def test_absolute_request_url(self, client: AsyncGitpod) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1486,37 +1522,37 @@ def test_absolute_request_url(self, client: AsyncGitpod) -> None: ), ) assert request.url == "https://myapi.com/foo" + await client.close() 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) - assert not client.is_closed() + test_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied await asyncio.sleep(0.2) - assert not client.is_closed() + assert not test_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) - async with client as c2: - assert c2 is client + test_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + async with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_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: + async def test_client_response_validation_error(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> 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) + await async_client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -1530,7 +1566,6 @@ async def test_client_max_retries_validation(self) -> 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 @@ -1542,11 +1577,14 @@ class Model(BaseModel): 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) + non_strict_client = AsyncGitpod(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) - response = await client.get("/foo", cast_to=Model) + response = await non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + await strict_client.close() + await non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -1569,13 +1607,12 @@ 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) - + async def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncGitpod + ) -> None: 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) + calculated = async_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) @@ -1588,7 +1625,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, with pytest.raises(APITimeoutError): await async_client.identity.with_streaming_response.get_authenticated_identity().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @mock.patch("gitpod._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1597,12 +1634,11 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, with pytest.raises(APIStatusError): await async_client.identity.with_streaming_response.get_authenticated_identity().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_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, @@ -1634,7 +1670,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @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: @@ -1660,7 +1695,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @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: @@ -1710,26 +1744,26 @@ async def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = await async_client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncGitpod) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - await self.client.post( + await async_client.post( "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response ) From ca7ec34adc07a3f66da8ca64398a218bf2fed68c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 16:12:53 +0000 Subject: [PATCH 09/18] chore(internal): grammar fix (it's -> its) --- src/gitpod/_utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitpod/_utils/_utils.py b/src/gitpod/_utils/_utils.py index 50d59269..eec7f4a1 100644 --- a/src/gitpod/_utils/_utils.py +++ b/src/gitpod/_utils/_utils.py @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: # 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. +# care about the contained types we can safely use `object` in its 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 From 86cbb785d19b2286fdb0dc4c92d621b395a1c94b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:29:39 +0000 Subject: [PATCH 10/18] chore(package): drop Python 3.8 support --- README.md | 4 ++-- pyproject.toml | 5 ++--- src/gitpod/_utils/_sync.py | 34 +++------------------------------- 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index ccfdae1d..c60349eb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![PyPI version](https://img.shields.io/pypi/v/gitpod-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/gitpod-sdk/) -The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.8+ +The Gitpod Python library provides convenient access to the Gitpod REST API from any Python 3.9+ 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). @@ -434,7 +434,7 @@ print(gitpod.__version__) ## Requirements -Python 3.8 or higher. +Python 3.9 or higher. ## Contributing diff --git a/pyproject.toml b/pyproject.toml index 2dbcca1d..e728ff65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,11 +15,10 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", ] -requires-python = ">= 3.8" +requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -144,7 +143,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.8" +pythonVersion = "3.9" exclude = [ "_dev", diff --git a/src/gitpod/_utils/_sync.py b/src/gitpod/_utils/_sync.py index ad7ec71b..f6027c18 100644 --- a/src/gitpod/_utils/_sync.py +++ b/src/gitpod/_utils/_sync.py @@ -1,10 +1,8 @@ from __future__ import annotations -import sys import asyncio import functools -import contextvars -from typing import Any, TypeVar, Callable, Awaitable +from typing import TypeVar, Callable, Awaitable from typing_extensions import ParamSpec import anyio @@ -15,34 +13,11 @@ T_ParamSpec = ParamSpec("T_ParamSpec") -if sys.version_info >= (3, 9): - _asyncio_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 _asyncio_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) - - async def to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> T_Retval: if sniffio.current_async_library() == "asyncio": - return await _asyncio_to_thread(func, *args, **kwargs) + return await asyncio.to_thread(func, *args, **kwargs) return await anyio.to_thread.run_sync( functools.partial(func, *args, **kwargs), @@ -53,10 +28,7 @@ async def to_thread( 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. 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. + positional and keyword arguments. Usage: From 11cab3b8afc2dcd7c64b38fead6ffbad805a6f1c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 13:38:19 +0000 Subject: [PATCH 11/18] fix: compat with Python 3.14 --- src/gitpod/_models.py | 11 ++++++++--- tests/test_models.py | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index 6a3cd1d2..fcec2cf9 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -2,6 +2,7 @@ import os import inspect +import weakref from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( @@ -573,6 +574,9 @@ class CachedDiscriminatorType(Protocol): __discriminator__: DiscriminatorDetails +DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary() + + class DiscriminatorDetails: field_name: str """The name of the discriminator field in the variant class, e.g. @@ -615,8 +619,9 @@ def __init__( def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None: - if isinstance(union, CachedDiscriminatorType): - return union.__discriminator__ + cached = DISCRIMINATOR_CACHE.get(union) + if cached is not None: + return cached discriminator_field_name: str | None = None @@ -669,7 +674,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, discriminator_field=discriminator_field_name, discriminator_alias=discriminator_alias, ) - cast(CachedDiscriminatorType, union).__discriminator__ = details + DISCRIMINATOR_CACHE.setdefault(union, details) return details diff --git a/tests/test_models.py b/tests/test_models.py index fad48103..47fa9efd 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -9,7 +9,7 @@ from gitpod._utils import PropertyInfo from gitpod._compat import PYDANTIC_V1, parse_obj, model_dump, model_json -from gitpod._models import BaseModel, construct_type +from gitpod._models import DISCRIMINATOR_CACHE, BaseModel, construct_type class BasicModel(BaseModel): @@ -809,7 +809,7 @@ class B(BaseModel): UnionType = cast(Any, Union[A, B]) - assert not hasattr(UnionType, "__discriminator__") + assert not DISCRIMINATOR_CACHE.get(UnionType) m = construct_type( value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) @@ -818,7 +818,7 @@ class B(BaseModel): assert m.type == "b" assert m.data == "foo" # type: ignore[comparison-overlap] - discriminator = UnionType.__discriminator__ + discriminator = DISCRIMINATOR_CACHE.get(UnionType) assert discriminator is not None m = construct_type( @@ -830,7 +830,7 @@ class B(BaseModel): # if the discriminator details object stays the same between invocations then # we hit the cache - assert UnionType.__discriminator__ is discriminator + assert DISCRIMINATOR_CACHE.get(UnionType) is discriminator @pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") From d878bc6a71bb2ac8e074019bee3db915d98a2312 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 14:37:51 +0000 Subject: [PATCH 12/18] fix(compat): update signatures of `model_dump` and `model_dump_json` for Pydantic v1 --- src/gitpod/_models.py | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/gitpod/_models.py b/src/gitpod/_models.py index fcec2cf9..ca9500b2 100644 --- a/src/gitpod/_models.py +++ b/src/gitpod/_models.py @@ -257,15 +257,16 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, - context: dict[str, Any] | None = None, - serialize_as_any: bool = False, fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -273,16 +274,24 @@ def model_dump( 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. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. 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. + 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. + exclude_none: Whether to exclude fields that have a value of `None`. + exclude_computed_fields: Whether to exclude computed fields. + While this can be useful for round-tripping, it is usually recommended to use the dedicated + `round_trip` parameter instead. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. Returns: A dictionary representation of the model. @@ -299,6 +308,8 @@ def model_dump( raise ValueError("serialize_as_any is only supported in Pydantic v2") if fallback is not None: raise ValueError("fallback is only supported in Pydantic v2") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, @@ -315,15 +326,17 @@ def model_dump_json( self, *, indent: int | None = None, + ensure_ascii: bool = False, include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, - context: dict[str, Any] | None = None, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: @@ -355,6 +368,10 @@ def model_dump_json( raise ValueError("serialize_as_any is only supported in Pydantic v2") if fallback is not None: raise ValueError("fallback is only supported in Pydantic v2") + if ensure_ascii != False: + raise ValueError("ensure_ascii is only supported in Pydantic v2") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, From 3487a7b28a7fd3949d9cb898fc67939ec6ef8c1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:30:12 +0000 Subject: [PATCH 13/18] chore(internal): codegen related update --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e728ff65..49d9d77b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", From 8e1d96725dd7a77bd1abe0625824537eedc5b387 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 16:52:18 +0000 Subject: [PATCH 14/18] fix: ensure streams are always closed --- src/gitpod/_streaming.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gitpod/_streaming.py b/src/gitpod/_streaming.py index 4a34a6b0..9a4ccf40 100644 --- a/src/gitpod/_streaming.py +++ b/src/gitpod/_streaming.py @@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]: 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) - - # As we might not fully consume the response stream, we need to close it explicitly - response.close() + try: + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + response.close() def __enter__(self) -> Self: return self @@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]: 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) - - # As we might not fully consume the response stream, we need to close it explicitly - await response.aclose() + try: + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + await response.aclose() async def __aenter__(self) -> Self: return self From 620927e38e8e968a7ee25cc4696be83b71b63dcc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:22:05 +0000 Subject: [PATCH 15/18] chore(deps): mypy 1.18.1 has a regression, pin to 1.17 --- pyproject.toml | 2 +- requirements-dev.lock | 4 +++- requirements.lock | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 49d9d77b..c6329578 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ managed = true # version pins are in requirements-dev.lock dev-dependencies = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", diff --git a/requirements-dev.lock b/requirements-dev.lock index 7c6ba0a3..6cbcfa81 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -86,7 +86,7 @@ mdurl==0.1.2 multidict==6.4.4 # via aiohttp # via yarl -mypy==1.14.1 +mypy==1.17.0 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 @@ -95,6 +95,8 @@ nox==2023.4.22 packaging==23.2 # via nox # via pytest +pathspec==0.12.1 + # via mypy paramiko==3.5.1 platformdirs==3.11.0 # via virtualenv diff --git a/requirements.lock b/requirements.lock index 201981e7..d08d684e 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,21 +55,21 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via gitpod-sdk -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic sniffio==1.3.0 # via anyio # via gitpod-sdk -typing-extensions==4.12.2 +typing-extensions==4.15.0 # via anyio # via gitpod-sdk # via multidict # via pydantic # via pydantic-core # via typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic yarl==1.20.0 # via aiohttp From 545bd8611860dc3a554ac238fbb8cae1fc471d6f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:28:12 +0000 Subject: [PATCH 16/18] chore: update lockfile --- pyproject.toml | 14 ++++---- requirements-dev.lock | 79 +++++++++++++++++++++++-------------------- requirements.lock | 31 +++++++++-------- 3 files changed, 66 insertions(+), 58 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c6329578..812e8347 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,14 +7,16 @@ license = "Apache-2.0" authors = [ { name = "Gitpod", email = "dev-feedback@ona.com" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", diff --git a/requirements-dev.lock b/requirements-dev.lock index 6cbcfa81..7e743238 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,23 +12,23 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via gitpod-sdk # via httpx-aiohttp -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic anthropic==0.45.2 anyio==4.4.0 # via anthropic # via gitpod-sdk # via httpx -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp bcrypt==4.2.1 # via paramiko @@ -49,14 +49,14 @@ distlib==0.3.7 distro==1.8.0 # via anthropic # via gitpod-sdk -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -70,12 +70,14 @@ httpx==0.28.1 # via respx httpx-aiohttp==0.1.9 # via gitpod-sdk -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.0 +iniconfig==2.1.0 # via pytest jiter==0.8.2 # via anthropic @@ -83,16 +85,17 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl mypy==1.17.0 -mypy-extensions==1.0.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.9.1 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest pathspec==0.12.1 @@ -100,9 +103,9 @@ pathspec==0.12.1 paramiko==3.5.1 platformdirs==3.11.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl pydantic==2.11.9 @@ -111,51 +114,53 @@ pycparser==2.22 # via cffi pydantic-core==2.33.2 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pynacl==1.5.0 # via paramiko pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.7 +six==1.17.0 # via python-dateutil sniffio==1.3.0 # via anthropic # via anyio # via gitpod-sdk -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.3.0 + # via dependency-groups # via mypy + # via nox # via pytest types-paramiko==3.5.0.20240928 typing-extensions==4.12.2 # via anthropic # via anyio + # via exceptiongroup # via gitpod-sdk # via multidict # via mypy # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.35.4 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index d08d684e..73d1ab78 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via gitpod-sdk # via httpx-aiohttp -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via gitpod-sdk # via httpx async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2025.11.12 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via gitpod-sdk -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -45,25 +45,26 @@ httpx==0.28.1 # via httpx-aiohttp httpx-aiohttp==0.1.9 # via gitpod-sdk -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl pydantic==2.12.5 # via gitpod-sdk pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via gitpod-sdk typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via gitpod-sdk # via multidict # via pydantic @@ -71,5 +72,5 @@ typing-extensions==4.15.0 # via typing-inspection typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp From 6435a4573f2c72303e813a55f6d30fc041afd80b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 21:24:34 +0000 Subject: [PATCH 17/18] chore(docs): use environment variables for authentication in code snippets --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c60349eb..7721c369 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ pip install gitpod-sdk[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from gitpod import DefaultAioHttpClient from gitpod import AsyncGitpod @@ -86,7 +87,7 @@ from gitpod import AsyncGitpod async def main() -> None: async with AsyncGitpod( - bearer_token="My Bearer Token", + bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: response = await client.identity.get_authenticated_identity() From 71949173131ff3e7150c5787eeb26c12298c52ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:28:30 +0000 Subject: [PATCH 18/18] release: 0.4.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 27 +++++++++++++++++++++++++++ pyproject.toml | 2 +- src/gitpod/_version.py | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da59f99e..3e2bf498 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.4.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1178c9b9..240d8a39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 0.4.1 (2025-12-05) + +Full Changelog: [v0.4.0...v0.4.1](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.4.0...v0.4.1) + +### Bug Fixes + +* **client:** close streams without requiring full consumption ([597eb34](https://github.com/gitpod-io/gitpod-sdk-python/commit/597eb34a2f9f94a0ac4b6a8efd626ee253c7266f)) +* compat with Python 3.14 ([11cab3b](https://github.com/gitpod-io/gitpod-sdk-python/commit/11cab3b8afc2dcd7c64b38fead6ffbad805a6f1c)) +* **compat:** update signatures of `model_dump` and `model_dump_json` for Pydantic v1 ([d878bc6](https://github.com/gitpod-io/gitpod-sdk-python/commit/d878bc6a71bb2ac8e074019bee3db915d98a2312)) +* ensure streams are always closed ([8e1d967](https://github.com/gitpod-io/gitpod-sdk-python/commit/8e1d96725dd7a77bd1abe0625824537eedc5b387)) + + +### Chores + +* bump `httpx-aiohttp` version to 0.1.9 ([0581279](https://github.com/gitpod-io/gitpod-sdk-python/commit/0581279f1c20a01fd1b741fc56a5d66b724a8f66)) +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([620927e](https://github.com/gitpod-io/gitpod-sdk-python/commit/620927e38e8e968a7ee25cc4696be83b71b63dcc)) +* do not install brew dependencies in ./scripts/bootstrap by default ([3fd8de4](https://github.com/gitpod-io/gitpod-sdk-python/commit/3fd8de42107e3941274833b72c4d17d3829dc6b9)) +* **docs:** use environment variables for authentication in code snippets ([6435a45](https://github.com/gitpod-io/gitpod-sdk-python/commit/6435a4573f2c72303e813a55f6d30fc041afd80b)) +* **internal/tests:** avoid race condition with implicit client cleanup ([2316010](https://github.com/gitpod-io/gitpod-sdk-python/commit/23160102a1df2cbcc7c9b4ab60f64860fca75af5)) +* **internal:** codegen related update ([3487a7b](https://github.com/gitpod-io/gitpod-sdk-python/commit/3487a7b28a7fd3949d9cb898fc67939ec6ef8c1a)) +* **internal:** detect missing future annotations with ruff ([98e718f](https://github.com/gitpod-io/gitpod-sdk-python/commit/98e718fd584a66b1cf64cf37baf4904935833b6c)) +* **internal:** grammar fix (it's -> its) ([ca7ec34](https://github.com/gitpod-io/gitpod-sdk-python/commit/ca7ec34adc07a3f66da8ca64398a218bf2fed68c)) +* **internal:** update pydantic dependency ([986fdba](https://github.com/gitpod-io/gitpod-sdk-python/commit/986fdbaf9c668a21f87ab6b1368fb1f9b4dca9fc)) +* **package:** drop Python 3.8 support ([86cbb78](https://github.com/gitpod-io/gitpod-sdk-python/commit/86cbb785d19b2286fdb0dc4c92d621b395a1c94b)) +* **types:** change optional parameter type from NotGiven to Omit ([efa6bd7](https://github.com/gitpod-io/gitpod-sdk-python/commit/efa6bd70aed63ff891300fc1529575c76a18f104)) +* update lockfile ([545bd86](https://github.com/gitpod-io/gitpod-sdk-python/commit/545bd8611860dc3a554ac238fbb8cae1fc471d6f)) + ## 0.4.0 (2025-12-05) Full Changelog: [v0.3.0...v0.4.0](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.3.0...v0.4.0) diff --git a/pyproject.toml b/pyproject.toml index 812e8347..e8254bc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitpod-sdk" -version = "0.4.0" +version = "0.4.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 7fe2c1c0..fffd9e81 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.4.0" # x-release-please-version +__version__ = "0.4.1" # x-release-please-version