Skip to content

Commit c4756f3

Browse files
feat(api): add explicit pagination fields
1 parent ce7151e commit c4756f3

4 files changed

Lines changed: 51 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 11
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/limrun--inc-dash%2Flimrun-v1-689a49df73337007a48d06ff14cc7860e26544689b00bd120b2573ade8a4f0aa.yml
3-
openapi_spec_hash: cab010a0d2a28bd6fc7572182cd0f3eb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/limrun--inc-dash%2Flimrun-v1-687c5166f8f7c345d6ec449d521662f8480848c01b62d3b1fff52ef59ed81e40.yml
3+
openapi_spec_hash: 051513bf286838c319f06da02f56c6a1
44
config_hash: 3100ba1d54ffa792477427f9d1bce03e

src/limrun_api/resources/android_instances.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ def create(
9393
def list(
9494
self,
9595
*,
96+
ending_before: str | Omit = omit,
9697
label_selector: str | Omit = omit,
98+
limit: int | Omit = omit,
9799
region: str | Omit = omit,
100+
starting_after: str | Omit = omit,
98101
state: Literal["unknown", "creating", "ready", "terminated"] | Omit = omit,
99102
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
100103
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -107,11 +110,19 @@ def list(
107110
List Android instances belonging to given organization
108111
109112
Args:
113+
ending_before: Return records up until this instance ID. If not given, it will return up until
114+
the 50th instance.
115+
110116
label_selector: Labels filter to apply to Android instances to return. Expects a comma-separated
111117
list of key=value pairs (e.g., env=prod,region=us-west).
112118
119+
limit: Maximum number of instances to be returned. The default is 50.
120+
113121
region: Region where the instance is scheduled on.
114122
123+
starting_after: Return records starting after this instance ID. If not given, it will start from
124+
the most recent one.
125+
115126
state: State filter to apply to Android instances to return.
116127
117128
extra_headers: Send extra headers
@@ -131,8 +142,11 @@ def list(
131142
timeout=timeout,
132143
query=maybe_transform(
133144
{
145+
"ending_before": ending_before,
134146
"label_selector": label_selector,
147+
"limit": limit,
135148
"region": region,
149+
"starting_after": starting_after,
136150
"state": state,
137151
},
138152
android_instance_list_params.AndroidInstanceListParams,
@@ -280,8 +294,11 @@ async def create(
280294
async def list(
281295
self,
282296
*,
297+
ending_before: str | Omit = omit,
283298
label_selector: str | Omit = omit,
299+
limit: int | Omit = omit,
284300
region: str | Omit = omit,
301+
starting_after: str | Omit = omit,
285302
state: Literal["unknown", "creating", "ready", "terminated"] | Omit = omit,
286303
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
287304
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -294,11 +311,19 @@ async def list(
294311
List Android instances belonging to given organization
295312
296313
Args:
314+
ending_before: Return records up until this instance ID. If not given, it will return up until
315+
the 50th instance.
316+
297317
label_selector: Labels filter to apply to Android instances to return. Expects a comma-separated
298318
list of key=value pairs (e.g., env=prod,region=us-west).
299319
320+
limit: Maximum number of instances to be returned. The default is 50.
321+
300322
region: Region where the instance is scheduled on.
301323
324+
starting_after: Return records starting after this instance ID. If not given, it will start from
325+
the most recent one.
326+
302327
state: State filter to apply to Android instances to return.
303328
304329
extra_headers: Send extra headers
@@ -318,8 +343,11 @@ async def list(
318343
timeout=timeout,
319344
query=await async_maybe_transform(
320345
{
346+
"ending_before": ending_before,
321347
"label_selector": label_selector,
348+
"limit": limit,
322349
"region": region,
350+
"starting_after": starting_after,
323351
"state": state,
324352
},
325353
android_instance_list_params.AndroidInstanceListParams,

src/limrun_api/types/android_instance_list_params.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,29 @@
1010

1111

1212
class AndroidInstanceListParams(TypedDict, total=False):
13+
ending_before: Annotated[str, PropertyInfo(alias="endingBefore")]
14+
"""Return records up until this instance ID.
15+
16+
If not given, it will return up until the 50th instance.
17+
"""
18+
1319
label_selector: Annotated[str, PropertyInfo(alias="labelSelector")]
1420
"""
1521
Labels filter to apply to Android instances to return. Expects a comma-separated
1622
list of key=value pairs (e.g., env=prod,region=us-west).
1723
"""
1824

25+
limit: int
26+
"""Maximum number of instances to be returned. The default is 50."""
27+
1928
region: str
2029
"""Region where the instance is scheduled on."""
2130

31+
starting_after: Annotated[str, PropertyInfo(alias="startingAfter")]
32+
"""Return records starting after this instance ID.
33+
34+
If not given, it will start from the most recent one.
35+
"""
36+
2237
state: Literal["unknown", "creating", "ready", "terminated"]
2338
"""State filter to apply to Android instances to return."""

tests/api_resources/test_android_instances.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ def test_method_list(self, client: Limrun) -> None:
9191
@parametrize
9292
def test_method_list_with_all_params(self, client: Limrun) -> None:
9393
android_instance = client.android_instances.list(
94+
ending_before="android_someid",
9495
label_selector="env=prod,version=1.2",
96+
limit=50,
9597
region="region",
98+
starting_after="android_someid",
9699
state="unknown",
97100
)
98101
assert_matches_type(AndroidInstanceListResponse, android_instance, path=["response"])
@@ -280,8 +283,11 @@ async def test_method_list(self, async_client: AsyncLimrun) -> None:
280283
@parametrize
281284
async def test_method_list_with_all_params(self, async_client: AsyncLimrun) -> None:
282285
android_instance = await async_client.android_instances.list(
286+
ending_before="android_someid",
283287
label_selector="env=prod,version=1.2",
288+
limit=50,
284289
region="region",
290+
starting_after="android_someid",
285291
state="unknown",
286292
)
287293
assert_matches_type(AndroidInstanceListResponse, android_instance, path=["response"])

0 commit comments

Comments
 (0)