Skip to content

Commit e93b420

Browse files
fix: assets.list returns object not Asset[]
1 parent f66a4e2 commit e93b420

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+240
-902
lines changed

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "webflow"
3-
version = "v1.1.0"
3+
version = "v1.2.0"
44
description = ""
55
readme = "README.md"
66
authors = []

src/webflow/__init__.py

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,20 @@
2020
CollectionItemFieldData,
2121
CollectionItemList,
2222
CollectionItemListPagination,
23-
CollectionItemRemoved,
2423
CollectionList,
2524
CollectionListArrayItem,
2625
CustomCodeBlock,
2726
CustomCodeBlockType,
2827
CustomCodeResponse,
2928
Dom,
3029
Domain,
30+
Domains,
3131
DuplicateUserEmail,
3232
EcommerceSettings,
3333
Error,
3434
ErrorDetailsItem,
3535
Field,
3636
FieldType,
37-
Fields,
3837
Form,
3938
FormField,
4039
FormFieldValue,
@@ -43,11 +42,8 @@
4342
FormResponseSettings,
4443
FormSubmission,
4544
FormSubmissionList,
46-
FormSubmissionTrigger,
47-
FormSubmissionTriggerPayload,
4845
ImageNode,
4946
InvalidDomain,
50-
InvalidScopes,
5147
InventoryItem,
5248
InventoryItemInventoryType,
5349
ListCustomCodeBlocks,
@@ -76,15 +72,9 @@
7672
OrderTotalsExtrasItem,
7773
OrderTotalsExtrasItemType,
7874
Page,
79-
PageCreatedWebhook,
80-
PageDeletedWebhook,
8175
PageList,
82-
PageMetadataUpdatedWebhook,
8376
PageOpenGraph,
8477
PageSeo,
85-
PageSeoGraphData,
86-
PageSeoGraphDataOpenGraph,
87-
PageSeoGraphDataSeo,
8878
Pagination,
8979
PaypalDetails,
9080
Product,
@@ -94,21 +84,16 @@
9484
ProductFieldDataEcProductType,
9585
ProductFieldDataTaxCategory,
9686
PublishStatus,
97-
PublishedItems,
98-
PublishedSite,
9987
RegisteredScriptList,
100-
RemovedItems,
10188
ScriptApply,
10289
ScriptApplyList,
10390
ScriptApplyLocation,
91+
Scripts,
10492
Site,
10593
SiteActivityLogItem,
10694
SiteActivityLogItemResourceOperation,
10795
SiteActivityLogItemUser,
10896
SiteActivityLogResponse,
109-
SitePublish,
110-
SitePublishPayload,
111-
Sites,
11297
Sku,
11398
SkuFieldData,
11499
SkuFieldDataCompareAtPrice,
@@ -133,8 +118,6 @@
133118
UserLimitReached,
134119
UserList,
135120
UserStatus,
136-
UserWebhookPayload,
137-
UserWebhookPayloadTriggerType,
138121
UsersNotEnabled,
139122
Webhook,
140123
WebhookList,
@@ -152,7 +135,6 @@
152135
AccessGroupsListRequestSort,
153136
DomWriteNodesItem,
154137
InventoryUpdateRequestInventoryType,
155-
OrdersListRequestStatus,
156138
OrdersRefundRequestReason,
157139
ProductSkuCreateProduct,
158140
ProductSkuCreateProductFieldData,
@@ -207,7 +189,6 @@
207189
"CollectionItemFieldData",
208190
"CollectionItemList",
209191
"CollectionItemListPagination",
210-
"CollectionItemRemoved",
211192
"CollectionList",
212193
"CollectionListArrayItem",
213194
"ConflictError",
@@ -217,13 +198,13 @@
217198
"Dom",
218199
"DomWriteNodesItem",
219200
"Domain",
201+
"Domains",
220202
"DuplicateUserEmail",
221203
"EcommerceSettings",
222204
"Error",
223205
"ErrorDetailsItem",
224206
"Field",
225207
"FieldType",
226-
"Fields",
227208
"ForbiddenError",
228209
"Form",
229210
"FormField",
@@ -233,12 +214,9 @@
233214
"FormResponseSettings",
234215
"FormSubmission",
235216
"FormSubmissionList",
236-
"FormSubmissionTrigger",
237-
"FormSubmissionTriggerPayload",
238217
"ImageNode",
239218
"InternalServerError",
240219
"InvalidDomain",
241-
"InvalidScopes",
242220
"InventoryItem",
243221
"InventoryItemInventoryType",
244222
"InventoryUpdateRequestInventoryType",
@@ -268,18 +246,11 @@
268246
"OrderTotals",
269247
"OrderTotalsExtrasItem",
270248
"OrderTotalsExtrasItemType",
271-
"OrdersListRequestStatus",
272249
"OrdersRefundRequestReason",
273250
"Page",
274-
"PageCreatedWebhook",
275-
"PageDeletedWebhook",
276251
"PageList",
277-
"PageMetadataUpdatedWebhook",
278252
"PageOpenGraph",
279253
"PageSeo",
280-
"PageSeoGraphData",
281-
"PageSeoGraphDataOpenGraph",
282-
"PageSeoGraphDataSeo",
283254
"Pagination",
284255
"PaypalDetails",
285256
"Product",
@@ -301,21 +272,16 @@
301272
"ProductSkuCreateSkuFieldDataPrice",
302273
"ProductsCreateSkuResponse",
303274
"PublishStatus",
304-
"PublishedItems",
305-
"PublishedSite",
306275
"RegisteredScriptList",
307-
"RemovedItems",
308276
"ScriptApply",
309277
"ScriptApplyList",
310278
"ScriptApplyLocation",
279+
"Scripts",
311280
"Site",
312281
"SiteActivityLogItem",
313282
"SiteActivityLogItemResourceOperation",
314283
"SiteActivityLogItemUser",
315284
"SiteActivityLogResponse",
316-
"SitePublish",
317-
"SitePublishPayload",
318-
"Sites",
319285
"Sku",
320286
"SkuFieldData",
321287
"SkuFieldDataCompareAtPrice",
@@ -342,8 +308,6 @@
342308
"UserLimitReached",
343309
"UserList",
344310
"UserStatus",
345-
"UserWebhookPayload",
346-
"UserWebhookPayloadTriggerType",
347311
"UsersListRequestSort",
348312
"UsersNotEnabled",
349313
"UsersUpdateRequestData",

src/webflow/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def __init__(
6565
self.collections = CollectionsClient(client_wrapper=self._client_wrapper)
6666
self.pages = PagesClient(client_wrapper=self._client_wrapper)
6767
self.scripts = ScriptsClient(client_wrapper=self._client_wrapper)
68-
self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
6968
self.assets = AssetsClient(client_wrapper=self._client_wrapper)
69+
self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
7070
self.forms = FormsClient(client_wrapper=self._client_wrapper)
7171
self.users = UsersClient(client_wrapper=self._client_wrapper)
7272
self.access_groups = AccessGroupsClient(client_wrapper=self._client_wrapper)
@@ -119,8 +119,8 @@ def __init__(
119119
self.collections = AsyncCollectionsClient(client_wrapper=self._client_wrapper)
120120
self.pages = AsyncPagesClient(client_wrapper=self._client_wrapper)
121121
self.scripts = AsyncScriptsClient(client_wrapper=self._client_wrapper)
122-
self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
123122
self.assets = AsyncAssetsClient(client_wrapper=self._client_wrapper)
123+
self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
124124
self.forms = AsyncFormsClient(client_wrapper=self._client_wrapper)
125125
self.users = AsyncUsersClient(client_wrapper=self._client_wrapper)
126126
self.access_groups = AsyncAccessGroupsClient(client_wrapper=self._client_wrapper)

src/webflow/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1414
headers: typing.Dict[str, str] = {
1515
"X-Fern-Language": "Python",
1616
"X-Fern-SDK-Name": "webflow",
17-
"X-Fern-SDK-Version": "v1.1.0",
17+
"X-Fern-SDK-Version": "v1.2.0",
1818
}
1919
headers["Authorization"] = f"Bearer {self._get_access_token()}"
2020
return headers

src/webflow/resources/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919
from .access_groups import AccessGroupsListRequestSort
2020
from .inventory import InventoryUpdateRequestInventoryType
21-
from .orders import OrdersListRequestStatus, OrdersRefundRequestReason
21+
from .orders import OrdersRefundRequestReason
2222
from .pages import DomWriteNodesItem
2323
from .products import (
2424
ProductSkuCreateProduct,
@@ -40,7 +40,6 @@
4040
"AccessGroupsListRequestSort",
4141
"DomWriteNodesItem",
4242
"InventoryUpdateRequestInventoryType",
43-
"OrdersListRequestStatus",
4443
"OrdersRefundRequestReason",
4544
"ProductSkuCreateProduct",
4645
"ProductSkuCreateProductFieldData",

src/webflow/resources/assets/client.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from ...types.asset_folder import AssetFolder
1919
from ...types.asset_folder_list import AssetFolderList
2020
from ...types.asset_upload import AssetUpload
21+
from ...types.assets import Assets
2122

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

35-
def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Asset]:
36+
def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assets:
3637
"""
3738
List assets for a given site </br></br> Required scope | `assets:read`
3839
@@ -71,7 +72,7 @@ def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions]
7172
else 60,
7273
)
7374
if 200 <= _response.status_code < 300:
74-
return pydantic.parse_obj_as(typing.List[Asset], _response.json()) # type: ignore
75+
return pydantic.parse_obj_as(Assets, _response.json()) # type: ignore
7576
if _response.status_code == 400:
7677
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
7778
if _response.status_code == 401:
@@ -298,7 +299,7 @@ def update(
298299
)
299300
client.assets.update(
300301
asset_id="asset_id",
301-
display_name="file.png",
302+
display_name="bulldoze.png",
302303
)
303304
"""
304305
_response = self._client_wrapper.httpx_client.request(
@@ -540,9 +541,7 @@ class AsyncAssetsClient:
540541
def __init__(self, *, client_wrapper: AsyncClientWrapper):
541542
self._client_wrapper = client_wrapper
542543

543-
async def list(
544-
self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None
545-
) -> typing.List[Asset]:
544+
async def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Assets:
546545
"""
547546
List assets for a given site </br></br> Required scope | `assets:read`
548547
@@ -581,7 +580,7 @@ async def list(
581580
else 60,
582581
)
583582
if 200 <= _response.status_code < 300:
584-
return pydantic.parse_obj_as(typing.List[Asset], _response.json()) # type: ignore
583+
return pydantic.parse_obj_as(Assets, _response.json()) # type: ignore
585584
if _response.status_code == 400:
586585
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
587586
if _response.status_code == 401:
@@ -808,7 +807,7 @@ async def update(
808807
)
809808
await client.assets.update(
810809
asset_id="asset_id",
811-
display_name="file.png",
810+
display_name="bulldoze.png",
812811
)
813812
"""
814813
_response = await self._client_wrapper.httpx_client.request(

0 commit comments

Comments
 (0)