Skip to content

Commit edefa46

Browse files
feat(api): properly produce empty request bodies (#4)
1 parent 305f90b commit edefa46

33 files changed

+69
-1009
lines changed

Diff for: .stats.yml

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

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse:
5555
def retrieve(
5656
self,
5757
*,
58-
body: object,
58+
empty: bool | NotGiven = NOT_GIVEN,
5959
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6060
# The extra values given here take precedence over values defined on the client or passed to this method.
6161
extra_headers: Headers | None = None,
@@ -77,7 +77,7 @@ def retrieve(
7777
"""
7878
return self._post(
7979
"/gitpod.v1.AccountService/GetAccount",
80-
body=maybe_transform(body, account_retrieve_params.AccountRetrieveParams),
80+
body=maybe_transform({"empty": empty}, account_retrieve_params.AccountRetrieveParams),
8181
options=make_request_options(
8282
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
8383
),
@@ -243,7 +243,7 @@ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse:
243243
async def retrieve(
244244
self,
245245
*,
246-
body: object,
246+
empty: bool | NotGiven = NOT_GIVEN,
247247
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
248248
# The extra values given here take precedence over values defined on the client or passed to this method.
249249
extra_headers: Headers | None = None,
@@ -265,7 +265,7 @@ async def retrieve(
265265
"""
266266
return await self._post(
267267
"/gitpod.v1.AccountService/GetAccount",
268-
body=await async_maybe_transform(body, account_retrieve_params.AccountRetrieveParams),
268+
body=await async_maybe_transform({"empty": empty}, account_retrieve_params.AccountRetrieveParams),
269269
options=make_request_options(
270270
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
271271
),

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def exchange_token(
9191
def get_authenticated_identity(
9292
self,
9393
*,
94-
body: object,
94+
empty: bool | NotGiven = NOT_GIVEN,
9595
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9696
# The extra values given here take precedence over values defined on the client or passed to this method.
9797
extra_headers: Headers | None = None,
@@ -114,7 +114,7 @@ def get_authenticated_identity(
114114
return self._post(
115115
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
116116
body=maybe_transform(
117-
body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
117+
{"empty": empty}, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
118118
),
119119
options=make_request_options(
120120
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -215,7 +215,7 @@ async def exchange_token(
215215
async def get_authenticated_identity(
216216
self,
217217
*,
218-
body: object,
218+
empty: bool | NotGiven = NOT_GIVEN,
219219
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
220220
# The extra values given here take precedence over values defined on the client or passed to this method.
221221
extra_headers: Headers | None = None,
@@ -238,7 +238,7 @@ async def get_authenticated_identity(
238238
return await self._post(
239239
"/gitpod.v1.IdentityService/GetAuthenticatedIdentity",
240240
body=await async_maybe_transform(
241-
body, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
241+
{"empty": empty}, identity_get_authenticated_identity_params.IdentityGetAuthenticatedIdentityParams
242242
),
243243
options=make_request_options(
244244
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse:
5959
def get_authenticated_user(
6060
self,
6161
*,
62-
body: object,
62+
empty: bool | NotGiven = NOT_GIVEN,
6363
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6464
# The extra values given here take precedence over values defined on the client or passed to this method.
6565
extra_headers: Headers | None = None,
@@ -81,7 +81,7 @@ def get_authenticated_user(
8181
"""
8282
return self._post(
8383
"/gitpod.v1.UserService/GetAuthenticatedUser",
84-
body=maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams),
84+
body=maybe_transform({"empty": empty}, user_get_authenticated_user_params.UserGetAuthenticatedUserParams),
8585
options=make_request_options(
8686
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
8787
),
@@ -155,7 +155,7 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse:
155155
async def get_authenticated_user(
156156
self,
157157
*,
158-
body: object,
158+
empty: bool | NotGiven = NOT_GIVEN,
159159
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
160160
# The extra values given here take precedence over values defined on the client or passed to this method.
161161
extra_headers: Headers | None = None,
@@ -177,7 +177,9 @@ async def get_authenticated_user(
177177
"""
178178
return await self._post(
179179
"/gitpod.v1.UserService/GetAuthenticatedUser",
180-
body=await async_maybe_transform(body, user_get_authenticated_user_params.UserGetAuthenticatedUserParams),
180+
body=await async_maybe_transform(
181+
{"empty": empty}, user_get_authenticated_user_params.UserGetAuthenticatedUserParams
182+
),
181183
options=make_request_options(
182184
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
183185
),

Diff for: src/gitpod/types/account_retrieve_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import TypedDict
66

77
__all__ = ["AccountRetrieveParams"]
88

99

1010
class AccountRetrieveParams(TypedDict, total=False):
11-
body: Required[object]
11+
empty: bool

Diff for: src/gitpod/types/identity_get_authenticated_identity_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import TypedDict
66

77
__all__ = ["IdentityGetAuthenticatedIdentityParams"]
88

99

1010
class IdentityGetAuthenticatedIdentityParams(TypedDict, total=False):
11-
body: Required[object]
11+
empty: bool

Diff for: src/gitpod/types/user_get_authenticated_user_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import TypedDict
66

77
__all__ = ["UserGetAuthenticatedUserParams"]
88

99

1010
class UserGetAuthenticatedUserParams(TypedDict, total=False):
11-
body: Required[object]
11+
empty: bool

Diff for: tests/api_resources/environments/automations/tasks/test_executions.py

-24
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,18 @@
2121
class TestExecutions:
2222
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
2323

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

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

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

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

5854
assert cast(Any, response.is_closed) is True
5955

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

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

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

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

10597
assert cast(Any, response.is_closed) is True
10698

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

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

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

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

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

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

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

171-
@pytest.mark.skip()
172156
@parametrize
173157
async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> None:
174158
async with (
@@ -182,13 +166,11 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGitpod) -> N
182166

183167
assert cast(Any, response.is_closed) is True
184168

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

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

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

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

230210
assert cast(Any, response.is_closed) is True
231211

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

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

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

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

0 commit comments

Comments
 (0)