From a3b9debfff7b076c75000a55257c3146d510af67 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 09:22:11 +0000 Subject: [PATCH] feat(api): update with latest API spec --- .stats.yml | 2 +- src/gitpod/resources/editors.py | 16 ++--- src/gitpod/types/editor.py | 15 ++--- src/gitpod/types/editor_resolve_url_params.py | 8 +-- .../types/editor_resolve_url_response.py | 3 +- src/gitpod/types/editor_retrieve_params.py | 4 +- src/gitpod/types/editor_retrieve_response.py | 3 +- tests/api_resources/test_editors.py | 64 +++++++++---------- 8 files changed, 56 insertions(+), 59 deletions(-) diff --git a/.stats.yml b/.stats.yml index 87b67de..031a738 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a058dd6f8c83b32adb6f30bae2db8295468b8ffc391342a960ec6f393c50b83e.yml diff --git a/src/gitpod/resources/editors.py b/src/gitpod/resources/editors.py index 1a910b7..78e0ba2 100644 --- a/src/gitpod/resources/editors.py +++ b/src/gitpod/resources/editors.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> EditorsResourceWithStreamingResponse: def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str, # 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, @@ -132,9 +132,9 @@ def list( def resolve_url( self, *, - editor_id: str | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + editor_id: str, + environment_id: str, + organization_id: str, # 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, @@ -200,7 +200,7 @@ def with_streaming_response(self) -> AsyncEditorsResourceWithStreamingResponse: async def retrieve( self, *, - id: str | NotGiven = NOT_GIVEN, + id: str, # 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, @@ -282,9 +282,9 @@ def list( async def resolve_url( self, *, - editor_id: str | NotGiven = NOT_GIVEN, - environment_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + editor_id: str, + environment_id: str, + organization_id: str, # 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, diff --git a/src/gitpod/types/editor.py b/src/gitpod/types/editor.py index b5ea9d0..6395cc7 100644 --- a/src/gitpod/types/editor.py +++ b/src/gitpod/types/editor.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from pydantic import Field as FieldInfo @@ -10,16 +9,16 @@ class Editor(BaseModel): - id: Optional[str] = None + id: str - alias: Optional[str] = None + alias: str - icon_url: Optional[str] = FieldInfo(alias="iconUrl", default=None) + icon_url: str = FieldInfo(alias="iconUrl") - installation_instructions: Optional[str] = FieldInfo(alias="installationInstructions", default=None) + installation_instructions: str = FieldInfo(alias="installationInstructions") - name: Optional[str] = None + name: str - short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None) + short_description: str = FieldInfo(alias="shortDescription") - url_template: Optional[str] = FieldInfo(alias="urlTemplate", default=None) + url_template: str = FieldInfo(alias="urlTemplate") diff --git a/src/gitpod/types/editor_resolve_url_params.py b/src/gitpod/types/editor_resolve_url_params.py index a4a34df..de698ba 100644 --- a/src/gitpod/types/editor_resolve_url_params.py +++ b/src/gitpod/types/editor_resolve_url_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -10,11 +10,11 @@ class EditorResolveURLParams(TypedDict, total=False): - editor_id: Annotated[str, PropertyInfo(alias="editorId")] + editor_id: Required[Annotated[str, PropertyInfo(alias="editorId")]] """editorId is the ID of the editor to resolve the URL for""" - environment_id: Annotated[str, PropertyInfo(alias="environmentId")] + environment_id: Required[Annotated[str, PropertyInfo(alias="environmentId")]] """environmentId is the ID of the environment to resolve the URL for""" - organization_id: Annotated[str, PropertyInfo(alias="organizationId")] + organization_id: Required[Annotated[str, PropertyInfo(alias="organizationId")]] """organizationId is the ID of the organization to resolve the URL for""" diff --git a/src/gitpod/types/editor_resolve_url_response.py b/src/gitpod/types/editor_resolve_url_response.py index b0ee8eb..f22f8cb 100644 --- a/src/gitpod/types/editor_resolve_url_response.py +++ b/src/gitpod/types/editor_resolve_url_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel @@ -8,5 +7,5 @@ class EditorResolveURLResponse(BaseModel): - url: Optional[str] = None + url: str """url is the resolved editor URL""" diff --git a/src/gitpod/types/editor_retrieve_params.py b/src/gitpod/types/editor_retrieve_params.py index 9b01102..f9f5194 100644 --- a/src/gitpod/types/editor_retrieve_params.py +++ b/src/gitpod/types/editor_retrieve_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["EditorRetrieveParams"] class EditorRetrieveParams(TypedDict, total=False): - id: str + id: Required[str] """id is the ID of the editor to get""" diff --git a/src/gitpod/types/editor_retrieve_response.py b/src/gitpod/types/editor_retrieve_response.py index 4f962cd..fa5bbe9 100644 --- a/src/gitpod/types/editor_retrieve_response.py +++ b/src/gitpod/types/editor_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .editor import Editor from .._models import BaseModel @@ -9,5 +8,5 @@ class EditorRetrieveResponse(BaseModel): - editor: Optional[Editor] = None + editor: Editor """editor contains the editor""" diff --git a/tests/api_resources/test_editors.py b/tests/api_resources/test_editors.py index 9ef5526..c8aa524 100644 --- a/tests/api_resources/test_editors.py +++ b/tests/api_resources/test_editors.py @@ -25,12 +25,6 @@ class TestEditors: @pytest.mark.skip() @parametrize def test_method_retrieve(self, client: Gitpod) -> None: - editor = client.editors.retrieve() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: editor = client.editors.retrieve( id="id", ) @@ -39,7 +33,9 @@ def test_method_retrieve_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_retrieve(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.retrieve() + response = client.editors.with_raw_response.retrieve( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,7 +45,9 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_retrieve(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.retrieve() as response: + with client.editors.with_streaming_response.retrieve( + id="id", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -102,12 +100,6 @@ def test_streaming_response_list(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_method_resolve_url(self, client: Gitpod) -> None: - editor = client.editors.resolve_url() - assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: editor = client.editors.resolve_url( editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -118,7 +110,11 @@ def test_method_resolve_url_with_all_params(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_raw_response_resolve_url(self, client: Gitpod) -> None: - response = client.editors.with_raw_response.resolve_url() + response = client.editors.with_raw_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,7 +124,11 @@ def test_raw_response_resolve_url(self, client: Gitpod) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_resolve_url(self, client: Gitpod) -> None: - with client.editors.with_streaming_response.resolve_url() as response: + with client.editors.with_streaming_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -144,12 +144,6 @@ class TestAsyncEditors: @pytest.mark.skip() @parametrize async def test_method_retrieve(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.retrieve() - assert_matches_type(EditorRetrieveResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.retrieve( id="id", ) @@ -158,7 +152,9 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) @pytest.mark.skip() @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.retrieve() + response = await async_client.editors.with_raw_response.retrieve( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -168,7 +164,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.retrieve() as response: + async with async_client.editors.with_streaming_response.retrieve( + id="id", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -221,12 +219,6 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None: @pytest.mark.skip() @parametrize async def test_method_resolve_url(self, async_client: AsyncGitpod) -> None: - editor = await async_client.editors.resolve_url() - assert_matches_type(EditorResolveURLResponse, editor, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpod) -> None: editor = await async_client.editors.resolve_url( editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -237,7 +229,11 @@ async def test_method_resolve_url_with_all_params(self, async_client: AsyncGitpo @pytest.mark.skip() @parametrize async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None: - response = await async_client.editors.with_raw_response.resolve_url() + response = await async_client.editors.with_raw_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -247,7 +243,11 @@ async def test_raw_response_resolve_url(self, async_client: AsyncGitpod) -> None @pytest.mark.skip() @parametrize async def test_streaming_response_resolve_url(self, async_client: AsyncGitpod) -> None: - async with async_client.editors.with_streaming_response.resolve_url() as response: + async with async_client.editors.with_streaming_response.resolve_url( + editor_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + environment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"