Skip to content

Commit 8bb4157

Browse files
feat(api): update API spec with pagination headers
1 parent 6b0c293 commit 8bb4157

File tree

4 files changed

+12
-24
lines changed

4 files changed

+12
-24
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-33f1feaba7bde46bfa36d2fefb5c3bc9512967945bccf78045ad3f64aafc4eb0.yml
3-
openapi_spec_hash: 52a448889d41216d1ca30e8a57115b14
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-cb38560915edce03abce2ae3ef5bc745489dbe9b6f80c2b4ff42edf8c2ff276d.yml
3+
openapi_spec_hash: a869194d6c864ba28d79ec0105439c3e
44
config_hash: 1f28d5c3c063f418ebd2799df1e4e781

src/kernel/resources/deployments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def retrieve(
151151
def list(
152152
self,
153153
*,
154-
app_name: str,
154+
app_name: str | NotGiven = NOT_GIVEN,
155155
limit: int | NotGiven = NOT_GIVEN,
156156
offset: int | NotGiven = NOT_GIVEN,
157157
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -370,7 +370,7 @@ async def retrieve(
370370
def list(
371371
self,
372372
*,
373-
app_name: str,
373+
app_name: str | NotGiven = NOT_GIVEN,
374374
limit: int | NotGiven = NOT_GIVEN,
375375
offset: int | NotGiven = NOT_GIVEN,
376376
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

src/kernel/types/deployment_list_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
from __future__ import annotations
44

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

77
__all__ = ["DeploymentListParams"]
88

99

1010
class DeploymentListParams(TypedDict, total=False):
11-
app_name: Required[str]
11+
app_name: str
1212
"""Filter results by application name."""
1313

1414
limit: int

tests/api_resources/test_deployments.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ def test_path_params_retrieve(self, client: Kernel) -> None:
117117
@pytest.mark.skip(reason="Prism tests are disabled")
118118
@parametrize
119119
def test_method_list(self, client: Kernel) -> None:
120-
deployment = client.deployments.list(
121-
app_name="app_name",
122-
)
120+
deployment = client.deployments.list()
123121
assert_matches_type(SyncOffsetPagination[DeploymentListResponse], deployment, path=["response"])
124122

125123
@pytest.mark.skip(reason="Prism tests are disabled")
@@ -135,9 +133,7 @@ def test_method_list_with_all_params(self, client: Kernel) -> None:
135133
@pytest.mark.skip(reason="Prism tests are disabled")
136134
@parametrize
137135
def test_raw_response_list(self, client: Kernel) -> None:
138-
response = client.deployments.with_raw_response.list(
139-
app_name="app_name",
140-
)
136+
response = client.deployments.with_raw_response.list()
141137

142138
assert response.is_closed is True
143139
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -147,9 +143,7 @@ def test_raw_response_list(self, client: Kernel) -> None:
147143
@pytest.mark.skip(reason="Prism tests are disabled")
148144
@parametrize
149145
def test_streaming_response_list(self, client: Kernel) -> None:
150-
with client.deployments.with_streaming_response.list(
151-
app_name="app_name",
152-
) as response:
146+
with client.deployments.with_streaming_response.list() as response:
153147
assert not response.is_closed
154148
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
155149

@@ -309,9 +303,7 @@ async def test_path_params_retrieve(self, async_client: AsyncKernel) -> None:
309303
@pytest.mark.skip(reason="Prism tests are disabled")
310304
@parametrize
311305
async def test_method_list(self, async_client: AsyncKernel) -> None:
312-
deployment = await async_client.deployments.list(
313-
app_name="app_name",
314-
)
306+
deployment = await async_client.deployments.list()
315307
assert_matches_type(AsyncOffsetPagination[DeploymentListResponse], deployment, path=["response"])
316308

317309
@pytest.mark.skip(reason="Prism tests are disabled")
@@ -327,9 +319,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKernel) -> N
327319
@pytest.mark.skip(reason="Prism tests are disabled")
328320
@parametrize
329321
async def test_raw_response_list(self, async_client: AsyncKernel) -> None:
330-
response = await async_client.deployments.with_raw_response.list(
331-
app_name="app_name",
332-
)
322+
response = await async_client.deployments.with_raw_response.list()
333323

334324
assert response.is_closed is True
335325
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -339,9 +329,7 @@ async def test_raw_response_list(self, async_client: AsyncKernel) -> None:
339329
@pytest.mark.skip(reason="Prism tests are disabled")
340330
@parametrize
341331
async def test_streaming_response_list(self, async_client: AsyncKernel) -> None:
342-
async with async_client.deployments.with_streaming_response.list(
343-
app_name="app_name",
344-
) as response:
332+
async with async_client.deployments.with_streaming_response.list() as response:
345333
assert not response.is_closed
346334
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
347335

0 commit comments

Comments
 (0)