From 70de7f7689aaa23ba84fd848ba3501fa217e5006 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 30 Dec 2023 01:02:24 +0000 Subject: [PATCH] SDK regeneration --- pyproject.toml | 2 +- src/webflow/client.py | 31 ++++++++---------------------- src/webflow/core/client_wrapper.py | 2 +- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 10a6dcf..8779618 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "webflow" -version = "0.1.0b1" +version = "0.0.5" description = "" readme = "README.md" authors = [] diff --git a/src/webflow/client.py b/src/webflow/client.py index 63d4dbf..08638bc 100644 --- a/src/webflow/client.py +++ b/src/webflow/client.py @@ -6,7 +6,6 @@ from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .environment import WebflowEnvironment -from .oauth import get_access_token from .resources.access_groups.client import AccessGroupsClient, AsyncAccessGroupsClient from .resources.assets.client import AssetsClient, AsyncAssetsClient from .resources.collections.client import AsyncCollectionsClient, CollectionsClient @@ -27,22 +26,15 @@ class Webflow: def __init__( self, *, - client_id: str, - client_secret: str, - code: str, - redirect_uri: typing.Optional[str] = None, + base_url: typing.Optional[str] = None, environment: WebflowEnvironment = WebflowEnvironment.DEFAULT, + access_token: typing.Union[str, typing.Callable[[], str]], timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): - self._token = get_access_token( - client_id=client_id, - client_secret=client_secret, - code=code, - redirect_uri=redirect_uri) self._client_wrapper = SyncClientWrapper( - base_url=_get_base_url(base_url=None, environment=environment), - access_token=self._token, + base_url=_get_base_url(base_url=base_url, environment=environment), + access_token=access_token, httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client, ) self.token = TokenClient(client_wrapper=self._client_wrapper) @@ -65,22 +57,15 @@ class AsyncWebflow: def __init__( self, *, - client_id: str, - client_secret: str, - code: str, - redirect_uri: typing.Optional[str] = None, + base_url: typing.Optional[str] = None, environment: WebflowEnvironment = WebflowEnvironment.DEFAULT, + access_token: typing.Union[str, typing.Callable[[], str]], timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.AsyncClient] = None ): - self._token = get_access_token( - client_id=client_id, - client_secret=client_secret, - code=code, - redirect_uri=redirect_uri) self._client_wrapper = AsyncClientWrapper( - base_url=_get_base_url(base_url=None, environment=environment), - access_token=self._token, + base_url=_get_base_url(base_url=base_url, environment=environment), + access_token=access_token, httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client, ) self.token = AsyncTokenClient(client_wrapper=self._client_wrapper) diff --git a/src/webflow/core/client_wrapper.py b/src/webflow/core/client_wrapper.py index 5e431c1..992f7e5 100644 --- a/src/webflow/core/client_wrapper.py +++ b/src/webflow/core/client_wrapper.py @@ -14,7 +14,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "webflow", - "X-Fern-SDK-Version": "0.1.0b1", + "X-Fern-SDK-Version": "0.0.5", } headers["Authorization"] = f"Bearer {self._get_access_token()}" return headers