From ebcafa64eb3f82085e78db2786cc82193ba43525 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:14:56 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#214) --- .../resources/workers/scripts/settings.py | 8 +- .../workers/scripts/setting_edit_params.py | 176 +++++------ .../environments/setting_edit_params.py | 293 +----------------- .../environments/setting_edit_response.py | 288 +---------------- .../environments/setting_get_response.py | 288 +---------------- .../namespaces/scripts/setting_edit_params.py | 293 +----------------- .../scripts/setting_edit_response.py | 288 +---------------- .../scripts/setting_get_response.py | 288 +---------------- .../workers/scripts/test_settings.py | 282 +++++++---------- .../services/environments/test_settings.py | 94 ------ .../namespaces/scripts/test_settings.py | 94 ------ 11 files changed, 200 insertions(+), 2192 deletions(-) diff --git a/src/cloudflare/resources/workers/scripts/settings.py b/src/cloudflare/resources/workers/scripts/settings.py index 8cf8611f7801..bd34844a1ba5 100644 --- a/src/cloudflare/resources/workers/scripts/settings.py +++ b/src/cloudflare/resources/workers/scripts/settings.py @@ -51,7 +51,7 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SettingEditResponse: """ - Patch script metadata or config, such as bindings or usage model + Patch metadata or config, such as bindings or usage model Args: account_id: Identifier @@ -96,7 +96,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SettingGetResponse: """ - Get script metadata and config, such as bindings or usage model + Get metadata and config, such as bindings or usage model Args: account_id: Identifier @@ -151,7 +151,7 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SettingEditResponse: """ - Patch script metadata or config, such as bindings or usage model + Patch metadata or config, such as bindings or usage model Args: account_id: Identifier @@ -196,7 +196,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SettingGetResponse: """ - Get script metadata and config, such as bindings or usage model + Get metadata and config, such as bindings or usage model Args: account_id: Identifier diff --git a/src/cloudflare/types/workers/scripts/setting_edit_params.py b/src/cloudflare/types/workers/scripts/setting_edit_params.py index 075b4d9915f4..08e4ef027eea 100644 --- a/src/cloudflare/types/workers/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers/scripts/setting_edit_params.py @@ -8,30 +8,27 @@ __all__ = [ "SettingEditParams", "Settings", - "SettingsError", - "SettingsMessage", - "SettingsResult", - "SettingsResultBinding", - "SettingsResultBindingWorkersKVNamespaceBinding", - "SettingsResultBindingWorkersServiceBinding", - "SettingsResultBindingWorkersDoBinding", - "SettingsResultBindingWorkersR2Binding", - "SettingsResultBindingWorkersQueueBinding", - "SettingsResultBindingWorkersD1Binding", - "SettingsResultBindingWorkersDispatchNamespaceBinding", - "SettingsResultBindingWorkersDispatchNamespaceBindingOutbound", - "SettingsResultBindingWorkersDispatchNamespaceBindingOutboundWorker", - "SettingsResultBindingWorkersMTLSCERTBinding", - "SettingsResultMigrations", - "SettingsResultMigrationsWorkersSingleStepMigrations", - "SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClass", - "SettingsResultMigrationsWorkersSingleStepMigrationsTransferredClass", - "SettingsResultMigrationsWorkersSteppedMigrations", - "SettingsResultMigrationsWorkersSteppedMigrationsStep", - "SettingsResultMigrationsWorkersSteppedMigrationsStepRenamedClass", - "SettingsResultMigrationsWorkersSteppedMigrationsStepTransferredClass", - "SettingsResultPlacement", - "SettingsResultTailConsumer", + "SettingsBinding", + "SettingsBindingWorkersKVNamespaceBinding", + "SettingsBindingWorkersServiceBinding", + "SettingsBindingWorkersDoBinding", + "SettingsBindingWorkersR2Binding", + "SettingsBindingWorkersQueueBinding", + "SettingsBindingWorkersD1Binding", + "SettingsBindingWorkersDispatchNamespaceBinding", + "SettingsBindingWorkersDispatchNamespaceBindingOutbound", + "SettingsBindingWorkersDispatchNamespaceBindingOutboundWorker", + "SettingsBindingWorkersMTLSCERTBinding", + "SettingsMigrations", + "SettingsMigrationsWorkersSingleStepMigrations", + "SettingsMigrationsWorkersSingleStepMigrationsRenamedClass", + "SettingsMigrationsWorkersSingleStepMigrationsTransferredClass", + "SettingsMigrationsWorkersSteppedMigrations", + "SettingsMigrationsWorkersSteppedMigrationsStep", + "SettingsMigrationsWorkersSteppedMigrationsStepRenamedClass", + "SettingsMigrationsWorkersSteppedMigrationsStepTransferredClass", + "SettingsPlacement", + "SettingsTailConsumer", ] @@ -42,24 +39,12 @@ class SettingEditParams(TypedDict, total=False): settings: Settings -class SettingsError(TypedDict, total=False): - code: Required[int] - - message: Required[str] - - -class SettingsMessage(TypedDict, total=False): - code: Required[int] - - message: Required[str] - - -class SettingsResultBindingWorkersKVNamespaceBinding(TypedDict, total=False): +class SettingsBindingWorkersKVNamespaceBinding(TypedDict, total=False): type: Required[Literal["kv_namespace"]] """The class of resource that the binding provides.""" -class SettingsResultBindingWorkersServiceBinding(TypedDict, total=False): +class SettingsBindingWorkersServiceBinding(TypedDict, total=False): environment: Required[str] """Optional environment if the Worker utilizes one.""" @@ -70,7 +55,7 @@ class SettingsResultBindingWorkersServiceBinding(TypedDict, total=False): """The class of resource that the binding provides.""" -class SettingsResultBindingWorkersDoBinding(TypedDict, total=False): +class SettingsBindingWorkersDoBinding(TypedDict, total=False): class_name: Required[str] """The exported class name of the Durable Object""" @@ -86,7 +71,7 @@ class SettingsResultBindingWorkersDoBinding(TypedDict, total=False): """ -class SettingsResultBindingWorkersR2Binding(TypedDict, total=False): +class SettingsBindingWorkersR2Binding(TypedDict, total=False): bucket_name: Required[str] """R2 bucket to bind to""" @@ -94,7 +79,7 @@ class SettingsResultBindingWorkersR2Binding(TypedDict, total=False): """The class of resource that the binding provides.""" -class SettingsResultBindingWorkersQueueBinding(TypedDict, total=False): +class SettingsBindingWorkersQueueBinding(TypedDict, total=False): queue_name: Required[str] """Name of the Queue to bind to""" @@ -102,7 +87,7 @@ class SettingsResultBindingWorkersQueueBinding(TypedDict, total=False): """The class of resource that the binding provides.""" -class SettingsResultBindingWorkersD1Binding(TypedDict, total=False): +class SettingsBindingWorkersD1Binding(TypedDict, total=False): id: Required[str] """ID of the D1 database to bind to""" @@ -113,7 +98,7 @@ class SettingsResultBindingWorkersD1Binding(TypedDict, total=False): """The class of resource that the binding provides.""" -class SettingsResultBindingWorkersDispatchNamespaceBindingOutboundWorker(TypedDict, total=False): +class SettingsBindingWorkersDispatchNamespaceBindingOutboundWorker(TypedDict, total=False): environment: str """Environment of the outbound worker""" @@ -121,29 +106,29 @@ class SettingsResultBindingWorkersDispatchNamespaceBindingOutboundWorker(TypedDi """Name of the outbound worker""" -class SettingsResultBindingWorkersDispatchNamespaceBindingOutbound(TypedDict, total=False): +class SettingsBindingWorkersDispatchNamespaceBindingOutbound(TypedDict, total=False): params: List[str] """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters """ - worker: SettingsResultBindingWorkersDispatchNamespaceBindingOutboundWorker + worker: SettingsBindingWorkersDispatchNamespaceBindingOutboundWorker """Outbound worker""" -class SettingsResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=False): +class SettingsBindingWorkersDispatchNamespaceBinding(TypedDict, total=False): namespace: Required[str] """Namespace to bind to""" type: Required[Literal["dispatch_namespace"]] """The class of resource that the binding provides.""" - outbound: SettingsResultBindingWorkersDispatchNamespaceBindingOutbound + outbound: SettingsBindingWorkersDispatchNamespaceBindingOutbound """Outbound worker""" -class SettingsResultBindingWorkersMTLSCERTBinding(TypedDict, total=False): +class SettingsBindingWorkersMTLSCERTBinding(TypedDict, total=False): certificate: Required[object] type: Required[Literal["mtls_certificate"]] @@ -153,19 +138,19 @@ class SettingsResultBindingWorkersMTLSCERTBinding(TypedDict, total=False): """ID of the certificate to bind to""" -SettingsResultBinding = Union[ - SettingsResultBindingWorkersKVNamespaceBinding, - SettingsResultBindingWorkersServiceBinding, - SettingsResultBindingWorkersDoBinding, - SettingsResultBindingWorkersR2Binding, - SettingsResultBindingWorkersQueueBinding, - SettingsResultBindingWorkersD1Binding, - SettingsResultBindingWorkersDispatchNamespaceBinding, - SettingsResultBindingWorkersMTLSCERTBinding, +SettingsBinding = Union[ + SettingsBindingWorkersKVNamespaceBinding, + SettingsBindingWorkersServiceBinding, + SettingsBindingWorkersDoBinding, + SettingsBindingWorkersR2Binding, + SettingsBindingWorkersQueueBinding, + SettingsBindingWorkersD1Binding, + SettingsBindingWorkersDispatchNamespaceBinding, + SettingsBindingWorkersMTLSCERTBinding, ] -_SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( - "_SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", +_SettingsMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( + "_SettingsMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", { "from": str, }, @@ -173,14 +158,14 @@ class SettingsResultBindingWorkersMTLSCERTBinding(TypedDict, total=False): ) -class SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClass( - _SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False +class SettingsMigrationsWorkersSingleStepMigrationsRenamedClass( + _SettingsMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False ): to: str -_SettingsResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( - "_SettingsResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", +_SettingsMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( + "_SettingsMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", { "from": str, }, @@ -188,15 +173,15 @@ class SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClass( ) -class SettingsResultMigrationsWorkersSingleStepMigrationsTransferredClass( - _SettingsResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False +class SettingsMigrationsWorkersSingleStepMigrationsTransferredClass( + _SettingsMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False ): from_script: str to: str -class SettingsResultMigrationsWorkersSingleStepMigrations(TypedDict, total=False): +class SettingsMigrationsWorkersSingleStepMigrations(TypedDict, total=False): deleted_classes: List[str] """A list of classes to delete Durable Object namespaces from.""" @@ -212,18 +197,18 @@ class SettingsResultMigrationsWorkersSingleStepMigrations(TypedDict, total=False If they don't match, the upload is rejected. """ - renamed_classes: Iterable[SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClass] + renamed_classes: Iterable[SettingsMigrationsWorkersSingleStepMigrationsRenamedClass] """A list of classes with Durable Object namespaces that were renamed.""" - transferred_classes: Iterable[SettingsResultMigrationsWorkersSingleStepMigrationsTransferredClass] + transferred_classes: Iterable[SettingsMigrationsWorkersSingleStepMigrationsTransferredClass] """ A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker. """ -_SettingsResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( - "_SettingsResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", +_SettingsMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( + "_SettingsMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", { "from": str, }, @@ -231,14 +216,14 @@ class to a class defined in this Worker. ) -class SettingsResultMigrationsWorkersSteppedMigrationsStepRenamedClass( - _SettingsResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False +class SettingsMigrationsWorkersSteppedMigrationsStepRenamedClass( + _SettingsMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False ): to: str -_SettingsResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( - "_SettingsResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", +_SettingsMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( + "_SettingsMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", { "from": str, }, @@ -246,32 +231,32 @@ class SettingsResultMigrationsWorkersSteppedMigrationsStepRenamedClass( ) -class SettingsResultMigrationsWorkersSteppedMigrationsStepTransferredClass( - _SettingsResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False +class SettingsMigrationsWorkersSteppedMigrationsStepTransferredClass( + _SettingsMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False ): from_script: str to: str -class SettingsResultMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): +class SettingsMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): deleted_classes: List[str] """A list of classes to delete Durable Object namespaces from.""" new_classes: List[str] """A list of classes to create Durable Object namespaces from.""" - renamed_classes: Iterable[SettingsResultMigrationsWorkersSteppedMigrationsStepRenamedClass] + renamed_classes: Iterable[SettingsMigrationsWorkersSteppedMigrationsStepRenamedClass] """A list of classes with Durable Object namespaces that were renamed.""" - transferred_classes: Iterable[SettingsResultMigrationsWorkersSteppedMigrationsStepTransferredClass] + transferred_classes: Iterable[SettingsMigrationsWorkersSteppedMigrationsStepTransferredClass] """ A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker. """ -class SettingsResultMigrationsWorkersSteppedMigrations(TypedDict, total=False): +class SettingsMigrationsWorkersSteppedMigrations(TypedDict, total=False): new_tag: str """Tag to set as the latest migration tag.""" @@ -281,16 +266,14 @@ class SettingsResultMigrationsWorkersSteppedMigrations(TypedDict, total=False): If they don't match, the upload is rejected. """ - steps: Iterable[SettingsResultMigrationsWorkersSteppedMigrationsStep] + steps: Iterable[SettingsMigrationsWorkersSteppedMigrationsStep] """Migrations to apply in order.""" -SettingsResultMigrations = Union[ - SettingsResultMigrationsWorkersSingleStepMigrations, SettingsResultMigrationsWorkersSteppedMigrations -] +SettingsMigrations = Union[SettingsMigrationsWorkersSingleStepMigrations, SettingsMigrationsWorkersSteppedMigrations] -class SettingsResultPlacement(TypedDict, total=False): +class SettingsPlacement(TypedDict, total=False): mode: Literal["smart"] """ Enables @@ -299,7 +282,7 @@ class SettingsResultPlacement(TypedDict, total=False): """ -class SettingsResultTailConsumer(TypedDict, total=False): +class SettingsTailConsumer(TypedDict, total=False): service: Required[str] """Name of Worker that is to be the consumer.""" @@ -310,8 +293,8 @@ class SettingsResultTailConsumer(TypedDict, total=False): """Optional dispatch namespace the script belongs to.""" -class SettingsResult(TypedDict, total=False): - bindings: Iterable[SettingsResultBinding] +class Settings(TypedDict, total=False): + bindings: Iterable[SettingsBinding] """List of bindings attached to this Worker""" compatibility_date: str @@ -323,27 +306,16 @@ class SettingsResult(TypedDict, total=False): logpush: bool """Whether Logpush is turned on for the Worker.""" - migrations: SettingsResultMigrations + migrations: SettingsMigrations """Migrations to apply for Durable Objects associated with this Worker.""" - placement: SettingsResultPlacement + placement: SettingsPlacement tags: List[str] """Tags to help you manage your Workers""" - tail_consumers: Iterable[SettingsResultTailConsumer] + tail_consumers: Iterable[SettingsTailConsumer] """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').""" - - -class Settings(TypedDict, total=False): - errors: Required[Iterable[SettingsError]] - - messages: Required[Iterable[SettingsMessage]] - - result: Required[SettingsResult] - - success: Required[Literal[True]] - """Whether the API call was successful""" diff --git a/src/cloudflare/types/workers/services/environments/setting_edit_params.py b/src/cloudflare/types/workers/services/environments/setting_edit_params.py index 856a3766ea59..1bf1ed5608cd 100644 --- a/src/cloudflare/types/workers/services/environments/setting_edit_params.py +++ b/src/cloudflare/types/workers/services/environments/setting_edit_params.py @@ -2,36 +2,10 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = [ - "SettingEditParams", - "Error", - "Message", - "Result", - "ResultBinding", - "ResultBindingWorkersKVNamespaceBinding", - "ResultBindingWorkersServiceBinding", - "ResultBindingWorkersDoBinding", - "ResultBindingWorkersR2Binding", - "ResultBindingWorkersQueueBinding", - "ResultBindingWorkersD1Binding", - "ResultBindingWorkersDispatchNamespaceBinding", - "ResultBindingWorkersDispatchNamespaceBindingOutbound", - "ResultBindingWorkersDispatchNamespaceBindingOutboundWorker", - "ResultBindingWorkersMTLSCERTBinding", - "ResultMigrations", - "ResultMigrationsWorkersSingleStepMigrations", - "ResultMigrationsWorkersSingleStepMigrationsRenamedClass", - "ResultMigrationsWorkersSingleStepMigrationsTransferredClass", - "ResultMigrationsWorkersSteppedMigrations", - "ResultMigrationsWorkersSteppedMigrationsStep", - "ResultMigrationsWorkersSteppedMigrationsStepRenamedClass", - "ResultMigrationsWorkersSteppedMigrationsStepTransferredClass", - "ResultPlacement", - "ResultTailConsumer", -] +__all__ = ["SettingEditParams", "Error", "Message", "Result", "ResultTailConsumer"] class SettingEditParams(TypedDict, total=False): @@ -63,249 +37,6 @@ class Message(TypedDict, total=False): message: Required[str] -class ResultBindingWorkersKVNamespaceBinding(TypedDict, total=False): - type: Required[Literal["kv_namespace"]] - """The class of resource that the binding provides.""" - - -class ResultBindingWorkersServiceBinding(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.""" - - -class ResultBindingWorkersDoBinding(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 - """ - - -class ResultBindingWorkersR2Binding(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.""" - - -class ResultBindingWorkersQueueBinding(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.""" - - -class ResultBindingWorkersD1Binding(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.""" - - -class ResultBindingWorkersDispatchNamespaceBindingOutboundWorker(TypedDict, total=False): - environment: str - """Environment of the outbound worker""" - - service: str - """Name of the outbound worker""" - - -class ResultBindingWorkersDispatchNamespaceBindingOutbound(TypedDict, total=False): - params: List[str] - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: ResultBindingWorkersDispatchNamespaceBindingOutboundWorker - """Outbound worker""" - - -class ResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=False): - namespace: Required[str] - """Namespace to bind to""" - - type: Required[Literal["dispatch_namespace"]] - """The class of resource that the binding provides.""" - - outbound: ResultBindingWorkersDispatchNamespaceBindingOutbound - """Outbound worker""" - - -class ResultBindingWorkersMTLSCERTBinding(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""" - - -ResultBinding = Union[ - ResultBindingWorkersKVNamespaceBinding, - ResultBindingWorkersServiceBinding, - ResultBindingWorkersDoBinding, - ResultBindingWorkersR2Binding, - ResultBindingWorkersQueueBinding, - ResultBindingWorkersD1Binding, - ResultBindingWorkersDispatchNamespaceBinding, - ResultBindingWorkersMTLSCERTBinding, -] - -_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSingleStepMigrationsRenamedClass( - _ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False -): - to: str - - -_ResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSingleStepMigrationsTransferredClass( - _ResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False -): - from_script: str - - to: str - - -class ResultMigrationsWorkersSingleStepMigrations(TypedDict, total=False): - deleted_classes: List[str] - """A list of classes to delete Durable Object namespaces from.""" - - new_classes: List[str] - """A list of classes to create Durable Object namespaces from.""" - - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - renamed_classes: Iterable[ResultMigrationsWorkersSingleStepMigrationsRenamedClass] - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Iterable[ResultMigrationsWorkersSingleStepMigrationsTransferredClass] - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -_ResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSteppedMigrationsStepRenamedClass( - _ResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False -): - to: str - - -_ResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSteppedMigrationsStepTransferredClass( - _ResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False -): - from_script: str - - to: str - - -class ResultMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): - deleted_classes: List[str] - """A list of classes to delete Durable Object namespaces from.""" - - new_classes: List[str] - """A list of classes to create Durable Object namespaces from.""" - - renamed_classes: Iterable[ResultMigrationsWorkersSteppedMigrationsStepRenamedClass] - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Iterable[ResultMigrationsWorkersSteppedMigrationsStepTransferredClass] - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class ResultMigrationsWorkersSteppedMigrations(TypedDict, total=False): - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - steps: Iterable[ResultMigrationsWorkersSteppedMigrationsStep] - """Migrations to apply in order.""" - - -ResultMigrations = Union[ResultMigrationsWorkersSingleStepMigrations, ResultMigrationsWorkersSteppedMigrations] - - -class ResultPlacement(TypedDict, total=False): - mode: Literal["smart"] - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ - - class ResultTailConsumer(TypedDict, total=False): service: Required[str] """Name of Worker that is to be the consumer.""" @@ -318,28 +49,8 @@ class ResultTailConsumer(TypedDict, total=False): class Result(TypedDict, total=False): - bindings: Iterable[ResultBinding] - """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""" - logpush: bool """Whether Logpush is turned on for the Worker.""" - migrations: ResultMigrations - """Migrations to apply for Durable Objects associated with this Worker.""" - - placement: ResultPlacement - - tags: List[str] - """Tags to help you manage your Workers""" - tail_consumers: Iterable[ResultTailConsumer] """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/services/environments/setting_edit_response.py b/src/cloudflare/types/workers/services/environments/setting_edit_response.py index 19bbf960f0ed..bdfc4f904ce0 100644 --- a/src/cloudflare/types/workers/services/environments/setting_edit_response.py +++ b/src/cloudflare/types/workers/services/environments/setting_edit_response.py @@ -1,274 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from typing import List, Optional from ....._models import BaseModel -__all__ = [ - "SettingEditResponse", - "Binding", - "BindingWorkersKVNamespaceBinding", - "BindingWorkersServiceBinding", - "BindingWorkersDoBinding", - "BindingWorkersR2Binding", - "BindingWorkersQueueBinding", - "BindingWorkersD1Binding", - "BindingWorkersDispatchNamespaceBinding", - "BindingWorkersDispatchNamespaceBindingOutbound", - "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCERTBinding", - "Migrations", - "MigrationsWorkersSingleStepMigrations", - "MigrationsWorkersSingleStepMigrationsRenamedClass", - "MigrationsWorkersSingleStepMigrationsTransferredClass", - "MigrationsWorkersSteppedMigrations", - "MigrationsWorkersSteppedMigrationsStep", - "MigrationsWorkersSteppedMigrationsStepRenamedClass", - "MigrationsWorkersSteppedMigrationsStepTransferredClass", - "Placement", - "TailConsumer", -] - - -class BindingWorkersKVNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The class of resource that the binding provides.""" - - -class BindingWorkersServiceBinding(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to""" - - type: Literal["service"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDoBinding(BaseModel): - class_name: str - """The exported class name of the Durable Object""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The class of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this Worker - """ - - -class BindingWorkersR2Binding(BaseModel): - bucket_name: str - """R2 bucket to bind to""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The class of resource that the binding provides.""" - - -class BindingWorkersQueueBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to""" - - type: Literal["queue"] - """The class of resource that the binding provides.""" - - -class BindingWorkersD1Binding(BaseModel): - id: str - """ID of the D1 database to bind to""" - - binding: str - """A JavaScript variable name for the binding.""" - - name: str - """The name of the D1 database associated with the 'id' provided.""" - - type: Literal["d1"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDispatchNamespaceBindingOutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker""" - - service: Optional[str] = None - """Name of the outbound worker""" - - -class BindingWorkersDispatchNamespaceBindingOutbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: Optional[BindingWorkersDispatchNamespaceBindingOutboundWorker] = None - """Outbound worker""" - - -class BindingWorkersDispatchNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to""" - - type: Literal["dispatch_namespace"] - """The class of resource that the binding provides.""" - - outbound: Optional[BindingWorkersDispatchNamespaceBindingOutbound] = None - """Outbound worker""" - - -class BindingWorkersMTLSCERTBinding(BaseModel): - certificate: object - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The class of resource that the binding provides.""" - - certificate_id: Optional[str] = None - """ID of the certificate to bind to""" - - -Binding = Union[ - BindingWorkersKVNamespaceBinding, - BindingWorkersServiceBinding, - BindingWorkersDoBinding, - BindingWorkersR2Binding, - BindingWorkersQueueBinding, - BindingWorkersD1Binding, - BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCERTBinding, -] - - -class MigrationsWorkersSingleStepMigrationsRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrationsTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrations(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[MigrationsWorkersSingleStepMigrationsRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSingleStepMigrationsTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrationsStepRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStepTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStep(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[MigrationsWorkersSteppedMigrationsStepRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSteppedMigrationsStepTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrations(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[MigrationsWorkersSteppedMigrationsStep]] = None - """Migrations to apply in order.""" - - -Migrations = Union[MigrationsWorkersSingleStepMigrations, MigrationsWorkersSteppedMigrations] - - -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ +__all__ = ["SettingEditResponse", "TailConsumer"] class TailConsumer(BaseModel): @@ -283,28 +19,8 @@ class TailConsumer(BaseModel): 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""" - 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[Placement] = None - - tags: Optional[List[str]] = None - """Tags to help you manage your Workers""" - tail_consumers: Optional[List[TailConsumer]] = 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/services/environments/setting_get_response.py b/src/cloudflare/types/workers/services/environments/setting_get_response.py index fb1db345a37e..14289dd0daf9 100644 --- a/src/cloudflare/types/workers/services/environments/setting_get_response.py +++ b/src/cloudflare/types/workers/services/environments/setting_get_response.py @@ -1,274 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from typing import List, Optional from ....._models import BaseModel -__all__ = [ - "SettingGetResponse", - "Binding", - "BindingWorkersKVNamespaceBinding", - "BindingWorkersServiceBinding", - "BindingWorkersDoBinding", - "BindingWorkersR2Binding", - "BindingWorkersQueueBinding", - "BindingWorkersD1Binding", - "BindingWorkersDispatchNamespaceBinding", - "BindingWorkersDispatchNamespaceBindingOutbound", - "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCERTBinding", - "Migrations", - "MigrationsWorkersSingleStepMigrations", - "MigrationsWorkersSingleStepMigrationsRenamedClass", - "MigrationsWorkersSingleStepMigrationsTransferredClass", - "MigrationsWorkersSteppedMigrations", - "MigrationsWorkersSteppedMigrationsStep", - "MigrationsWorkersSteppedMigrationsStepRenamedClass", - "MigrationsWorkersSteppedMigrationsStepTransferredClass", - "Placement", - "TailConsumer", -] - - -class BindingWorkersKVNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The class of resource that the binding provides.""" - - -class BindingWorkersServiceBinding(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to""" - - type: Literal["service"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDoBinding(BaseModel): - class_name: str - """The exported class name of the Durable Object""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The class of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this Worker - """ - - -class BindingWorkersR2Binding(BaseModel): - bucket_name: str - """R2 bucket to bind to""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The class of resource that the binding provides.""" - - -class BindingWorkersQueueBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to""" - - type: Literal["queue"] - """The class of resource that the binding provides.""" - - -class BindingWorkersD1Binding(BaseModel): - id: str - """ID of the D1 database to bind to""" - - binding: str - """A JavaScript variable name for the binding.""" - - name: str - """The name of the D1 database associated with the 'id' provided.""" - - type: Literal["d1"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDispatchNamespaceBindingOutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker""" - - service: Optional[str] = None - """Name of the outbound worker""" - - -class BindingWorkersDispatchNamespaceBindingOutbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: Optional[BindingWorkersDispatchNamespaceBindingOutboundWorker] = None - """Outbound worker""" - - -class BindingWorkersDispatchNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to""" - - type: Literal["dispatch_namespace"] - """The class of resource that the binding provides.""" - - outbound: Optional[BindingWorkersDispatchNamespaceBindingOutbound] = None - """Outbound worker""" - - -class BindingWorkersMTLSCERTBinding(BaseModel): - certificate: object - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The class of resource that the binding provides.""" - - certificate_id: Optional[str] = None - """ID of the certificate to bind to""" - - -Binding = Union[ - BindingWorkersKVNamespaceBinding, - BindingWorkersServiceBinding, - BindingWorkersDoBinding, - BindingWorkersR2Binding, - BindingWorkersQueueBinding, - BindingWorkersD1Binding, - BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCERTBinding, -] - - -class MigrationsWorkersSingleStepMigrationsRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrationsTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrations(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[MigrationsWorkersSingleStepMigrationsRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSingleStepMigrationsTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrationsStepRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStepTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStep(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[MigrationsWorkersSteppedMigrationsStepRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSteppedMigrationsStepTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrations(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[MigrationsWorkersSteppedMigrationsStep]] = None - """Migrations to apply in order.""" - - -Migrations = Union[MigrationsWorkersSingleStepMigrations, MigrationsWorkersSteppedMigrations] - - -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ +__all__ = ["SettingGetResponse", "TailConsumer"] class TailConsumer(BaseModel): @@ -283,28 +19,8 @@ class TailConsumer(BaseModel): 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""" - 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[Placement] = None - - tags: Optional[List[str]] = None - """Tags to help you manage your Workers""" - tail_consumers: Optional[List[TailConsumer]] = 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_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index 7180aa4daa24..2f61aedd1d55 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,36 +2,10 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = [ - "SettingEditParams", - "Error", - "Message", - "Result", - "ResultBinding", - "ResultBindingWorkersKVNamespaceBinding", - "ResultBindingWorkersServiceBinding", - "ResultBindingWorkersDoBinding", - "ResultBindingWorkersR2Binding", - "ResultBindingWorkersQueueBinding", - "ResultBindingWorkersD1Binding", - "ResultBindingWorkersDispatchNamespaceBinding", - "ResultBindingWorkersDispatchNamespaceBindingOutbound", - "ResultBindingWorkersDispatchNamespaceBindingOutboundWorker", - "ResultBindingWorkersMTLSCERTBinding", - "ResultMigrations", - "ResultMigrationsWorkersSingleStepMigrations", - "ResultMigrationsWorkersSingleStepMigrationsRenamedClass", - "ResultMigrationsWorkersSingleStepMigrationsTransferredClass", - "ResultMigrationsWorkersSteppedMigrations", - "ResultMigrationsWorkersSteppedMigrationsStep", - "ResultMigrationsWorkersSteppedMigrationsStepRenamedClass", - "ResultMigrationsWorkersSteppedMigrationsStepTransferredClass", - "ResultPlacement", - "ResultTailConsumer", -] +__all__ = ["SettingEditParams", "Error", "Message", "Result", "ResultTailConsumer"] class SettingEditParams(TypedDict, total=False): @@ -63,249 +37,6 @@ class Message(TypedDict, total=False): message: Required[str] -class ResultBindingWorkersKVNamespaceBinding(TypedDict, total=False): - type: Required[Literal["kv_namespace"]] - """The class of resource that the binding provides.""" - - -class ResultBindingWorkersServiceBinding(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.""" - - -class ResultBindingWorkersDoBinding(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 - """ - - -class ResultBindingWorkersR2Binding(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.""" - - -class ResultBindingWorkersQueueBinding(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.""" - - -class ResultBindingWorkersD1Binding(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.""" - - -class ResultBindingWorkersDispatchNamespaceBindingOutboundWorker(TypedDict, total=False): - environment: str - """Environment of the outbound worker""" - - service: str - """Name of the outbound worker""" - - -class ResultBindingWorkersDispatchNamespaceBindingOutbound(TypedDict, total=False): - params: List[str] - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: ResultBindingWorkersDispatchNamespaceBindingOutboundWorker - """Outbound worker""" - - -class ResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=False): - namespace: Required[str] - """Namespace to bind to""" - - type: Required[Literal["dispatch_namespace"]] - """The class of resource that the binding provides.""" - - outbound: ResultBindingWorkersDispatchNamespaceBindingOutbound - """Outbound worker""" - - -class ResultBindingWorkersMTLSCERTBinding(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""" - - -ResultBinding = Union[ - ResultBindingWorkersKVNamespaceBinding, - ResultBindingWorkersServiceBinding, - ResultBindingWorkersDoBinding, - ResultBindingWorkersR2Binding, - ResultBindingWorkersQueueBinding, - ResultBindingWorkersD1Binding, - ResultBindingWorkersDispatchNamespaceBinding, - ResultBindingWorkersMTLSCERTBinding, -] - -_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSingleStepMigrationsRenamedClass( - _ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False -): - to: str - - -_ResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSingleStepMigrationsTransferredClass( - _ResultMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False -): - from_script: str - - to: str - - -class ResultMigrationsWorkersSingleStepMigrations(TypedDict, total=False): - deleted_classes: List[str] - """A list of classes to delete Durable Object namespaces from.""" - - new_classes: List[str] - """A list of classes to create Durable Object namespaces from.""" - - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - renamed_classes: Iterable[ResultMigrationsWorkersSingleStepMigrationsRenamedClass] - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Iterable[ResultMigrationsWorkersSingleStepMigrationsTransferredClass] - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -_ResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSteppedMigrationsStepRenamedClass( - _ResultMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False -): - to: str - - -_ResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( - "_ResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", - { - "from": str, - }, - total=False, -) - - -class ResultMigrationsWorkersSteppedMigrationsStepTransferredClass( - _ResultMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False -): - from_script: str - - to: str - - -class ResultMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): - deleted_classes: List[str] - """A list of classes to delete Durable Object namespaces from.""" - - new_classes: List[str] - """A list of classes to create Durable Object namespaces from.""" - - renamed_classes: Iterable[ResultMigrationsWorkersSteppedMigrationsStepRenamedClass] - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Iterable[ResultMigrationsWorkersSteppedMigrationsStepTransferredClass] - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class ResultMigrationsWorkersSteppedMigrations(TypedDict, total=False): - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - steps: Iterable[ResultMigrationsWorkersSteppedMigrationsStep] - """Migrations to apply in order.""" - - -ResultMigrations = Union[ResultMigrationsWorkersSingleStepMigrations, ResultMigrationsWorkersSteppedMigrations] - - -class ResultPlacement(TypedDict, total=False): - mode: Literal["smart"] - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ - - class ResultTailConsumer(TypedDict, total=False): service: Required[str] """Name of Worker that is to be the consumer.""" @@ -318,28 +49,8 @@ class ResultTailConsumer(TypedDict, total=False): class Result(TypedDict, total=False): - bindings: Iterable[ResultBinding] - """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""" - logpush: bool """Whether Logpush is turned on for the Worker.""" - migrations: ResultMigrations - """Migrations to apply for Durable Objects associated with this Worker.""" - - placement: ResultPlacement - - tags: List[str] - """Tags to help you manage your Workers""" - tail_consumers: Iterable[ResultTailConsumer] """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 index 3f865653be27..6142374a92a1 100644 --- 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 @@ -1,274 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from typing import List, Optional from ......_models import BaseModel -__all__ = [ - "SettingEditResponse", - "Binding", - "BindingWorkersKVNamespaceBinding", - "BindingWorkersServiceBinding", - "BindingWorkersDoBinding", - "BindingWorkersR2Binding", - "BindingWorkersQueueBinding", - "BindingWorkersD1Binding", - "BindingWorkersDispatchNamespaceBinding", - "BindingWorkersDispatchNamespaceBindingOutbound", - "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCERTBinding", - "Migrations", - "MigrationsWorkersSingleStepMigrations", - "MigrationsWorkersSingleStepMigrationsRenamedClass", - "MigrationsWorkersSingleStepMigrationsTransferredClass", - "MigrationsWorkersSteppedMigrations", - "MigrationsWorkersSteppedMigrationsStep", - "MigrationsWorkersSteppedMigrationsStepRenamedClass", - "MigrationsWorkersSteppedMigrationsStepTransferredClass", - "Placement", - "TailConsumer", -] - - -class BindingWorkersKVNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The class of resource that the binding provides.""" - - -class BindingWorkersServiceBinding(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to""" - - type: Literal["service"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDoBinding(BaseModel): - class_name: str - """The exported class name of the Durable Object""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The class of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this Worker - """ - - -class BindingWorkersR2Binding(BaseModel): - bucket_name: str - """R2 bucket to bind to""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The class of resource that the binding provides.""" - - -class BindingWorkersQueueBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to""" - - type: Literal["queue"] - """The class of resource that the binding provides.""" - - -class BindingWorkersD1Binding(BaseModel): - id: str - """ID of the D1 database to bind to""" - - binding: str - """A JavaScript variable name for the binding.""" - - name: str - """The name of the D1 database associated with the 'id' provided.""" - - type: Literal["d1"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDispatchNamespaceBindingOutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker""" - - service: Optional[str] = None - """Name of the outbound worker""" - - -class BindingWorkersDispatchNamespaceBindingOutbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: Optional[BindingWorkersDispatchNamespaceBindingOutboundWorker] = None - """Outbound worker""" - - -class BindingWorkersDispatchNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to""" - - type: Literal["dispatch_namespace"] - """The class of resource that the binding provides.""" - - outbound: Optional[BindingWorkersDispatchNamespaceBindingOutbound] = None - """Outbound worker""" - - -class BindingWorkersMTLSCERTBinding(BaseModel): - certificate: object - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The class of resource that the binding provides.""" - - certificate_id: Optional[str] = None - """ID of the certificate to bind to""" - - -Binding = Union[ - BindingWorkersKVNamespaceBinding, - BindingWorkersServiceBinding, - BindingWorkersDoBinding, - BindingWorkersR2Binding, - BindingWorkersQueueBinding, - BindingWorkersD1Binding, - BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCERTBinding, -] - - -class MigrationsWorkersSingleStepMigrationsRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrationsTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrations(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[MigrationsWorkersSingleStepMigrationsRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSingleStepMigrationsTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrationsStepRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStepTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStep(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[MigrationsWorkersSteppedMigrationsStepRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSteppedMigrationsStepTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrations(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[MigrationsWorkersSteppedMigrationsStep]] = None - """Migrations to apply in order.""" - - -Migrations = Union[MigrationsWorkersSingleStepMigrations, MigrationsWorkersSteppedMigrations] - - -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ +__all__ = ["SettingEditResponse", "TailConsumer"] class TailConsumer(BaseModel): @@ -283,28 +19,8 @@ class TailConsumer(BaseModel): 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""" - 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[Placement] = None - - tags: Optional[List[str]] = None - """Tags to help you manage your Workers""" - tail_consumers: Optional[List[TailConsumer]] = 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 index 903f2b70102c..ee471cc0e594 100644 --- 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 @@ -1,274 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from typing import List, Optional from ......_models import BaseModel -__all__ = [ - "SettingGetResponse", - "Binding", - "BindingWorkersKVNamespaceBinding", - "BindingWorkersServiceBinding", - "BindingWorkersDoBinding", - "BindingWorkersR2Binding", - "BindingWorkersQueueBinding", - "BindingWorkersD1Binding", - "BindingWorkersDispatchNamespaceBinding", - "BindingWorkersDispatchNamespaceBindingOutbound", - "BindingWorkersDispatchNamespaceBindingOutboundWorker", - "BindingWorkersMTLSCERTBinding", - "Migrations", - "MigrationsWorkersSingleStepMigrations", - "MigrationsWorkersSingleStepMigrationsRenamedClass", - "MigrationsWorkersSingleStepMigrationsTransferredClass", - "MigrationsWorkersSteppedMigrations", - "MigrationsWorkersSteppedMigrationsStep", - "MigrationsWorkersSteppedMigrationsStepRenamedClass", - "MigrationsWorkersSteppedMigrationsStepTransferredClass", - "Placement", - "TailConsumer", -] - - -class BindingWorkersKVNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The class of resource that the binding provides.""" - - -class BindingWorkersServiceBinding(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to""" - - type: Literal["service"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDoBinding(BaseModel): - class_name: str - """The exported class name of the Durable Object""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The class of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this Worker - """ - - -class BindingWorkersR2Binding(BaseModel): - bucket_name: str - """R2 bucket to bind to""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The class of resource that the binding provides.""" - - -class BindingWorkersQueueBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to""" - - type: Literal["queue"] - """The class of resource that the binding provides.""" - - -class BindingWorkersD1Binding(BaseModel): - id: str - """ID of the D1 database to bind to""" - - binding: str - """A JavaScript variable name for the binding.""" - - name: str - """The name of the D1 database associated with the 'id' provided.""" - - type: Literal["d1"] - """The class of resource that the binding provides.""" - - -class BindingWorkersDispatchNamespaceBindingOutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker""" - - service: Optional[str] = None - """Name of the outbound worker""" - - -class BindingWorkersDispatchNamespaceBindingOutbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: Optional[BindingWorkersDispatchNamespaceBindingOutboundWorker] = None - """Outbound worker""" - - -class BindingWorkersDispatchNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to""" - - type: Literal["dispatch_namespace"] - """The class of resource that the binding provides.""" - - outbound: Optional[BindingWorkersDispatchNamespaceBindingOutbound] = None - """Outbound worker""" - - -class BindingWorkersMTLSCERTBinding(BaseModel): - certificate: object - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The class of resource that the binding provides.""" - - certificate_id: Optional[str] = None - """ID of the certificate to bind to""" - - -Binding = Union[ - BindingWorkersKVNamespaceBinding, - BindingWorkersServiceBinding, - BindingWorkersDoBinding, - BindingWorkersR2Binding, - BindingWorkersQueueBinding, - BindingWorkersD1Binding, - BindingWorkersDispatchNamespaceBinding, - BindingWorkersMTLSCERTBinding, -] - - -class MigrationsWorkersSingleStepMigrationsRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrationsTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSingleStepMigrations(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[MigrationsWorkersSingleStepMigrationsRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSingleStepMigrationsTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrationsStepRenamedClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStepTransferredClass(BaseModel): - from_: Optional[str] = FieldInfo(alias="from", default=None) - - from_script: Optional[str] = None - - to: Optional[str] = None - - -class MigrationsWorkersSteppedMigrationsStep(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[MigrationsWorkersSteppedMigrationsStepRenamedClass]] = None - """A list of classes with Durable Object namespaces that were renamed.""" - - transferred_classes: Optional[List[MigrationsWorkersSteppedMigrationsStepTransferredClass]] = None - """ - A list of transfers for Durable Object namespaces from a different Worker and - class to a class defined in this Worker. - """ - - -class MigrationsWorkersSteppedMigrations(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[MigrationsWorkersSteppedMigrationsStep]] = None - """Migrations to apply in order.""" - - -Migrations = Union[MigrationsWorkersSingleStepMigrations, MigrationsWorkersSteppedMigrations] - - -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ +__all__ = ["SettingGetResponse", "TailConsumer"] class TailConsumer(BaseModel): @@ -283,28 +19,8 @@ class TailConsumer(BaseModel): 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""" - 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[Placement] = None - - tags: Optional[List[str]] = None - """Tags to help you manage your Workers""" - tail_consumers: Optional[List[TailConsumer]] = 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/scripts/test_settings.py b/tests/api_resources/workers/scripts/test_settings.py index 93a924099d21..ed4edcf67c44 100644 --- a/tests/api_resources/workers/scripts/test_settings.py +++ b/tests/api_resources/workers/scripts/test_settings.py @@ -33,102 +33,71 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", settings={ - "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", - }, + "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", ], - "result": { - "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", + "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", + }, ], - "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": [ + "transferred_classes": [ { - "environment": "production", - "namespace": "my-namespace", - "service": "my-log-consumer", + "from": "string", + "from_script": "string", + "to": "string", }, { - "environment": "production", - "namespace": "my-namespace", - "service": "my-log-consumer", + "from": "string", + "from_script": "string", + "to": "string", }, { - "environment": "production", - "namespace": "my-namespace", - "service": "my-log-consumer", + "from": "string", + "from_script": "string", + "to": "string", }, ], - "usage_model": "unbound", }, - "success": True, + "placement": {"mode": "smart"}, + "tags": ["my-tag", "my-tag", "my-tag"], + "tail_consumers": [ + { + "environment": "production", + "namespace": "my-namespace", + "service": "my-log-consumer", + }, + { + "environment": "production", + "namespace": "my-namespace", + "service": "my-log-consumer", + }, + { + "environment": "production", + "namespace": "my-namespace", + "service": "my-log-consumer", + }, + ], + "usage_model": "unbound", }, ) assert_matches_type(SettingEditResponse, setting, path=["response"]) @@ -248,102 +217,71 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", settings={ - "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", - }, + "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", ], - "result": { - "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", + "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", + }, ], - "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": [ + "transferred_classes": [ { - "environment": "production", - "namespace": "my-namespace", - "service": "my-log-consumer", + "from": "string", + "from_script": "string", + "to": "string", }, { - "environment": "production", - "namespace": "my-namespace", - "service": "my-log-consumer", + "from": "string", + "from_script": "string", + "to": "string", }, { - "environment": "production", - "namespace": "my-namespace", - "service": "my-log-consumer", + "from": "string", + "from_script": "string", + "to": "string", }, ], - "usage_model": "unbound", }, - "success": True, + "placement": {"mode": "smart"}, + "tags": ["my-tag", "my-tag", "my-tag"], + "tail_consumers": [ + { + "environment": "production", + "namespace": "my-namespace", + "service": "my-log-consumer", + }, + { + "environment": "production", + "namespace": "my-namespace", + "service": "my-log-consumer", + }, + { + "environment": "production", + "namespace": "my-namespace", + "service": "my-log-consumer", + }, + ], + "usage_model": "unbound", }, ) assert_matches_type(SettingEditResponse, setting, path=["response"]) diff --git a/tests/api_resources/workers/services/environments/test_settings.py b/tests/api_resources/workers/services/environments/test_settings.py index 49ef9121dae0..6787c041e5fe 100644 --- a/tests/api_resources/workers/services/environments/test_settings.py +++ b/tests/api_resources/workers/services/environments/test_settings.py @@ -93,53 +93,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, ], result={ - "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", - ], "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", @@ -157,7 +111,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "service": "my-log-consumer", }, ], - "usage_model": "unbound", }, success=True, ) @@ -511,53 +464,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, ], result={ - "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", - ], "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", @@ -575,7 +482,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "service": "my-log-consumer", }, ], - "usage_model": "unbound", }, success=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 e1abbb919d18..0fac573644a1 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 @@ -96,53 +96,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, ], result={ - "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", - ], "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", @@ -160,7 +114,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "service": "my-log-consumer", }, ], - "usage_model": "unbound", }, success=True, ) @@ -514,53 +467,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, ], result={ - "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", - ], "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", @@ -578,7 +485,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "service": "my-log-consumer", }, ], - "usage_model": "unbound", }, success=True, )