Skip to content

Commit

Permalink
docs: deprecate old access token getter (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Mar 6, 2024
1 parent 3296aff commit 1abb098
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ from finch.types import ConnectionStatusType, OperationSupport, OperationSupport

Methods:

- <code>client.<a href="./src/finch/_client.py">get_access_token</a>(\*args) -> str</code>
- <code>client.<a href="./src/finch/_client.py">get_auth_url</a>(\*args) -> str</code>
- <code>client.<a href="./src/finch/_client.py">with_access_token</a>(\*args) -> Self</code>

Expand Down
12 changes: 2 additions & 10 deletions src/finch/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,7 @@ def get_access_token(
*,
redirect_uri: str | None = None,
) -> str:
"""Returns an access token for the Finch API given an authorization code.
An authorization code can be obtained by visiting the url returned by
get_auth_url().
"""
"""DEPRECATED: use client.access_tokens.create instead."""
if self.client_id is None:
raise ValueError("Expected client_id to be set in order to call get_access_token")

Expand Down Expand Up @@ -659,11 +655,7 @@ async def get_access_token(
*,
redirect_uri: str | None = None,
) -> str:
"""Returns an access token for the Finch API given an authorization code.
An authorization code can be obtained by visiting the url returned by
get_auth_url().
"""
"""DEPRECATED: use client.access_tokens.create instead."""
if self.client_id is None:
raise ValueError("Expected client_id to be set in order to call get_access_token")

Expand Down

0 comments on commit 1abb098

Please sign in to comment.