2
2
3
3
from __future__ import annotations
4
4
5
- from typing import List , Type , Optional , cast
5
+ from typing import Type , Optional , cast
6
6
from typing_extensions import overload
7
7
8
8
import httpx
39
39
VersionsResourceWithStreamingResponse ,
40
40
AsyncVersionsResourceWithStreamingResponse ,
41
41
)
42
- from ...._types import NOT_GIVEN , Body , Query , Headers , NoneType , NotGiven , FileTypes
42
+ from ...._types import NOT_GIVEN , Body , Query , Headers , NoneType , NotGiven
43
43
from ...._utils import (
44
44
required_args ,
45
45
maybe_transform ,
@@ -161,9 +161,8 @@ def update(
161
161
script_name : str ,
162
162
* ,
163
163
account_id : str ,
164
+ metadata : script_update_params .Variant0Metadata ,
164
165
rollback_to : str | NotGiven = NOT_GIVEN ,
165
- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
166
- metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
167
166
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168
167
# The extra values given here take precedence over values defined on the client or passed to this method.
169
168
extra_headers : Headers | None = None ,
@@ -182,18 +181,12 @@ def update(
182
181
183
182
script_name: Name of the script, used in URLs and route configuration.
184
183
184
+ metadata: JSON encoded metadata about the uploaded parts and Worker configuration.
185
+
185
186
rollback_to: Rollback to provided deployment based on deployment ID. Request body will only
186
187
parse a "message" part. You can learn more about deployments
187
188
[here](https://developers.cloudflare.com/workers/platform/deployments/).
188
189
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
-
197
190
extra_headers: Send extra headers
198
191
199
192
extra_query: Add additional query parameters to the request
@@ -247,15 +240,14 @@ def update(
247
240
"""
248
241
...
249
242
250
- @required_args (["account_id" ])
243
+ @required_args (["account_id" , "metadata" ], [ "account_id" ])
251
244
def update (
252
245
self ,
253
246
script_name : str ,
254
247
* ,
255
248
account_id : str ,
256
- rollback_to : str | NotGiven = NOT_GIVEN ,
257
- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
258
249
metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
250
+ rollback_to : str | NotGiven = NOT_GIVEN ,
259
251
message : str | NotGiven = NOT_GIVEN ,
260
252
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
261
253
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -272,7 +264,6 @@ def update(
272
264
f"/accounts/{ account_id } /workers/scripts/{ script_name } " ,
273
265
body = maybe_transform (
274
266
{
275
- "any_part_name" : any_part_name ,
276
267
"metadata" : metadata ,
277
268
"message" : message ,
278
269
},
@@ -478,9 +469,8 @@ async def update(
478
469
script_name : str ,
479
470
* ,
480
471
account_id : str ,
472
+ metadata : script_update_params .Variant0Metadata ,
481
473
rollback_to : str | NotGiven = NOT_GIVEN ,
482
- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
483
- metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
484
474
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
485
475
# The extra values given here take precedence over values defined on the client or passed to this method.
486
476
extra_headers : Headers | None = None ,
@@ -499,18 +489,12 @@ async def update(
499
489
500
490
script_name: Name of the script, used in URLs and route configuration.
501
491
492
+ metadata: JSON encoded metadata about the uploaded parts and Worker configuration.
493
+
502
494
rollback_to: Rollback to provided deployment based on deployment ID. Request body will only
503
495
parse a "message" part. You can learn more about deployments
504
496
[here](https://developers.cloudflare.com/workers/platform/deployments/).
505
497
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
-
514
498
extra_headers: Send extra headers
515
499
516
500
extra_query: Add additional query parameters to the request
@@ -564,15 +548,14 @@ async def update(
564
548
"""
565
549
...
566
550
567
- @required_args (["account_id" ])
551
+ @required_args (["account_id" , "metadata" ], [ "account_id" ])
568
552
async def update (
569
553
self ,
570
554
script_name : str ,
571
555
* ,
572
556
account_id : str ,
573
- rollback_to : str | NotGiven = NOT_GIVEN ,
574
- any_part_name : List [FileTypes ] | NotGiven = NOT_GIVEN ,
575
557
metadata : script_update_params .Variant0Metadata | NotGiven = NOT_GIVEN ,
558
+ rollback_to : str | NotGiven = NOT_GIVEN ,
576
559
message : str | NotGiven = NOT_GIVEN ,
577
560
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
578
561
# 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(
589
572
f"/accounts/{ account_id } /workers/scripts/{ script_name } " ,
590
573
body = await async_maybe_transform (
591
574
{
592
- "any_part_name" : any_part_name ,
593
575
"metadata" : metadata ,
594
576
"message" : message ,
595
577
},
0 commit comments