Skip to content

feat(api): properly produce empty request bodies #4

New issue

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

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

Already on GitHub? Sign in to your account

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 106
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-63491b1baa3dbc60caaec79becdece3854356b354909e4bb3f1ccaab80a6be20.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-4e2df4ddd41d8f2552c00f0f93c8b655c7bfb039bd62e654dd7ace9cdd8f9a9f.yml
8 changes: 4 additions & 4 deletions src/gitpod/resources/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse:
def retrieve(
self,
*,
body: object,
empty: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -77,7 +77,7 @@ def retrieve(
"""
return self._post(
"/gitpod.v1.AccountService/GetAccount",
body=maybe_transform(body, account_retrieve_params.AccountRetrieveParams),
body=maybe_transform({"empty": empty}, account_retrieve_params.AccountRetrieveParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -243,7 +243,7 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse:
async def retrieve(
self,
*,
body: object,
empty: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -265,7 +265,7 @@ async def retrieve(
"""
return await self._post(
"/gitpod.v1.AccountService/GetAccount",
body=await async_maybe_transform(body, account_retrieve_params.AccountRetrieveParams),
body=await async_maybe_transform({"empty": empty}, account_retrieve_params.AccountRetrieveParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down
8 changes: 4 additions & 4 deletions src/gitpod/resources/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def exchange_token(
def get_authenticated_identity(
self,
*,
body: object,
empty: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -114,7 +114,7 @@ def get_authenticated_identity(
return self._post(
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
body=maybe_transform(
body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
{"empty": empty}, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand Down Expand Up @@ -215,7 +215,7 @@ async def exchange_token(
async def get_authenticated_identity(
self,
*,
body: object,
empty: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -238,7 +238,7 @@ async def get_authenticated_identity(
return await self._post(
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
body=await async_maybe_transform(
body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
{"empty": empty}, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand Down
10 changes: 6 additions & 4 deletions src/gitpod/resources/users/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse:
def get_authenticated_user(
self,
*,
body: object,
empty: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -81,7 +81,7 @@ def get_authenticated_user(
"""
return self._post(
"/gitpod.v1.UserService/GetAuthenticatedUser",
body=maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams),
body=maybe_transform({"empty": empty}, user_get_authenticated_user_params.UserGetAuthenticatedUserParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -155,7 +155,7 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse:
async def get_authenticated_user(
self,
*,
body: object,
empty: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -177,7 +177,9 @@ async def get_authenticated_user(
"""
return await self._post(
"/gitpod.v1.UserService/GetAuthenticatedUser",
body=await async_maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams),
body=await async_maybe_transform(
{"empty": empty}, user_get_authenticated_user_params.UserGetAuthenticatedUserParams
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down
4 changes: 2 additions & 2 deletions src/gitpod/types/account_retrieve_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from __future__ import annotations

from typing_extensions import Required, TypedDict
from typing_extensions import TypedDict

__all__ = ["AccountRetrieveParams"]


class AccountRetrieveParams(TypedDict, total=False):
body: Required[object]
empty: bool
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from __future__ import annotations

from typing_extensions import Required, TypedDict
from typing_extensions import TypedDict

__all__ = ["IdentityGetAuthenticatedIdentityParams"]


class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False):
body: Required[object]
empty: bool
4 changes: 2 additions & 2 deletions src/gitpod/types/user_get_authenticated_user_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from __future__ import annotations

from typing_extensions import Required, TypedDict
from typing_extensions import TypedDict

__all__ = ["UserGetAuthenticatedUserParams"]


class UserGetAuthenticatedUserParams(TypedDict, total=False):
body: Required[object]
empty: bool
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@
class TestExecutions:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip()
@parametrize
def test_method_retrieve(self, client: Gitpod) -> None:
execution = client.environments.automations.tasks.executions.retrieve()
assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_retrieve_with_all_params(self, client: Gitpod) -> None:
execution = client.environments.automations.tasks.executions.retrieve(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_retrieve(self, client: Gitpod) -> None:
response = client.environments.automations.tasks.executions.with_raw_response.retrieve()
Expand All @@ -45,7 +42,6 @@ def test_raw_response_retrieve(self, client: Gitpod) -> None:
execution = response.parse()
assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_streaming_response_retrieve(self, client: Gitpod) -> None:
with client.environments.automations.tasks.executions.with_streaming_response.retrieve() as response:
Expand All @@ -57,13 +53,11 @@ def test_streaming_response_retrieve(self, client: Gitpod) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
def test_method_list(self, client: Gitpod) -> None:
execution = client.environments.automations.tasks.executions.list()
assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_list_with_all_params(self, client: Gitpod) -> None:
execution = client.environments.automations.tasks.executions.list(
Expand All @@ -82,7 +76,6 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
)
assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Gitpod) -> None:
response = client.environments.automations.tasks.executions.with_raw_response.list()
Expand All @@ -92,7 +85,6 @@ def test_raw_response_list(self, client: Gitpod) -> None:
execution = response.parse()
assert_matches_type(SyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_streaming_response_list(self, client: Gitpod) -> None:
with client.environments.automations.tasks.executions.with_streaming_response.list() as response:
Expand All @@ -104,21 +96,18 @@ def test_streaming_response_list(self, client: Gitpod) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
def test_method_stop(self, client: Gitpod) -> None:
execution = client.environments.automations.tasks.executions.stop()
assert_matches_type(object, execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_stop_with_all_params(self, client: Gitpod) -> None:
execution = client.environments.automations.tasks.executions.stop(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(object, execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_stop(self, client: Gitpod) -> None:
response = client.environments.automations.tasks.executions.with_raw_response.stop()
Expand All @@ -128,7 +117,6 @@ def test_raw_response_stop(self, client: Gitpod) -> None:
execution = response.parse()
assert_matches_type(object, execution, path=["response"])

@pytest.mark.skip()
@parametrize
def test_streaming_response_stop(self, client: Gitpod) -> None:
with client.environments.automations.tasks.executions.with_streaming_response.stop() as response:
Expand All @@ -144,21 +132,18 @@ def test_streaming_response_stop(self, client: Gitpod) -> None:
class TestAsyncExecutions:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip()
@parametrize
async def test_method_retrieve(self, async_client: AsyncGitpod) -> None:
execution = await async_client.environments.automations.tasks.executions.retrieve()
assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_retrieve_with_all_params(self, async_client: AsyncGitpod) -> None:
execution = await async_client.environments.automations.tasks.executions.retrieve(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None:
response = await async_client.environments.automations.tasks.executions.with_raw_response.retrieve()
Expand All @@ -168,7 +153,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGitpod) -> None:
execution = await response.parse()
assert_matches_type(ExecutionRetrieveResponse, execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None:
async with (
Expand All @@ -182,13 +166,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
async def test_method_list(self, async_client: AsyncGitpod) -> None:
execution = await async_client.environments.automations.tasks.executions.list()
assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> None:
execution = await async_client.environments.automations.tasks.executions.list(
Expand All @@ -207,7 +189,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
)
assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncGitpod) -> None:
response = await async_client.environments.automations.tasks.executions.with_raw_response.list()
Expand All @@ -217,7 +198,6 @@ async def test_raw_response_list(self, async_client: AsyncGitpod) -> None:
execution = await response.parse()
assert_matches_type(AsyncTaskExecutionsPage[ExecutionListResponse], execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None:
async with async_client.environments.automations.tasks.executions.with_streaming_response.list() as response:
Expand All @@ -229,21 +209,18 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None:

assert cast(Any, response.is_closed) is True

@pytest.mark.skip()
@parametrize
async def test_method_stop(self, async_client: AsyncGitpod) -> None:
execution = await async_client.environments.automations.tasks.executions.stop()
assert_matches_type(object, execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_stop_with_all_params(self, async_client: AsyncGitpod) -> None:
execution = await async_client.environments.automations.tasks.executions.stop(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(object, execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None:
response = await async_client.environments.automations.tasks.executions.with_raw_response.stop()
Expand All @@ -253,7 +230,6 @@ async def test_raw_response_stop(self, async_client: AsyncGitpod) -> None:
execution = await response.parse()
assert_matches_type(object, execution, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_streaming_response_stop(self, async_client: AsyncGitpod) -> None:
async with async_client.environments.automations.tasks.executions.with_streaming_response.stop() as response:
Expand Down
Loading