22
33from __future__ import annotations
44
5- from typing import List , Type , Optional , cast
5+ from typing import Type , Optional , cast
66from typing_extensions import overload
77
88import httpx
3939 VersionsResourceWithStreamingResponse ,
4040 AsyncVersionsResourceWithStreamingResponse ,
4141)
42- from ...._types import NOT_GIVEN , Body , Query , Headers , NoneType , NotGiven , FileTypes
42+ from ...._types import NOT_GIVEN , Body , Query , Headers , NoneType , NotGiven
4343from ...._utils import (
4444 required_args ,
4545 maybe_transform ,
@@ -161,9 +161,8 @@ def update(
161161 script_name : str ,
162162 * ,
163163 account_id : str ,
164+ metadata : script_update_params .Variant0Metadata ,
164165 rollback_to : str | NotGiven = NOT_GIVEN ,
165- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
166- metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
167166 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168167 # The extra values given here take precedence over values defined on the client or passed to this method.
169168 extra_headers : Headers | None = None ,
@@ -182,18 +181,12 @@ def update(
182181
183182 script_name: Name of the script, used in URLs and route configuration.
184183
184+ metadata: JSON encoded metadata about the uploaded parts and Worker configuration.
185+
185186 rollback_to: Rollback to provided deployment based on deployment ID. Request body will only
186187 parse a "message" part. You can learn more about deployments
187188 [here](https://developers.cloudflare.com/workers/platform/deployments/).
188189
189- any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules
190- may be provided as separate named parts, but at least one module must be present
191- and referenced in the metadata as `main_module` or `body_part` by part name.
192- Source maps may also be included using the `application/source-map` content
193- type.
194-
195- metadata: JSON encoded metadata about the uploaded parts and Worker configuration.
196-
197190 extra_headers: Send extra headers
198191
199192 extra_query: Add additional query parameters to the request
@@ -247,15 +240,14 @@ def update(
247240 """
248241 ...
249242
250- @required_args (["account_id" ])
243+ @required_args (["account_id" , "metadata" ], [ "account_id" ])
251244 def update (
252245 self ,
253246 script_name : str ,
254247 * ,
255248 account_id : str ,
256- rollback_to : str | NotGiven = NOT_GIVEN ,
257- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
258249 metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
250+ rollback_to : str | NotGiven = NOT_GIVEN ,
259251 message : str | NotGiven = NOT_GIVEN ,
260252 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
261253 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -272,7 +264,6 @@ def update(
272264 f"/accounts/{ account_id } /workers/scripts/{ script_name } " ,
273265 body = maybe_transform (
274266 {
275- "any_part_name" : any_part_name ,
276267 "metadata" : metadata ,
277268 "message" : message ,
278269 },
@@ -478,9 +469,8 @@ async def update(
478469 script_name : str ,
479470 * ,
480471 account_id : str ,
472+ metadata : script_update_params .Variant0Metadata ,
481473 rollback_to : str | NotGiven = NOT_GIVEN ,
482- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
483- metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
484474 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
485475 # The extra values given here take precedence over values defined on the client or passed to this method.
486476 extra_headers : Headers | None = None ,
@@ -499,18 +489,12 @@ async def update(
499489
500490 script_name: Name of the script, used in URLs and route configuration.
501491
492+ metadata: JSON encoded metadata about the uploaded parts and Worker configuration.
493+
502494 rollback_to: Rollback to provided deployment based on deployment ID. Request body will only
503495 parse a "message" part. You can learn more about deployments
504496 [here](https://developers.cloudflare.com/workers/platform/deployments/).
505497
506- any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules
507- may be provided as separate named parts, but at least one module must be present
508- and referenced in the metadata as `main_module` or `body_part` by part name.
509- Source maps may also be included using the `application/source-map` content
510- type.
511-
512- metadata: JSON encoded metadata about the uploaded parts and Worker configuration.
513-
514498 extra_headers: Send extra headers
515499
516500 extra_query: Add additional query parameters to the request
@@ -564,15 +548,14 @@ async def update(
564548 """
565549 ...
566550
567- @required_args (["account_id" ])
551+ @required_args (["account_id" , "metadata" ], [ "account_id" ])
568552 async def update (
569553 self ,
570554 script_name : str ,
571555 * ,
572556 account_id : str ,
573- rollback_to : str | NotGiven = NOT_GIVEN ,
574- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
575557 metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
558+ rollback_to : str | NotGiven = NOT_GIVEN ,
576559 message : str | NotGiven = NOT_GIVEN ,
577560 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
578561 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -589,7 +572,6 @@ async def update(
589572 f"/accounts/{ account_id } /workers/scripts/{ script_name } " ,
590573 body = await async_maybe_transform (
591574 {
592- "any_part_name" : any_part_name ,
593575 "metadata" : metadata ,
594576 "message" : message ,
595577 },
0 commit comments