Skip to content

Commit 894766b

Browse files
feat(docs): updating documented docs for stainless
1 parent 656f9df commit 894766b

8 files changed

+85
-42
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openint%2Fopenint-b1eb7e567b4189d22d4699483e51b8872be5ec24eb5f37384be637d1f11e2f26.yml
3-
openapi_spec_hash: fff7dab9505ebbf35885f0a7c65c8baf
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openint%2Fopenint-67a61cc981caf2a7992bcb19816e09474399f50cfa9a2a6cf2c79b8299a53d16.yml
3+
openapi_spec_hash: 32eae2c2f8547ef3ea3e395bf2f413e2
44
config_hash: a6e549521fa293498319c532d9cfa93f

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Methods:
2828
- <code title="get /viewer">client.<a href="./src/openint/_client.py">get_current_user</a>() -> <a href="./src/openint/types/get_current_user_response.py">GetCurrentUserResponse</a></code>
2929
- <code title="get /connector-config">client.<a href="./src/openint/_client.py">list_connection_configs</a>(\*\*<a href="src/openint/types/client_list_connection_configs_params.py">params</a>) -> <a href="./src/openint/types/list_connection_configs_response.py">SyncOffsetPagination[ListConnectionConfigsResponse]</a></code>
3030
- <code title="get /connection">client.<a href="./src/openint/_client.py">list_connections</a>(\*\*<a href="src/openint/types/client_list_connections_params.py">params</a>) -> <a href="./src/openint/types/list_connections_response.py">SyncOffsetPagination[ListConnectionsResponse]</a></code>
31-
- <code title="get /connector">client.<a href="./src/openint/_client.py">list_connectors</a>(\*\*<a href="src/openint/types/client_list_connectors_params.py">params</a>) -> <a href="./src/openint/types/list_connectors_response.py">ListConnectorsResponse</a></code>
31+
- <code title="get /connector">client.<a href="./src/openint/_client.py">list_connectors</a>(\*\*<a href="src/openint/types/client_list_connectors_params.py">params</a>) -> <a href="./src/openint/types/list_connectors_response.py">SyncOffsetPagination[ListConnectorsResponse]</a></code>

src/openint/_client.py

+52-10
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@ def list_connection_configs(
607607
List Configured Connectors
608608
609609
Args:
610+
limit: Limit the number of items returned
611+
612+
offset: Offset the items returned
613+
610614
extra_headers: Send extra headers
611615
612616
extra_query: Add additional query parameters to the request
@@ -729,6 +733,10 @@ def list_connections(
729733
730734
expand: Expand the response with additional optionals
731735
736+
limit: Limit the number of items returned
737+
738+
offset: Offset the items returned
739+
732740
extra_headers: Send extra headers
733741
734742
extra_query: Add additional query parameters to the request
@@ -765,17 +773,23 @@ def list_connectors(
765773
self,
766774
*,
767775
expand: List[Literal["schemas"]] | NotGiven = NOT_GIVEN,
776+
limit: int | NotGiven = NOT_GIVEN,
777+
offset: int | NotGiven = NOT_GIVEN,
768778
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
769779
# The extra values given here take precedence over values defined on the client or passed to this method.
770780
extra_headers: Headers | None = None,
771781
extra_query: Query | None = None,
772782
extra_body: Body | None = None,
773783
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
774-
) -> ListConnectorsResponse:
784+
) -> SyncOffsetPagination[ListConnectorsResponse]:
775785
"""
776786
List all connectors to understand what integrations are available to configure
777787
778788
Args:
789+
limit: Limit the number of items returned
790+
791+
offset: Offset the items returned
792+
779793
extra_headers: Send extra headers
780794
781795
extra_query: Add additional query parameters to the request
@@ -784,16 +798,24 @@ def list_connectors(
784798
785799
timeout: Override the client-level default timeout for this request, in seconds
786800
"""
787-
return self.get(
801+
return self.get_api_list(
788802
"/connector",
803+
page=SyncOffsetPagination[ListConnectorsResponse],
789804
options=make_request_options(
790805
extra_headers=extra_headers,
791806
extra_query=extra_query,
792807
extra_body=extra_body,
793808
timeout=timeout,
794-
query=maybe_transform({"expand": expand}, client_list_connectors_params.ClientListConnectorsParams),
809+
query=maybe_transform(
810+
{
811+
"expand": expand,
812+
"limit": limit,
813+
"offset": offset,
814+
},
815+
client_list_connectors_params.ClientListConnectorsParams,
816+
),
795817
),
796-
cast_to=ListConnectorsResponse,
818+
model=ListConnectorsResponse,
797819
)
798820

799821
@override
@@ -1369,6 +1391,10 @@ def list_connection_configs(
13691391
List Configured Connectors
13701392
13711393
Args:
1394+
limit: Limit the number of items returned
1395+
1396+
offset: Offset the items returned
1397+
13721398
extra_headers: Send extra headers
13731399
13741400
extra_query: Add additional query parameters to the request
@@ -1491,6 +1517,10 @@ def list_connections(
14911517
14921518
expand: Expand the response with additional optionals
14931519
1520+
limit: Limit the number of items returned
1521+
1522+
offset: Offset the items returned
1523+
14941524
extra_headers: Send extra headers
14951525
14961526
extra_query: Add additional query parameters to the request
@@ -1523,21 +1553,27 @@ def list_connections(
15231553
model=cast(Any, ListConnectionsResponse), # Union types cannot be passed in as arguments in the type system
15241554
)
15251555

1526-
async def list_connectors(
1556+
def list_connectors(
15271557
self,
15281558
*,
15291559
expand: List[Literal["schemas"]] | NotGiven = NOT_GIVEN,
1560+
limit: int | NotGiven = NOT_GIVEN,
1561+
offset: int | NotGiven = NOT_GIVEN,
15301562
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
15311563
# The extra values given here take precedence over values defined on the client or passed to this method.
15321564
extra_headers: Headers | None = None,
15331565
extra_query: Query | None = None,
15341566
extra_body: Body | None = None,
15351567
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1536-
) -> ListConnectorsResponse:
1568+
) -> AsyncPaginator[ListConnectorsResponse, AsyncOffsetPagination[ListConnectorsResponse]]:
15371569
"""
15381570
List all connectors to understand what integrations are available to configure
15391571
15401572
Args:
1573+
limit: Limit the number of items returned
1574+
1575+
offset: Offset the items returned
1576+
15411577
extra_headers: Send extra headers
15421578
15431579
extra_query: Add additional query parameters to the request
@@ -1546,18 +1582,24 @@ async def list_connectors(
15461582
15471583
timeout: Override the client-level default timeout for this request, in seconds
15481584
"""
1549-
return await self.get(
1585+
return self.get_api_list(
15501586
"/connector",
1587+
page=AsyncOffsetPagination[ListConnectorsResponse],
15511588
options=make_request_options(
15521589
extra_headers=extra_headers,
15531590
extra_query=extra_query,
15541591
extra_body=extra_body,
15551592
timeout=timeout,
1556-
query=await async_maybe_transform(
1557-
{"expand": expand}, client_list_connectors_params.ClientListConnectorsParams
1593+
query=maybe_transform(
1594+
{
1595+
"expand": expand,
1596+
"limit": limit,
1597+
"offset": offset,
1598+
},
1599+
client_list_connectors_params.ClientListConnectorsParams,
15581600
),
15591601
),
1560-
cast_to=ListConnectorsResponse,
1602+
model=ListConnectorsResponse,
15611603
)
15621604

15631605
@override

src/openint/types/client_list_connection_configs_params.py

+2
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ class ClientListConnectionConfigsParams(TypedDict, total=False):
7373
expand: List[Literal["connector", "connector.schemas", "connection_count"]]
7474

7575
limit: int
76+
"""Limit the number of items returned"""
7677

7778
offset: int
79+
"""Offset the items returned"""

src/openint/types/client_list_connections_params.py

+2
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,7 @@ class ClientListConnectionsParams(TypedDict, total=False):
8585
include_secrets: bool
8686

8787
limit: int
88+
"""Limit the number of items returned"""
8889

8990
offset: int
91+
"""Offset the items returned"""

src/openint/types/client_list_connectors_params.py

+6
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@
1010

1111
class ClientListConnectorsParams(TypedDict, total=False):
1212
expand: List[Literal["schemas"]]
13+
14+
limit: int
15+
"""Limit the number of items returned"""
16+
17+
offset: int
18+
"""Offset the items returned"""

src/openint/types/list_connectors_response.py

+8-21
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
from .._models import BaseModel
99

10-
__all__ = ["ListConnectorsResponse", "Item", "ItemIntegration", "ItemSchemas", "ItemScope"]
10+
__all__ = ["ListConnectorsResponse", "Integration", "Schemas", "Scope"]
1111

1212

13-
class ItemIntegration(BaseModel):
13+
class Integration(BaseModel):
1414
id: str
1515

1616
connector_name: Literal[
@@ -95,7 +95,7 @@ class ItemIntegration(BaseModel):
9595
version: Optional[str] = None
9696

9797

98-
class ItemSchemas(BaseModel):
98+
class Schemas(BaseModel):
9999
connect_input: Optional[object] = None
100100

101101
connect_output: Optional[object] = None
@@ -111,15 +111,15 @@ class ItemSchemas(BaseModel):
111111
webhook_input: Optional[object] = None
112112

113113

114-
class ItemScope(BaseModel):
114+
class Scope(BaseModel):
115115
scope: str
116116

117117
description: Optional[str] = None
118118

119119
display_name: Optional[str] = None
120120

121121

122-
class Item(BaseModel):
122+
class ListConnectorsResponse(BaseModel):
123123
name: str
124124

125125
auth_type: Optional[Literal["BASIC", "OAUTH1", "OAUTH2", "OAUTH2CC", "API_KEY", "CUSTOM"]] = FieldInfo(
@@ -128,29 +128,16 @@ class Item(BaseModel):
128128

129129
display_name: Optional[str] = None
130130

131-
integrations: Optional[List[ItemIntegration]] = None
131+
integrations: Optional[List[Integration]] = None
132132

133133
logo_url: Optional[str] = None
134134

135135
openint_scopes: Optional[List[str]] = None
136136

137137
platforms: Optional[List[Literal["web", "mobile", "desktop", "local", "cloud"]]] = None
138138

139-
schemas: Optional[ItemSchemas] = None
139+
schemas: Optional[Schemas] = None
140140

141-
scopes: Optional[List[ItemScope]] = None
141+
scopes: Optional[List[Scope]] = None
142142

143143
stage: Optional[Literal["alpha", "beta", "ga", "hidden"]] = None
144-
145-
146-
class ListConnectorsResponse(BaseModel):
147-
items: List[Item]
148-
149-
limit: int
150-
"""Limit the number of items returned"""
151-
152-
offset: int
153-
"""Offset the items returned"""
154-
155-
total: int
156-
"""Total number of items in the database for the organization"""

tests/api_resources/test_client.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -467,15 +467,17 @@ def test_streaming_response_list_connections(self, client: Openint) -> None:
467467
@parametrize
468468
def test_method_list_connectors(self, client: Openint) -> None:
469469
client_ = client.list_connectors()
470-
assert_matches_type(ListConnectorsResponse, client_, path=["response"])
470+
assert_matches_type(SyncOffsetPagination[ListConnectorsResponse], client_, path=["response"])
471471

472472
@pytest.mark.skip()
473473
@parametrize
474474
def test_method_list_connectors_with_all_params(self, client: Openint) -> None:
475475
client_ = client.list_connectors(
476476
expand=["schemas"],
477+
limit=0,
478+
offset=0,
477479
)
478-
assert_matches_type(ListConnectorsResponse, client_, path=["response"])
480+
assert_matches_type(SyncOffsetPagination[ListConnectorsResponse], client_, path=["response"])
479481

480482
@pytest.mark.skip()
481483
@parametrize
@@ -485,7 +487,7 @@ def test_raw_response_list_connectors(self, client: Openint) -> None:
485487
assert response.is_closed is True
486488
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
487489
client_ = response.parse()
488-
assert_matches_type(ListConnectorsResponse, client_, path=["response"])
490+
assert_matches_type(SyncOffsetPagination[ListConnectorsResponse], client_, path=["response"])
489491

490492
@pytest.mark.skip()
491493
@parametrize
@@ -495,7 +497,7 @@ def test_streaming_response_list_connectors(self, client: Openint) -> None:
495497
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
496498

497499
client_ = response.parse()
498-
assert_matches_type(ListConnectorsResponse, client_, path=["response"])
500+
assert_matches_type(SyncOffsetPagination[ListConnectorsResponse], client_, path=["response"])
499501

500502
assert cast(Any, response.is_closed) is True
501503

@@ -941,15 +943,17 @@ async def test_streaming_response_list_connections(self, async_client: AsyncOpen
941943
@parametrize
942944
async def test_method_list_connectors(self, async_client: AsyncOpenint) -> None:
943945
client = await async_client.list_connectors()
944-
assert_matches_type(ListConnectorsResponse, client, path=["response"])
946+
assert_matches_type(AsyncOffsetPagination[ListConnectorsResponse], client, path=["response"])
945947

946948
@pytest.mark.skip()
947949
@parametrize
948950
async def test_method_list_connectors_with_all_params(self, async_client: AsyncOpenint) -> None:
949951
client = await async_client.list_connectors(
950952
expand=["schemas"],
953+
limit=0,
954+
offset=0,
951955
)
952-
assert_matches_type(ListConnectorsResponse, client, path=["response"])
956+
assert_matches_type(AsyncOffsetPagination[ListConnectorsResponse], client, path=["response"])
953957

954958
@pytest.mark.skip()
955959
@parametrize
@@ -959,7 +963,7 @@ async def test_raw_response_list_connectors(self, async_client: AsyncOpenint) ->
959963
assert response.is_closed is True
960964
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
961965
client = await response.parse()
962-
assert_matches_type(ListConnectorsResponse, client, path=["response"])
966+
assert_matches_type(AsyncOffsetPagination[ListConnectorsResponse], client, path=["response"])
963967

964968
@pytest.mark.skip()
965969
@parametrize
@@ -969,6 +973,6 @@ async def test_streaming_response_list_connectors(self, async_client: AsyncOpeni
969973
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
970974

971975
client = await response.parse()
972-
assert_matches_type(ListConnectorsResponse, client, path=["response"])
976+
assert_matches_type(AsyncOffsetPagination[ListConnectorsResponse], client, path=["response"])
973977

974978
assert cast(Any, response.is_closed) is True

0 commit comments

Comments
 (0)