Skip to content

Commit

Permalink
fix: assets.list returns object not Asset[]
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] authored Mar 29, 2024
1 parent f66a4e2 commit e93b420
Show file tree
Hide file tree
Showing 47 changed files with 240 additions and 902 deletions.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "webflow"
version = "v1.1.0"
version = "v1.2.0"
description = ""
readme = "README.md"
authors = []
Expand Down
44 changes: 4 additions & 40 deletions src/webflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@
CollectionItemFieldData,
CollectionItemList,
CollectionItemListPagination,
CollectionItemRemoved,
CollectionList,
CollectionListArrayItem,
CustomCodeBlock,
CustomCodeBlockType,
CustomCodeResponse,
Dom,
Domain,
Domains,
DuplicateUserEmail,
EcommerceSettings,
Error,
ErrorDetailsItem,
Field,
FieldType,
Fields,
Form,
FormField,
FormFieldValue,
Expand All @@ -43,11 +42,8 @@
FormResponseSettings,
FormSubmission,
FormSubmissionList,
FormSubmissionTrigger,
FormSubmissionTriggerPayload,
ImageNode,
InvalidDomain,
InvalidScopes,
InventoryItem,
InventoryItemInventoryType,
ListCustomCodeBlocks,
Expand Down Expand Up @@ -76,15 +72,9 @@
OrderTotalsExtrasItem,
OrderTotalsExtrasItemType,
Page,
PageCreatedWebhook,
PageDeletedWebhook,
PageList,
PageMetadataUpdatedWebhook,
PageOpenGraph,
PageSeo,
PageSeoGraphData,
PageSeoGraphDataOpenGraph,
PageSeoGraphDataSeo,
Pagination,
PaypalDetails,
Product,
Expand All @@ -94,21 +84,16 @@
ProductFieldDataEcProductType,
ProductFieldDataTaxCategory,
PublishStatus,
PublishedItems,
PublishedSite,
RegisteredScriptList,
RemovedItems,
ScriptApply,
ScriptApplyList,
ScriptApplyLocation,
Scripts,
Site,
SiteActivityLogItem,
SiteActivityLogItemResourceOperation,
SiteActivityLogItemUser,
SiteActivityLogResponse,
SitePublish,
SitePublishPayload,
Sites,
Sku,
SkuFieldData,
SkuFieldDataCompareAtPrice,
Expand All @@ -133,8 +118,6 @@
UserLimitReached,
UserList,
UserStatus,
UserWebhookPayload,
UserWebhookPayloadTriggerType,
UsersNotEnabled,
Webhook,
WebhookList,
Expand All @@ -152,7 +135,6 @@
AccessGroupsListRequestSort,
DomWriteNodesItem,
InventoryUpdateRequestInventoryType,
OrdersListRequestStatus,
OrdersRefundRequestReason,
ProductSkuCreateProduct,
ProductSkuCreateProductFieldData,
Expand Down Expand Up @@ -207,7 +189,6 @@
"CollectionItemFieldData",
"CollectionItemList",
"CollectionItemListPagination",
"CollectionItemRemoved",
"CollectionList",
"CollectionListArrayItem",
"ConflictError",
Expand All @@ -217,13 +198,13 @@
"Dom",
"DomWriteNodesItem",
"Domain",
"Domains",
"DuplicateUserEmail",
"EcommerceSettings",
"Error",
"ErrorDetailsItem",
"Field",
"FieldType",
"Fields",
"ForbiddenError",
"Form",
"FormField",
Expand All @@ -233,12 +214,9 @@
"FormResponseSettings",
"FormSubmission",
"FormSubmissionList",
"FormSubmissionTrigger",
"FormSubmissionTriggerPayload",
"ImageNode",
"InternalServerError",
"InvalidDomain",
"InvalidScopes",
"InventoryItem",
"InventoryItemInventoryType",
"InventoryUpdateRequestInventoryType",
Expand Down Expand Up @@ -268,18 +246,11 @@
"OrderTotals",
"OrderTotalsExtrasItem",
"OrderTotalsExtrasItemType",
"OrdersListRequestStatus",
"OrdersRefundRequestReason",
"Page",
"PageCreatedWebhook",
"PageDeletedWebhook",
"PageList",
"PageMetadataUpdatedWebhook",
"PageOpenGraph",
"PageSeo",
"PageSeoGraphData",
"PageSeoGraphDataOpenGraph",
"PageSeoGraphDataSeo",
"Pagination",
"PaypalDetails",
"Product",
Expand All @@ -301,21 +272,16 @@
"ProductSkuCreateSkuFieldDataPrice",
"ProductsCreateSkuResponse",
"PublishStatus",
"PublishedItems",
"PublishedSite",
"RegisteredScriptList",
"RemovedItems",
"ScriptApply",
"ScriptApplyList",
"ScriptApplyLocation",
"Scripts",
"Site",
"SiteActivityLogItem",
"SiteActivityLogItemResourceOperation",
"SiteActivityLogItemUser",
"SiteActivityLogResponse",
"SitePublish",
"SitePublishPayload",
"Sites",
"Sku",
"SkuFieldData",
"SkuFieldDataCompareAtPrice",
Expand All @@ -342,8 +308,6 @@
"UserLimitReached",
"UserList",
"UserStatus",
"UserWebhookPayload",
"UserWebhookPayloadTriggerType",
"UsersListRequestSort",
"UsersNotEnabled",
"UsersUpdateRequestData",
Expand Down
4 changes: 2 additions & 2 deletions src/webflow/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def __init__(
self.collections = CollectionsClient(client_wrapper=self._client_wrapper)
self.pages = PagesClient(client_wrapper=self._client_wrapper)
self.scripts = ScriptsClient(client_wrapper=self._client_wrapper)
self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
self.assets = AssetsClient(client_wrapper=self._client_wrapper)
self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
self.forms = FormsClient(client_wrapper=self._client_wrapper)
self.users = UsersClient(client_wrapper=self._client_wrapper)
self.access_groups = AccessGroupsClient(client_wrapper=self._client_wrapper)
Expand Down Expand Up @@ -119,8 +119,8 @@ def __init__(
self.collections = AsyncCollectionsClient(client_wrapper=self._client_wrapper)
self.pages = AsyncPagesClient(client_wrapper=self._client_wrapper)
self.scripts = AsyncScriptsClient(client_wrapper=self._client_wrapper)
self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
self.assets = AsyncAssetsClient(client_wrapper=self._client_wrapper)
self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
self.forms = AsyncFormsClient(client_wrapper=self._client_wrapper)
self.users = AsyncUsersClient(client_wrapper=self._client_wrapper)
self.access_groups = AsyncAccessGroupsClient(client_wrapper=self._client_wrapper)
Expand Down
2 changes: 1 addition & 1 deletion src/webflow/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "v1.1.0",
"X-Fern-SDK-Version": "v1.2.0",
}
headers["Authorization"] = f"Bearer {self._get_access_token()}"
return headers
Expand Down
3 changes: 1 addition & 2 deletions src/webflow/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)
from .access_groups import AccessGroupsListRequestSort
from .inventory import InventoryUpdateRequestInventoryType
from .orders import OrdersListRequestStatus, OrdersRefundRequestReason
from .orders import OrdersRefundRequestReason
from .pages import DomWriteNodesItem
from .products import (
ProductSkuCreateProduct,
Expand All @@ -40,7 +40,6 @@
"AccessGroupsListRequestSort",
"DomWriteNodesItem",
"InventoryUpdateRequestInventoryType",
"OrdersListRequestStatus",
"OrdersRefundRequestReason",
"ProductSkuCreateProduct",
"ProductSkuCreateProductFieldData",
Expand Down
15 changes: 7 additions & 8 deletions src/webflow/resources/assets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ...types.asset_folder import AssetFolder
from ...types.asset_folder_list import AssetFolderList
from ...types.asset_upload import AssetUpload
from ...types.assets import Assets

try:
import pydantic.v1 as pydantic # type: ignore
Expand All @@ -32,7 +33,7 @@ class AssetsClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper

def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Asset]:
def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assets:
"""
List assets for a given site </br></br> Required scope | `assets:read`
Expand Down Expand Up @@ -71,7 +72,7 @@ def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions]
else 60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.List[Asset], _response.json()) # type: ignore
return pydantic.parse_obj_as(Assets, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
if _response.status_code == 401:
Expand Down Expand Up @@ -298,7 +299,7 @@ def update(
)
client.assets.update(
asset_id="asset_id",
display_name="file.png",
display_name="bulldoze.png",
)
"""
_response = self._client_wrapper.httpx_client.request(
Expand Down Expand Up @@ -540,9 +541,7 @@ class AsyncAssetsClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper

async def list(
self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> typing.List[Asset]:
async def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assets:
"""
List assets for a given site </br></br> Required scope | `assets:read`
Expand Down Expand Up @@ -581,7 +580,7 @@ async def list(
else 60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.List[Asset], _response.json()) # type: ignore
return pydantic.parse_obj_as(Assets, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
if _response.status_code == 401:
Expand Down Expand Up @@ -808,7 +807,7 @@ async def update(
)
await client.assets.update(
asset_id="asset_id",
display_name="file.png",
display_name="bulldoze.png",
)
"""
_response = await self._client_wrapper.httpx_client.request(
Expand Down
Loading

0 comments on commit e93b420

Please sign in to comment.