From 3e716c4f1792f3962975bac1e8d7c97e2a13a6fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 19:53:17 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#297) --- api.md | 21 +- .../resources/workers/scripts/content.py | 6 +- .../resources/workers/scripts/scripts.py | 4 + .../dispatch/namespaces/namespaces.py | 4 +- .../dispatch/namespaces/scripts/bindings.py | 43 +- .../dispatch/namespaces/scripts/content.py | 6 +- .../dispatch/namespaces/scripts/scripts.py | 32 +- .../dispatch/namespaces/scripts/settings.py | 61 +- src/cloudflare/types/__init__.py | 12 + .../types/addressing/prefixes/bgp/__init__.py | 1 + .../prefixes/bgp/service_binding_param.py | 29 + src/cloudflare/types/binding_param.py | 36 ++ src/cloudflare/types/d1_binding_param.py | 18 + .../types/dispatch_namespace_binding_param.py | 38 ++ .../types/durable_object_binding_param.py | 23 + .../types/kv_namespace_binding_param.py | 12 + src/cloudflare/types/migration_step.py | 40 ++ .../types/mtls_cert_binding_param.py | 17 + .../types/placement_configuration.py | 17 + src/cloudflare/types/r2_binding_param.py | 15 + src/cloudflare/types/service_binding_param.py | 18 + .../types/shared_params/__init__.py | 3 - .../types/shared_params/response_info.py | 13 - src/cloudflare/types/single_step_migration.py | 49 ++ src/cloudflare/types/stepped_migration.py | 22 + src/cloudflare/types/workers/__init__.py | 1 - src/cloudflare/types/workers/script.py | 3 - .../types/workers/script_setting_param.py | 18 - .../types/workers/script_update_params.py | 3 +- .../workers/scripts/content_update_params.py | 3 +- .../namespaces/script_update_params.py | 3 +- .../dispatch/namespaces/scripts/__init__.py | 3 + .../scripts/binding_get_response.py | 9 + .../scripts/content_update_params.py | 3 +- .../namespaces/scripts/setting_edit_params.py | 55 +- .../scripts/setting_edit_response.py | 51 ++ .../scripts/setting_get_response.py | 51 ++ .../namespaces/scripts/test_bindings.py | 14 +- .../namespaces/scripts/test_settings.py | 551 ++++-------------- 39 files changed, 734 insertions(+), 574 deletions(-) create mode 100644 src/cloudflare/types/addressing/prefixes/bgp/service_binding_param.py create mode 100644 src/cloudflare/types/binding_param.py create mode 100644 src/cloudflare/types/d1_binding_param.py create mode 100644 src/cloudflare/types/dispatch_namespace_binding_param.py create mode 100644 src/cloudflare/types/durable_object_binding_param.py create mode 100644 src/cloudflare/types/kv_namespace_binding_param.py create mode 100644 src/cloudflare/types/migration_step.py create mode 100644 src/cloudflare/types/mtls_cert_binding_param.py create mode 100644 src/cloudflare/types/placement_configuration.py create mode 100644 src/cloudflare/types/r2_binding_param.py create mode 100644 src/cloudflare/types/service_binding_param.py delete mode 100644 src/cloudflare/types/shared_params/__init__.py delete mode 100644 src/cloudflare/types/shared_params/response_info.py create mode 100644 src/cloudflare/types/single_step_migration.py create mode 100644 src/cloudflare/types/stepped_migration.py delete mode 100644 src/cloudflare/types/workers/script_setting_param.py create mode 100644 src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py create mode 100644 src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py create mode 100644 src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py diff --git a/api.md b/api.md index ce47a59b65e..54eaf9c3a94 100644 --- a/api.md +++ b/api.md @@ -4658,16 +4658,31 @@ Methods: ##### Settings +Types: + +```python +from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( + SettingEditResponse, + SettingGetResponse, +) +``` + Methods: -- client.workers_for_platforms.dispatch.namespaces.scripts.settings.edit(script_name, \*, account_id, dispatch_namespace, \*\*params) -> ScriptSetting -- client.workers_for_platforms.dispatch.namespaces.scripts.settings.get(script_name, \*, account_id, dispatch_namespace) -> ScriptSetting +- client.workers_for_platforms.dispatch.namespaces.scripts.settings.edit(script_name, \*, account_id, dispatch_namespace, \*\*params) -> SettingEditResponse +- client.workers_for_platforms.dispatch.namespaces.scripts.settings.get(script_name, \*, account_id, dispatch_namespace) -> SettingGetResponse ##### Bindings +Types: + +```python +from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import BindingGetResponse +``` + Methods: -- client.workers_for_platforms.dispatch.namespaces.scripts.bindings.get(script_name, \*, account_id, dispatch_namespace) -> Binding +- client.workers_for_platforms.dispatch.namespaces.scripts.bindings.get(script_name, \*, account_id, dispatch_namespace) -> BindingGetResponse # ZeroTrust diff --git a/src/cloudflare/resources/workers/scripts/content.py b/src/cloudflare/resources/workers/scripts/content.py index a30c03bc011..98e0d2a57ab 100644 --- a/src/cloudflare/resources/workers/scripts/content.py +++ b/src/cloudflare/resources/workers/scripts/content.py @@ -75,7 +75,8 @@ def update( may be provided as separate named parts, but at least one module must be present. This should be referenced either in the metadata as `main_module` (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. @@ -194,7 +195,8 @@ async def update( may be provided as separate named parts, but at least one module must be present. This should be referenced either in the metadata as `main_module` (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index a23838b3bad..8c8d0e6cb61 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -151,6 +151,8 @@ def update( any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. @@ -443,6 +445,8 @@ async def update( any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py index 0f025e9189a..6609c826615 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py @@ -193,7 +193,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> NamespaceGetResponse: """ - Fetch a Workers for Platforms namespace. + Get a Workers for Platforms namespace. Args: account_id: Identifier @@ -374,7 +374,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> NamespaceGetResponse: """ - Fetch a Workers for Platforms namespace. + Get a Workers for Platforms namespace. Args: account_id: Identifier diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py index 3dac5a7055d..60f9cfd9db9 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py @@ -2,11 +2,10 @@ from __future__ import annotations -from typing import Any, cast +from typing import Type, cast import httpx -from ......types import Binding from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -16,9 +15,11 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ......_wrappers import ResultWrapper from ......_base_client import ( make_request_options, ) +from ......types.workers_for_platforms.dispatch.namespaces.scripts import BindingGetResponse __all__ = ["Bindings", "AsyncBindings"] @@ -44,7 +45,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Binding: + ) -> BindingGetResponse: """ Fetch script bindings from a script uploaded to a Workers for Platforms namespace. @@ -70,15 +71,16 @@ def get( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return cast( - Binding, - self._get( - f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast(Any, Binding), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, ), + cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]), ) @@ -103,7 +105,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Binding: + ) -> BindingGetResponse: """ Fetch script bindings from a script uploaded to a Workers for Platforms namespace. @@ -129,15 +131,16 @@ async def get( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return cast( - Binding, - await self._get( - f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast(Any, Binding), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, ), + cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]), ) diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py index 4accbd37876..d7372f37893 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py @@ -78,7 +78,8 @@ def update( may be provided as separate named parts, but at least one module must be present. This should be referenced either in the metadata as `main_module` (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. @@ -208,7 +209,8 @@ async def update( may be provided as separate named parts, but at least one module must be present. This should be referenced either in the metadata as `main_module` (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py index 5091e6f18dc..3a82e2d2a85 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -91,8 +91,11 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Script: - """ - Upload a worker module to a Workers for Platforms namespace. + """Upload a worker module to a Workers for Platforms namespace. + + You can find an + example of the metadata on our docs: + https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/reference/metadata/ Args: account_id: Identifier @@ -104,6 +107,8 @@ def update( any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. @@ -132,8 +137,11 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Script: - """ - Upload a worker module to a Workers for Platforms namespace. + """Upload a worker module to a Workers for Platforms namespace. + + You can find an + example of the metadata on our docs: + https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/reference/metadata/ Args: account_id: Identifier @@ -344,8 +352,11 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Script: - """ - Upload a worker module to a Workers for Platforms namespace. + """Upload a worker module to a Workers for Platforms namespace. + + You can find an + example of the metadata on our docs: + https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/reference/metadata/ Args: account_id: Identifier @@ -357,6 +368,8 @@ async def update( any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. metadata: JSON encoded metadata about the uploaded parts and Worker configuration. @@ -385,8 +398,11 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Script: - """ - Upload a worker module to a Workers for Platforms namespace. + """Upload a worker module to a Workers for Platforms namespace. + + You can find an + example of the metadata on our docs: + https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/reference/metadata/ Args: account_id: Identifier diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py index adc6596e51a..ca87932c18a 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py @@ -2,12 +2,10 @@ from __future__ import annotations -from typing import Type, Iterable, cast -from typing_extensions import Literal +from typing import Type, cast import httpx -from ......types import shared_params from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven from ......_utils import ( maybe_transform, @@ -25,8 +23,11 @@ from ......_base_client import ( make_request_options, ) -from ......types.workers import ScriptSetting, ScriptSettingParam -from ......types.workers_for_platforms.dispatch.namespaces.scripts import setting_edit_params +from ......types.workers_for_platforms.dispatch.namespaces.scripts import ( + SettingGetResponse, + SettingEditResponse, + setting_edit_params, +) __all__ = ["Settings", "AsyncSettings"] @@ -46,17 +47,14 @@ def edit( *, account_id: str, dispatch_namespace: str, - errors: Iterable[shared_params.ResponseInfo], - messages: Iterable[shared_params.ResponseInfo], - result: ScriptSettingParam, - success: Literal[True], + settings: setting_edit_params.Settings | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScriptSetting: + ) -> SettingEditResponse: """ Patch script metadata, such as bindings @@ -67,8 +65,6 @@ def edit( script_name: Name of the script, used in URLs and route configuration. - success: Whether the API call was successful - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -85,15 +81,7 @@ def edit( raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return self._patch( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/settings", - body=maybe_transform( - { - "errors": errors, - "messages": messages, - "result": result, - "success": success, - }, - setting_edit_params.SettingEditParams, - ), + body=maybe_transform({"settings": settings}, setting_edit_params.SettingEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -101,7 +89,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), + cast_to=cast(Type[SettingEditResponse], ResultWrapper[SettingEditResponse]), ) def get( @@ -116,7 +104,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScriptSetting: + ) -> SettingGetResponse: """ Get script settings from a script uploaded to a Workers for Platforms namespace. @@ -150,7 +138,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), + cast_to=cast(Type[SettingGetResponse], ResultWrapper[SettingGetResponse]), ) @@ -169,17 +157,14 @@ async def edit( *, account_id: str, dispatch_namespace: str, - errors: Iterable[shared_params.ResponseInfo], - messages: Iterable[shared_params.ResponseInfo], - result: ScriptSettingParam, - success: Literal[True], + settings: setting_edit_params.Settings | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScriptSetting: + ) -> SettingEditResponse: """ Patch script metadata, such as bindings @@ -190,8 +175,6 @@ async def edit( script_name: Name of the script, used in URLs and route configuration. - success: Whether the API call was successful - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -208,15 +191,7 @@ async def edit( raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return await self._patch( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/settings", - body=await async_maybe_transform( - { - "errors": errors, - "messages": messages, - "result": result, - "success": success, - }, - setting_edit_params.SettingEditParams, - ), + body=await async_maybe_transform({"settings": settings}, setting_edit_params.SettingEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -224,7 +199,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), + cast_to=cast(Type[SettingEditResponse], ResultWrapper[SettingEditResponse]), ) async def get( @@ -239,7 +214,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScriptSetting: + ) -> SettingGetResponse: """ Get script settings from a script uploaded to a Workers for Platforms namespace. @@ -273,7 +248,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), + cast_to=cast(Type[SettingGetResponse], ResultWrapper[SettingGetResponse]), ) diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index 3842e635ec8..4b06fc7e734 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -65,6 +65,7 @@ from .target_param import TargetParam as TargetParam from .tunnel_param import TunnelParam as TunnelParam from .waiting_room import WaitingRoom as WaitingRoom +from .binding_param import BindingParam as BindingParam from .bundle_method import BundleMethod as BundleMethod from .configuration import Configuration as Configuration from .default_pools import DefaultPools as DefaultPools @@ -78,6 +79,7 @@ from .hostname_param import HostnameParam as HostnameParam from .ip_list_params import IPListParams as IPListParams from .labeled_region import LabeledRegion as LabeledRegion +from .migration_step import MigrationStep as MigrationStep from .allowed_origins import AllowedOrigins as AllowedOrigins from .firewall_filter import FirewallFilter as FirewallFilter from .origin_steering import OriginSteering as OriginSteering @@ -85,10 +87,12 @@ from .rate_plan_param import RatePlanParam as RatePlanParam from .service_binding import ServiceBinding as ServiceBinding from .adaptive_routing import AdaptiveRouting as AdaptiveRouting +from .d1_binding_param import D1BindingParam as D1BindingParam from .geo_restrictions import GeoRestrictions as GeoRestrictions from .ip_list_response import IPListResponse as IPListResponse from .mtls_certificate import MTLSCertificate as MTLSCertificate from .origin_dns_param import OriginDNSParam as OriginDNSParam +from .r2_binding_param import R2BindingParam as R2BindingParam from .user_edit_params import UserEditParams as UserEditParams from .zone_edit_params import ZoneEditParams as ZoneEditParams from .zone_list_params import ZoneListParams as ZoneListParams @@ -103,6 +107,7 @@ from .origin_port_param import OriginPortParam as OriginPortParam from .pcap_filter_param import PCAPFilterParam as PCAPFilterParam from .pcap_get_response import PCAPGetResponse as PCAPGetResponse +from .stepped_migration import SteppedMigration as SteppedMigration from .tcp_configuration import TCPConfiguration as TCPConfiguration from .user_get_response import UserGetResponse as UserGetResponse from .cache_purge_params import CachePurgeParams as CachePurgeParams @@ -157,6 +162,8 @@ from .random_steering_param import RandomSteeringParam as RandomSteeringParam from .ruleset_create_params import RulesetCreateParams as RulesetCreateParams from .ruleset_update_params import RulesetUpdateParams as RulesetUpdateParams +from .service_binding_param import ServiceBindingParam as ServiceBindingParam +from .single_step_migration import SingleStepMigration as SingleStepMigration from .snippet_update_params import SnippetUpdateParams as SnippetUpdateParams from .speed_delete_response import SpeedDeleteResponse as SpeedDeleteResponse from .worker_metadata_param import WorkerMetadataParam as WorkerMetadataParam @@ -182,6 +189,8 @@ from .healthcheck_edit_params import HealthcheckEditParams as HealthcheckEditParams from .location_strategy_param import LocationStrategyParam as LocationStrategyParam from .membership_get_response import MembershipGetResponse as MembershipGetResponse +from .mtls_cert_binding_param import MTLSCERTBindingParam as MTLSCERTBindingParam +from .placement_configuration import PlacementConfiguration as PlacementConfiguration from .rate_limit_get_response import RateLimitGetResponse as RateLimitGetResponse from .ruleset_create_response import RulesetCreateResponse as RulesetCreateResponse from .ruleset_update_response import RulesetUpdateResponse as RulesetUpdateResponse @@ -211,6 +220,7 @@ from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse from .url_scanner_scan_response import URLScannerScanResponse as URLScannerScanResponse from .dispatch_namespace_binding import DispatchNamespaceBinding as DispatchNamespaceBinding +from .kv_namespace_binding_param import KVNamespaceBindingParam as KVNamespaceBindingParam from .managed_header_edit_params import ManagedHeaderEditParams as ManagedHeaderEditParams from .membership_delete_response import MembershipDeleteResponse as MembershipDeleteResponse from .membership_update_response import MembershipUpdateResponse as MembershipUpdateResponse @@ -241,6 +251,7 @@ from .bot_management_update_params import BotManagementUpdateParams as BotManagementUpdateParams from .custom_hostname_get_response import CustomHostnameGetResponse as CustomHostnameGetResponse from .dns_analytics_nominal_metric import DNSAnalyticsNominalMetric as DNSAnalyticsNominalMetric +from .durable_object_binding_param import DurableObjectBindingParam as DurableObjectBindingParam from .email_routing_disable_params import EmailRoutingDisableParams as EmailRoutingDisableParams from .managed_header_edit_response import ManagedHeaderEditResponse as ManagedHeaderEditResponse from .managed_header_list_response import ManagedHeaderListResponse as ManagedHeaderListResponse @@ -284,6 +295,7 @@ from .custom_certificate_create_params import CustomCertificateCreateParams as CustomCertificateCreateParams from .custom_certificate_delete_params import CustomCertificateDeleteParams as CustomCertificateDeleteParams from .custom_certificate_edit_response import CustomCertificateEditResponse as CustomCertificateEditResponse +from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam as DispatchNamespaceBindingParam from .mtls_certificate_create_response import MTLSCertificateCreateResponse as MTLSCertificateCreateResponse from .custom_nameserver_delete_response import CustomNameserverDeleteResponse as CustomNameserverDeleteResponse from .custom_nameserver_verify_response import CustomNameserverVerifyResponse as CustomNameserverVerifyResponse diff --git a/src/cloudflare/types/addressing/prefixes/bgp/__init__.py b/src/cloudflare/types/addressing/prefixes/bgp/__init__.py index bf70ca01135..6406cdc7c26 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/__init__.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/__init__.py @@ -9,4 +9,5 @@ from .status_get_response import StatusGetResponse as StatusGetResponse from .status_edit_response import StatusEditResponse as StatusEditResponse from .binding_create_params import BindingCreateParams as BindingCreateParams +from .service_binding_param import ServiceBindingParam as ServiceBindingParam from .binding_delete_response import BindingDeleteResponse as BindingDeleteResponse diff --git a/src/cloudflare/types/addressing/prefixes/bgp/service_binding_param.py b/src/cloudflare/types/addressing/prefixes/bgp/service_binding_param.py new file mode 100644 index 00000000000..3dd61ede1cb --- /dev/null +++ b/src/cloudflare/types/addressing/prefixes/bgp/service_binding_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["ServiceBindingParam", "Provisioning"] + + +class Provisioning(TypedDict, total=False): + state: Literal["provisioning", "active"] + """ + When a binding has been deployed to a majority of Cloudflare datacenters, the + binding will become active and can be used with its associated service. + """ + + +class ServiceBindingParam(TypedDict, total=False): + cidr: str + """IP Prefix in Classless Inter-Domain Routing format.""" + + provisioning: Provisioning + """Status of a Service Binding's deployment to the Cloudflare network""" + + service_id: str + """Identifier""" + + service_name: str + """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/binding_param.py b/src/cloudflare/types/binding_param.py new file mode 100644 index 00000000000..478be46927b --- /dev/null +++ b/src/cloudflare/types/binding_param.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypedDict + +from .d1_binding_param import D1BindingParam +from .r2_binding_param import R2BindingParam +from .service_binding_param import ServiceBindingParam +from .mtls_cert_binding_param import MTLSCERTBindingParam +from .kv_namespace_binding_param import KVNamespaceBindingParam +from .durable_object_binding_param import DurableObjectBindingParam +from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam + +__all__ = ["BindingParam", "WorkersQueueBinding"] + + +class WorkersQueueBinding(TypedDict, total=False): + queue_name: Required[str] + """Name of the Queue to bind to""" + + type: Required[Literal["queue"]] + """The class of resource that the binding provides.""" + + +BindingParam = Union[ + KVNamespaceBindingParam, + ServiceBindingParam, + DurableObjectBindingParam, + R2BindingParam, + WorkersQueueBinding, + D1BindingParam, + DispatchNamespaceBindingParam, + MTLSCERTBindingParam, +] diff --git a/src/cloudflare/types/d1_binding_param.py b/src/cloudflare/types/d1_binding_param.py new file mode 100644 index 00000000000..74face1628f --- /dev/null +++ b/src/cloudflare/types/d1_binding_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["D1BindingParam"] + + +class D1BindingParam(TypedDict, total=False): + id: Required[str] + """ID of the D1 database to bind to""" + + name: Required[str] + """The name of the D1 database associated with the 'id' provided.""" + + type: Required[Literal["d1"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/dispatch_namespace_binding_param.py b/src/cloudflare/types/dispatch_namespace_binding_param.py new file mode 100644 index 00000000000..584c5d86e15 --- /dev/null +++ b/src/cloudflare/types/dispatch_namespace_binding_param.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DispatchNamespaceBindingParam", "Outbound", "OutboundWorker"] + + +class OutboundWorker(TypedDict, total=False): + environment: str + """Environment of the outbound worker""" + + service: str + """Name of the outbound worker""" + + +class Outbound(TypedDict, total=False): + params: List[str] + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters + """ + + worker: OutboundWorker + """Outbound worker""" + + +class DispatchNamespaceBindingParam(TypedDict, total=False): + namespace: Required[str] + """Namespace to bind to""" + + type: Required[Literal["dispatch_namespace"]] + """The class of resource that the binding provides.""" + + outbound: Outbound + """Outbound worker""" diff --git a/src/cloudflare/types/durable_object_binding_param.py b/src/cloudflare/types/durable_object_binding_param.py new file mode 100644 index 00000000000..6c00bbd63a9 --- /dev/null +++ b/src/cloudflare/types/durable_object_binding_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DurableObjectBindingParam"] + + +class DurableObjectBindingParam(TypedDict, total=False): + class_name: Required[str] + """The exported class name of the Durable Object""" + + type: Required[Literal["durable_object_namespace"]] + """The class of resource that the binding provides.""" + + environment: str + """The environment of the script_name to bind to""" + + script_name: str + """ + The script where the Durable Object is defined, if it is external to this Worker + """ diff --git a/src/cloudflare/types/kv_namespace_binding_param.py b/src/cloudflare/types/kv_namespace_binding_param.py new file mode 100644 index 00000000000..7dc97bab2a6 --- /dev/null +++ b/src/cloudflare/types/kv_namespace_binding_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["KVNamespaceBindingParam"] + + +class KVNamespaceBindingParam(TypedDict, total=False): + type: Required[Literal["kv_namespace"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/migration_step.py b/src/cloudflare/types/migration_step.py new file mode 100644 index 00000000000..24ba3dbed16 --- /dev/null +++ b/src/cloudflare/types/migration_step.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["MigrationStep", "RenamedClass", "TransferredClass"] + + +class RenamedClass(BaseModel): + from_: Optional[str] = FieldInfo(alias="from", default=None) + + to: Optional[str] = None + + +class TransferredClass(BaseModel): + from_: Optional[str] = FieldInfo(alias="from", default=None) + + from_script: Optional[str] = None + + to: Optional[str] = None + + +class MigrationStep(BaseModel): + deleted_classes: Optional[List[str]] = None + """A list of classes to delete Durable Object namespaces from.""" + + new_classes: Optional[List[str]] = None + """A list of classes to create Durable Object namespaces from.""" + + renamed_classes: Optional[List[RenamedClass]] = None + """A list of classes with Durable Object namespaces that were renamed.""" + + transferred_classes: Optional[List[TransferredClass]] = None + """ + A list of transfers for Durable Object namespaces from a different Worker and + class to a class defined in this Worker. + """ diff --git a/src/cloudflare/types/mtls_cert_binding_param.py b/src/cloudflare/types/mtls_cert_binding_param.py new file mode 100644 index 00000000000..e6d8c865b55 --- /dev/null +++ b/src/cloudflare/types/mtls_cert_binding_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["MTLSCERTBindingParam"] + + +class MTLSCERTBindingParam(TypedDict, total=False): + certificate: Required[object] + + type: Required[Literal["mtls_certificate"]] + """The class of resource that the binding provides.""" + + certificate_id: str + """ID of the certificate to bind to""" diff --git a/src/cloudflare/types/placement_configuration.py b/src/cloudflare/types/placement_configuration.py new file mode 100644 index 00000000000..13def2d7f05 --- /dev/null +++ b/src/cloudflare/types/placement_configuration.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["PlacementConfiguration"] + + +class PlacementConfiguration(BaseModel): + mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + Only `"smart"` is currently supported + """ diff --git a/src/cloudflare/types/r2_binding_param.py b/src/cloudflare/types/r2_binding_param.py new file mode 100644 index 00000000000..559667ded10 --- /dev/null +++ b/src/cloudflare/types/r2_binding_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["R2BindingParam"] + + +class R2BindingParam(TypedDict, total=False): + bucket_name: Required[str] + """R2 bucket to bind to""" + + type: Required[Literal["r2_bucket"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/service_binding_param.py b/src/cloudflare/types/service_binding_param.py new file mode 100644 index 00000000000..52ecb335075 --- /dev/null +++ b/src/cloudflare/types/service_binding_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ServiceBindingParam"] + + +class ServiceBindingParam(TypedDict, total=False): + environment: Required[str] + """Optional environment if the Worker utilizes one.""" + + service: Required[str] + """Name of Worker to bind to""" + + type: Required[Literal["service"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/shared_params/__init__.py b/src/cloudflare/types/shared_params/__init__.py deleted file mode 100644 index 9325e6fd293..00000000000 --- a/src/cloudflare/types/shared_params/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .response_info import ResponseInfo as ResponseInfo diff --git a/src/cloudflare/types/shared_params/response_info.py b/src/cloudflare/types/shared_params/response_info.py deleted file mode 100644 index 5e5530fa01e..00000000000 --- a/src/cloudflare/types/shared_params/response_info.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["ResponseInfo"] - - -class ResponseInfo(TypedDict, total=False): - code: Required[int] - - message: Required[str] diff --git a/src/cloudflare/types/single_step_migration.py b/src/cloudflare/types/single_step_migration.py new file mode 100644 index 00000000000..615d51a4905 --- /dev/null +++ b/src/cloudflare/types/single_step_migration.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["SingleStepMigration", "RenamedClass", "TransferredClass"] + + +class RenamedClass(BaseModel): + from_: Optional[str] = FieldInfo(alias="from", default=None) + + to: Optional[str] = None + + +class TransferredClass(BaseModel): + from_: Optional[str] = FieldInfo(alias="from", default=None) + + from_script: Optional[str] = None + + to: Optional[str] = None + + +class SingleStepMigration(BaseModel): + deleted_classes: Optional[List[str]] = None + """A list of classes to delete Durable Object namespaces from.""" + + new_classes: Optional[List[str]] = None + """A list of classes to create Durable Object namespaces from.""" + + new_tag: Optional[str] = None + """Tag to set as the latest migration tag.""" + + old_tag: Optional[str] = None + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + renamed_classes: Optional[List[RenamedClass]] = None + """A list of classes with Durable Object namespaces that were renamed.""" + + transferred_classes: Optional[List[TransferredClass]] = None + """ + A list of transfers for Durable Object namespaces from a different Worker and + class to a class defined in this Worker. + """ diff --git a/src/cloudflare/types/stepped_migration.py b/src/cloudflare/types/stepped_migration.py new file mode 100644 index 00000000000..f89090e3e66 --- /dev/null +++ b/src/cloudflare/types/stepped_migration.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .migration_step import MigrationStep + +__all__ = ["SteppedMigration"] + + +class SteppedMigration(BaseModel): + new_tag: Optional[str] = None + """Tag to set as the latest migration tag.""" + + old_tag: Optional[str] = None + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + steps: Optional[List[MigrationStep]] = None + """Migrations to apply in order.""" diff --git a/src/cloudflare/types/workers/__init__.py b/src/cloudflare/types/workers/__init__.py index 33c80609e12..d966f906713 100644 --- a/src/cloudflare/types/workers/__init__.py +++ b/src/cloudflare/types/workers/__init__.py @@ -11,7 +11,6 @@ from .domain_delete_params import DomainDeleteParams as DomainDeleteParams from .domain_update_params import DomainUpdateParams as DomainUpdateParams from .script_delete_params import ScriptDeleteParams as ScriptDeleteParams -from .script_setting_param import ScriptSettingParam as ScriptSettingParam from .script_update_params import ScriptUpdateParams as ScriptUpdateParams from .subdomain_get_response import SubdomainGetResponse as SubdomainGetResponse from .subdomain_update_params import SubdomainUpdateParams as SubdomainUpdateParams diff --git a/src/cloudflare/types/workers/script.py b/src/cloudflare/types/workers/script.py index 38b5900c4b9..99c72f91c25 100644 --- a/src/cloudflare/types/workers/script.py +++ b/src/cloudflare/types/workers/script.py @@ -25,9 +25,6 @@ class Script(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - pipeline_hash: Optional[str] = None - """Deprecated. Deployment metadata for internal usage.""" - placement_mode: Optional[str] = None """Specifies the placement mode for the Worker (e.g. 'smart').""" diff --git a/src/cloudflare/types/workers/script_setting_param.py b/src/cloudflare/types/workers/script_setting_param.py deleted file mode 100644 index 0ffcee9ea57..00000000000 --- a/src/cloudflare/types/workers/script_setting_param.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import TypedDict - -from .scripts import ConsumerScriptParam - -__all__ = ["ScriptSettingParam"] - - -class ScriptSettingParam(TypedDict, total=False): - logpush: bool - """Whether Logpush is turned on for the Worker.""" - - tail_consumers: Iterable[ConsumerScriptParam] - """List of Workers that will consume logs from the attached Worker.""" diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 502f9da812e..23aac77d3b1 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -32,7 +32,8 @@ class Variant0(TypedDict, total=False): Multiple modules may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or - `body_part` by part name. + `body_part` by part name. Source maps may also be included using the + `application/source-map` content type. """ metadata: Variant0Metadata diff --git a/src/cloudflare/types/workers/scripts/content_update_params.py b/src/cloudflare/types/workers/scripts/content_update_params.py index 10089d59229..7455c2df074 100644 --- a/src/cloudflare/types/workers/scripts/content_update_params.py +++ b/src/cloudflare/types/workers/scripts/content_update_params.py @@ -23,7 +23,8 @@ class ContentUpdateParams(TypedDict, total=False): module must be present. This should be referenced either in the metadata as `main_module` (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` (esm) /`CF-WORKER-BODY-PART` (service worker) by - part name. + part name. Source maps may also be included using the `application/source-map` + content type. """ metadata: WorkerMetadataParam diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 4d37d169a81..c647e7127b7 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -27,7 +27,8 @@ class Variant0(TypedDict, total=False): Multiple modules may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or - `body_part` by part name. + `body_part` by part name. Source maps may also be included using the + `application/source-map` content type. """ metadata: Variant0Metadata diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py index 5b2d8619a66..f02cfa2e631 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py @@ -3,4 +3,7 @@ from __future__ import annotations from .setting_edit_params import SettingEditParams as SettingEditParams +from .binding_get_response import BindingGetResponse as BindingGetResponse +from .setting_get_response import SettingGetResponse as SettingGetResponse from .content_update_params import ContentUpdateParams as ContentUpdateParams +from .setting_edit_response import SettingEditResponse as SettingEditResponse diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py new file mode 100644 index 00000000000..c294ece4d49 --- /dev/null +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .....binding import Binding + +__all__ = ["BindingGetResponse"] + +BindingGetResponse = List[Binding] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py index 75cfc5b9d04..ae14a76e153 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py @@ -26,7 +26,8 @@ class ContentUpdateParams(TypedDict, total=False): module must be present. This should be referenced either in the metadata as `main_module` (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` (esm) /`CF-WORKER-BODY-PART` (service worker) by - part name. + part name. Source maps may also be included using the `application/source-map` + content type. """ metadata: WorkerMetadataParam diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index 006e229ecb6..46f4772625f 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -2,13 +2,16 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, Required, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Required, TypedDict -from ......types import shared_params -from .....workers import ScriptSettingParam +from .....binding_param import BindingParam +from .....workers.scripts import ConsumerScriptParam +from .....stepped_migration_param import SteppedMigrationParam +from .....single_step_migration_param import SingleStepMigrationParam +from .....placement_configuration_param import PlacementConfigurationParam -__all__ = ["SettingEditParams"] +__all__ = ["SettingEditParams", "Settings", "SettingsLimits", "SettingsMigrations"] class SettingEditParams(TypedDict, total=False): @@ -18,11 +21,43 @@ class SettingEditParams(TypedDict, total=False): dispatch_namespace: Required[str] """Name of the Workers for Platforms dispatch namespace.""" - errors: Required[Iterable[shared_params.ResponseInfo]] + settings: Settings - messages: Required[Iterable[shared_params.ResponseInfo]] - result: Required[ScriptSettingParam] +class SettingsLimits(TypedDict, total=False): + cpu_ms: int + """The amount of CPU time this Worker can use in milliseconds.""" - success: Required[Literal[True]] - """Whether the API call was successful""" + +SettingsMigrations = Union[SingleStepMigrationParam, SteppedMigrationParam] + + +class Settings(TypedDict, total=False): + bindings: Iterable[BindingParam] + """List of bindings attached to this Worker""" + + compatibility_date: str + """Opt your Worker into changes after this date""" + + compatibility_flags: List[str] + """Opt your Worker into specific changes""" + + limits: SettingsLimits + """Limits to apply for this Worker.""" + + logpush: bool + """Whether Logpush is turned on for the Worker.""" + + migrations: SettingsMigrations + """Migrations to apply for Durable Objects associated with this Worker.""" + + placement: PlacementConfigurationParam + + tags: List[str] + """Tags to help you manage your Workers""" + + tail_consumers: Iterable[ConsumerScriptParam] + """List of Workers that will consume logs from the attached Worker.""" + + usage_model: str + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py new file mode 100644 index 00000000000..49eac786783 --- /dev/null +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional + +from .....binding import Binding +from ......_models import BaseModel +from .....workers.scripts import ConsumerScript +from .....stepped_migration import SteppedMigration +from .....single_step_migration import SingleStepMigration +from .....placement_configuration import PlacementConfiguration + +__all__ = ["SettingEditResponse", "Limits", "Migrations"] + + +class Limits(BaseModel): + cpu_ms: Optional[int] = None + """The amount of CPU time this Worker can use in milliseconds.""" + + +Migrations = Union[SingleStepMigration, SteppedMigration] + + +class SettingEditResponse(BaseModel): + bindings: Optional[List[Binding]] = None + """List of bindings attached to this Worker""" + + compatibility_date: Optional[str] = None + """Opt your Worker into changes after this date""" + + compatibility_flags: Optional[List[str]] = None + """Opt your Worker into specific changes""" + + limits: Optional[Limits] = None + """Limits to apply for this Worker.""" + + logpush: Optional[bool] = None + """Whether Logpush is turned on for the Worker.""" + + migrations: Optional[Migrations] = None + """Migrations to apply for Durable Objects associated with this Worker.""" + + placement: Optional[PlacementConfiguration] = None + + tags: Optional[List[str]] = None + """Tags to help you manage your Workers""" + + tail_consumers: Optional[List[ConsumerScript]] = None + """List of Workers that will consume logs from the attached Worker.""" + + usage_model: Optional[str] = None + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py new file mode 100644 index 00000000000..4076f23ee32 --- /dev/null +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional + +from .....binding import Binding +from ......_models import BaseModel +from .....workers.scripts import ConsumerScript +from .....stepped_migration import SteppedMigration +from .....single_step_migration import SingleStepMigration +from .....placement_configuration import PlacementConfiguration + +__all__ = ["SettingGetResponse", "Limits", "Migrations"] + + +class Limits(BaseModel): + cpu_ms: Optional[int] = None + """The amount of CPU time this Worker can use in milliseconds.""" + + +Migrations = Union[SingleStepMigration, SteppedMigration] + + +class SettingGetResponse(BaseModel): + bindings: Optional[List[Binding]] = None + """List of bindings attached to this Worker""" + + compatibility_date: Optional[str] = None + """Opt your Worker into changes after this date""" + + compatibility_flags: Optional[List[str]] = None + """Opt your Worker into specific changes""" + + limits: Optional[Limits] = None + """Limits to apply for this Worker.""" + + logpush: Optional[bool] = None + """Whether Logpush is turned on for the Worker.""" + + migrations: Optional[Migrations] = None + """Migrations to apply for Durable Objects associated with this Worker.""" + + placement: Optional[PlacementConfiguration] = None + + tags: Optional[List[str]] = None + """Tags to help you manage your Workers""" + + tail_consumers: Optional[List[ConsumerScript]] = None + """List of Workers that will consume logs from the attached Worker.""" + + usage_model: Optional[str] = None + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py index 43663655eb0..e11447ac29a 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import Binding +from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import BindingGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(Binding, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(Binding, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -53,7 +53,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(Binding, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) assert cast(Any, response.is_closed) is True @@ -93,7 +93,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(Binding, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +107,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(Binding, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -121,7 +121,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(Binding, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py index 68c0091b8ae..eb8a214f241 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py @@ -9,7 +9,10 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers import ScriptSetting +from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( + SettingGetResponse, + SettingEditResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,38 +27,8 @@ def test_method_edit(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -64,36 +37,55 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={ + settings={ + "bindings": [{"type": "kv_namespace"}, {"type": "kv_namespace"}, {"type": "kv_namespace"}], + "compatibility_date": "2022-04-05", + "compatibility_flags": [ + "formdata_parser_supports_files", + "formdata_parser_supports_files", + "formdata_parser_supports_files", + ], + "limits": {"cpu_ms": 50}, "logpush": False, + "migrations": { + "new_tag": "v2", + "old_tag": "v1", + "deleted_classes": ["string", "string", "string"], + "new_classes": ["string", "string", "string"], + "renamed_classes": [ + { + "from": "string", + "to": "string", + }, + { + "from": "string", + "to": "string", + }, + { + "from": "string", + "to": "string", + }, + ], + "transferred_classes": [ + { + "from": "string", + "from_script": "string", + "to": "string", + }, + { + "from": "string", + "from_script": "string", + "to": "string", + }, + { + "from": "string", + "from_script": "string", + "to": "string", + }, + ], + }, + "placement": {"mode": "smart"}, + "tags": ["my-tag", "my-tag", "my-tag"], "tail_consumers": [ { "environment": "production", @@ -111,10 +103,10 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "service": "my-log-consumer", }, ], + "usage_model": "unbound", }, - success=True, ) - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -123,42 +115,12 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -167,42 +129,12 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -214,36 +146,6 @@ def test_path_params_edit(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -251,36 +153,6 @@ def test_path_params_edit(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -288,36 +160,6 @@ def test_path_params_edit(self, client: Cloudflare) -> None: "", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) @pytest.mark.skip() @@ -328,7 +170,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingGetResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -342,7 +184,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingGetResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -356,7 +198,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingGetResponse, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -395,38 +237,8 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -435,36 +247,55 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={ + settings={ + "bindings": [{"type": "kv_namespace"}, {"type": "kv_namespace"}, {"type": "kv_namespace"}], + "compatibility_date": "2022-04-05", + "compatibility_flags": [ + "formdata_parser_supports_files", + "formdata_parser_supports_files", + "formdata_parser_supports_files", + ], + "limits": {"cpu_ms": 50}, "logpush": False, + "migrations": { + "new_tag": "v2", + "old_tag": "v1", + "deleted_classes": ["string", "string", "string"], + "new_classes": ["string", "string", "string"], + "renamed_classes": [ + { + "from": "string", + "to": "string", + }, + { + "from": "string", + "to": "string", + }, + { + "from": "string", + "to": "string", + }, + ], + "transferred_classes": [ + { + "from": "string", + "from_script": "string", + "to": "string", + }, + { + "from": "string", + "from_script": "string", + "to": "string", + }, + { + "from": "string", + "from_script": "string", + "to": "string", + }, + ], + }, + "placement": {"mode": "smart"}, + "tags": ["my-tag", "my-tag", "my-tag"], "tail_consumers": [ { "environment": "production", @@ -482,10 +313,10 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "service": "my-log-consumer", }, ], + "usage_model": "unbound", }, - success=True, ) - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -494,42 +325,12 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -538,42 +339,12 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingEditResponse, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -585,36 +356,6 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -622,36 +363,6 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -659,36 +370,6 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: "", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - errors=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - messages=[ - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - { - "code": 1000, - "message": "string", - }, - ], - result={}, - success=True, ) @pytest.mark.skip() @@ -699,7 +380,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingGetResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -713,7 +394,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingGetResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -727,7 +408,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(ScriptSetting, setting, path=["response"]) + assert_matches_type(SettingGetResponse, setting, path=["response"]) assert cast(Any, response.is_closed) is True