Skip to content

Commit d4c4d1b

Browse files
feat: improved identities pagination
1 parent d91f00f commit d4c4d1b

20 files changed

Lines changed: 238 additions & 111 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 106
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/keycard%2Fkeycard-api-66564a738b57bf537ef9f25f8865d8e115e07927c967bfd10b8c657ae501848f.yml
3-
openapi_spec_hash: 92f837f627811e1ed5c36ba5d05a4a30
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/keycard%2Fkeycard-api-f935374f57248d24e5f8a2393ce0730503bc466f7c51e93b6d3225d5b9317baf.yml
3+
openapi_spec_hash: de0d11f4dcc9810bcb0d6bb8882e21a4
44
config_hash: fab2044922865fa04fb03f5f19e195a0

src/keycardai_api/resources/organizations/invitations.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def list(
102102
*,
103103
after: str | Omit = omit,
104104
before: str | Omit = omit,
105-
expand: List[Literal["permissions"]] | Omit = omit,
105+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
106106
limit: int | Omit = omit,
107107
x_client_request_id: str | Omit = omit,
108108
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -122,8 +122,11 @@ def list(
122122
123123
before: Cursor for backward pagination
124124
125-
expand: Fields to expand in the response. Currently supports "permissions" to include
126-
the permissions field with the caller's permissions for the resource.
125+
expand: Fields to expand in the response. Supports "permissions" to include the
126+
permissions field with the caller's permissions for the resource. For list
127+
organization identities only, "total_count" populates pagination.total_count
128+
with the number of identities matching the same filters as the list (excluding
129+
cursor and limit). Other operations ignore expand values they do not use.
127130
128131
limit: Maximum number of invitations to return
129132
@@ -282,7 +285,7 @@ async def list(
282285
*,
283286
after: str | Omit = omit,
284287
before: str | Omit = omit,
285-
expand: List[Literal["permissions"]] | Omit = omit,
288+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
286289
limit: int | Omit = omit,
287290
x_client_request_id: str | Omit = omit,
288291
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -302,8 +305,11 @@ async def list(
302305
303306
before: Cursor for backward pagination
304307
305-
expand: Fields to expand in the response. Currently supports "permissions" to include
306-
the permissions field with the caller's permissions for the resource.
308+
expand: Fields to expand in the response. Supports "permissions" to include the
309+
permissions field with the caller's permissions for the resource. For list
310+
organization identities only, "total_count" populates pagination.total_count
311+
with the number of identities matching the same filters as the list (excluding
312+
cursor and limit). Other operations ignore expand values they do not use.
307313
308314
limit: Maximum number of invitations to return
309315

src/keycardai_api/resources/organizations/organizations.py

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def retrieve(
145145
self,
146146
organization_id: str,
147147
*,
148-
expand: List[Literal["permissions"]] | Omit = omit,
148+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
149149
x_client_request_id: str | Omit = omit,
150150
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
151151
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -160,8 +160,11 @@ def retrieve(
160160
Args:
161161
organization_id: Organization ID or label identifier
162162
163-
expand: Fields to expand in the response. Currently supports "permissions" to include
164-
the permissions field with the caller's permissions for the resource.
163+
expand: Fields to expand in the response. Supports "permissions" to include the
164+
permissions field with the caller's permissions for the resource. For list
165+
organization identities only, "total_count" populates pagination.total_count
166+
with the number of identities matching the same filters as the list (excluding
167+
cursor and limit). Other operations ignore expand values they do not use.
165168
166169
extra_headers: Send extra headers
167170
@@ -232,7 +235,7 @@ def list(
232235
*,
233236
after: str | Omit = omit,
234237
before: str | Omit = omit,
235-
expand: List[Literal["permissions"]] | Omit = omit,
238+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
236239
limit: int | Omit = omit,
237240
x_client_request_id: str | Omit = omit,
238241
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -250,8 +253,11 @@ def list(
250253
251254
before: Cursor for backward pagination
252255
253-
expand: Fields to expand in the response. Currently supports "permissions" to include
254-
the permissions field with the caller's permissions for the resource.
256+
expand: Fields to expand in the response. Supports "permissions" to include the
257+
permissions field with the caller's permissions for the resource. For list
258+
organization identities only, "total_count" populates pagination.total_count
259+
with the number of identities matching the same filters as the list (excluding
260+
cursor and limit). Other operations ignore expand values they do not use.
255261
256262
limit: Maximum number of organizations to return
257263
@@ -327,7 +333,7 @@ def list_identities(
327333
*,
328334
after: str | Omit = omit,
329335
before: str | Omit = omit,
330-
expand: List[Literal["permissions"]] | Omit = omit,
336+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
331337
limit: int | Omit = omit,
332338
query_email: str | Omit = omit,
333339
role: OrganizationRole | Omit = omit,
@@ -349,8 +355,11 @@ def list_identities(
349355
350356
before: Cursor for backward pagination
351357
352-
expand: Fields to expand in the response. Currently supports "permissions" to include
353-
the permissions field with the caller's permissions for the resource.
358+
expand: Fields to expand in the response. Supports "permissions" to include the
359+
permissions field with the caller's permissions for the resource. For list
360+
organization identities only, "total_count" populates pagination.total_count
361+
with the number of identities matching the same filters as the list (excluding
362+
cursor and limit). Other operations ignore expand values they do not use.
354363
355364
limit: Maximum number of identities to return
356365
@@ -395,7 +404,7 @@ def list_roles(
395404
self,
396405
organization_id: str,
397406
*,
398-
expand: List[Literal["permissions"]] | Omit = omit,
407+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
399408
scope: RoleScope | Omit = omit,
400409
x_client_request_id: str | Omit = omit,
401410
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -420,8 +429,11 @@ def list_roles(
420429
Args:
421430
organization_id: Organization ID or label identifier
422431
423-
expand: Fields to expand in the response. Currently supports "permissions" to include
424-
the permissions field with the caller's permissions for the resource.
432+
expand: Fields to expand in the response. Supports "permissions" to include the
433+
permissions field with the caller's permissions for the resource. For list
434+
organization identities only, "total_count" populates pagination.total_count
435+
with the number of identities matching the same filters as the list (excluding
436+
cursor and limit). Other operations ignore expand values they do not use.
425437
426438
scope: Filter roles by scope (organization or zone level)
427439
@@ -529,7 +541,7 @@ async def retrieve(
529541
self,
530542
organization_id: str,
531543
*,
532-
expand: List[Literal["permissions"]] | Omit = omit,
544+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
533545
x_client_request_id: str | Omit = omit,
534546
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
535547
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -544,8 +556,11 @@ async def retrieve(
544556
Args:
545557
organization_id: Organization ID or label identifier
546558
547-
expand: Fields to expand in the response. Currently supports "permissions" to include
548-
the permissions field with the caller's permissions for the resource.
559+
expand: Fields to expand in the response. Supports "permissions" to include the
560+
permissions field with the caller's permissions for the resource. For list
561+
organization identities only, "total_count" populates pagination.total_count
562+
with the number of identities matching the same filters as the list (excluding
563+
cursor and limit). Other operations ignore expand values they do not use.
549564
550565
extra_headers: Send extra headers
551566
@@ -618,7 +633,7 @@ async def list(
618633
*,
619634
after: str | Omit = omit,
620635
before: str | Omit = omit,
621-
expand: List[Literal["permissions"]] | Omit = omit,
636+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
622637
limit: int | Omit = omit,
623638
x_client_request_id: str | Omit = omit,
624639
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -636,8 +651,11 @@ async def list(
636651
637652
before: Cursor for backward pagination
638653
639-
expand: Fields to expand in the response. Currently supports "permissions" to include
640-
the permissions field with the caller's permissions for the resource.
654+
expand: Fields to expand in the response. Supports "permissions" to include the
655+
permissions field with the caller's permissions for the resource. For list
656+
organization identities only, "total_count" populates pagination.total_count
657+
with the number of identities matching the same filters as the list (excluding
658+
cursor and limit). Other operations ignore expand values they do not use.
641659
642660
limit: Maximum number of organizations to return
643661
@@ -713,7 +731,7 @@ async def list_identities(
713731
*,
714732
after: str | Omit = omit,
715733
before: str | Omit = omit,
716-
expand: List[Literal["permissions"]] | Omit = omit,
734+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
717735
limit: int | Omit = omit,
718736
query_email: str | Omit = omit,
719737
role: OrganizationRole | Omit = omit,
@@ -735,8 +753,11 @@ async def list_identities(
735753
736754
before: Cursor for backward pagination
737755
738-
expand: Fields to expand in the response. Currently supports "permissions" to include
739-
the permissions field with the caller's permissions for the resource.
756+
expand: Fields to expand in the response. Supports "permissions" to include the
757+
permissions field with the caller's permissions for the resource. For list
758+
organization identities only, "total_count" populates pagination.total_count
759+
with the number of identities matching the same filters as the list (excluding
760+
cursor and limit). Other operations ignore expand values they do not use.
740761
741762
limit: Maximum number of identities to return
742763
@@ -781,7 +802,7 @@ async def list_roles(
781802
self,
782803
organization_id: str,
783804
*,
784-
expand: List[Literal["permissions"]] | Omit = omit,
805+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
785806
scope: RoleScope | Omit = omit,
786807
x_client_request_id: str | Omit = omit,
787808
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -806,8 +827,11 @@ async def list_roles(
806827
Args:
807828
organization_id: Organization ID or label identifier
808829
809-
expand: Fields to expand in the response. Currently supports "permissions" to include
810-
the permissions field with the caller's permissions for the resource.
830+
expand: Fields to expand in the response. Supports "permissions" to include the
831+
permissions field with the caller's permissions for the resource. For list
832+
organization identities only, "total_count" populates pagination.total_count
833+
with the number of identities matching the same filters as the list (excluding
834+
cursor and limit). Other operations ignore expand values they do not use.
811835
812836
scope: Filter roles by scope (organization or zone level)
813837

src/keycardai_api/resources/organizations/service_accounts/credentials.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def retrieve(
116116
*,
117117
organization_id: str,
118118
service_account_id: str,
119-
expand: List[Literal["permissions"]] | Omit = omit,
119+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
120120
x_client_request_id: str | Omit = omit,
121121
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
122122
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -135,8 +135,11 @@ def retrieve(
135135
136136
credential_id: Identifier for API resources. A 26-char nanoid (URL/DNS safe).
137137
138-
expand: Fields to expand in the response. Currently supports "permissions" to include
139-
the permissions field with the caller's permissions for the resource.
138+
expand: Fields to expand in the response. Supports "permissions" to include the
139+
permissions field with the caller's permissions for the resource. For list
140+
organization identities only, "total_count" populates pagination.total_count
141+
with the number of identities matching the same filters as the list (excluding
142+
cursor and limit). Other operations ignore expand values they do not use.
140143
141144
extra_headers: Send extra headers
142145
@@ -242,7 +245,7 @@ def list(
242245
organization_id: str,
243246
after: str | Omit = omit,
244247
before: str | Omit = omit,
245-
expand: List[Literal["permissions"]] | Omit = omit,
248+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
246249
limit: int | Omit = omit,
247250
x_client_request_id: str | Omit = omit,
248251
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -264,8 +267,11 @@ def list(
264267
265268
before: Cursor for backward pagination
266269
267-
expand: Fields to expand in the response. Currently supports "permissions" to include
268-
the permissions field with the caller's permissions for the resource.
270+
expand: Fields to expand in the response. Supports "permissions" to include the
271+
permissions field with the caller's permissions for the resource. For list
272+
organization identities only, "total_count" populates pagination.total_count
273+
with the number of identities matching the same filters as the list (excluding
274+
cursor and limit). Other operations ignore expand values they do not use.
269275
270276
limit: Maximum number of credentials to return
271277
@@ -445,7 +451,7 @@ async def retrieve(
445451
*,
446452
organization_id: str,
447453
service_account_id: str,
448-
expand: List[Literal["permissions"]] | Omit = omit,
454+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
449455
x_client_request_id: str | Omit = omit,
450456
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
451457
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -464,8 +470,11 @@ async def retrieve(
464470
465471
credential_id: Identifier for API resources. A 26-char nanoid (URL/DNS safe).
466472
467-
expand: Fields to expand in the response. Currently supports "permissions" to include
468-
the permissions field with the caller's permissions for the resource.
473+
expand: Fields to expand in the response. Supports "permissions" to include the
474+
permissions field with the caller's permissions for the resource. For list
475+
organization identities only, "total_count" populates pagination.total_count
476+
with the number of identities matching the same filters as the list (excluding
477+
cursor and limit). Other operations ignore expand values they do not use.
469478
470479
extra_headers: Send extra headers
471480
@@ -573,7 +582,7 @@ async def list(
573582
organization_id: str,
574583
after: str | Omit = omit,
575584
before: str | Omit = omit,
576-
expand: List[Literal["permissions"]] | Omit = omit,
585+
expand: List[Literal["permissions", "total_count"]] | Omit = omit,
577586
limit: int | Omit = omit,
578587
x_client_request_id: str | Omit = omit,
579588
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -595,8 +604,11 @@ async def list(
595604
596605
before: Cursor for backward pagination
597606
598-
expand: Fields to expand in the response. Currently supports "permissions" to include
599-
the permissions field with the caller's permissions for the resource.
607+
expand: Fields to expand in the response. Supports "permissions" to include the
608+
permissions field with the caller's permissions for the resource. For list
609+
organization identities only, "total_count" populates pagination.total_count
610+
with the number of identities matching the same filters as the list (excluding
611+
cursor and limit). Other operations ignore expand values they do not use.
600612
601613
limit: Maximum number of credentials to return
602614

0 commit comments

Comments
 (0)