Skip to content

Commit 8fb55b1

Browse files
committed
Rename from_token to from_param
1 parent 2957000 commit 8fb55b1

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

examples/ConnectedAccounts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ This method provides a list of connections that have been enabled for use with C
125125

126126
This method requires the My Account `read:me:connected_accounts` scope to be enabled for your application and configured for MRRT.
127127

128-
This method supports paging via optional the use of `take` parameter. Without this parameters, a default page size of 10 is used. Subsequent pages can be retrieved by also passing the `from_token` parameter with the token returned in the `next` property of the response
128+
This method supports paging via optional the use of `take` parameter. Without this parameters, a default page size of 10 is used. Subsequent pages can be retrieved by also passing the `from_param` parameter with the token returned in the `next` property of the response
129129

130130
```python
131131
available_connections = await client.list_connected_account_connections(
132132
take= 5, # optional
133-
from_token= "NEXT_VALUE_FROM_PREVIOUS_RESPONSE", # optional
133+
from_param= "NEXT_VALUE_FROM_PREVIOUS_RESPONSE", # optional
134134
store_options= {"request": request, "response": response}
135135
)
136136
```
@@ -143,13 +143,13 @@ This method requires the My Account `read:me:connected_accounts` scope to be ena
143143

144144
An optional `connection` parameter can be used to filter the connected accounts for a specific connection, otherwise all connected accounts will be returns
145145

146-
This method supports paging via optional the use of `take` parameter. Without this parameters, a default page size of 10 is used. Subsequent pages can be retrieved by also passing the `from_token` parameter with the token returned in the `next` property of the response
146+
This method supports paging via optional the use of `take` parameter. Without this parameters, a default page size of 10 is used. Subsequent pages can be retrieved by also passing the `from_param` parameter with the token returned in the `next` property of the response
147147

148148
```python
149149
connected_accounts = await client.list_connected_accounts(
150150
connection= "google-oauth2", # optional
151151
take= 5, # optional
152-
from_token= "NEXT_VALUE_FROM_PREVIOUS_RESPONSE", # optional
152+
from_param= "NEXT_VALUE_FROM_PREVIOUS_RESPONSE", # optional
153153
store_options= {"request": request, "response": response}
154154
)
155155
```

src/auth0_server_python/auth_server/my_account_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ async def list_connected_accounts(
101101
self,
102102
access_token: str,
103103
connection: Optional[str] = None,
104-
from_token: Optional[str] = None,
104+
from_param: Optional[str] = None,
105105
take: Optional[int] = None
106106
) -> ListConnectedAccountResponse:
107107
try:
108108
async with httpx.AsyncClient() as client:
109109
params = {}
110110
if connection:
111111
params["connection"] = connection
112-
if from_token:
113-
params["from"] = from_token
112+
if from_param:
113+
params["from"] = from_param
114114
if take:
115115
params["take"] = take
116116

@@ -178,14 +178,14 @@ async def delete_connected_account(
178178
async def list_connected_account_connections(
179179
self,
180180
access_token: str,
181-
from_token: Optional[str] = None,
181+
from_param: Optional[str] = None,
182182
take: Optional[int] = None
183183
) -> ListConnectedAccountConnectionsResponse:
184184
try:
185185
async with httpx.AsyncClient() as client:
186186
params = {}
187-
if from_token:
188-
params["from"] = from_token
187+
if from_param:
188+
params["from"] = from_param
189189
if take:
190190
params["take"] = take
191191

src/auth0_server_python/auth_server/server_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ async def complete_connect_account(
14771477
async def list_connected_accounts(
14781478
self,
14791479
connection: Optional[str] = None,
1480-
from_token: Optional[str] = None,
1480+
from_param: Optional[str] = None,
14811481
take: Optional[int] = None,
14821482
store_options: dict = None
14831483
) -> ListConnectedAccountResponse:
@@ -1486,7 +1486,7 @@ async def list_connected_accounts(
14861486
14871487
Args:
14881488
connection (Optional[str], optional): Filter results to a specific connection. Defaults to None.
1489-
from_token (Optional[str], optional): A pagination token indicating where to start retrieving results, obtained from a prior request. Defaults to None.
1489+
from_param (Optional[str], optional): A pagination token indicating where to start retrieving results, obtained from a prior request. Defaults to None.
14901490
take (Optional[int], optional): The maximum number of connections to retrieve. Defaults to None.
14911491
store_options: Optional options used to pass to the Transaction and State Store.
14921492
@@ -1503,7 +1503,7 @@ async def list_connected_accounts(
15031503
store_options=store_options
15041504
)
15051505
return await self._my_account_client.list_connected_accounts(
1506-
access_token=access_token, connection=connection, from_token=from_token, take=take)
1506+
access_token=access_token, connection=connection, from_param=from_param, take=take)
15071507

15081508
async def delete_connected_account(
15091509
self,
@@ -1531,15 +1531,15 @@ async def delete_connected_account(
15311531

15321532
async def list_connected_account_connections(
15331533
self,
1534-
from_token: Optional[str] = None,
1534+
from_param: Optional[str] = None,
15351535
take: Optional[int] = None,
15361536
store_options: dict = None
15371537
) -> ListConnectedAccountConnectionsResponse:
15381538
"""
15391539
Retrieves a list of available connections that can be used connected accounts for the authenticated user.
15401540
15411541
Args:
1542-
from_token (Optional[str], optional): A pagination token indicating where to start retrieving results, obtained from a prior request. Defaults to None.
1542+
from_param (Optional[str], optional): A pagination token indicating where to start retrieving results, obtained from a prior request. Defaults to None.
15431543
take (Optional[int], optional): The maximum number of connections to retrieve. Defaults to None.
15441544
store_options: Optional options used to pass to the Transaction and State Store.
15451545
@@ -1556,4 +1556,4 @@ async def list_connected_account_connections(
15561556
store_options=store_options
15571557
)
15581558
return await self._my_account_client.list_connected_account_connections(
1559-
access_token=access_token, from_token=from_token, take=take)
1559+
access_token=access_token, from_param=from_param, take=take)

src/auth0_server_python/tests/test_my_account_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ async def test_list_connected_accounts_success(mocker):
195195
result = await client.list_connected_accounts(
196196
access_token="<access_token>",
197197
connection="<connection>",
198-
from_token="<from_token>",
198+
from_param="<from_param>",
199199
take=2
200200
)
201201

@@ -204,7 +204,7 @@ async def test_list_connected_accounts_success(mocker):
204204
url="https://auth0.local/me/v1/connected-accounts/accounts",
205205
params={
206206
"connection": "<connection>",
207-
"from": "<from_token>",
207+
"from": "<from_param>",
208208
"take": 2
209209
},
210210
auth=ANY
@@ -248,7 +248,7 @@ async def test_list_connected_accounts_api_response_failure(mocker):
248248
await client.list_connected_accounts(
249249
access_token="<access_token>",
250250
connection="<connection>",
251-
from_token="<from_token>",
251+
from_param="<from_param>",
252252
take=2
253253
)
254254

@@ -333,15 +333,15 @@ async def test_list_connected_account_connections_success(mocker):
333333
# Act
334334
result = await client.list_connected_account_connections(
335335
access_token="<access_token>",
336-
from_token="<from_token>",
336+
from_param="<from_param>",
337337
take=2
338338
)
339339

340340
# Assert
341341
mock_get.assert_awaited_with(
342342
url="https://auth0.local/me/v1/connected-accounts/connections",
343343
params={
344-
"from": "<from_token>",
344+
"from": "<from_param>",
345345
"take": 2
346346
},
347347
auth=ANY
@@ -378,7 +378,7 @@ async def test_list_connected_account_connections_api_response_failure(mocker):
378378
with pytest.raises(MyAccountApiError) as exc:
379379
await client.list_connected_account_connections(
380380
access_token="<access_token>",
381-
from_token="<from_token>",
381+
from_param="<from_param>",
382382
take=2
383383
)
384384

src/auth0_server_python/tests/test_server_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,7 +1975,7 @@ async def test_list_connected_accounts_gets_access_token_and_calls_my_account(mo
19751975
# Act
19761976
response = await client.list_connected_accounts(
19771977
connection="<connection>",
1978-
from_token="<from_token>",
1978+
from_param="<from_param>",
19791979
take=2
19801980
)
19811981

@@ -1989,7 +1989,7 @@ async def test_list_connected_accounts_gets_access_token_and_calls_my_account(mo
19891989
mock_my_account_client.list_connected_accounts.assert_awaited_with(
19901990
access_token="<access_token>",
19911991
connection="<connection>",
1992-
from_token="<from_token>",
1992+
from_param="<from_param>",
19931993
take=2
19941994
)
19951995

@@ -2053,7 +2053,7 @@ async def test_list_connected_account_connections_gets_access_token_and_calls_my
20532053

20542054
# Act
20552055
response = await client.list_connected_account_connections(
2056-
from_token="<from_token>",
2056+
from_param="<from_param>",
20572057
take=2
20582058
)
20592059

@@ -2066,6 +2066,6 @@ async def test_list_connected_account_connections_gets_access_token_and_calls_my
20662066
)
20672067
mock_my_account_client.list_connected_account_connections.assert_awaited_with(
20682068
access_token="<access_token>",
2069-
from_token="<from_token>",
2069+
from_param="<from_param>",
20702070
take=2
20712071
)

0 commit comments

Comments
 (0)