From 794b7ecd422f7ceca18174978b2e060c6d172c19 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 21:07:54 +0000 Subject: [PATCH] SDK regeneration --- .fern/metadata.json | 6 +- poetry.lock | 102 +- pyproject.toml | 2 +- reference.md | 443 ++++++++- src/webflow/__init__.py | 36 +- src/webflow/core/client_wrapper.py | 4 +- src/webflow/resources/__init__.py | 4 +- src/webflow/resources/assets/client.py | 84 +- src/webflow/resources/assets/raw_client.py | 78 +- .../collections/resources/items/client.py | 52 +- .../collections/resources/items/raw_client.py | 60 ++ .../items_list_items_live_request_sort_by.py | 4 +- .../types/items_list_items_request_sort_by.py | 4 +- src/webflow/resources/components/client.py | 16 +- .../resources/components/raw_client.py | 16 +- src/webflow/resources/pages/client.py | 16 +- src/webflow/resources/pages/raw_client.py | 16 +- src/webflow/resources/sites/__init__.py | 7 +- src/webflow/resources/sites/client.py | 43 +- src/webflow/resources/sites/raw_client.py | 24 +- .../resources/sites/resources/__init__.py | 4 +- .../sites/resources/comments/client.py | 12 +- .../sites/resources/comments/raw_client.py | 12 +- .../sites/resources/google_tag/__init__.py | 4 + .../sites/resources/google_tag/client.py | 388 ++++++++ .../sites/resources/google_tag/raw_client.py | 869 ++++++++++++++++++ src/webflow/resources/sites/types/__init__.py | 8 +- .../sites/types/sites_publish_response.py | 6 + .../sites_publish_response_publish_scope.py | 5 + src/webflow/types/__init__.py | 35 +- src/webflow/types/comment_payload.py | 9 +- src/webflow/types/component_property.py | 44 +- src/webflow/types/component_property_text.py | 45 + .../types/component_property_text_type.py | 5 + src/webflow/types/component_property_type.py | 5 - ...field_validations_additional_properties.py | 8 +- src/webflow/types/google_tag_id.py | 42 + src/webflow/types/google_tag_ids.py | 30 + ...tems_list_items_live_request_created_on.py | 28 + ...ms_list_items_live_request_last_updated.py | 28 + ...=> items_list_items_request_created_on.py} | 17 +- .../items_list_items_request_last_updated.py | 28 + src/webflow/types/site_publish_payload.py | 13 +- .../site_publish_payload_publish_scope.py | 5 + 44 files changed, 2430 insertions(+), 237 deletions(-) create mode 100644 src/webflow/resources/sites/resources/google_tag/__init__.py create mode 100644 src/webflow/resources/sites/resources/google_tag/client.py create mode 100644 src/webflow/resources/sites/resources/google_tag/raw_client.py create mode 100644 src/webflow/resources/sites/types/sites_publish_response_publish_scope.py create mode 100644 src/webflow/types/component_property_text.py create mode 100644 src/webflow/types/component_property_text_type.py delete mode 100644 src/webflow/types/component_property_type.py create mode 100644 src/webflow/types/google_tag_id.py create mode 100644 src/webflow/types/google_tag_ids.py create mode 100644 src/webflow/types/items_list_items_live_request_created_on.py create mode 100644 src/webflow/types/items_list_items_live_request_last_updated.py rename src/webflow/types/{field_validations_additional_properties_additional_properties.py => items_list_items_request_created_on.py} (58%) create mode 100644 src/webflow/types/items_list_items_request_last_updated.py create mode 100644 src/webflow/types/site_publish_payload_publish_scope.py diff --git a/.fern/metadata.json b/.fern/metadata.json index 44a2882..a259f26 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "4.22.0", + "cliVersion": "4.65.1", "generatorName": "fernapi/fern-python-sdk", "generatorVersion": "4.63.4", "generatorConfig": { @@ -9,6 +9,6 @@ "use_str_enums": false } }, - "originGitCommit": "3ad89f5558f1774e8535f034a87bfe8c2fdfcd50", - "sdkVersion": "2.0.0" + "originGitCommit": "549d014f65c12ff88077dea2ce7f398297b0a3cd", + "sdkVersion": "2.0.1" } \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 83fdc8b..aa94f30 100644 --- a/poetry.lock +++ b/poetry.lock @@ -236,13 +236,13 @@ files = [ [[package]] name = "packaging" -version = "26.0" +version = "26.1" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529"}, - {file = "packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4"}, + {file = "packaging-26.1-py3-none-any.whl", hash = "sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f"}, + {file = "packaging-26.1.tar.gz", hash = "sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de"}, ] [[package]] @@ -517,58 +517,58 @@ files = [ [[package]] name = "tomli" -version = "2.4.0" +version = "2.4.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867"}, - {file = "tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9"}, - {file = "tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95"}, - {file = "tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76"}, - {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d"}, - {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576"}, - {file = "tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a"}, - {file = "tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa"}, - {file = "tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614"}, - {file = "tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1"}, - {file = "tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8"}, - {file = "tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a"}, - {file = "tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1"}, - {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b"}, - {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51"}, - {file = "tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729"}, - {file = "tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da"}, - {file = "tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3"}, - {file = "tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0"}, - {file = "tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e"}, - {file = "tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4"}, - {file = "tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e"}, - {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c"}, - {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f"}, - {file = "tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86"}, - {file = "tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87"}, - {file = "tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132"}, - {file = "tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6"}, - {file = "tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc"}, - {file = "tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66"}, - {file = "tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d"}, - {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702"}, - {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8"}, - {file = "tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776"}, - {file = "tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475"}, - {file = "tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2"}, - {file = "tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9"}, - {file = "tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0"}, - {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df"}, - {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d"}, - {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f"}, - {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b"}, - {file = "tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087"}, - {file = "tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd"}, - {file = "tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4"}, - {file = "tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a"}, - {file = "tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c"}, + {file = "tomli-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30"}, + {file = "tomli-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a"}, + {file = "tomli-2.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076"}, + {file = "tomli-2.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9"}, + {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c"}, + {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc"}, + {file = "tomli-2.4.1-cp311-cp311-win32.whl", hash = "sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049"}, + {file = "tomli-2.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e"}, + {file = "tomli-2.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece"}, + {file = "tomli-2.4.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a"}, + {file = "tomli-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085"}, + {file = "tomli-2.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9"}, + {file = "tomli-2.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5"}, + {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585"}, + {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1"}, + {file = "tomli-2.4.1-cp312-cp312-win32.whl", hash = "sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917"}, + {file = "tomli-2.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9"}, + {file = "tomli-2.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257"}, + {file = "tomli-2.4.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54"}, + {file = "tomli-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a"}, + {file = "tomli-2.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897"}, + {file = "tomli-2.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f"}, + {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d"}, + {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5"}, + {file = "tomli-2.4.1-cp313-cp313-win32.whl", hash = "sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd"}, + {file = "tomli-2.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36"}, + {file = "tomli-2.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd"}, + {file = "tomli-2.4.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf"}, + {file = "tomli-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac"}, + {file = "tomli-2.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662"}, + {file = "tomli-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853"}, + {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15"}, + {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba"}, + {file = "tomli-2.4.1-cp314-cp314-win32.whl", hash = "sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6"}, + {file = "tomli-2.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7"}, + {file = "tomli-2.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232"}, + {file = "tomli-2.4.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4"}, + {file = "tomli-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c"}, + {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d"}, + {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41"}, + {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c"}, + {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f"}, + {file = "tomli-2.4.1-cp314-cp314t-win32.whl", hash = "sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8"}, + {file = "tomli-2.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26"}, + {file = "tomli-2.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396"}, + {file = "tomli-2.4.1-py3-none-any.whl", hash = "sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe"}, + {file = "tomli-2.4.1.tar.gz", hash = "sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 786103a..2aa101e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "webflow" -version = "2.0.0" +version = "2.0.1" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index fbfbd16..b25a33d 100644 --- a/reference.md +++ b/reference.md @@ -630,10 +630,15 @@ client.sites.get_custom_domain(
-Publishes a site to one or more more domains. +Publishes a site or an individual page to one or more domains. +If multiple individual pages are published to staging, publishing from staging to production publishes all staged changes. To publish to a specific custom domain, use the domain IDs from the [Get Custom Domains](/data/reference/sites/get-custom-domain) endpoint. +You must include at least one of the `customDomains` or `publishToWebflowSubdomain` properties in the request body. + +To publish an individual page instead of the entire site, provide the ID of the page in the `pageId` parameter. + This endpoint has a specific rate limit of one successful publish queue per minute. Required scope | `sites:write` @@ -706,6 +711,14 @@ client.sites.publish(
+**page_id:** `typing.Optional[str]` — The ID of the page to publish + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -1147,7 +1160,7 @@ client.pages.list( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization)
@@ -1251,7 +1264,7 @@ client.pages.get_metadata( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) @@ -1352,7 +1365,7 @@ client.pages.update_page_settings( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) @@ -1481,7 +1494,7 @@ client.pages.get_content( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) @@ -1826,7 +1839,7 @@ client.components.get_content( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) @@ -1987,7 +2000,7 @@ client.components.update_content( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) @@ -2097,7 +2110,7 @@ client.components.get_properties( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) @@ -2244,7 +2257,7 @@ client.components.update_properties( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) @@ -2637,6 +2650,7 @@ client = Webflow( client.assets.list( site_id="580e63e98c9a982ac9b8b741", + locale_id="65427cf400e02b306eaa04a0", offset=1, limit=1, ) @@ -2663,6 +2677,18 @@ client.assets.list(
+**locale_id:** `typing.Optional[str]` + +Unique identifier for a specific Locale. + +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + +
+
+ +
+
+ **offset:** `typing.Optional[int]` — Offset used for pagination if the results have more than limit records
@@ -2840,6 +2866,7 @@ client = Webflow( client.assets.get( asset_id="580e63fc8c9a982ac9b8b745", + locale_id="65427cf400e02b306eaa04a0", ) ``` @@ -2864,6 +2891,18 @@ client.assets.get(
+**locale_id:** `typing.Optional[str]` + +Unique identifier for a specific Locale. + +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -2990,6 +3029,7 @@ client = Webflow( client.assets.update( asset_id="580e63fc8c9a982ac9b8b745", + locale_id="65427cf400e02b306eaa04a0", ) ``` @@ -3014,7 +3054,19 @@ client.assets.update(
-**locale_id:** `typing.Optional[str]` — Unique identifier for a specific locale. Applicable, when using localization. +**locale_id:** `typing.Optional[str]` + +Unique identifier for a specific Locale. + +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + +
+
+ +
+
+ +**display_name:** `typing.Optional[str]` — A human readable name for the asset. This value is not localizable.
@@ -3022,7 +3074,7 @@ client.assets.update(
-**display_name:** `typing.Optional[str]` — A human readable name for the asset +**alt_text:** `typing.Optional[str]` — Alternate text describing the image
@@ -6003,7 +6055,7 @@ client.collections.items.list_items( limit=1, name="name", slug="slug", - sort_by="lastPublished", + sort_by="createdOn", sort_order="asc", ) @@ -6069,6 +6121,14 @@ client.collections.items.list_items(
+**created_on:** `typing.Optional[ItemsListItemsRequestCreatedOn]` — Filter by the creation date of the item(s) + +
+
+ +
+
+ **last_published:** `typing.Optional[ItemsListItemsRequestLastPublished]` — Filter by the last published date of the item(s)
@@ -6077,6 +6137,14 @@ client.collections.items.list_items(
+**last_updated:** `typing.Optional[ItemsListItemsRequestLastUpdated]` — Filter by the last updated date of the item(s) + +
+
+ +
+
+ **sort_by:** `typing.Optional[ItemsListItemsRequestSortBy]` — Sort results by the provided value
@@ -6477,7 +6545,7 @@ client.collections.items.list_items_live( limit=1, name="name", slug="slug", - sort_by="lastPublished", + sort_by="createdOn", sort_order="asc", ) @@ -6543,6 +6611,14 @@ client.collections.items.list_items_live(
+**created_on:** `typing.Optional[ItemsListItemsLiveRequestCreatedOn]` — Filter by the creation date of the item(s) + +
+
+ +
+
+ **last_published:** `typing.Optional[ItemsListItemsLiveRequestLastPublished]` — Filter by the last published date of the item(s)
@@ -6551,6 +6627,14 @@ client.collections.items.list_items_live(
+**last_updated:** `typing.Optional[ItemsListItemsLiveRequestLastUpdated]` — Filter by the last updated date of the item(s) + +
+
+ +
+
+ **sort_by:** `typing.Optional[ItemsListItemsLiveRequestSortBy]` — Sort results by the provided value
@@ -8975,6 +9059,333 @@ client.sites.well_known.delete(
+ +
+ + +## Sites GoogleTag +
client.sites.google_tag.list(...) -> GoogleTagIds +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List all Google Tag IDs configured for a site, sorted by order. + +Required scope: `sites:read` +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from webflow import Webflow +from webflow.environment import WebflowEnvironment + +client = Webflow( + access_token="", + environment=WebflowEnvironment.DATA_API, +) + +client.sites.google_tag.list( + site_id="580e63e98c9a982ac9b8b741", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**site_id:** `str` — Unique identifier for a Site + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sites.google_tag.delete_all(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete all Google Tag IDs from a site. + +Required scope: `sites:write` +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from webflow import Webflow +from webflow.environment import WebflowEnvironment + +client = Webflow( + access_token="", + environment=WebflowEnvironment.DATA_API, +) + +client.sites.google_tag.delete_all( + site_id="580e63e98c9a982ac9b8b741", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**site_id:** `str` — Unique identifier for a Site + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sites.google_tag.upsert(...) -> GoogleTagIds +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add or update Google Tag IDs for a site. Existing tags not referenced in the request are preserved. A site may have a maximum of 25 tags total. + +`order` is optional on input — it is auto-assigned for new tags and returned on all tags in the response. + +Required scope: `sites:write` +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from webflow import Webflow, GoogleTagId +from webflow.environment import WebflowEnvironment + +client = Webflow( + access_token="", + environment=WebflowEnvironment.DATA_API, +) + +client.sites.google_tag.upsert( + site_id="580e63e98c9a982ac9b8b741", + google_tag_ids=[ + GoogleTagId( + order=0, + display_name="Main Analytics Tag", + tag_id="G-1234567890", + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**site_id:** `str` — Unique identifier for a Site + +
+
+ +
+
+ +**request:** `GoogleTagIds` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sites.google_tag.delete(...) -> GoogleTagIds +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a single Google Tag ID from a site. The `order` values of the remaining tags are renormalized after deletion. + +Required scope: `sites:write` +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from webflow import Webflow +from webflow.environment import WebflowEnvironment + +client = Webflow( + access_token="", + environment=WebflowEnvironment.DATA_API, +) + +client.sites.google_tag.delete( + site_id="580e63e98c9a982ac9b8b741", + tag_id="G-XXXXXXXXXX", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**site_id:** `str` — Unique identifier for a Site + +
+
+ +
+
+ +**tag_id:** `str` — The Google Tag ID (e.g. G-XXXXXXXXXX) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -9152,7 +9563,7 @@ client.sites.comments.list_comment_threads( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization)
@@ -9289,7 +9700,7 @@ client.sites.comments.get_comment_thread( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization)
@@ -9426,7 +9837,7 @@ client.sites.comments.list_comment_replies( Unique identifier for a specific Locale. -[Lear more about localization.](/data/v2.0.0/docs/working-with-localization) +[Learn more about localization.](/data/v2.0.0/docs/working-with-localization)
diff --git a/src/webflow/__init__.py b/src/webflow/__init__.py index 48d0673..27b6c41 100644 --- a/src/webflow/__init__.py +++ b/src/webflow/__init__.py @@ -67,7 +67,8 @@ ComponentNode, ComponentProperties, ComponentProperty, - ComponentPropertyType, + ComponentPropertyText, + ComponentPropertyTextType, Conflict, CustomCodeBlock, CustomCodeBlockType, @@ -87,7 +88,6 @@ FieldType, FieldValidations, FieldValidationsAdditionalProperties, - FieldValidationsAdditionalPropertiesAdditionalProperties, ForbiddenErrorBody, Form, FormField, @@ -101,14 +101,20 @@ FormSubmissionTriggerPayload, FormSubmissionTriggerPayloadSchemaItem, FormSubmissionTriggerPayloadSchemaItemFieldType, + GoogleTagId, + GoogleTagIds, ImageNode, ImageNodeImage, InvalidDomain, InvalidScopes, InventoryItem, InventoryItemInventoryType, + ItemsListItemsLiveRequestCreatedOn, ItemsListItemsLiveRequestLastPublished, + ItemsListItemsLiveRequestLastUpdated, + ItemsListItemsRequestCreatedOn, ItemsListItemsRequestLastPublished, + ItemsListItemsRequestLastUpdated, ListCustomCodeBlocks, Locale, Locales, @@ -209,6 +215,7 @@ SitePlanName, SitePublish, SitePublishPayload, + SitePublishPayloadPublishScope, Sites, Sku, SkuFieldData, @@ -300,6 +307,7 @@ ProductSkuCreateSku, ProductsCreateSkuResponse, SitesPublishResponse, + SitesPublishResponsePublishScope, UpdateStaticContentResponse, assets, collections, @@ -384,7 +392,8 @@ "ComponentProperties": ".types", "ComponentPropertiesWritePropertiesItem": ".resources", "ComponentProperty": ".types", - "ComponentPropertyType": ".types", + "ComponentPropertyText": ".types", + "ComponentPropertyTextType": ".types", "ComponentsUpdateContentResponse": ".resources", "ComponentsUpdatePropertiesResponse": ".resources", "Conflict": ".types", @@ -408,7 +417,6 @@ "FieldType": ".types", "FieldValidations": ".types", "FieldValidationsAdditionalProperties": ".types", - "FieldValidationsAdditionalPropertiesAdditionalProperties": ".types", "ForbiddenError": ".errors", "ForbiddenErrorBody": ".types", "Form": ".types", @@ -423,6 +431,8 @@ "FormSubmissionTriggerPayload": ".types", "FormSubmissionTriggerPayloadSchemaItem": ".types", "FormSubmissionTriggerPayloadSchemaItemFieldType": ".types", + "GoogleTagId": ".types", + "GoogleTagIds": ".types", "ImageNode": ".types", "ImageNodeImage": ".types", "InternalServerError": ".errors", @@ -431,8 +441,12 @@ "InventoryItem": ".types", "InventoryItemInventoryType": ".types", "InventoryUpdateRequestInventoryType": ".resources", + "ItemsListItemsLiveRequestCreatedOn": ".types", "ItemsListItemsLiveRequestLastPublished": ".types", + "ItemsListItemsLiveRequestLastUpdated": ".types", + "ItemsListItemsRequestCreatedOn": ".types", "ItemsListItemsRequestLastPublished": ".types", + "ItemsListItemsRequestLastUpdated": ".types", "ListCustomCodeBlocks": ".types", "Locale": ".types", "Locales": ".types", @@ -542,8 +556,10 @@ "SitePlanName": ".types", "SitePublish": ".types", "SitePublishPayload": ".types", + "SitePublishPayloadPublishScope": ".types", "Sites": ".types", "SitesPublishResponse": ".resources", + "SitesPublishResponsePublishScope": ".resources", "Sku": ".types", "SkuFieldData": ".types", "SkuFieldDataCompareAtPrice": ".types", @@ -717,7 +733,8 @@ def __dir__(): "ComponentProperties", "ComponentPropertiesWritePropertiesItem", "ComponentProperty", - "ComponentPropertyType", + "ComponentPropertyText", + "ComponentPropertyTextType", "ComponentsUpdateContentResponse", "ComponentsUpdatePropertiesResponse", "Conflict", @@ -741,7 +758,6 @@ def __dir__(): "FieldType", "FieldValidations", "FieldValidationsAdditionalProperties", - "FieldValidationsAdditionalPropertiesAdditionalProperties", "ForbiddenError", "ForbiddenErrorBody", "Form", @@ -756,6 +772,8 @@ def __dir__(): "FormSubmissionTriggerPayload", "FormSubmissionTriggerPayloadSchemaItem", "FormSubmissionTriggerPayloadSchemaItemFieldType", + "GoogleTagId", + "GoogleTagIds", "ImageNode", "ImageNodeImage", "InternalServerError", @@ -764,8 +782,12 @@ def __dir__(): "InventoryItem", "InventoryItemInventoryType", "InventoryUpdateRequestInventoryType", + "ItemsListItemsLiveRequestCreatedOn", "ItemsListItemsLiveRequestLastPublished", + "ItemsListItemsLiveRequestLastUpdated", + "ItemsListItemsRequestCreatedOn", "ItemsListItemsRequestLastPublished", + "ItemsListItemsRequestLastUpdated", "ListCustomCodeBlocks", "Locale", "Locales", @@ -875,8 +897,10 @@ def __dir__(): "SitePlanName", "SitePublish", "SitePublishPayload", + "SitePublishPayloadPublishScope", "Sites", "SitesPublishResponse", + "SitesPublishResponsePublishScope", "Sku", "SkuFieldData", "SkuFieldDataCompareAtPrice", diff --git a/src/webflow/core/client_wrapper.py b/src/webflow/core/client_wrapper.py index 7f6db17..3839879 100644 --- a/src/webflow/core/client_wrapper.py +++ b/src/webflow/core/client_wrapper.py @@ -28,12 +28,12 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "webflow/2.0.0", + "User-Agent": "webflow/2.0.1", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "webflow", - "X-Fern-SDK-Version": "2.0.0", + "X-Fern-SDK-Version": "2.0.1", **(self.get_custom_headers() or {}), } headers["Authorization"] = f"Bearer {self._get_access_token()}" diff --git a/src/webflow/resources/__init__.py b/src/webflow/resources/__init__.py index 7eea249..389ce9a 100644 --- a/src/webflow/resources/__init__.py +++ b/src/webflow/resources/__init__.py @@ -37,7 +37,7 @@ UpdateStaticContentResponse, ) from .products import ProductSkuCreateProduct, ProductSkuCreateSku, ProductsCreateSkuResponse - from .sites import SitesPublishResponse + from .sites import SitesPublishResponse, SitesPublishResponsePublishScope _dynamic_imports: typing.Dict[str, str] = { "ComponentDomWriteNodesItem": ".components", "ComponentPropertiesWritePropertiesItem": ".components", @@ -54,6 +54,7 @@ "ProductSkuCreateSku": ".products", "ProductsCreateSkuResponse": ".products", "SitesPublishResponse": ".sites", + "SitesPublishResponsePublishScope": ".sites", "UpdateStaticContentResponse": ".pages", "assets": ".assets", "collections": ".collections", @@ -109,6 +110,7 @@ def __dir__(): "ProductSkuCreateSku", "ProductsCreateSkuResponse", "SitesPublishResponse", + "SitesPublishResponsePublishScope", "UpdateStaticContentResponse", "assets", "collections", diff --git a/src/webflow/resources/assets/client.py b/src/webflow/resources/assets/client.py index ae22ab4..aa1f215 100644 --- a/src/webflow/resources/assets/client.py +++ b/src/webflow/resources/assets/client.py @@ -34,6 +34,7 @@ def list( self, site_id: str, *, + locale_id: typing.Optional[str] = None, offset: typing.Optional[int] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -48,6 +49,11 @@ def list( site_id : str Unique identifier for a Site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -71,11 +77,14 @@ def list( ) client.assets.list( site_id="580e63e98c9a982ac9b8b741", + locale_id="65427cf400e02b306eaa04a0", offset=1, limit=1, ) """ - _response = self._raw_client.list(site_id, offset=offset, limit=limit, request_options=request_options) + _response = self._raw_client.list( + site_id, locale_id=locale_id, offset=offset, limit=limit, request_options=request_options + ) return _response.data def create( @@ -145,7 +154,13 @@ def create( ) return _response.data - def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Asset: + def get( + self, + asset_id: str, + *, + locale_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Asset: """ Get details about an asset @@ -156,6 +171,11 @@ def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] asset_id : str Unique identifier for an Asset on a site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -173,9 +193,10 @@ def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] ) client.assets.get( asset_id="580e63fc8c9a982ac9b8b745", + locale_id="65427cf400e02b306eaa04a0", ) """ - _response = self._raw_client.get(asset_id, request_options=request_options) + _response = self._raw_client.get(asset_id, locale_id=locale_id, request_options=request_options) return _response.data def delete(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: @@ -214,8 +235,9 @@ def update( self, asset_id: str, *, - locale_id: typing.Optional[str] = OMIT, + locale_id: typing.Optional[str] = None, display_name: typing.Optional[str] = OMIT, + alt_text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Asset: """ @@ -229,10 +251,15 @@ def update( Unique identifier for an Asset on a site locale_id : typing.Optional[str] - Unique identifier for a specific locale. Applicable, when using localization. + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) display_name : typing.Optional[str] - A human readable name for the asset + A human readable name for the asset. This value is not localizable. + + alt_text : typing.Optional[str] + Alternate text describing the image request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -251,10 +278,11 @@ def update( ) client.assets.update( asset_id="580e63fc8c9a982ac9b8b745", + locale_id="65427cf400e02b306eaa04a0", ) """ _response = self._raw_client.update( - asset_id, locale_id=locale_id, display_name=display_name, request_options=request_options + asset_id, locale_id=locale_id, display_name=display_name, alt_text=alt_text, request_options=request_options ) return _response.data @@ -395,6 +423,7 @@ async def list( self, site_id: str, *, + locale_id: typing.Optional[str] = None, offset: typing.Optional[int] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -409,6 +438,11 @@ async def list( site_id : str Unique identifier for a Site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -437,6 +471,7 @@ async def list( async def main() -> None: await client.assets.list( site_id="580e63e98c9a982ac9b8b741", + locale_id="65427cf400e02b306eaa04a0", offset=1, limit=1, ) @@ -444,7 +479,9 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list(site_id, offset=offset, limit=limit, request_options=request_options) + _response = await self._raw_client.list( + site_id, locale_id=locale_id, offset=offset, limit=limit, request_options=request_options + ) return _response.data async def create( @@ -522,7 +559,13 @@ async def main() -> None: ) return _response.data - async def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Asset: + async def get( + self, + asset_id: str, + *, + locale_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Asset: """ Get details about an asset @@ -533,6 +576,11 @@ async def get(self, asset_id: str, *, request_options: typing.Optional[RequestOp asset_id : str Unique identifier for an Asset on a site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -555,12 +603,13 @@ async def get(self, asset_id: str, *, request_options: typing.Optional[RequestOp async def main() -> None: await client.assets.get( asset_id="580e63fc8c9a982ac9b8b745", + locale_id="65427cf400e02b306eaa04a0", ) asyncio.run(main()) """ - _response = await self._raw_client.get(asset_id, request_options=request_options) + _response = await self._raw_client.get(asset_id, locale_id=locale_id, request_options=request_options) return _response.data async def delete(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: @@ -607,8 +656,9 @@ async def update( self, asset_id: str, *, - locale_id: typing.Optional[str] = OMIT, + locale_id: typing.Optional[str] = None, display_name: typing.Optional[str] = OMIT, + alt_text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> Asset: """ @@ -622,10 +672,15 @@ async def update( Unique identifier for an Asset on a site locale_id : typing.Optional[str] - Unique identifier for a specific locale. Applicable, when using localization. + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) display_name : typing.Optional[str] - A human readable name for the asset + A human readable name for the asset. This value is not localizable. + + alt_text : typing.Optional[str] + Alternate text describing the image request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -649,13 +704,14 @@ async def update( async def main() -> None: await client.assets.update( asset_id="580e63fc8c9a982ac9b8b745", + locale_id="65427cf400e02b306eaa04a0", ) asyncio.run(main()) """ _response = await self._raw_client.update( - asset_id, locale_id=locale_id, display_name=display_name, request_options=request_options + asset_id, locale_id=locale_id, display_name=display_name, alt_text=alt_text, request_options=request_options ) return _response.data diff --git a/src/webflow/resources/assets/raw_client.py b/src/webflow/resources/assets/raw_client.py index 5c99d98..ece9f5c 100644 --- a/src/webflow/resources/assets/raw_client.py +++ b/src/webflow/resources/assets/raw_client.py @@ -35,6 +35,7 @@ def list( self, site_id: str, *, + locale_id: typing.Optional[str] = None, offset: typing.Optional[int] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -49,6 +50,11 @@ def list( site_id : str Unique identifier for a Site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -68,6 +74,7 @@ def list( base_url=self._client_wrapper.get_environment().base, method="GET", params={ + "localeId": locale_id, "offset": offset, "limit": limit, }, @@ -281,7 +288,13 @@ def create( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Asset]: + def get( + self, + asset_id: str, + *, + locale_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[Asset]: """ Get details about an asset @@ -292,6 +305,11 @@ def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] asset_id : str Unique identifier for an Asset on a site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -304,6 +322,9 @@ def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] f"assets/{jsonable_encoder(asset_id)}", base_url=self._client_wrapper.get_environment().base, method="GET", + params={ + "localeId": locale_id, + }, request_options=request_options, ) try: @@ -475,8 +496,9 @@ def update( self, asset_id: str, *, - locale_id: typing.Optional[str] = OMIT, + locale_id: typing.Optional[str] = None, display_name: typing.Optional[str] = OMIT, + alt_text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Asset]: """ @@ -490,10 +512,15 @@ def update( Unique identifier for an Asset on a site locale_id : typing.Optional[str] - Unique identifier for a specific locale. Applicable, when using localization. + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) display_name : typing.Optional[str] - A human readable name for the asset + A human readable name for the asset. This value is not localizable. + + alt_text : typing.Optional[str] + Alternate text describing the image request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -507,9 +534,12 @@ def update( f"assets/{jsonable_encoder(asset_id)}", base_url=self._client_wrapper.get_environment().base, method="PATCH", - json={ + params={ "localeId": locale_id, + }, + json={ "displayName": display_name, + "altText": alt_text, }, headers={ "content-type": "application/json", @@ -922,6 +952,7 @@ async def list( self, site_id: str, *, + locale_id: typing.Optional[str] = None, offset: typing.Optional[int] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -936,6 +967,11 @@ async def list( site_id : str Unique identifier for a Site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -955,6 +991,7 @@ async def list( base_url=self._client_wrapper.get_environment().base, method="GET", params={ + "localeId": locale_id, "offset": offset, "limit": limit, }, @@ -1169,7 +1206,11 @@ async def create( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def get( - self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + asset_id: str, + *, + locale_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Asset]: """ Get details about an asset @@ -1181,6 +1222,11 @@ async def get( asset_id : str Unique identifier for an Asset on a site + locale_id : typing.Optional[str] + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1193,6 +1239,9 @@ async def get( f"assets/{jsonable_encoder(asset_id)}", base_url=self._client_wrapper.get_environment().base, method="GET", + params={ + "localeId": locale_id, + }, request_options=request_options, ) try: @@ -1366,8 +1415,9 @@ async def update( self, asset_id: str, *, - locale_id: typing.Optional[str] = OMIT, + locale_id: typing.Optional[str] = None, display_name: typing.Optional[str] = OMIT, + alt_text: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Asset]: """ @@ -1381,10 +1431,15 @@ async def update( Unique identifier for an Asset on a site locale_id : typing.Optional[str] - Unique identifier for a specific locale. Applicable, when using localization. + Unique identifier for a specific Locale. + + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) display_name : typing.Optional[str] - A human readable name for the asset + A human readable name for the asset. This value is not localizable. + + alt_text : typing.Optional[str] + Alternate text describing the image request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1398,9 +1453,12 @@ async def update( f"assets/{jsonable_encoder(asset_id)}", base_url=self._client_wrapper.get_environment().base, method="PATCH", - json={ + params={ "localeId": locale_id, + }, + json={ "displayName": display_name, + "altText": alt_text, }, headers={ "content-type": "application/json", diff --git a/src/webflow/resources/collections/resources/items/client.py b/src/webflow/resources/collections/resources/items/client.py index 16f1d5c..4606299 100644 --- a/src/webflow/resources/collections/resources/items/client.py +++ b/src/webflow/resources/collections/resources/items/client.py @@ -10,8 +10,12 @@ from .....types.collection_item_list_no_pagination import CollectionItemListNoPagination from .....types.collection_item_patch_single_field_data import CollectionItemPatchSingleFieldData from .....types.collection_item_with_id_input import CollectionItemWithIdInput +from .....types.items_list_items_live_request_created_on import ItemsListItemsLiveRequestCreatedOn from .....types.items_list_items_live_request_last_published import ItemsListItemsLiveRequestLastPublished +from .....types.items_list_items_live_request_last_updated import ItemsListItemsLiveRequestLastUpdated +from .....types.items_list_items_request_created_on import ItemsListItemsRequestCreatedOn from .....types.items_list_items_request_last_published import ItemsListItemsRequestLastPublished +from .....types.items_list_items_request_last_updated import ItemsListItemsRequestLastUpdated from .raw_client import AsyncRawItemsClient, RawItemsClient from .types.create_bulk_collection_item_request_body_field_data import CreateBulkCollectionItemRequestBodyFieldData from .types.items_create_item_live_request_body import ItemsCreateItemLiveRequestBody @@ -54,7 +58,9 @@ def list_items( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -84,9 +90,15 @@ def list_items( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsRequestSortBy] Sort results by the provided value @@ -115,7 +127,7 @@ def list_items( limit=1, name="name", slug="slug", - sort_by="lastPublished", + sort_by="createdOn", sort_order="asc", ) """ @@ -126,7 +138,9 @@ def list_items( limit=limit, name=name, slug=slug, + created_on=created_on, last_published=last_published, + last_updated=last_updated, sort_by=sort_by, sort_order=sort_order, request_options=request_options, @@ -345,7 +359,9 @@ def list_items_live( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsLiveRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsLiveRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsLiveRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsLiveRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsLiveRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -379,9 +395,15 @@ def list_items_live( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsLiveRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsLiveRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsLiveRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsLiveRequestSortBy] Sort results by the provided value @@ -410,7 +432,7 @@ def list_items_live( limit=1, name="name", slug="slug", - sort_by="lastPublished", + sort_by="createdOn", sort_order="asc", ) """ @@ -421,7 +443,9 @@ def list_items_live( limit=limit, name=name, slug=slug, + created_on=created_on, last_published=last_published, + last_updated=last_updated, sort_by=sort_by, sort_order=sort_order, request_options=request_options, @@ -1183,7 +1207,9 @@ async def list_items( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1213,9 +1239,15 @@ async def list_items( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsRequestSortBy] Sort results by the provided value @@ -1249,7 +1281,7 @@ async def main() -> None: limit=1, name="name", slug="slug", - sort_by="lastPublished", + sort_by="createdOn", sort_order="asc", ) @@ -1263,7 +1295,9 @@ async def main() -> None: limit=limit, name=name, slug=slug, + created_on=created_on, last_published=last_published, + last_updated=last_updated, sort_by=sort_by, sort_order=sort_order, request_options=request_options, @@ -1506,7 +1540,9 @@ async def list_items_live( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsLiveRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsLiveRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsLiveRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsLiveRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsLiveRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1540,9 +1576,15 @@ async def list_items_live( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsLiveRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsLiveRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsLiveRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsLiveRequestSortBy] Sort results by the provided value @@ -1576,7 +1618,7 @@ async def main() -> None: limit=1, name="name", slug="slug", - sort_by="lastPublished", + sort_by="createdOn", sort_order="asc", ) @@ -1590,7 +1632,9 @@ async def main() -> None: limit=limit, name=name, slug=slug, + created_on=created_on, last_published=last_published, + last_updated=last_updated, sort_by=sort_by, sort_order=sort_order, request_options=request_options, diff --git a/src/webflow/resources/collections/resources/items/raw_client.py b/src/webflow/resources/collections/resources/items/raw_client.py index 010bbfd..c676cc9 100644 --- a/src/webflow/resources/collections/resources/items/raw_client.py +++ b/src/webflow/resources/collections/resources/items/raw_client.py @@ -24,8 +24,12 @@ from .....types.collection_item_patch_single_field_data import CollectionItemPatchSingleFieldData from .....types.collection_item_with_id_input import CollectionItemWithIdInput from .....types.error import Error +from .....types.items_list_items_live_request_created_on import ItemsListItemsLiveRequestCreatedOn from .....types.items_list_items_live_request_last_published import ItemsListItemsLiveRequestLastPublished +from .....types.items_list_items_live_request_last_updated import ItemsListItemsLiveRequestLastUpdated +from .....types.items_list_items_request_created_on import ItemsListItemsRequestCreatedOn from .....types.items_list_items_request_last_published import ItemsListItemsRequestLastPublished +from .....types.items_list_items_request_last_updated import ItemsListItemsRequestLastUpdated from .types.create_bulk_collection_item_request_body_field_data import CreateBulkCollectionItemRequestBodyFieldData from .types.items_create_item_live_request_body import ItemsCreateItemLiveRequestBody from .types.items_create_item_request_body import ItemsCreateItemRequestBody @@ -57,7 +61,9 @@ def list_items( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -87,9 +93,15 @@ def list_items( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsRequestSortBy] Sort results by the provided value @@ -114,9 +126,15 @@ def list_items( "limit": limit, "name": name, "slug": slug, + "createdOn": convert_and_respect_annotation_metadata( + object_=created_on, annotation=ItemsListItemsRequestCreatedOn, direction="write" + ), "lastPublished": convert_and_respect_annotation_metadata( object_=last_published, annotation=ItemsListItemsRequestLastPublished, direction="write" ), + "lastUpdated": convert_and_respect_annotation_metadata( + object_=last_updated, annotation=ItemsListItemsRequestLastUpdated, direction="write" + ), "sortBy": sort_by, "sortOrder": sort_order, }, @@ -577,7 +595,9 @@ def list_items_live( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsLiveRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsLiveRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsLiveRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsLiveRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsLiveRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -611,9 +631,15 @@ def list_items_live( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsLiveRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsLiveRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsLiveRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsLiveRequestSortBy] Sort results by the provided value @@ -638,9 +664,15 @@ def list_items_live( "limit": limit, "name": name, "slug": slug, + "createdOn": convert_and_respect_annotation_metadata( + object_=created_on, annotation=ItemsListItemsLiveRequestCreatedOn, direction="write" + ), "lastPublished": convert_and_respect_annotation_metadata( object_=last_published, annotation=ItemsListItemsLiveRequestLastPublished, direction="write" ), + "lastUpdated": convert_and_respect_annotation_metadata( + object_=last_updated, annotation=ItemsListItemsLiveRequestLastUpdated, direction="write" + ), "sortBy": sort_by, "sortOrder": sort_order, }, @@ -2158,7 +2190,9 @@ async def list_items( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2188,9 +2222,15 @@ async def list_items( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsRequestSortBy] Sort results by the provided value @@ -2215,9 +2255,15 @@ async def list_items( "limit": limit, "name": name, "slug": slug, + "createdOn": convert_and_respect_annotation_metadata( + object_=created_on, annotation=ItemsListItemsRequestCreatedOn, direction="write" + ), "lastPublished": convert_and_respect_annotation_metadata( object_=last_published, annotation=ItemsListItemsRequestLastPublished, direction="write" ), + "lastUpdated": convert_and_respect_annotation_metadata( + object_=last_updated, annotation=ItemsListItemsRequestLastUpdated, direction="write" + ), "sortBy": sort_by, "sortOrder": sort_order, }, @@ -2678,7 +2724,9 @@ async def list_items_live( limit: typing.Optional[int] = None, name: typing.Optional[str] = None, slug: typing.Optional[str] = None, + created_on: typing.Optional[ItemsListItemsLiveRequestCreatedOn] = None, last_published: typing.Optional[ItemsListItemsLiveRequestLastPublished] = None, + last_updated: typing.Optional[ItemsListItemsLiveRequestLastUpdated] = None, sort_by: typing.Optional[ItemsListItemsLiveRequestSortBy] = None, sort_order: typing.Optional[ItemsListItemsLiveRequestSortOrder] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2712,9 +2760,15 @@ async def list_items_live( slug : typing.Optional[str] Filter by the exact slug of the item + created_on : typing.Optional[ItemsListItemsLiveRequestCreatedOn] + Filter by the creation date of the item(s) + last_published : typing.Optional[ItemsListItemsLiveRequestLastPublished] Filter by the last published date of the item(s) + last_updated : typing.Optional[ItemsListItemsLiveRequestLastUpdated] + Filter by the last updated date of the item(s) + sort_by : typing.Optional[ItemsListItemsLiveRequestSortBy] Sort results by the provided value @@ -2739,9 +2793,15 @@ async def list_items_live( "limit": limit, "name": name, "slug": slug, + "createdOn": convert_and_respect_annotation_metadata( + object_=created_on, annotation=ItemsListItemsLiveRequestCreatedOn, direction="write" + ), "lastPublished": convert_and_respect_annotation_metadata( object_=last_published, annotation=ItemsListItemsLiveRequestLastPublished, direction="write" ), + "lastUpdated": convert_and_respect_annotation_metadata( + object_=last_updated, annotation=ItemsListItemsLiveRequestLastUpdated, direction="write" + ), "sortBy": sort_by, "sortOrder": sort_order, }, diff --git a/src/webflow/resources/collections/resources/items/types/items_list_items_live_request_sort_by.py b/src/webflow/resources/collections/resources/items/types/items_list_items_live_request_sort_by.py index 9929480..655f308 100644 --- a/src/webflow/resources/collections/resources/items/types/items_list_items_live_request_sort_by.py +++ b/src/webflow/resources/collections/resources/items/types/items_list_items_live_request_sort_by.py @@ -2,4 +2,6 @@ import typing -ItemsListItemsLiveRequestSortBy = typing.Union[typing.Literal["lastPublished", "name", "slug"], typing.Any] +ItemsListItemsLiveRequestSortBy = typing.Union[ + typing.Literal["createdOn", "lastPublished", "lastUpdated", "name", "slug"], typing.Any +] diff --git a/src/webflow/resources/collections/resources/items/types/items_list_items_request_sort_by.py b/src/webflow/resources/collections/resources/items/types/items_list_items_request_sort_by.py index 222d1ff..1564f0e 100644 --- a/src/webflow/resources/collections/resources/items/types/items_list_items_request_sort_by.py +++ b/src/webflow/resources/collections/resources/items/types/items_list_items_request_sort_by.py @@ -2,4 +2,6 @@ import typing -ItemsListItemsRequestSortBy = typing.Union[typing.Literal["lastPublished", "name", "slug"], typing.Any] +ItemsListItemsRequestSortBy = typing.Union[ + typing.Literal["createdOn", "lastPublished", "lastUpdated", "name", "slug"], typing.Any +] diff --git a/src/webflow/resources/components/client.py b/src/webflow/resources/components/client.py index a9584d8..9658d82 100644 --- a/src/webflow/resources/components/client.py +++ b/src/webflow/resources/components/client.py @@ -117,7 +117,7 @@ def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -201,7 +201,7 @@ def update_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -321,7 +321,7 @@ def get_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -402,7 +402,7 @@ def update_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -559,7 +559,7 @@ async def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -651,7 +651,7 @@ async def update_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -779,7 +779,7 @@ async def get_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -868,7 +868,7 @@ async def update_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. diff --git a/src/webflow/resources/components/raw_client.py b/src/webflow/resources/components/raw_client.py index caf0799..78f6e7d 100644 --- a/src/webflow/resources/components/raw_client.py +++ b/src/webflow/resources/components/raw_client.py @@ -186,7 +186,7 @@ def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -329,7 +329,7 @@ def update_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -475,7 +475,7 @@ def get_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -615,7 +615,7 @@ def update_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -879,7 +879,7 @@ async def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -1022,7 +1022,7 @@ async def update_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -1168,7 +1168,7 @@ async def get_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. @@ -1308,7 +1308,7 @@ async def update_properties( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) branch_id : typing.Optional[str] Scope the operation to work on a specific branch. diff --git a/src/webflow/resources/pages/client.py b/src/webflow/resources/pages/client.py index 9f6f980..5ce0fbe 100644 --- a/src/webflow/resources/pages/client.py +++ b/src/webflow/resources/pages/client.py @@ -60,7 +60,7 @@ def list( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) @@ -115,7 +115,7 @@ def get_metadata( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -164,7 +164,7 @@ def update_page_settings( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) title : typing.Optional[str] Title for the page @@ -252,7 +252,7 @@ def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) @@ -447,7 +447,7 @@ async def list( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) @@ -510,7 +510,7 @@ async def get_metadata( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -567,7 +567,7 @@ async def update_page_settings( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) title : typing.Optional[str] Title for the page @@ -663,7 +663,7 @@ async def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) diff --git a/src/webflow/resources/pages/raw_client.py b/src/webflow/resources/pages/raw_client.py index 1287d92..6f423df 100644 --- a/src/webflow/resources/pages/raw_client.py +++ b/src/webflow/resources/pages/raw_client.py @@ -57,7 +57,7 @@ def list( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) @@ -178,7 +178,7 @@ def get_metadata( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -295,7 +295,7 @@ def update_page_settings( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) title : typing.Optional[str] Title for the page @@ -441,7 +441,7 @@ def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) @@ -724,7 +724,7 @@ async def list( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) @@ -845,7 +845,7 @@ async def get_metadata( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -962,7 +962,7 @@ async def update_page_settings( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) title : typing.Optional[str] Title for the page @@ -1108,7 +1108,7 @@ async def get_content( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) limit : typing.Optional[int] Maximum number of records to be returned (max limit: 100) diff --git a/src/webflow/resources/sites/__init__.py b/src/webflow/resources/sites/__init__.py index fb81115..580db67 100644 --- a/src/webflow/resources/sites/__init__.py +++ b/src/webflow/resources/sites/__init__.py @@ -6,7 +6,7 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .types import SitesPublishResponse + from .types import SitesPublishResponse, SitesPublishResponsePublishScope from .resources import ( CommentsGetCommentThreadRequestSortBy, CommentsGetCommentThreadRequestSortOrder, @@ -18,6 +18,7 @@ activity_logs, comments, forms, + google_tag, plans, redirects, robots_txt, @@ -32,10 +33,12 @@ "CommentsListCommentThreadsRequestSortBy": ".resources", "CommentsListCommentThreadsRequestSortOrder": ".resources", "SitesPublishResponse": ".types", + "SitesPublishResponsePublishScope": ".types", "WellKnownFileContentType": ".resources", "activity_logs": ".resources", "comments": ".resources", "forms": ".resources", + "google_tag": ".resources", "plans": ".resources", "redirects": ".resources", "robots_txt": ".resources", @@ -73,10 +76,12 @@ def __dir__(): "CommentsListCommentThreadsRequestSortBy", "CommentsListCommentThreadsRequestSortOrder", "SitesPublishResponse", + "SitesPublishResponsePublishScope", "WellKnownFileContentType", "activity_logs", "comments", "forms", + "google_tag", "plans", "redirects", "robots_txt", diff --git a/src/webflow/resources/sites/client.py b/src/webflow/resources/sites/client.py index 30b9ca2..2ad2d85 100644 --- a/src/webflow/resources/sites/client.py +++ b/src/webflow/resources/sites/client.py @@ -16,6 +16,7 @@ from .resources.activity_logs.client import ActivityLogsClient, AsyncActivityLogsClient from .resources.comments.client import AsyncCommentsClient, CommentsClient from .resources.forms.client import AsyncFormsClient, FormsClient + from .resources.google_tag.client import AsyncGoogleTagClient, GoogleTagClient from .resources.plans.client import AsyncPlansClient, PlansClient from .resources.redirects.client import AsyncRedirectsClient, RedirectsClient from .resources.robots_txt.client import AsyncRobotsTxtClient, RobotsTxtClient @@ -33,6 +34,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._plans: typing.Optional[PlansClient] = None self._robots_txt: typing.Optional[RobotsTxtClient] = None self._well_known: typing.Optional[WellKnownClient] = None + self._google_tag: typing.Optional[GoogleTagClient] = None self._activity_logs: typing.Optional[ActivityLogsClient] = None self._comments: typing.Optional[CommentsClient] = None self._scripts: typing.Optional[ScriptsClient] = None @@ -292,13 +294,19 @@ def publish( *, custom_domains: typing.Optional[typing.Sequence[str]] = OMIT, publish_to_webflow_subdomain: typing.Optional[bool] = OMIT, + page_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SitesPublishResponse: """ - Publishes a site to one or more more domains. + Publishes a site or an individual page to one or more domains. + If multiple individual pages are published to staging, publishing from staging to production publishes all staged changes. To publish to a specific custom domain, use the domain IDs from the [Get Custom Domains](/data/reference/sites/get-custom-domain) endpoint. + You must include at least one of the `customDomains` or `publishToWebflowSubdomain` properties in the request body. + + To publish an individual page instead of the entire site, provide the ID of the page in the `pageId` parameter. + This endpoint has a specific rate limit of one successful publish queue per minute. Required scope | `sites:write` @@ -314,6 +322,9 @@ def publish( publish_to_webflow_subdomain : typing.Optional[bool] Choice of whether to publish to the default Webflow Subdomain + page_id : typing.Optional[str] + The ID of the page to publish + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -339,6 +350,7 @@ def publish( site_id, custom_domains=custom_domains, publish_to_webflow_subdomain=publish_to_webflow_subdomain, + page_id=page_id, request_options=request_options, ) return _response.data @@ -375,6 +387,14 @@ def well_known(self): self._well_known = WellKnownClient(client_wrapper=self._client_wrapper) return self._well_known + @property + def google_tag(self): + if self._google_tag is None: + from .resources.google_tag.client import GoogleTagClient # noqa: E402 + + self._google_tag = GoogleTagClient(client_wrapper=self._client_wrapper) + return self._google_tag + @property def activity_logs(self): if self._activity_logs is None: @@ -416,6 +436,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._plans: typing.Optional[AsyncPlansClient] = None self._robots_txt: typing.Optional[AsyncRobotsTxtClient] = None self._well_known: typing.Optional[AsyncWellKnownClient] = None + self._google_tag: typing.Optional[AsyncGoogleTagClient] = None self._activity_logs: typing.Optional[AsyncActivityLogsClient] = None self._comments: typing.Optional[AsyncCommentsClient] = None self._scripts: typing.Optional[AsyncScriptsClient] = None @@ -725,13 +746,19 @@ async def publish( *, custom_domains: typing.Optional[typing.Sequence[str]] = OMIT, publish_to_webflow_subdomain: typing.Optional[bool] = OMIT, + page_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SitesPublishResponse: """ - Publishes a site to one or more more domains. + Publishes a site or an individual page to one or more domains. + If multiple individual pages are published to staging, publishing from staging to production publishes all staged changes. To publish to a specific custom domain, use the domain IDs from the [Get Custom Domains](/data/reference/sites/get-custom-domain) endpoint. + You must include at least one of the `customDomains` or `publishToWebflowSubdomain` properties in the request body. + + To publish an individual page instead of the entire site, provide the ID of the page in the `pageId` parameter. + This endpoint has a specific rate limit of one successful publish queue per minute. Required scope | `sites:write` @@ -747,6 +774,9 @@ async def publish( publish_to_webflow_subdomain : typing.Optional[bool] Choice of whether to publish to the default Webflow Subdomain + page_id : typing.Optional[str] + The ID of the page to publish + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -780,6 +810,7 @@ async def main() -> None: site_id, custom_domains=custom_domains, publish_to_webflow_subdomain=publish_to_webflow_subdomain, + page_id=page_id, request_options=request_options, ) return _response.data @@ -816,6 +847,14 @@ def well_known(self): self._well_known = AsyncWellKnownClient(client_wrapper=self._client_wrapper) return self._well_known + @property + def google_tag(self): + if self._google_tag is None: + from .resources.google_tag.client import AsyncGoogleTagClient # noqa: E402 + + self._google_tag = AsyncGoogleTagClient(client_wrapper=self._client_wrapper) + return self._google_tag + @property def activity_logs(self): if self._activity_logs is None: diff --git a/src/webflow/resources/sites/raw_client.py b/src/webflow/resources/sites/raw_client.py index cc08250..722f00e 100644 --- a/src/webflow/resources/sites/raw_client.py +++ b/src/webflow/resources/sites/raw_client.py @@ -686,13 +686,19 @@ def publish( *, custom_domains: typing.Optional[typing.Sequence[str]] = OMIT, publish_to_webflow_subdomain: typing.Optional[bool] = OMIT, + page_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SitesPublishResponse]: """ - Publishes a site to one or more more domains. + Publishes a site or an individual page to one or more domains. + If multiple individual pages are published to staging, publishing from staging to production publishes all staged changes. To publish to a specific custom domain, use the domain IDs from the [Get Custom Domains](/data/reference/sites/get-custom-domain) endpoint. + You must include at least one of the `customDomains` or `publishToWebflowSubdomain` properties in the request body. + + To publish an individual page instead of the entire site, provide the ID of the page in the `pageId` parameter. + This endpoint has a specific rate limit of one successful publish queue per minute. Required scope | `sites:write` @@ -708,6 +714,9 @@ def publish( publish_to_webflow_subdomain : typing.Optional[bool] Choice of whether to publish to the default Webflow Subdomain + page_id : typing.Optional[str] + The ID of the page to publish + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -723,6 +732,7 @@ def publish( json={ "customDomains": custom_domains, "publishToWebflowSubdomain": publish_to_webflow_subdomain, + "pageId": page_id, }, headers={ "content-type": "application/json", @@ -1468,13 +1478,19 @@ async def publish( *, custom_domains: typing.Optional[typing.Sequence[str]] = OMIT, publish_to_webflow_subdomain: typing.Optional[bool] = OMIT, + page_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SitesPublishResponse]: """ - Publishes a site to one or more more domains. + Publishes a site or an individual page to one or more domains. + If multiple individual pages are published to staging, publishing from staging to production publishes all staged changes. To publish to a specific custom domain, use the domain IDs from the [Get Custom Domains](/data/reference/sites/get-custom-domain) endpoint. + You must include at least one of the `customDomains` or `publishToWebflowSubdomain` properties in the request body. + + To publish an individual page instead of the entire site, provide the ID of the page in the `pageId` parameter. + This endpoint has a specific rate limit of one successful publish queue per minute. Required scope | `sites:write` @@ -1490,6 +1506,9 @@ async def publish( publish_to_webflow_subdomain : typing.Optional[bool] Choice of whether to publish to the default Webflow Subdomain + page_id : typing.Optional[str] + The ID of the page to publish + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1505,6 +1524,7 @@ async def publish( json={ "customDomains": custom_domains, "publishToWebflowSubdomain": publish_to_webflow_subdomain, + "pageId": page_id, }, headers={ "content-type": "application/json", diff --git a/src/webflow/resources/sites/resources/__init__.py b/src/webflow/resources/sites/resources/__init__.py index 529b1de..ccb2767 100644 --- a/src/webflow/resources/sites/resources/__init__.py +++ b/src/webflow/resources/sites/resources/__init__.py @@ -6,7 +6,7 @@ from importlib import import_module if typing.TYPE_CHECKING: - from . import activity_logs, comments, forms, plans, redirects, robots_txt, scripts, well_known + from . import activity_logs, comments, forms, google_tag, plans, redirects, robots_txt, scripts, well_known from .comments import ( CommentsGetCommentThreadRequestSortBy, CommentsGetCommentThreadRequestSortOrder, @@ -27,6 +27,7 @@ "activity_logs": ".activity_logs", "comments": ".comments", "forms": ".forms", + "google_tag": ".google_tag", "plans": ".plans", "redirects": ".redirects", "robots_txt": ".robots_txt", @@ -67,6 +68,7 @@ def __dir__(): "activity_logs", "comments", "forms", + "google_tag", "plans", "redirects", "robots_txt", diff --git a/src/webflow/resources/sites/resources/comments/client.py b/src/webflow/resources/sites/resources/comments/client.py index 8fbae1e..038a08e 100644 --- a/src/webflow/resources/sites/resources/comments/client.py +++ b/src/webflow/resources/sites/resources/comments/client.py @@ -59,7 +59,7 @@ def list_comment_threads( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -140,7 +140,7 @@ def get_comment_thread( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -223,7 +223,7 @@ def list_comment_replies( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -318,7 +318,7 @@ async def list_comment_threads( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -407,7 +407,7 @@ async def get_comment_thread( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -498,7 +498,7 @@ async def list_comment_replies( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records diff --git a/src/webflow/resources/sites/resources/comments/raw_client.py b/src/webflow/resources/sites/resources/comments/raw_client.py index 9502f35..caef032 100644 --- a/src/webflow/resources/sites/resources/comments/raw_client.py +++ b/src/webflow/resources/sites/resources/comments/raw_client.py @@ -60,7 +60,7 @@ def list_comment_threads( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -201,7 +201,7 @@ def get_comment_thread( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -342,7 +342,7 @@ def list_comment_replies( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -484,7 +484,7 @@ async def list_comment_threads( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -625,7 +625,7 @@ async def get_comment_thread( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records @@ -766,7 +766,7 @@ async def list_comment_replies( locale_id : typing.Optional[str] Unique identifier for a specific Locale. - [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) + [Learn more about localization.](/data/v2.0.0/docs/working-with-localization) offset : typing.Optional[int] Offset used for pagination if the results have more than limit records diff --git a/src/webflow/resources/sites/resources/google_tag/__init__.py b/src/webflow/resources/sites/resources/google_tag/__init__.py new file mode 100644 index 0000000..5cde020 --- /dev/null +++ b/src/webflow/resources/sites/resources/google_tag/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/webflow/resources/sites/resources/google_tag/client.py b/src/webflow/resources/sites/resources/google_tag/client.py new file mode 100644 index 0000000..1c0bf6b --- /dev/null +++ b/src/webflow/resources/sites/resources/google_tag/client.py @@ -0,0 +1,388 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from .....types.google_tag_id import GoogleTagId +from .....types.google_tag_ids import GoogleTagIds +from .raw_client import AsyncRawGoogleTagClient, RawGoogleTagClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class GoogleTagClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawGoogleTagClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawGoogleTagClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawGoogleTagClient + """ + return self._raw_client + + def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GoogleTagIds: + """ + List all Google Tag IDs configured for a site, sorted by order. + + Required scope: `sites:read` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GoogleTagIds + Request was successful + + Examples + -------- + from webflow import Webflow + + client = Webflow( + access_token="YOUR_ACCESS_TOKEN", + ) + client.sites.google_tag.list( + site_id="580e63e98c9a982ac9b8b741", + ) + """ + _response = self._raw_client.list(site_id, request_options=request_options) + return _response.data + + def delete_all(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Delete all Google Tag IDs from a site. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from webflow import Webflow + + client = Webflow( + access_token="YOUR_ACCESS_TOKEN", + ) + client.sites.google_tag.delete_all( + site_id="580e63e98c9a982ac9b8b741", + ) + """ + _response = self._raw_client.delete_all(site_id, request_options=request_options) + return _response.data + + def upsert( + self, + site_id: str, + *, + google_tag_ids: typing.Sequence[GoogleTagId], + request_options: typing.Optional[RequestOptions] = None, + ) -> GoogleTagIds: + """ + Add or update Google Tag IDs for a site. Existing tags not referenced in the request are preserved. A site may have a maximum of 25 tags total. + + `order` is optional on input — it is auto-assigned for new tags and returned on all tags in the response. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + google_tag_ids : typing.Sequence[GoogleTagId] + List of Google Tags configured for a site, sorted by order. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GoogleTagIds + Request was successful + + Examples + -------- + from webflow import GoogleTagId, Webflow + + client = Webflow( + access_token="YOUR_ACCESS_TOKEN", + ) + client.sites.google_tag.upsert( + site_id="580e63e98c9a982ac9b8b741", + google_tag_ids=[ + GoogleTagId( + order=0, + display_name="Main Analytics Tag", + tag_id="G-1234567890", + ) + ], + ) + """ + _response = self._raw_client.upsert(site_id, google_tag_ids=google_tag_ids, request_options=request_options) + return _response.data + + def delete( + self, site_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GoogleTagIds: + """ + Delete a single Google Tag ID from a site. The `order` values of the remaining tags are renormalized after deletion. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + tag_id : str + The Google Tag ID (e.g. G-XXXXXXXXXX) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GoogleTagIds + Request was successful + + Examples + -------- + from webflow import Webflow + + client = Webflow( + access_token="YOUR_ACCESS_TOKEN", + ) + client.sites.google_tag.delete( + site_id="580e63e98c9a982ac9b8b741", + tag_id="G-XXXXXXXXXX", + ) + """ + _response = self._raw_client.delete(site_id, tag_id, request_options=request_options) + return _response.data + + +class AsyncGoogleTagClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawGoogleTagClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawGoogleTagClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawGoogleTagClient + """ + return self._raw_client + + async def list(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GoogleTagIds: + """ + List all Google Tag IDs configured for a site, sorted by order. + + Required scope: `sites:read` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GoogleTagIds + Request was successful + + Examples + -------- + import asyncio + + from webflow import AsyncWebflow + + client = AsyncWebflow( + access_token="YOUR_ACCESS_TOKEN", + ) + + + async def main() -> None: + await client.sites.google_tag.list( + site_id="580e63e98c9a982ac9b8b741", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list(site_id, request_options=request_options) + return _response.data + + async def delete_all(self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Delete all Google Tag IDs from a site. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from webflow import AsyncWebflow + + client = AsyncWebflow( + access_token="YOUR_ACCESS_TOKEN", + ) + + + async def main() -> None: + await client.sites.google_tag.delete_all( + site_id="580e63e98c9a982ac9b8b741", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete_all(site_id, request_options=request_options) + return _response.data + + async def upsert( + self, + site_id: str, + *, + google_tag_ids: typing.Sequence[GoogleTagId], + request_options: typing.Optional[RequestOptions] = None, + ) -> GoogleTagIds: + """ + Add or update Google Tag IDs for a site. Existing tags not referenced in the request are preserved. A site may have a maximum of 25 tags total. + + `order` is optional on input — it is auto-assigned for new tags and returned on all tags in the response. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + google_tag_ids : typing.Sequence[GoogleTagId] + List of Google Tags configured for a site, sorted by order. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GoogleTagIds + Request was successful + + Examples + -------- + import asyncio + + from webflow import AsyncWebflow, GoogleTagId + + client = AsyncWebflow( + access_token="YOUR_ACCESS_TOKEN", + ) + + + async def main() -> None: + await client.sites.google_tag.upsert( + site_id="580e63e98c9a982ac9b8b741", + google_tag_ids=[ + GoogleTagId( + order=0, + display_name="Main Analytics Tag", + tag_id="G-1234567890", + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.upsert( + site_id, google_tag_ids=google_tag_ids, request_options=request_options + ) + return _response.data + + async def delete( + self, site_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GoogleTagIds: + """ + Delete a single Google Tag ID from a site. The `order` values of the remaining tags are renormalized after deletion. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + tag_id : str + The Google Tag ID (e.g. G-XXXXXXXXXX) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GoogleTagIds + Request was successful + + Examples + -------- + import asyncio + + from webflow import AsyncWebflow + + client = AsyncWebflow( + access_token="YOUR_ACCESS_TOKEN", + ) + + + async def main() -> None: + await client.sites.google_tag.delete( + site_id="580e63e98c9a982ac9b8b741", + tag_id="G-XXXXXXXXXX", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete(site_id, tag_id, request_options=request_options) + return _response.data diff --git a/src/webflow/resources/sites/resources/google_tag/raw_client.py b/src/webflow/resources/sites/resources/google_tag/raw_client.py new file mode 100644 index 0000000..144a463 --- /dev/null +++ b/src/webflow/resources/sites/resources/google_tag/raw_client.py @@ -0,0 +1,869 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.parse_error import ParsingError +from .....core.pydantic_utilities import parse_obj_as +from .....core.request_options import RequestOptions +from .....core.serialization import convert_and_respect_annotation_metadata +from .....errors.bad_request_error import BadRequestError +from .....errors.internal_server_error import InternalServerError +from .....errors.not_found_error import NotFoundError +from .....errors.too_many_requests_error import TooManyRequestsError +from .....errors.unauthorized_error import UnauthorizedError +from .....types.error import Error +from .....types.google_tag_id import GoogleTagId +from .....types.google_tag_ids import GoogleTagIds +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawGoogleTagClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GoogleTagIds]: + """ + List all Google Tag IDs configured for a site, sorted by order. + + Required scope: `sites:read` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GoogleTagIds] + Request was successful + """ + _response = self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GoogleTagIds, + parse_obj_as( + type_=GoogleTagIds, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def delete_all( + self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[None]: + """ + Delete all Google Tag IDs from a site. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def upsert( + self, + site_id: str, + *, + google_tag_ids: typing.Sequence[GoogleTagId], + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[GoogleTagIds]: + """ + Add or update Google Tag IDs for a site. Existing tags not referenced in the request are preserved. A site may have a maximum of 25 tags total. + + `order` is optional on input — it is auto-assigned for new tags and returned on all tags in the response. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + google_tag_ids : typing.Sequence[GoogleTagId] + List of Google Tags configured for a site, sorted by order. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GoogleTagIds] + Request was successful + """ + _response = self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags", + base_url=self._client_wrapper.get_environment().base, + method="PATCH", + json={ + "googleTagIds": convert_and_respect_annotation_metadata( + object_=google_tag_ids, annotation=typing.Sequence[GoogleTagId], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GoogleTagIds, + parse_obj_as( + type_=GoogleTagIds, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def delete( + self, site_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GoogleTagIds]: + """ + Delete a single Google Tag ID from a site. The `order` values of the remaining tags are renormalized after deletion. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + tag_id : str + The Google Tag ID (e.g. G-XXXXXXXXXX) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GoogleTagIds] + Request was successful + """ + _response = self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags/{jsonable_encoder(tag_id)}", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GoogleTagIds, + parse_obj_as( + type_=GoogleTagIds, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawGoogleTagClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GoogleTagIds]: + """ + List all Google Tag IDs configured for a site, sorted by order. + + Required scope: `sites:read` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GoogleTagIds] + Request was successful + """ + _response = await self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GoogleTagIds, + parse_obj_as( + type_=GoogleTagIds, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def delete_all( + self, site_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[None]: + """ + Delete all Google Tag IDs from a site. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def upsert( + self, + site_id: str, + *, + google_tag_ids: typing.Sequence[GoogleTagId], + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[GoogleTagIds]: + """ + Add or update Google Tag IDs for a site. Existing tags not referenced in the request are preserved. A site may have a maximum of 25 tags total. + + `order` is optional on input — it is auto-assigned for new tags and returned on all tags in the response. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + google_tag_ids : typing.Sequence[GoogleTagId] + List of Google Tags configured for a site, sorted by order. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GoogleTagIds] + Request was successful + """ + _response = await self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags", + base_url=self._client_wrapper.get_environment().base, + method="PATCH", + json={ + "googleTagIds": convert_and_respect_annotation_metadata( + object_=google_tag_ids, annotation=typing.Sequence[GoogleTagId], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GoogleTagIds, + parse_obj_as( + type_=GoogleTagIds, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def delete( + self, site_id: str, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GoogleTagIds]: + """ + Delete a single Google Tag ID from a site. The `order` values of the remaining tags are renormalized after deletion. + + Required scope: `sites:write` + + Parameters + ---------- + site_id : str + Unique identifier for a Site + + tag_id : str + The Google Tag ID (e.g. G-XXXXXXXXXX) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GoogleTagIds] + Request was successful + """ + _response = await self._client_wrapper.httpx_client.request( + f"sites/{jsonable_encoder(site_id)}/integrations/google_tags/{jsonable_encoder(tag_id)}", + base_url=self._client_wrapper.get_environment().base, + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GoogleTagIds, + parse_obj_as( + type_=GoogleTagIds, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/webflow/resources/sites/types/__init__.py b/src/webflow/resources/sites/types/__init__.py index 960aec6..85cd533 100644 --- a/src/webflow/resources/sites/types/__init__.py +++ b/src/webflow/resources/sites/types/__init__.py @@ -7,7 +7,11 @@ if typing.TYPE_CHECKING: from .sites_publish_response import SitesPublishResponse -_dynamic_imports: typing.Dict[str, str] = {"SitesPublishResponse": ".sites_publish_response"} + from .sites_publish_response_publish_scope import SitesPublishResponsePublishScope +_dynamic_imports: typing.Dict[str, str] = { + "SitesPublishResponse": ".sites_publish_response", + "SitesPublishResponsePublishScope": ".sites_publish_response_publish_scope", +} def __getattr__(attr_name: str) -> typing.Any: @@ -31,4 +35,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["SitesPublishResponse"] +__all__ = ["SitesPublishResponse", "SitesPublishResponsePublishScope"] diff --git a/src/webflow/resources/sites/types/sites_publish_response.py b/src/webflow/resources/sites/types/sites_publish_response.py index d32e70c..18debc2 100644 --- a/src/webflow/resources/sites/types/sites_publish_response.py +++ b/src/webflow/resources/sites/types/sites_publish_response.py @@ -7,6 +7,7 @@ from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ....core.serialization import FieldMetadata from ....types.domain import Domain +from .sites_publish_response_publish_scope import SitesPublishResponsePublishScope class SitesPublishResponse(UniversalBaseModel): @@ -20,6 +21,11 @@ class SitesPublishResponse(UniversalBaseModel): FieldMetadata(alias="publishToWebflowSubdomain"), pydantic.Field(alias="publishToWebflowSubdomain", description="Flag for publishing to webflow.io subdomain"), ] = None + publish_scope: typing_extensions.Annotated[ + typing.Optional[SitesPublishResponsePublishScope], + FieldMetadata(alias="publishScope"), + pydantic.Field(alias="publishScope", description="Whether the site or an individual page was published"), + ] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/webflow/resources/sites/types/sites_publish_response_publish_scope.py b/src/webflow/resources/sites/types/sites_publish_response_publish_scope.py new file mode 100644 index 0000000..11ce327 --- /dev/null +++ b/src/webflow/resources/sites/types/sites_publish_response_publish_scope.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SitesPublishResponsePublishScope = typing.Union[typing.Literal["site", "page"], typing.Any] diff --git a/src/webflow/types/__init__.py b/src/webflow/types/__init__.py index 88c0cbd..417d175 100644 --- a/src/webflow/types/__init__.py +++ b/src/webflow/types/__init__.py @@ -68,7 +68,8 @@ from .component_node import ComponentNode from .component_properties import ComponentProperties from .component_property import ComponentProperty - from .component_property_type import ComponentPropertyType + from .component_property_text import ComponentPropertyText + from .component_property_text_type import ComponentPropertyTextType from .conflict import Conflict from .custom_code_block import CustomCodeBlock from .custom_code_block_type import CustomCodeBlockType @@ -88,9 +89,6 @@ from .field_type import FieldType from .field_validations import FieldValidations from .field_validations_additional_properties import FieldValidationsAdditionalProperties - from .field_validations_additional_properties_additional_properties import ( - FieldValidationsAdditionalPropertiesAdditionalProperties, - ) from .forbidden_error_body import ForbiddenErrorBody from .form import Form from .form_field import FormField @@ -104,14 +102,20 @@ from .form_submission_trigger_payload import FormSubmissionTriggerPayload from .form_submission_trigger_payload_schema_item import FormSubmissionTriggerPayloadSchemaItem from .form_submission_trigger_payload_schema_item_field_type import FormSubmissionTriggerPayloadSchemaItemFieldType + from .google_tag_id import GoogleTagId + from .google_tag_ids import GoogleTagIds from .image_node import ImageNode from .image_node_image import ImageNodeImage from .invalid_domain import InvalidDomain from .invalid_scopes import InvalidScopes from .inventory_item import InventoryItem from .inventory_item_inventory_type import InventoryItemInventoryType + from .items_list_items_live_request_created_on import ItemsListItemsLiveRequestCreatedOn from .items_list_items_live_request_last_published import ItemsListItemsLiveRequestLastPublished + from .items_list_items_live_request_last_updated import ItemsListItemsLiveRequestLastUpdated + from .items_list_items_request_created_on import ItemsListItemsRequestCreatedOn from .items_list_items_request_last_published import ItemsListItemsRequestLastPublished + from .items_list_items_request_last_updated import ItemsListItemsRequestLastUpdated from .list_custom_code_blocks import ListCustomCodeBlocks from .locale import Locale from .locales import Locales @@ -214,6 +218,7 @@ from .site_plan_name import SitePlanName from .site_publish import SitePublish from .site_publish_payload import SitePublishPayload + from .site_publish_payload_publish_scope import SitePublishPayloadPublishScope from .sites import Sites from .sku import Sku from .sku_field_data import SkuFieldData @@ -366,7 +371,8 @@ "ComponentNode": ".component_node", "ComponentProperties": ".component_properties", "ComponentProperty": ".component_property", - "ComponentPropertyType": ".component_property_type", + "ComponentPropertyText": ".component_property_text", + "ComponentPropertyTextType": ".component_property_text_type", "Conflict": ".conflict", "CustomCodeBlock": ".custom_code_block", "CustomCodeBlockType": ".custom_code_block_type", @@ -386,7 +392,6 @@ "FieldType": ".field_type", "FieldValidations": ".field_validations", "FieldValidationsAdditionalProperties": ".field_validations_additional_properties", - "FieldValidationsAdditionalPropertiesAdditionalProperties": ".field_validations_additional_properties_additional_properties", "ForbiddenErrorBody": ".forbidden_error_body", "Form": ".form", "FormField": ".form_field", @@ -400,14 +405,20 @@ "FormSubmissionTriggerPayload": ".form_submission_trigger_payload", "FormSubmissionTriggerPayloadSchemaItem": ".form_submission_trigger_payload_schema_item", "FormSubmissionTriggerPayloadSchemaItemFieldType": ".form_submission_trigger_payload_schema_item_field_type", + "GoogleTagId": ".google_tag_id", + "GoogleTagIds": ".google_tag_ids", "ImageNode": ".image_node", "ImageNodeImage": ".image_node_image", "InvalidDomain": ".invalid_domain", "InvalidScopes": ".invalid_scopes", "InventoryItem": ".inventory_item", "InventoryItemInventoryType": ".inventory_item_inventory_type", + "ItemsListItemsLiveRequestCreatedOn": ".items_list_items_live_request_created_on", "ItemsListItemsLiveRequestLastPublished": ".items_list_items_live_request_last_published", + "ItemsListItemsLiveRequestLastUpdated": ".items_list_items_live_request_last_updated", + "ItemsListItemsRequestCreatedOn": ".items_list_items_request_created_on", "ItemsListItemsRequestLastPublished": ".items_list_items_request_last_published", + "ItemsListItemsRequestLastUpdated": ".items_list_items_request_last_updated", "ListCustomCodeBlocks": ".list_custom_code_blocks", "Locale": ".locale", "Locales": ".locales", @@ -508,6 +519,7 @@ "SitePlanName": ".site_plan_name", "SitePublish": ".site_publish", "SitePublishPayload": ".site_publish_payload", + "SitePublishPayloadPublishScope": ".site_publish_payload_publish_scope", "Sites": ".sites", "Sku": ".sku", "SkuFieldData": ".sku_field_data", @@ -658,7 +670,8 @@ def __dir__(): "ComponentNode", "ComponentProperties", "ComponentProperty", - "ComponentPropertyType", + "ComponentPropertyText", + "ComponentPropertyTextType", "Conflict", "CustomCodeBlock", "CustomCodeBlockType", @@ -678,7 +691,6 @@ def __dir__(): "FieldType", "FieldValidations", "FieldValidationsAdditionalProperties", - "FieldValidationsAdditionalPropertiesAdditionalProperties", "ForbiddenErrorBody", "Form", "FormField", @@ -692,14 +704,20 @@ def __dir__(): "FormSubmissionTriggerPayload", "FormSubmissionTriggerPayloadSchemaItem", "FormSubmissionTriggerPayloadSchemaItemFieldType", + "GoogleTagId", + "GoogleTagIds", "ImageNode", "ImageNodeImage", "InvalidDomain", "InvalidScopes", "InventoryItem", "InventoryItemInventoryType", + "ItemsListItemsLiveRequestCreatedOn", "ItemsListItemsLiveRequestLastPublished", + "ItemsListItemsLiveRequestLastUpdated", + "ItemsListItemsRequestCreatedOn", "ItemsListItemsRequestLastPublished", + "ItemsListItemsRequestLastUpdated", "ListCustomCodeBlocks", "Locale", "Locales", @@ -800,6 +818,7 @@ def __dir__(): "SitePlanName", "SitePublish", "SitePublishPayload", + "SitePublishPayloadPublishScope", "Sites", "Sku", "SkuFieldData", diff --git a/src/webflow/types/comment_payload.py b/src/webflow/types/comment_payload.py index 8b51391..b77fb0b 100644 --- a/src/webflow/types/comment_payload.py +++ b/src/webflow/types/comment_payload.py @@ -38,18 +38,15 @@ class CommentPayload(UniversalBaseModel): page_id: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="pageId"), - pydantic.Field(alias="pageId", description="The page unique identifier"), + pydantic.Field( + alias="pageId", description="The page unique identifier, or for CMS item comments, the template page ID" + ), ] = None locale_id: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="localeId"), pydantic.Field(alias="localeId", description="The locale unique identifier"), ] = None - item_id: typing_extensions.Annotated[ - typing.Optional[str], - FieldMetadata(alias="itemId"), - pydantic.Field(alias="itemId", description="The item unique identifier"), - ] = None breakpoint: typing.Optional[str] = pydantic.Field(default=None) """ The breakpoint the comment was left on diff --git a/src/webflow/types/component_property.py b/src/webflow/types/component_property.py index 4583f4d..fd30a17 100644 --- a/src/webflow/types/component_property.py +++ b/src/webflow/types/component_property.py @@ -1,45 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from .component_property_text import ComponentPropertyText -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ..core.serialization import FieldMetadata -from .component_property_type import ComponentPropertyType -from .text import Text - - -class ComponentProperty(UniversalBaseModel): - """ - Represents a property of a component instance in the DOM. A property contains a list of both the raw text and the HTML representation, allowing for flexibility in rendering and processing. Additional attributes can be associated with the text for styling or other purposes. - """ - - property_id: typing_extensions.Annotated[ - typing.Optional[str], - FieldMetadata(alias="propertyId"), - pydantic.Field(alias="propertyId", description="The ID of the property."), - ] = None - type: typing.Optional[ComponentPropertyType] = pydantic.Field(default=None) - """ - The type of the property. - """ - - label: typing.Optional[str] = pydantic.Field(default=None) - """ - The label of the property in the UI. - """ - - text: typing.Optional[Text] = pydantic.Field(default=None) - """ - Represents text content within the DOM. It contains both the raw text and its HTML representation. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +ComponentProperty = ComponentPropertyText diff --git a/src/webflow/types/component_property_text.py b/src/webflow/types/component_property_text.py new file mode 100644 index 0000000..c708551 --- /dev/null +++ b/src/webflow/types/component_property_text.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata +from .component_property_text_type import ComponentPropertyTextType +from .text import Text + + +class ComponentPropertyText(UniversalBaseModel): + """ + A text-based component property containing raw text and HTML representation. + """ + + property_id: typing_extensions.Annotated[ + str, + FieldMetadata(alias="propertyId"), + pydantic.Field(alias="propertyId", description="The ID of the property."), + ] + type: ComponentPropertyTextType = pydantic.Field() + """ + The type of the property. + """ + + label: str = pydantic.Field() + """ + The label of the property in the UI. + """ + + text: Text = pydantic.Field() + """ + Represents text content within the DOM. It contains both the raw text and its HTML representation. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/webflow/types/component_property_text_type.py b/src/webflow/types/component_property_text_type.py new file mode 100644 index 0000000..6038e5c --- /dev/null +++ b/src/webflow/types/component_property_text_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ComponentPropertyTextType = typing.Union[typing.Literal["Plain Text", "Rich Text", "Alt Text"], typing.Any] diff --git a/src/webflow/types/component_property_type.py b/src/webflow/types/component_property_type.py deleted file mode 100644 index 117b2fe..0000000 --- a/src/webflow/types/component_property_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ComponentPropertyType = typing.Union[typing.Literal["Plain Text", "Rich Text", "Alt Text"], typing.Any] diff --git a/src/webflow/types/field_validations_additional_properties.py b/src/webflow/types/field_validations_additional_properties.py index 845d42f..4e4a1df 100644 --- a/src/webflow/types/field_validations_additional_properties.py +++ b/src/webflow/types/field_validations_additional_properties.py @@ -2,10 +2,4 @@ import typing -from .field_validations_additional_properties_additional_properties import ( - FieldValidationsAdditionalPropertiesAdditionalProperties, -) - -FieldValidationsAdditionalProperties = typing.Union[ - str, float, bool, int, FieldValidationsAdditionalPropertiesAdditionalProperties -] +FieldValidationsAdditionalProperties = typing.Union[str, float, bool, int, typing.Any] diff --git a/src/webflow/types/google_tag_id.py b/src/webflow/types/google_tag_id.py new file mode 100644 index 0000000..6671d24 --- /dev/null +++ b/src/webflow/types/google_tag_id.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata + + +class GoogleTagId(UniversalBaseModel): + """ + A Google Tag associated with a site. + """ + + order: typing.Optional[int] = pydantic.Field(default=None) + """ + Display order of the tag. Optional on input; always present on output. Auto-assigned for new tags and renormalized after deletion. + """ + + display_name: typing_extensions.Annotated[ + str, + FieldMetadata(alias="displayName"), + pydantic.Field(alias="displayName", description="A human-readable label for the tag."), + ] + tag_id: typing_extensions.Annotated[ + str, + FieldMetadata(alias="tagId"), + pydantic.Field( + alias="tagId", + description="The Google Tag ID. Accepts G-, GT-, AW-, and DC- prefixes. Rejects UA- prefixes.", + ), + ] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/webflow/types/google_tag_ids.py b/src/webflow/types/google_tag_ids.py new file mode 100644 index 0000000..21cdb69 --- /dev/null +++ b/src/webflow/types/google_tag_ids.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata +from .google_tag_id import GoogleTagId + + +class GoogleTagIds(UniversalBaseModel): + """ + A list of Google Tags configured for a site. + """ + + google_tag_ids: typing_extensions.Annotated[ + typing.List[GoogleTagId], + FieldMetadata(alias="googleTagIds"), + pydantic.Field(alias="googleTagIds", description="List of Google Tags configured for a site, sorted by order."), + ] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/webflow/types/items_list_items_live_request_created_on.py b/src/webflow/types/items_list_items_live_request_created_on.py new file mode 100644 index 0000000..93a7ec1 --- /dev/null +++ b/src/webflow/types/items_list_items_live_request_created_on.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ItemsListItemsLiveRequestCreatedOn(UniversalBaseModel): + lte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items created before this date + """ + + gte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items created after this date + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/webflow/types/items_list_items_live_request_last_updated.py b/src/webflow/types/items_list_items_live_request_last_updated.py new file mode 100644 index 0000000..fc621f8 --- /dev/null +++ b/src/webflow/types/items_list_items_live_request_last_updated.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ItemsListItemsLiveRequestLastUpdated(UniversalBaseModel): + lte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items last updated before this date + """ + + gte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items last updated after this date + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/webflow/types/field_validations_additional_properties_additional_properties.py b/src/webflow/types/items_list_items_request_created_on.py similarity index 58% rename from src/webflow/types/field_validations_additional_properties_additional_properties.py rename to src/webflow/types/items_list_items_request_created_on.py index 0c676dd..f67078c 100644 --- a/src/webflow/types/field_validations_additional_properties_additional_properties.py +++ b/src/webflow/types/items_list_items_request_created_on.py @@ -1,17 +1,22 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing import pydantic -import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ..core.serialization import FieldMetadata -class FieldValidationsAdditionalPropertiesAdditionalProperties(UniversalBaseModel): - additional_properties: typing_extensions.Annotated[ - typing.Any, FieldMetadata(alias="additionalProperties"), pydantic.Field(alias="additionalProperties") - ] +class ItemsListItemsRequestCreatedOn(UniversalBaseModel): + lte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items created before this date + """ + + gte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items created after this date + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/webflow/types/items_list_items_request_last_updated.py b/src/webflow/types/items_list_items_request_last_updated.py new file mode 100644 index 0000000..cd3e1ef --- /dev/null +++ b/src/webflow/types/items_list_items_request_last_updated.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ItemsListItemsRequestLastUpdated(UniversalBaseModel): + lte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items last updated before this date + """ + + gte: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + Filter items last updated after this date + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/webflow/types/site_publish_payload.py b/src/webflow/types/site_publish_payload.py index 3e61145..2bcadfe 100644 --- a/src/webflow/types/site_publish_payload.py +++ b/src/webflow/types/site_publish_payload.py @@ -7,6 +7,7 @@ import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ..core.serialization import FieldMetadata +from .site_publish_payload_publish_scope import SitePublishPayloadPublishScope class SitePublishPayload(UniversalBaseModel): @@ -32,7 +33,17 @@ class SitePublishPayload(UniversalBaseModel): published_by: typing_extensions.Annotated[ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="publishedBy"), - pydantic.Field(alias="publishedBy", description="The name andID of the user who published the site"), + pydantic.Field(alias="publishedBy", description="The name and ID of the user who published the site"), + ] = None + publish_scope: typing_extensions.Annotated[ + typing.Optional[SitePublishPayloadPublishScope], + FieldMetadata(alias="publishScope"), + pydantic.Field(alias="publishScope", description="Whether the entire site or an individual page was published"), + ] = None + page_id: typing_extensions.Annotated[ + typing.Optional[str], + FieldMetadata(alias="pageId"), + pydantic.Field(alias="pageId", description="The ID of the page that was published"), ] = None if IS_PYDANTIC_V2: diff --git a/src/webflow/types/site_publish_payload_publish_scope.py b/src/webflow/types/site_publish_payload_publish_scope.py new file mode 100644 index 0000000..029f208 --- /dev/null +++ b/src/webflow/types/site_publish_payload_publish_scope.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SitePublishPayloadPublishScope = typing.Union[typing.Literal["page", "site"], typing.Any]