From bd8c0339b4e9b9ef7ebfa9cb0b5d00387e596202 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Thu, 27 Mar 2025 21:16:40 +0000 Subject: [PATCH 01/20] Generated with expanded spec --- .codegen.json | 2 +- .codegen/_openapi_sha | 2 +- databricks/sdk/service/apps.py | 29 + databricks/sdk/service/billing.py | 49 +- databricks/sdk/service/catalog.py | 54 +- databricks/sdk/service/cleanrooms.py | 680 ++++++- databricks/sdk/service/compute.py | 82 - databricks/sdk/service/dashboards.py | 776 +++++++- databricks/sdk/service/jobs.py | 1663 ++++++++++++++++- databricks/sdk/service/marketplace.py | 3 - databricks/sdk/service/ml.py | 305 ++- databricks/sdk/service/pipelines.py | 892 ++++++++- databricks/sdk/service/serving.py | 2 + databricks/sdk/service/settings.py | 303 +-- databricks/sdk/service/sharing.py | 50 +- databricks/sdk/service/sql.py | 128 ++ docs/account/iam/service_principals.rst | 5 +- docs/account/iam/workspace_assignment.rst | 8 +- docs/account/provisioning/credentials.rst | 6 +- docs/account/provisioning/storage.rst | 7 +- docs/dbdataclasses/billing.rst | 4 + docs/dbdataclasses/catalog.rst | 13 +- docs/dbdataclasses/cleanrooms.rst | 290 +++ docs/dbdataclasses/compute.rst | 8 - docs/dbdataclasses/dashboards.rst | 182 ++ docs/dbdataclasses/jobs.rst | 206 ++ docs/dbdataclasses/ml.rst | 8 + docs/dbdataclasses/pipelines.rst | 110 ++ docs/dbdataclasses/serving.rst | 4 + docs/dbdataclasses/settings.rst | 83 +- docs/dbdataclasses/sharing.rst | 4 + docs/dbdataclasses/sql.rst | 11 + docs/workspace/catalog/catalogs.rst | 4 +- docs/workspace/catalog/external_locations.rst | 27 +- .../workspace/catalog/storage_credentials.rst | 15 +- docs/workspace/catalog/volumes.rst | 5 + docs/workspace/compute/clusters.rst | 3 +- docs/workspace/dashboards/genie.rst | 51 + docs/workspace/iam/current_user.rst | 2 +- docs/workspace/iam/groups.rst | 3 + docs/workspace/iam/permissions.rst | 2 +- docs/workspace/jobs/jobs.rst | 16 +- docs/workspace/ml/experiments.rst | 23 +- docs/workspace/ml/forecasting.rst | 52 +- docs/workspace/ml/model_registry.rst | 13 +- docs/workspace/pipelines/pipelines.rst | 8 +- docs/workspace/sharing/providers.rst | 17 +- docs/workspace/sql/queries.rst | 2 +- docs/workspace/workspace/workspace.rst | 2 +- 49 files changed, 5440 insertions(+), 774 deletions(-) diff --git a/.codegen.json b/.codegen.json index f98f968ab..516edbc7c 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1,5 +1,5 @@ { - "mode": "py_v0", + "mode": "py_mod", "api_changelog": true, "version": { "databricks/sdk/version.py": "__version__ = \"$VERSION\"" diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 12fb465ab..347bf5ee5 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -94dc3e7289a19a90b167adf27316bd703a86f0eb \ No newline at end of file +universe:/home/parth.bansal/universetwo \ No newline at end of file diff --git a/databricks/sdk/service/apps.py b/databricks/sdk/service/apps.py index 766f99581..37c317f42 100755 --- a/databricks/sdk/service/apps.py +++ b/databricks/sdk/service/apps.py @@ -50,9 +50,16 @@ class App: effective_budget_policy_id: Optional[str] = None + effective_user_api_scopes: Optional[List[str]] = None + """The effective api scopes granted to the user access token.""" + id: Optional[str] = None """The unique identifier of the app.""" + oauth2_app_client_id: Optional[str] = None + + oauth2_app_integration_id: Optional[str] = None + pending_deployment: Optional[AppDeployment] = None """The pending deployment of the app. A deployment is considered pending when it is being prepared for deployment to the app compute.""" @@ -75,6 +82,8 @@ class App: url: Optional[str] = None """The URL of the app once it is deployed.""" + user_api_scopes: Optional[List[str]] = None + def as_dict(self) -> dict: """Serializes the App into a dictionary suitable for use as a JSON request body.""" body = {} @@ -96,10 +105,16 @@ def as_dict(self) -> dict: body["description"] = self.description if self.effective_budget_policy_id is not None: body["effective_budget_policy_id"] = self.effective_budget_policy_id + if self.effective_user_api_scopes: + body["effective_user_api_scopes"] = [v for v in self.effective_user_api_scopes] if self.id is not None: body["id"] = self.id if self.name is not None: body["name"] = self.name + if self.oauth2_app_client_id is not None: + body["oauth2_app_client_id"] = self.oauth2_app_client_id + if self.oauth2_app_integration_id is not None: + body["oauth2_app_integration_id"] = self.oauth2_app_integration_id if self.pending_deployment: body["pending_deployment"] = self.pending_deployment.as_dict() if self.resources: @@ -116,6 +131,8 @@ def as_dict(self) -> dict: body["updater"] = self.updater if self.url is not None: body["url"] = self.url + if self.user_api_scopes: + body["user_api_scopes"] = [v for v in self.user_api_scopes] return body def as_shallow_dict(self) -> dict: @@ -139,10 +156,16 @@ def as_shallow_dict(self) -> dict: body["description"] = self.description if self.effective_budget_policy_id is not None: body["effective_budget_policy_id"] = self.effective_budget_policy_id + if self.effective_user_api_scopes: + body["effective_user_api_scopes"] = self.effective_user_api_scopes if self.id is not None: body["id"] = self.id if self.name is not None: body["name"] = self.name + if self.oauth2_app_client_id is not None: + body["oauth2_app_client_id"] = self.oauth2_app_client_id + if self.oauth2_app_integration_id is not None: + body["oauth2_app_integration_id"] = self.oauth2_app_integration_id if self.pending_deployment: body["pending_deployment"] = self.pending_deployment if self.resources: @@ -159,6 +182,8 @@ def as_shallow_dict(self) -> dict: body["updater"] = self.updater if self.url is not None: body["url"] = self.url + if self.user_api_scopes: + body["user_api_scopes"] = self.user_api_scopes return body @classmethod @@ -174,8 +199,11 @@ def from_dict(cls, d: Dict[str, Any]) -> App: default_source_code_path=d.get("default_source_code_path", None), description=d.get("description", None), effective_budget_policy_id=d.get("effective_budget_policy_id", None), + effective_user_api_scopes=d.get("effective_user_api_scopes", None), id=d.get("id", None), name=d.get("name", None), + oauth2_app_client_id=d.get("oauth2_app_client_id", None), + oauth2_app_integration_id=d.get("oauth2_app_integration_id", None), pending_deployment=_from_dict(d, "pending_deployment", AppDeployment), resources=_repeated_dict(d, "resources", AppResource), service_principal_client_id=d.get("service_principal_client_id", None), @@ -184,6 +212,7 @@ def from_dict(cls, d: Dict[str, Any]) -> App: update_time=d.get("update_time", None), updater=d.get("updater", None), url=d.get("url", None), + user_api_scopes=d.get("user_api_scopes", None), ) diff --git a/databricks/sdk/service/billing.py b/databricks/sdk/service/billing.py index 4e8e4bca6..e0a589d9d 100755 --- a/databricks/sdk/service/billing.py +++ b/databricks/sdk/service/billing.py @@ -12,8 +12,6 @@ _LOG = logging.getLogger("databricks.sdk") -from databricks.sdk.service import compute - # all definitions in this file are in alphabetical order @@ -364,7 +362,7 @@ def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterWorkspaceIdCla class BudgetPolicy: """Contains the BudgetPolicy details.""" - custom_tags: Optional[List[compute.CustomPolicyTag]] = None + custom_tags: Optional[List[CustomPolicyTag]] = None """A list of tags defined by the customer. At most 20 entries are allowed per policy.""" policy_id: Optional[str] = None @@ -372,7 +370,8 @@ class BudgetPolicy: policy_name: Optional[str] = None """The name of the policy. - Must be unique among active policies. - Can contain only characters - from the ISO 8859-1 (latin1) set.""" + from the ISO 8859-1 (latin1) set. - Can't start with reserved keywords such as + `databricks:default-policy`.""" def as_dict(self) -> dict: """Serializes the BudgetPolicy into a dictionary suitable for use as a JSON request body.""" @@ -400,7 +399,7 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> BudgetPolicy: """Deserializes the BudgetPolicy from a dictionary.""" return cls( - custom_tags=_repeated_dict(d, "custom_tags", compute.CustomPolicyTag), + custom_tags=_repeated_dict(d, "custom_tags", CustomPolicyTag), policy_id=d.get("policy_id", None), policy_name=d.get("policy_name", None), ) @@ -838,6 +837,46 @@ def from_dict(cls, d: Dict[str, Any]) -> CreateLogDeliveryConfigurationParams: ) +@dataclass +class CustomPolicyTag: + key: str + """The key of the tag. - Must be unique among all custom tags of the same policy - Cannot be + “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" - these + tags are preserved. + + - Follows the regex pattern defined in cluster-common/conf/src/ClusterTagConstraints.scala + (https://src.dev.databricks.com/databricks/universe@1647196627c8dc7b4152ad098a94b86484b93a6c/-/blob/cluster-common/conf/src/ClusterTagConstraints.scala?L17)""" + + value: Optional[str] = None + """The value of the tag. + + - Follows the regex pattern defined in cluster-common/conf/src/ClusterTagConstraints.scala + (https://src.dev.databricks.com/databricks/universe@1647196627c8dc7b4152ad098a94b86484b93a6c/-/blob/cluster-common/conf/src/ClusterTagConstraints.scala?L24)""" + + def as_dict(self) -> dict: + """Serializes the CustomPolicyTag into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.key is not None: + body["key"] = self.key + if self.value is not None: + body["value"] = self.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the CustomPolicyTag into a shallow dictionary of its immediate attributes.""" + body = {} + if self.key is not None: + body["key"] = self.key + if self.value is not None: + body["value"] = self.value + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> CustomPolicyTag: + """Deserializes the CustomPolicyTag from a dictionary.""" + return cls(key=d.get("key", None), value=d.get("value", None)) + + @dataclass class DeleteBudgetConfigurationResponse: def as_dict(self) -> dict: diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/service/catalog.py index 3124937d6..a778ff628 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -1065,6 +1065,7 @@ class CatalogType(Enum): """The type of the catalog.""" DELTASHARING_CATALOG = "DELTASHARING_CATALOG" + FOREIGN_CATALOG = "FOREIGN_CATALOG" MANAGED_CATALOG = "MANAGED_CATALOG" SYSTEM_CATALOG = "SYSTEM_CATALOG" @@ -2591,6 +2592,11 @@ class CreateVolumeRequestContent: """The name of the volume""" volume_type: VolumeType + """The type of the volume. An external volume is located in the specified external location. A + managed volume is located in the default location which is specified by the parent schema, or + the parent catalog, or the Metastore. [Learn more] + + [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external""" comment: Optional[str] = None """The comment attached to the volume""" @@ -6664,6 +6670,7 @@ class Privilege(Enum): ACCESS = "ACCESS" ALL_PRIVILEGES = "ALL_PRIVILEGES" APPLY_TAG = "APPLY_TAG" + BROWSE = "BROWSE" CREATE = "CREATE" CREATE_CATALOG = "CREATE_CATALOG" CREATE_CONNECTION = "CREATE_CONNECTION" @@ -8132,38 +8139,6 @@ class TableType(Enum): VIEW = "VIEW" -@dataclass -class TagKeyValue: - key: Optional[str] = None - """name of the tag""" - - value: Optional[str] = None - """value of the tag associated with the key, could be optional""" - - def as_dict(self) -> dict: - """Serializes the TagKeyValue into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.key is not None: - body["key"] = self.key - if self.value is not None: - body["value"] = self.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the TagKeyValue into a shallow dictionary of its immediate attributes.""" - body = {} - if self.key is not None: - body["key"] = self.key - if self.value is not None: - body["value"] = self.value - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> TagKeyValue: - """Deserializes the TagKeyValue from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) - - @dataclass class TemporaryCredentials: aws_temp_credentials: Optional[AwsCredentials] = None @@ -9833,6 +9808,11 @@ class VolumeInfo: """The unique identifier of the volume""" volume_type: Optional[VolumeType] = None + """The type of the volume. An external volume is located in the specified external location. A + managed volume is located in the default location which is specified by the parent schema, or + the parent catalog, or the Metastore. [Learn more] + + [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external""" def as_dict(self) -> dict: """Serializes the VolumeInfo into a dictionary suitable for use as a JSON request body.""" @@ -9937,6 +9917,11 @@ def from_dict(cls, d: Dict[str, Any]) -> VolumeInfo: class VolumeType(Enum): + """The type of the volume. An external volume is located in the specified external location. A + managed volume is located in the default location which is specified by the parent schema, or + the parent catalog, or the Metastore. [Learn more] + + [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external""" EXTERNAL = "EXTERNAL" MANAGED = "MANAGED" @@ -14268,6 +14253,11 @@ def create( :param name: str The name of the volume :param volume_type: :class:`VolumeType` + The type of the volume. An external volume is located in the specified external location. A managed + volume is located in the default location which is specified by the parent schema, or the parent + catalog, or the Metastore. [Learn more] + + [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external :param comment: str (optional) The comment attached to the volume :param storage_location: str (optional) diff --git a/databricks/sdk/service/cleanrooms.py b/databricks/sdk/service/cleanrooms.py index e551d82be..10df23745 100755 --- a/databricks/sdk/service/cleanrooms.py +++ b/databricks/sdk/service/cleanrooms.py @@ -7,13 +7,11 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict +from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum _LOG = logging.getLogger("databricks.sdk") -from databricks.sdk.service import catalog, jobs, settings, sharing - # all definitions in this file are in alphabetical order @@ -280,7 +278,7 @@ class CleanRoomAssetAssetType(Enum): @dataclass class CleanRoomAssetForeignTable: - columns: Optional[List[catalog.ColumnInfo]] = None + columns: Optional[List[ColumnInfo]] = None """The metadata information of the columns in the foreign table""" def as_dict(self) -> dict: @@ -300,7 +298,7 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetForeignTable: """Deserializes the CleanRoomAssetForeignTable from a dictionary.""" - return cls(columns=_repeated_dict(d, "columns", catalog.ColumnInfo)) + return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -371,7 +369,7 @@ class CleanRoomAssetStatusEnum(Enum): @dataclass class CleanRoomAssetTable: - columns: Optional[List[catalog.ColumnInfo]] = None + columns: Optional[List[ColumnInfo]] = None """The metadata information of the columns in the table""" def as_dict(self) -> dict: @@ -391,7 +389,7 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetTable: """Deserializes the CleanRoomAssetTable from a dictionary.""" - return cls(columns=_repeated_dict(d, "columns", catalog.ColumnInfo)) + return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -400,7 +398,7 @@ class CleanRoomAssetTableLocalDetails: """The fully qualified name of the table in its owner's local metastore, in the format of *catalog*.*schema*.*table_name*""" - partitions: Optional[List[sharing.Partition]] = None + partitions: Optional[List[Partition]] = None """Partition filtering specification for a shared table.""" def as_dict(self) -> dict: @@ -424,12 +422,12 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetTableLocalDetails: """Deserializes the CleanRoomAssetTableLocalDetails from a dictionary.""" - return cls(local_name=d.get("local_name", None), partitions=_repeated_dict(d, "partitions", sharing.Partition)) + return cls(local_name=d.get("local_name", None), partitions=_repeated_dict(d, "partitions", Partition)) @dataclass class CleanRoomAssetView: - columns: Optional[List[catalog.ColumnInfo]] = None + columns: Optional[List[ColumnInfo]] = None """The metadata information of the columns in the view""" def as_dict(self) -> dict: @@ -449,7 +447,7 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetView: """Deserializes the CleanRoomAssetView from a dictionary.""" - return cls(columns=_repeated_dict(d, "columns", catalog.ColumnInfo)) + return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -594,7 +592,7 @@ class CleanRoomNotebookTaskRun: LIST API. if the task was run within the same workspace the API is being called. If the task run was in a different workspace under the same metastore, only the workspace_id is included.""" - notebook_job_run_state: Optional[jobs.CleanRoomTaskRunState] = None + notebook_job_run_state: Optional[CleanRoomTaskRunState] = None """State of the task run.""" notebook_name: Optional[str] = None @@ -655,7 +653,7 @@ def from_dict(cls, d: Dict[str, Any]) -> CleanRoomNotebookTaskRun: """Deserializes the CleanRoomNotebookTaskRun from a dictionary.""" return cls( collaborator_job_run_info=_from_dict(d, "collaborator_job_run_info", CollaboratorJobRunInfo), - notebook_job_run_state=_from_dict(d, "notebook_job_run_state", jobs.CleanRoomTaskRunState), + notebook_job_run_state=_from_dict(d, "notebook_job_run_state", CleanRoomTaskRunState), notebook_name=d.get("notebook_name", None), output_schema_expiration_time=d.get("output_schema_expiration_time", None), output_schema_name=d.get("output_schema_name", None), @@ -732,7 +730,7 @@ class CleanRoomRemoteDetail: creator: Optional[CleanRoomCollaborator] = None """Collaborator who creates the clean room.""" - egress_network_policy: Optional[settings.EgressNetworkPolicy] = None + egress_network_policy: Optional[EgressNetworkPolicy] = None """Egress network policy to apply to the central clean room workspace.""" region: Optional[str] = None @@ -785,7 +783,7 @@ def from_dict(cls, d: Dict[str, Any]) -> CleanRoomRemoteDetail: collaborators=_repeated_dict(d, "collaborators", CleanRoomCollaborator), compliance_security_profile=_from_dict(d, "compliance_security_profile", ComplianceSecurityProfile), creator=_from_dict(d, "creator", CleanRoomCollaborator), - egress_network_policy=_from_dict(d, "egress_network_policy", settings.EgressNetworkPolicy), + egress_network_policy=_from_dict(d, "egress_network_policy", EgressNetworkPolicy), region=d.get("region", None), ) @@ -798,6 +796,79 @@ class CleanRoomStatusEnum(Enum): PROVISIONING = "PROVISIONING" +class CleanRoomTaskRunLifeCycleState(Enum): + """Copied from elastic-spark-common/api/messages/runs.proto. Using the original definition to + remove coupling with jobs API definition""" + + BLOCKED = "BLOCKED" + INTERNAL_ERROR = "INTERNAL_ERROR" + PENDING = "PENDING" + QUEUED = "QUEUED" + RUNNING = "RUNNING" + RUN_LIFE_CYCLE_STATE_UNSPECIFIED = "RUN_LIFE_CYCLE_STATE_UNSPECIFIED" + SKIPPED = "SKIPPED" + TERMINATED = "TERMINATED" + TERMINATING = "TERMINATING" + WAITING_FOR_RETRY = "WAITING_FOR_RETRY" + + +class CleanRoomTaskRunResultState(Enum): + """Copied from elastic-spark-common/api/messages/runs.proto. Using the original definition to avoid + cyclic dependency.""" + + CANCELED = "CANCELED" + DISABLED = "DISABLED" + EVICTED = "EVICTED" + EXCLUDED = "EXCLUDED" + FAILED = "FAILED" + MAXIMUM_CONCURRENT_RUNS_REACHED = "MAXIMUM_CONCURRENT_RUNS_REACHED" + RUN_RESULT_STATE_UNSPECIFIED = "RUN_RESULT_STATE_UNSPECIFIED" + SUCCESS = "SUCCESS" + SUCCESS_WITH_FAILURES = "SUCCESS_WITH_FAILURES" + TIMEDOUT = "TIMEDOUT" + UPSTREAM_CANCELED = "UPSTREAM_CANCELED" + UPSTREAM_EVICTED = "UPSTREAM_EVICTED" + UPSTREAM_FAILED = "UPSTREAM_FAILED" + + +@dataclass +class CleanRoomTaskRunState: + """Stores the run state of the clean rooms notebook task.""" + + life_cycle_state: Optional[CleanRoomTaskRunLifeCycleState] = None + """A value indicating the run's current lifecycle state. This field is always available in the + response.""" + + result_state: Optional[CleanRoomTaskRunResultState] = None + """A value indicating the run's result. This field is only available for terminal lifecycle states.""" + + def as_dict(self) -> dict: + """Serializes the CleanRoomTaskRunState into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.life_cycle_state is not None: + body["life_cycle_state"] = self.life_cycle_state.value + if self.result_state is not None: + body["result_state"] = self.result_state.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the CleanRoomTaskRunState into a shallow dictionary of its immediate attributes.""" + body = {} + if self.life_cycle_state is not None: + body["life_cycle_state"] = self.life_cycle_state + if self.result_state is not None: + body["result_state"] = self.result_state + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> CleanRoomTaskRunState: + """Deserializes the CleanRoomTaskRunState from a dictionary.""" + return cls( + life_cycle_state=_enum(d, "life_cycle_state", CleanRoomTaskRunLifeCycleState), + result_state=_enum(d, "result_state", CleanRoomTaskRunResultState), + ) + + @dataclass class CollaboratorJobRunInfo: collaborator_alias: Optional[str] = None @@ -857,11 +928,184 @@ def from_dict(cls, d: Dict[str, Any]) -> CollaboratorJobRunInfo: ) +@dataclass +class ColumnInfo: + comment: Optional[str] = None + """User-provided free-form text description.""" + + mask: Optional[ColumnMask] = None + + name: Optional[str] = None + """Name of Column.""" + + nullable: Optional[bool] = None + """Whether field may be Null (default: true).""" + + partition_index: Optional[int] = None + """Partition index for column.""" + + position: Optional[int] = None + """Ordinal position of column (starting at position 0).""" + + type_interval_type: Optional[str] = None + """Format of IntervalType.""" + + type_json: Optional[str] = None + """Full data type specification, JSON-serialized.""" + + type_name: Optional[ColumnTypeName] = None + + type_precision: Optional[int] = None + """Digits of precision; required for DecimalTypes.""" + + type_scale: Optional[int] = None + """Digits to right of decimal; Required for DecimalTypes.""" + + type_text: Optional[str] = None + """Full data type specification as SQL/catalogString text.""" + + def as_dict(self) -> dict: + """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.comment is not None: + body["comment"] = self.comment + if self.mask: + body["mask"] = self.mask.as_dict() + if self.name is not None: + body["name"] = self.name + if self.nullable is not None: + body["nullable"] = self.nullable + if self.partition_index is not None: + body["partition_index"] = self.partition_index + if self.position is not None: + body["position"] = self.position + if self.type_interval_type is not None: + body["type_interval_type"] = self.type_interval_type + if self.type_json is not None: + body["type_json"] = self.type_json + if self.type_name is not None: + body["type_name"] = self.type_name.value + if self.type_precision is not None: + body["type_precision"] = self.type_precision + if self.type_scale is not None: + body["type_scale"] = self.type_scale + if self.type_text is not None: + body["type_text"] = self.type_text + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.comment is not None: + body["comment"] = self.comment + if self.mask: + body["mask"] = self.mask + if self.name is not None: + body["name"] = self.name + if self.nullable is not None: + body["nullable"] = self.nullable + if self.partition_index is not None: + body["partition_index"] = self.partition_index + if self.position is not None: + body["position"] = self.position + if self.type_interval_type is not None: + body["type_interval_type"] = self.type_interval_type + if self.type_json is not None: + body["type_json"] = self.type_json + if self.type_name is not None: + body["type_name"] = self.type_name + if self.type_precision is not None: + body["type_precision"] = self.type_precision + if self.type_scale is not None: + body["type_scale"] = self.type_scale + if self.type_text is not None: + body["type_text"] = self.type_text + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: + """Deserializes the ColumnInfo from a dictionary.""" + return cls( + comment=d.get("comment", None), + mask=_from_dict(d, "mask", ColumnMask), + name=d.get("name", None), + nullable=d.get("nullable", None), + partition_index=d.get("partition_index", None), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_json=d.get("type_json", None), + type_name=_enum(d, "type_name", ColumnTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), + ) + + +@dataclass +class ColumnMask: + function_name: Optional[str] = None + """The full name of the column mask SQL UDF.""" + + using_column_names: Optional[List[str]] = None + """The list of additional table columns to be passed as input to the column mask function. The + first arg of the mask function should be of the type of the column being masked and the types of + the rest of the args should match the types of columns in 'using_column_names'.""" + + def as_dict(self) -> dict: + """Serializes the ColumnMask into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.function_name is not None: + body["function_name"] = self.function_name + if self.using_column_names: + body["using_column_names"] = [v for v in self.using_column_names] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ColumnMask into a shallow dictionary of its immediate attributes.""" + body = {} + if self.function_name is not None: + body["function_name"] = self.function_name + if self.using_column_names: + body["using_column_names"] = self.using_column_names + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ColumnMask: + """Deserializes the ColumnMask from a dictionary.""" + return cls(function_name=d.get("function_name", None), using_column_names=d.get("using_column_names", None)) + + +class ColumnTypeName(Enum): + + ARRAY = "ARRAY" + BINARY = "BINARY" + BOOLEAN = "BOOLEAN" + BYTE = "BYTE" + CHAR = "CHAR" + DATE = "DATE" + DECIMAL = "DECIMAL" + DOUBLE = "DOUBLE" + FLOAT = "FLOAT" + INT = "INT" + INTERVAL = "INTERVAL" + LONG = "LONG" + MAP = "MAP" + NULL = "NULL" + SHORT = "SHORT" + STRING = "STRING" + STRUCT = "STRUCT" + TABLE_TYPE = "TABLE_TYPE" + TIMESTAMP = "TIMESTAMP" + TIMESTAMP_NTZ = "TIMESTAMP_NTZ" + USER_DEFINED_TYPE = "USER_DEFINED_TYPE" + VARIANT = "VARIANT" + + @dataclass class ComplianceSecurityProfile: """The compliance security profile used to process regulated data following compliance standards.""" - compliance_standards: Optional[List[settings.ComplianceStandard]] = None + compliance_standards: Optional[List[ComplianceStandard]] = None """The list of compliance standards that the compliance security profile is configured to enforce.""" is_enabled: Optional[bool] = None @@ -871,7 +1115,7 @@ def as_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_standards: - body["compliance_standards"] = [v.as_dict() for v in self.compliance_standards] + body["compliance_standards"] = [v.value for v in self.compliance_standards] if self.is_enabled is not None: body["is_enabled"] = self.is_enabled return body @@ -889,11 +1133,28 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> ComplianceSecurityProfile: """Deserializes the ComplianceSecurityProfile from a dictionary.""" return cls( - compliance_standards=_repeated_dict(d, "compliance_standards", settings.ComplianceStandard), + compliance_standards=_repeated_enum(d, "compliance_standards", ComplianceStandard), is_enabled=d.get("is_enabled", None), ) +class ComplianceStandard(Enum): + """Compliance stardard for SHIELD customers""" + + CANADA_PROTECTED_B = "CANADA_PROTECTED_B" + CYBER_ESSENTIAL_PLUS = "CYBER_ESSENTIAL_PLUS" + FEDRAMP_HIGH = "FEDRAMP_HIGH" + FEDRAMP_IL5 = "FEDRAMP_IL5" + FEDRAMP_MODERATE = "FEDRAMP_MODERATE" + HIPAA = "HIPAA" + HITRUST = "HITRUST" + IRAP_PROTECTED = "IRAP_PROTECTED" + ISMAP = "ISMAP" + ITAR_EAR = "ITAR_EAR" + NONE = "NONE" + PCI_DSS = "PCI_DSS" + + @dataclass class CreateCleanRoomOutputCatalogResponse: output_catalog: Optional[CleanRoomOutputCatalog] = None @@ -957,6 +1218,305 @@ def from_dict(cls, d: Dict[str, Any]) -> DeleteResponse: return cls() +@dataclass +class EgressNetworkPolicy: + """The network policies applying for egress traffic. This message is used by the UI/REST API. We + translate this message to the format expected by the dataplane in Lakehouse Network Manager (for + the format expected by the dataplane, see networkconfig.textproto).""" + + internet_access: Optional[EgressNetworkPolicyInternetAccessPolicy] = None + """The access policy enforced for egress traffic to the internet.""" + + def as_dict(self) -> dict: + """Serializes the EgressNetworkPolicy into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.internet_access: + body["internet_access"] = self.internet_access.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EgressNetworkPolicy into a shallow dictionary of its immediate attributes.""" + body = {} + if self.internet_access: + body["internet_access"] = self.internet_access + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicy: + """Deserializes the EgressNetworkPolicy from a dictionary.""" + return cls(internet_access=_from_dict(d, "internet_access", EgressNetworkPolicyInternetAccessPolicy)) + + +@dataclass +class EgressNetworkPolicyInternetAccessPolicy: + allowed_internet_destinations: Optional[List[EgressNetworkPolicyInternetAccessPolicyInternetDestination]] = None + + allowed_storage_destinations: Optional[List[EgressNetworkPolicyInternetAccessPolicyStorageDestination]] = None + + log_only_mode: Optional[EgressNetworkPolicyInternetAccessPolicyLogOnlyMode] = None + """Optional. If not specified, assume the policy is enforced for all workloads.""" + + restriction_mode: Optional[EgressNetworkPolicyInternetAccessPolicyRestrictionMode] = None + """At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: + Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can + only access explicitly allowed internet and storage destinations, as well as UC connections and + external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via + private link.""" + + def as_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicy into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.allowed_internet_destinations: + body["allowed_internet_destinations"] = [v.as_dict() for v in self.allowed_internet_destinations] + if self.allowed_storage_destinations: + body["allowed_storage_destinations"] = [v.as_dict() for v in self.allowed_storage_destinations] + if self.log_only_mode: + body["log_only_mode"] = self.log_only_mode.as_dict() + if self.restriction_mode is not None: + body["restriction_mode"] = self.restriction_mode.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicy into a shallow dictionary of its immediate attributes.""" + body = {} + if self.allowed_internet_destinations: + body["allowed_internet_destinations"] = self.allowed_internet_destinations + if self.allowed_storage_destinations: + body["allowed_storage_destinations"] = self.allowed_storage_destinations + if self.log_only_mode: + body["log_only_mode"] = self.log_only_mode + if self.restriction_mode is not None: + body["restriction_mode"] = self.restriction_mode + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicy: + """Deserializes the EgressNetworkPolicyInternetAccessPolicy from a dictionary.""" + return cls( + allowed_internet_destinations=_repeated_dict( + d, "allowed_internet_destinations", EgressNetworkPolicyInternetAccessPolicyInternetDestination + ), + allowed_storage_destinations=_repeated_dict( + d, "allowed_storage_destinations", EgressNetworkPolicyInternetAccessPolicyStorageDestination + ), + log_only_mode=_from_dict(d, "log_only_mode", EgressNetworkPolicyInternetAccessPolicyLogOnlyMode), + restriction_mode=_enum(d, "restriction_mode", EgressNetworkPolicyInternetAccessPolicyRestrictionMode), + ) + + +@dataclass +class EgressNetworkPolicyInternetAccessPolicyInternetDestination: + """Users can specify accessible internet destinations when outbound access is restricted. We only + support domain name (FQDN) destinations for the time being, though going forwards we want to + support host names and IP addresses.""" + + destination: Optional[str] = None + + protocol: Optional[ + EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol + ] = None + """The filtering protocol used by the DP. For private and public preview, SEG will only support TCP + filtering (i.e. DNS based filtering, filtering by destination IP address), so protocol will be + set to TCP by default and hidden from the user. In the future, users may be able to select HTTP + filtering (i.e. SNI based filtering, filtering by FQDN).""" + + type: Optional[EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType] = None + + def as_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + if self.protocol is not None: + body["protocol"] = self.protocol.value + if self.type is not None: + body["type"] = self.type.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + if self.protocol is not None: + body["protocol"] = self.protocol + if self.type is not None: + body["type"] = self.type + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyInternetDestination: + """Deserializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination from a dictionary.""" + return cls( + destination=d.get("destination", None), + protocol=_enum( + d, + "protocol", + EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol, + ), + type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType), + ) + + +class EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol(Enum): + """The filtering protocol used by the DP. For private and public preview, SEG will only support TCP + filtering (i.e. DNS based filtering, filtering by destination IP address), so protocol will be + set to TCP by default and hidden from the user. In the future, users may be able to select HTTP + filtering (i.e. SNI based filtering, filtering by FQDN).""" + + TCP = "TCP" + + +class EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType(Enum): + + FQDN = "FQDN" + + +@dataclass +class EgressNetworkPolicyInternetAccessPolicyLogOnlyMode: + log_only_mode_type: Optional[EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType] = None + + workloads: Optional[List[EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType]] = None + + def as_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.log_only_mode_type is not None: + body["log_only_mode_type"] = self.log_only_mode_type.value + if self.workloads: + body["workloads"] = [v.value for v in self.workloads] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a shallow dictionary of its immediate attributes.""" + body = {} + if self.log_only_mode_type is not None: + body["log_only_mode_type"] = self.log_only_mode_type + if self.workloads: + body["workloads"] = self.workloads + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyLogOnlyMode: + """Deserializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode from a dictionary.""" + return cls( + log_only_mode_type=_enum( + d, "log_only_mode_type", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType + ), + workloads=_repeated_enum(d, "workloads", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType), + ) + + +class EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType(Enum): + + ALL_SERVICES = "ALL_SERVICES" + SELECTED_SERVICES = "SELECTED_SERVICES" + + +class EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType(Enum): + """The values should match the list of workloads used in networkconfig.proto""" + + DBSQL = "DBSQL" + ML_SERVING = "ML_SERVING" + + +class EgressNetworkPolicyInternetAccessPolicyRestrictionMode(Enum): + """At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: + Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can + only access explicitly allowed internet and storage destinations, as well as UC connections and + external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via + private link.""" + + FULL_ACCESS = "FULL_ACCESS" + PRIVATE_ACCESS_ONLY = "PRIVATE_ACCESS_ONLY" + RESTRICTED_ACCESS = "RESTRICTED_ACCESS" + + +@dataclass +class EgressNetworkPolicyInternetAccessPolicyStorageDestination: + """Users can specify accessible storage destinations.""" + + allowed_paths: Optional[List[str]] = None + + azure_container: Optional[str] = None + + azure_dns_zone: Optional[str] = None + + azure_storage_account: Optional[str] = None + + azure_storage_service: Optional[str] = None + + bucket_name: Optional[str] = None + + region: Optional[str] = None + + type: Optional[EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType] = None + + def as_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.allowed_paths: + body["allowed_paths"] = [v for v in self.allowed_paths] + if self.azure_container is not None: + body["azure_container"] = self.azure_container + if self.azure_dns_zone is not None: + body["azure_dns_zone"] = self.azure_dns_zone + if self.azure_storage_account is not None: + body["azure_storage_account"] = self.azure_storage_account + if self.azure_storage_service is not None: + body["azure_storage_service"] = self.azure_storage_service + if self.bucket_name is not None: + body["bucket_name"] = self.bucket_name + if self.region is not None: + body["region"] = self.region + if self.type is not None: + body["type"] = self.type.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a shallow dictionary of its immediate attributes.""" + body = {} + if self.allowed_paths: + body["allowed_paths"] = self.allowed_paths + if self.azure_container is not None: + body["azure_container"] = self.azure_container + if self.azure_dns_zone is not None: + body["azure_dns_zone"] = self.azure_dns_zone + if self.azure_storage_account is not None: + body["azure_storage_account"] = self.azure_storage_account + if self.azure_storage_service is not None: + body["azure_storage_service"] = self.azure_storage_service + if self.bucket_name is not None: + body["bucket_name"] = self.bucket_name + if self.region is not None: + body["region"] = self.region + if self.type is not None: + body["type"] = self.type + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyStorageDestination: + """Deserializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination from a dictionary.""" + return cls( + allowed_paths=d.get("allowed_paths", None), + azure_container=d.get("azure_container", None), + azure_dns_zone=d.get("azure_dns_zone", None), + azure_storage_account=d.get("azure_storage_account", None), + azure_storage_service=d.get("azure_storage_service", None), + bucket_name=d.get("bucket_name", None), + region=d.get("region", None), + type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType), + ) + + +class EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType(Enum): + + AWS_S3 = "AWS_S3" + AZURE_STORAGE = "AZURE_STORAGE" + CLOUDFLARE_R2 = "CLOUDFLARE_R2" + GOOGLE_CLOUD_STORAGE = "GOOGLE_CLOUD_STORAGE" + + @dataclass class ListCleanRoomAssetsResponse: assets: Optional[List[CleanRoomAsset]] = None @@ -1059,6 +1619,90 @@ def from_dict(cls, d: Dict[str, Any]) -> ListCleanRoomsResponse: ) +@dataclass +class Partition: + values: Optional[List[PartitionValue]] = None + """An array of partition values.""" + + def as_dict(self) -> dict: + """Serializes the Partition into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.values: + body["values"] = [v.as_dict() for v in self.values] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Partition into a shallow dictionary of its immediate attributes.""" + body = {} + if self.values: + body["values"] = self.values + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Partition: + """Deserializes the Partition from a dictionary.""" + return cls(values=_repeated_dict(d, "values", PartitionValue)) + + +@dataclass +class PartitionValue: + name: Optional[str] = None + """The name of the partition column.""" + + op: Optional[PartitionValueOp] = None + """The operator to apply for the value.""" + + recipient_property_key: Optional[str] = None + """The key of a Delta Sharing recipient's property. For example "databricks-account-id". When this + field is set, field `value` can not be set.""" + + value: Optional[str] = None + """The value of the partition column. When this value is not set, it means `null` value. When this + field is set, field `recipient_property_key` can not be set.""" + + def as_dict(self) -> dict: + """Serializes the PartitionValue into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.name is not None: + body["name"] = self.name + if self.op is not None: + body["op"] = self.op.value + if self.recipient_property_key is not None: + body["recipient_property_key"] = self.recipient_property_key + if self.value is not None: + body["value"] = self.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the PartitionValue into a shallow dictionary of its immediate attributes.""" + body = {} + if self.name is not None: + body["name"] = self.name + if self.op is not None: + body["op"] = self.op + if self.recipient_property_key is not None: + body["recipient_property_key"] = self.recipient_property_key + if self.value is not None: + body["value"] = self.value + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> PartitionValue: + """Deserializes the PartitionValue from a dictionary.""" + return cls( + name=d.get("name", None), + op=_enum(d, "op", PartitionValueOp), + recipient_property_key=d.get("recipient_property_key", None), + value=d.get("value", None), + ) + + +class PartitionValueOp(Enum): + + EQUAL = "EQUAL" + LIKE = "LIKE" + + @dataclass class UpdateCleanRoomRequest: clean_room: Optional[CleanRoom] = None diff --git a/databricks/sdk/service/compute.py b/databricks/sdk/service/compute.py index 49014519b..ec740e5b5 100755 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/service/compute.py @@ -3519,46 +3519,6 @@ def from_dict(cls, d: Dict[str, Any]) -> Created: return cls(id=d.get("id", None)) -@dataclass -class CustomPolicyTag: - key: str - """The key of the tag. - Must be unique among all custom tags of the same policy - Cannot be - “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" - these - tags are preserved. - - - Follows the regex pattern defined in cluster-common/conf/src/ClusterTagConstraints.scala - (https://src.dev.databricks.com/databricks/universe@1647196627c8dc7b4152ad098a94b86484b93a6c/-/blob/cluster-common/conf/src/ClusterTagConstraints.scala?L17)""" - - value: Optional[str] = None - """The value of the tag. - - - Follows the regex pattern defined in cluster-common/conf/src/ClusterTagConstraints.scala - (https://src.dev.databricks.com/databricks/universe@1647196627c8dc7b4152ad098a94b86484b93a6c/-/blob/cluster-common/conf/src/ClusterTagConstraints.scala?L24)""" - - def as_dict(self) -> dict: - """Serializes the CustomPolicyTag into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.key is not None: - body["key"] = self.key - if self.value is not None: - body["value"] = self.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the CustomPolicyTag into a shallow dictionary of its immediate attributes.""" - body = {} - if self.key is not None: - body["key"] = self.key - if self.value is not None: - body["value"] = self.value - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> CustomPolicyTag: - """Deserializes the CustomPolicyTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) - - @dataclass class DataPlaneEventDetails: event_type: Optional[DataPlaneEventDetailsEventType] = None @@ -4770,48 +4730,6 @@ def from_dict(cls, d: Dict[str, Any]) -> EnforceClusterComplianceResponse: return cls(changes=_repeated_dict(d, "changes", ClusterSettingsChange), has_changes=d.get("has_changes", None)) -@dataclass -class Environment: - """The environment entity used to preserve serverless environment side panel and jobs' environment - for non-notebook task. In this minimal environment spec, only pip dependencies are supported.""" - - client: str - """Client version used by the environment The client is the user-facing environment of the runtime. - Each client comes with a specific set of pre-installed libraries. The version is a string, - consisting of the major client version.""" - - dependencies: Optional[List[str]] = None - """List of pip dependencies, as supported by the version of pip in this environment. Each - dependency is a pip requirement file line - https://pip.pypa.io/en/stable/reference/requirements-file-format/ Allowed dependency could be - , , (WSFS or Volumes in - Databricks), E.g. dependencies: ["foo==0.0.1", "-r - /Workspace/test/requirements.txt"]""" - - def as_dict(self) -> dict: - """Serializes the Environment into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.client is not None: - body["client"] = self.client - if self.dependencies: - body["dependencies"] = [v for v in self.dependencies] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the Environment into a shallow dictionary of its immediate attributes.""" - body = {} - if self.client is not None: - body["client"] = self.client - if self.dependencies: - body["dependencies"] = self.dependencies - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> Environment: - """Deserializes the Environment from a dictionary.""" - return cls(client=d.get("client", None), dependencies=d.get("dependencies", None)) - - @dataclass class EventDetails: attributes: Optional[ClusterAttributes] = None diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/service/dashboards.py index de1042e7f..98307a8bb 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -16,11 +16,64 @@ _LOG = logging.getLogger("databricks.sdk") -from databricks.sdk.service import sql - # all definitions in this file are in alphabetical order +@dataclass +class BaseChunkInfo: + """Describes metadata for a particular chunk, within a result set; this structure is used both + within a manifest, and when fetching individual chunk data or links.""" + + byte_count: Optional[int] = None + """The number of bytes in the result chunk. This field is not available when using `INLINE` + disposition.""" + + chunk_index: Optional[int] = None + """The position within the sequence of result set chunks.""" + + row_count: Optional[int] = None + """The number of rows within the result chunk.""" + + row_offset: Optional[int] = None + """The starting row offset within the result set.""" + + def as_dict(self) -> dict: + """Serializes the BaseChunkInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.byte_count is not None: + body["byte_count"] = self.byte_count + if self.chunk_index is not None: + body["chunk_index"] = self.chunk_index + if self.row_count is not None: + body["row_count"] = self.row_count + if self.row_offset is not None: + body["row_offset"] = self.row_offset + return body + + def as_shallow_dict(self) -> dict: + """Serializes the BaseChunkInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.byte_count is not None: + body["byte_count"] = self.byte_count + if self.chunk_index is not None: + body["chunk_index"] = self.chunk_index + if self.row_count is not None: + body["row_count"] = self.row_count + if self.row_offset is not None: + body["row_offset"] = self.row_offset + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> BaseChunkInfo: + """Deserializes the BaseChunkInfo from a dictionary.""" + return cls( + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), + ) + + @dataclass class CancelQueryExecutionResponse: status: Optional[List[CancelQueryExecutionResponseStatus]] = None @@ -91,6 +144,108 @@ def from_dict(cls, d: Dict[str, Any]) -> CancelQueryExecutionResponseStatus: ) +@dataclass +class ColumnInfo: + name: Optional[str] = None + """The name of the column.""" + + position: Optional[int] = None + """The ordinal position of the column (starting at position 0).""" + + type_interval_type: Optional[str] = None + """The format of the interval type.""" + + type_name: Optional[ColumnInfoTypeName] = None + """The name of the base data type. This doesn't include details for complex types such as STRUCT, + MAP or ARRAY.""" + + type_precision: Optional[int] = None + """Specifies the number of digits in a number. This applies to the DECIMAL type.""" + + type_scale: Optional[int] = None + """Specifies the number of digits to the right of the decimal point in a number. This applies to + the DECIMAL type.""" + + type_text: Optional[str] = None + """The full SQL type specification.""" + + def as_dict(self) -> dict: + """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.name is not None: + body["name"] = self.name + if self.position is not None: + body["position"] = self.position + if self.type_interval_type is not None: + body["type_interval_type"] = self.type_interval_type + if self.type_name is not None: + body["type_name"] = self.type_name.value + if self.type_precision is not None: + body["type_precision"] = self.type_precision + if self.type_scale is not None: + body["type_scale"] = self.type_scale + if self.type_text is not None: + body["type_text"] = self.type_text + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.name is not None: + body["name"] = self.name + if self.position is not None: + body["position"] = self.position + if self.type_interval_type is not None: + body["type_interval_type"] = self.type_interval_type + if self.type_name is not None: + body["type_name"] = self.type_name + if self.type_precision is not None: + body["type_precision"] = self.type_precision + if self.type_scale is not None: + body["type_scale"] = self.type_scale + if self.type_text is not None: + body["type_text"] = self.type_text + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: + """Deserializes the ColumnInfo from a dictionary.""" + return cls( + name=d.get("name", None), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_name=_enum(d, "type_name", ColumnInfoTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), + ) + + +class ColumnInfoTypeName(Enum): + """The name of the base data type. This doesn't include details for complex types such as STRUCT, + MAP or ARRAY.""" + + ARRAY = "ARRAY" + BINARY = "BINARY" + BOOLEAN = "BOOLEAN" + BYTE = "BYTE" + CHAR = "CHAR" + DATE = "DATE" + DECIMAL = "DECIMAL" + DOUBLE = "DOUBLE" + FLOAT = "FLOAT" + INT = "INT" + INTERVAL = "INTERVAL" + LONG = "LONG" + MAP = "MAP" + NULL = "NULL" + SHORT = "SHORT" + STRING = "STRING" + STRUCT = "STRUCT" + TIMESTAMP = "TIMESTAMP" + USER_DEFINED_TYPE = "USER_DEFINED_TYPE" + + @dataclass class CronSchedule: quartz_cron_expression: str @@ -366,6 +521,112 @@ def from_dict(cls, d: Dict[str, Any]) -> ExecuteQueryResponse: return cls() +@dataclass +class ExternalLink: + byte_count: Optional[int] = None + """The number of bytes in the result chunk. This field is not available when using `INLINE` + disposition.""" + + chunk_index: Optional[int] = None + """The position within the sequence of result set chunks.""" + + expiration: Optional[str] = None + """Indicates the date-time that the given external link will expire and becomes invalid, after + which point a new `external_link` must be requested.""" + + external_link: Optional[str] = None + + http_headers: Optional[Dict[str, str]] = None + """HTTP headers that must be included with a GET request to the `external_link`. Each header is + provided as a key-value pair. Headers are typically used to pass a decryption key to the + external service. The values of these headers should be considered sensitive and the client + should not expose these values in a log.""" + + next_chunk_index: Optional[int] = None + """When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are + no more chunks. The next chunk can be fetched with a + :method:statementexecution/getStatementResultChunkN request.""" + + next_chunk_internal_link: Optional[str] = None + """When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more + chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be + treated as an opaque link. This is an alternative to using `next_chunk_index`.""" + + row_count: Optional[int] = None + """The number of rows within the result chunk.""" + + row_offset: Optional[int] = None + """The starting row offset within the result set.""" + + def as_dict(self) -> dict: + """Serializes the ExternalLink into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.byte_count is not None: + body["byte_count"] = self.byte_count + if self.chunk_index is not None: + body["chunk_index"] = self.chunk_index + if self.expiration is not None: + body["expiration"] = self.expiration + if self.external_link is not None: + body["external_link"] = self.external_link + if self.http_headers: + body["http_headers"] = self.http_headers + if self.next_chunk_index is not None: + body["next_chunk_index"] = self.next_chunk_index + if self.next_chunk_internal_link is not None: + body["next_chunk_internal_link"] = self.next_chunk_internal_link + if self.row_count is not None: + body["row_count"] = self.row_count + if self.row_offset is not None: + body["row_offset"] = self.row_offset + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ExternalLink into a shallow dictionary of its immediate attributes.""" + body = {} + if self.byte_count is not None: + body["byte_count"] = self.byte_count + if self.chunk_index is not None: + body["chunk_index"] = self.chunk_index + if self.expiration is not None: + body["expiration"] = self.expiration + if self.external_link is not None: + body["external_link"] = self.external_link + if self.http_headers: + body["http_headers"] = self.http_headers + if self.next_chunk_index is not None: + body["next_chunk_index"] = self.next_chunk_index + if self.next_chunk_internal_link is not None: + body["next_chunk_internal_link"] = self.next_chunk_internal_link + if self.row_count is not None: + body["row_count"] = self.row_count + if self.row_offset is not None: + body["row_offset"] = self.row_offset + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ExternalLink: + """Deserializes the ExternalLink from a dictionary.""" + return cls( + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + expiration=d.get("expiration", None), + external_link=d.get("external_link", None), + http_headers=d.get("http_headers", None), + next_chunk_index=d.get("next_chunk_index", None), + next_chunk_internal_link=d.get("next_chunk_internal_link", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), + ) + + +class Format(Enum): + + ARROW_STREAM = "ARROW_STREAM" + CSV = "CSV" + JSON_ARRAY = "JSON_ARRAY" + + @dataclass class GenieAttachment: """Genie AI Response""" @@ -529,9 +790,88 @@ def from_dict(cls, d: Dict[str, Any]) -> GenieCreateConversationMessageRequest: ) +@dataclass +class GenieGenerateDownloadFullQueryResultResponse: + error: Optional[str] = None + """Error message if Genie failed to download the result""" + + status: Optional[MessageStatus] = None + """Download result status""" + + transient_statement_id: Optional[str] = None + """Transient Statement ID. Use this ID to track the download request in subsequent polling calls""" + + def as_dict(self) -> dict: + """Serializes the GenieGenerateDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.error is not None: + body["error"] = self.error + if self.status is not None: + body["status"] = self.status.value + if self.transient_statement_id is not None: + body["transient_statement_id"] = self.transient_statement_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GenieGenerateDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes.""" + body = {} + if self.error is not None: + body["error"] = self.error + if self.status is not None: + body["status"] = self.status + if self.transient_statement_id is not None: + body["transient_statement_id"] = self.transient_statement_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GenieGenerateDownloadFullQueryResultResponse: + """Deserializes the GenieGenerateDownloadFullQueryResultResponse from a dictionary.""" + return cls( + error=d.get("error", None), + status=_enum(d, "status", MessageStatus), + transient_statement_id=d.get("transient_statement_id", None), + ) + + +@dataclass +class GenieGetDownloadFullQueryResultResponse: + statement_response: Optional[StatementResponse] = None + """SQL Statement Execution response. See [Get status, manifest, and result first + chunk](:method:statementexecution/getstatement) for more details.""" + + transient_statement_id: Optional[str] = None + """Transient Statement ID""" + + def as_dict(self) -> dict: + """Serializes the GenieGetDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.statement_response: + body["statement_response"] = self.statement_response.as_dict() + if self.transient_statement_id is not None: + body["transient_statement_id"] = self.transient_statement_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GenieGetDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes.""" + body = {} + if self.statement_response: + body["statement_response"] = self.statement_response + if self.transient_statement_id is not None: + body["transient_statement_id"] = self.transient_statement_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GenieGetDownloadFullQueryResultResponse: + """Deserializes the GenieGetDownloadFullQueryResultResponse from a dictionary.""" + return cls( + statement_response=_from_dict(d, "statement_response", StatementResponse), + transient_statement_id=d.get("transient_statement_id", None), + ) + + @dataclass class GenieGetMessageQueryResultResponse: - statement_response: Optional[sql.StatementResponse] = None + statement_response: Optional[StatementResponse] = None """SQL Statement Execution response. See [Get status, manifest, and result first chunk](:method:statementexecution/getstatement) for more details.""" @@ -552,7 +892,7 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieGetMessageQueryResultResponse: """Deserializes the GenieGetMessageQueryResultResponse from a dictionary.""" - return cls(statement_response=_from_dict(d, "statement_response", sql.StatementResponse)) + return cls(statement_response=_from_dict(d, "statement_response", StatementResponse)) @dataclass @@ -1470,6 +1810,203 @@ def from_dict(cls, d: Dict[str, Any]) -> Result: ) +@dataclass +class ResultData: + byte_count: Optional[int] = None + """The number of bytes in the result chunk. This field is not available when using `INLINE` + disposition.""" + + chunk_index: Optional[int] = None + """The position within the sequence of result set chunks.""" + + data_array: Optional[List[List[str]]] = None + """The `JSON_ARRAY` format is an array of arrays of values, where each non-null value is formatted + as a string. Null values are encoded as JSON `null`.""" + + external_links: Optional[List[ExternalLink]] = None + + next_chunk_index: Optional[int] = None + """When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are + no more chunks. The next chunk can be fetched with a + :method:statementexecution/getStatementResultChunkN request.""" + + next_chunk_internal_link: Optional[str] = None + """When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more + chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be + treated as an opaque link. This is an alternative to using `next_chunk_index`.""" + + row_count: Optional[int] = None + """The number of rows within the result chunk.""" + + row_offset: Optional[int] = None + """The starting row offset within the result set.""" + + def as_dict(self) -> dict: + """Serializes the ResultData into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.byte_count is not None: + body["byte_count"] = self.byte_count + if self.chunk_index is not None: + body["chunk_index"] = self.chunk_index + if self.data_array: + body["data_array"] = [v for v in self.data_array] + if self.external_links: + body["external_links"] = [v.as_dict() for v in self.external_links] + if self.next_chunk_index is not None: + body["next_chunk_index"] = self.next_chunk_index + if self.next_chunk_internal_link is not None: + body["next_chunk_internal_link"] = self.next_chunk_internal_link + if self.row_count is not None: + body["row_count"] = self.row_count + if self.row_offset is not None: + body["row_offset"] = self.row_offset + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ResultData into a shallow dictionary of its immediate attributes.""" + body = {} + if self.byte_count is not None: + body["byte_count"] = self.byte_count + if self.chunk_index is not None: + body["chunk_index"] = self.chunk_index + if self.data_array: + body["data_array"] = self.data_array + if self.external_links: + body["external_links"] = self.external_links + if self.next_chunk_index is not None: + body["next_chunk_index"] = self.next_chunk_index + if self.next_chunk_internal_link is not None: + body["next_chunk_internal_link"] = self.next_chunk_internal_link + if self.row_count is not None: + body["row_count"] = self.row_count + if self.row_offset is not None: + body["row_offset"] = self.row_offset + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ResultData: + """Deserializes the ResultData from a dictionary.""" + return cls( + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + data_array=d.get("data_array", None), + external_links=_repeated_dict(d, "external_links", ExternalLink), + next_chunk_index=d.get("next_chunk_index", None), + next_chunk_internal_link=d.get("next_chunk_internal_link", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), + ) + + +@dataclass +class ResultManifest: + """The result manifest provides schema and metadata for the result set.""" + + chunks: Optional[List[BaseChunkInfo]] = None + """Array of result set chunk metadata.""" + + format: Optional[Format] = None + + schema: Optional[ResultSchema] = None + """The schema is an ordered list of column descriptions.""" + + total_byte_count: Optional[int] = None + """The total number of bytes in the result set. This field is not available when using `INLINE` + disposition.""" + + total_chunk_count: Optional[int] = None + """The total number of chunks that the result set has been divided into.""" + + total_row_count: Optional[int] = None + """The total number of rows in the result set.""" + + truncated: Optional[bool] = None + """Indicates whether the result is truncated due to `row_limit` or `byte_limit`.""" + + def as_dict(self) -> dict: + """Serializes the ResultManifest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.chunks: + body["chunks"] = [v.as_dict() for v in self.chunks] + if self.format is not None: + body["format"] = self.format.value + if self.schema: + body["schema"] = self.schema.as_dict() + if self.total_byte_count is not None: + body["total_byte_count"] = self.total_byte_count + if self.total_chunk_count is not None: + body["total_chunk_count"] = self.total_chunk_count + if self.total_row_count is not None: + body["total_row_count"] = self.total_row_count + if self.truncated is not None: + body["truncated"] = self.truncated + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ResultManifest into a shallow dictionary of its immediate attributes.""" + body = {} + if self.chunks: + body["chunks"] = self.chunks + if self.format is not None: + body["format"] = self.format + if self.schema: + body["schema"] = self.schema + if self.total_byte_count is not None: + body["total_byte_count"] = self.total_byte_count + if self.total_chunk_count is not None: + body["total_chunk_count"] = self.total_chunk_count + if self.total_row_count is not None: + body["total_row_count"] = self.total_row_count + if self.truncated is not None: + body["truncated"] = self.truncated + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ResultManifest: + """Deserializes the ResultManifest from a dictionary.""" + return cls( + chunks=_repeated_dict(d, "chunks", BaseChunkInfo), + format=_enum(d, "format", Format), + schema=_from_dict(d, "schema", ResultSchema), + total_byte_count=d.get("total_byte_count", None), + total_chunk_count=d.get("total_chunk_count", None), + total_row_count=d.get("total_row_count", None), + truncated=d.get("truncated", None), + ) + + +@dataclass +class ResultSchema: + """The schema is an ordered list of column descriptions.""" + + column_count: Optional[int] = None + + columns: Optional[List[ColumnInfo]] = None + + def as_dict(self) -> dict: + """Serializes the ResultSchema into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.column_count is not None: + body["column_count"] = self.column_count + if self.columns: + body["columns"] = [v.as_dict() for v in self.columns] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ResultSchema into a shallow dictionary of its immediate attributes.""" + body = {} + if self.column_count is not None: + body["column_count"] = self.column_count + if self.columns: + body["columns"] = self.columns + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ResultSchema: + """Deserializes the ResultSchema from a dictionary.""" + return cls(column_count=d.get("column_count", None), columns=_repeated_dict(d, "columns", ColumnInfo)) + + @dataclass class Schedule: cron_schedule: CronSchedule @@ -1569,6 +2106,158 @@ class SchedulePauseStatus(Enum): UNPAUSED = "UNPAUSED" +@dataclass +class ServiceError: + error_code: Optional[ServiceErrorCode] = None + + message: Optional[str] = None + """A brief summary of the error condition.""" + + def as_dict(self) -> dict: + """Serializes the ServiceError into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.error_code is not None: + body["error_code"] = self.error_code.value + if self.message is not None: + body["message"] = self.message + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ServiceError into a shallow dictionary of its immediate attributes.""" + body = {} + if self.error_code is not None: + body["error_code"] = self.error_code + if self.message is not None: + body["message"] = self.message + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ServiceError: + """Deserializes the ServiceError from a dictionary.""" + return cls(error_code=_enum(d, "error_code", ServiceErrorCode), message=d.get("message", None)) + + +class ServiceErrorCode(Enum): + + ABORTED = "ABORTED" + ALREADY_EXISTS = "ALREADY_EXISTS" + BAD_REQUEST = "BAD_REQUEST" + CANCELLED = "CANCELLED" + DEADLINE_EXCEEDED = "DEADLINE_EXCEEDED" + INTERNAL_ERROR = "INTERNAL_ERROR" + IO_ERROR = "IO_ERROR" + NOT_FOUND = "NOT_FOUND" + RESOURCE_EXHAUSTED = "RESOURCE_EXHAUSTED" + SERVICE_UNDER_MAINTENANCE = "SERVICE_UNDER_MAINTENANCE" + TEMPORARILY_UNAVAILABLE = "TEMPORARILY_UNAVAILABLE" + UNAUTHENTICATED = "UNAUTHENTICATED" + UNKNOWN = "UNKNOWN" + WORKSPACE_TEMPORARILY_UNAVAILABLE = "WORKSPACE_TEMPORARILY_UNAVAILABLE" + + +@dataclass +class StatementResponse: + manifest: Optional[ResultManifest] = None + """The result manifest provides schema and metadata for the result set.""" + + result: Optional[ResultData] = None + + statement_id: Optional[str] = None + """The statement ID is returned upon successfully submitting a SQL statement, and is a required + reference for all subsequent calls.""" + + status: Optional[StatementStatus] = None + """The status response includes execution state and if relevant, error information.""" + + def as_dict(self) -> dict: + """Serializes the StatementResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.manifest: + body["manifest"] = self.manifest.as_dict() + if self.result: + body["result"] = self.result.as_dict() + if self.statement_id is not None: + body["statement_id"] = self.statement_id + if self.status: + body["status"] = self.status.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the StatementResponse into a shallow dictionary of its immediate attributes.""" + body = {} + if self.manifest: + body["manifest"] = self.manifest + if self.result: + body["result"] = self.result + if self.statement_id is not None: + body["statement_id"] = self.statement_id + if self.status: + body["status"] = self.status + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> StatementResponse: + """Deserializes the StatementResponse from a dictionary.""" + return cls( + manifest=_from_dict(d, "manifest", ResultManifest), + result=_from_dict(d, "result", ResultData), + statement_id=d.get("statement_id", None), + status=_from_dict(d, "status", StatementStatus), + ) + + +class StatementState(Enum): + """Statement execution state: - `PENDING`: waiting for warehouse - `RUNNING`: running - + `SUCCEEDED`: execution was successful, result data available for fetch - `FAILED`: execution + failed; reason for failure described in accomanying error message - `CANCELED`: user canceled; + can come from explicit cancel call, or timeout with `on_wait_timeout=CANCEL` - `CLOSED`: + execution successful, and statement closed; result no longer available for fetch""" + + CANCELED = "CANCELED" + CLOSED = "CLOSED" + FAILED = "FAILED" + PENDING = "PENDING" + RUNNING = "RUNNING" + SUCCEEDED = "SUCCEEDED" + + +@dataclass +class StatementStatus: + """The status response includes execution state and if relevant, error information.""" + + error: Optional[ServiceError] = None + + state: Optional[StatementState] = None + """Statement execution state: - `PENDING`: waiting for warehouse - `RUNNING`: running - + `SUCCEEDED`: execution was successful, result data available for fetch - `FAILED`: execution + failed; reason for failure described in accomanying error message - `CANCELED`: user canceled; + can come from explicit cancel call, or timeout with `on_wait_timeout=CANCEL` - `CLOSED`: + execution successful, and statement closed; result no longer available for fetch""" + + def as_dict(self) -> dict: + """Serializes the StatementStatus into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.error: + body["error"] = self.error.as_dict() + if self.state is not None: + body["state"] = self.state.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the StatementStatus into a shallow dictionary of its immediate attributes.""" + body = {} + if self.error: + body["error"] = self.error + if self.state is not None: + body["state"] = self.state + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> StatementStatus: + """Deserializes the StatementStatus from a dictionary.""" + return cls(error=_from_dict(d, "error", ServiceError), state=_enum(d, "state", StatementState)) + + @dataclass class Subscriber: destination_subscriber: Optional[SubscriptionSubscriberDestination] = None @@ -1989,6 +2678,85 @@ def execute_message_query( ) return GenieGetMessageQueryResultResponse.from_dict(res) + def generate_download_full_query_result( + self, space_id: str, conversation_id: str, message_id: str, attachment_id: str + ) -> GenieGenerateDownloadFullQueryResultResponse: + """Generate full query result download. + + Initiate full SQL query result download and obtain a transient ID for tracking the download progress. + This call initiates a new SQL execution to generate the query result. The result is stored in an + external link can be retrieved using the [Get Download Full Query + Result](:method:genie/getdownloadfullqueryresult) API. Warning: Databricks strongly recommends that + you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition. See [Execute + Statement](:method:statementexecution/executestatement) for more details. + + :param space_id: str + Space ID + :param conversation_id: str + Conversation ID + :param message_id: str + Message ID + :param attachment_id: str + Attachment ID + + :returns: :class:`GenieGenerateDownloadFullQueryResultResponse` + """ + + headers = { + "Accept": "application/json", + } + + res = self._api.do( + "POST", + f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/generate-download", + headers=headers, + ) + return GenieGenerateDownloadFullQueryResultResponse.from_dict(res) + + def get_download_full_query_result( + self, space_id: str, conversation_id: str, message_id: str, attachment_id: str, transient_statement_id: str + ) -> GenieGetDownloadFullQueryResultResponse: + """Get download full query result status. + + Poll download progress and retrieve the SQL query result external link(s) upon completion. Warning: + Databricks strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` + disposition. When you use the `EXTERNAL_LINKS` disposition, a short-lived, presigned URL is generated, + which can be used to download the results directly from Amazon S3. As a short-lived access credential + is embedded in this presigned URL, you should protect the URL. Because presigned URLs are already + generated with embedded temporary access credentials, you must not set an Authorization header in the + download requests. See [Execute Statement](:method:statementexecution/executestatement) for more + details. + + :param space_id: str + Space ID + :param conversation_id: str + Conversation ID + :param message_id: str + Message ID + :param attachment_id: str + Attachment ID + :param transient_statement_id: str + Transient Statement ID. This ID is provided by the [Start Download + endpoint](:method:genie/startdownloadfullqueryresult) + + :returns: :class:`GenieGetDownloadFullQueryResultResponse` + """ + + query = {} + if transient_statement_id is not None: + query["transient_statement_id"] = transient_statement_id + headers = { + "Accept": "application/json", + } + + res = self._api.do( + "GET", + f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/get-download", + query=query, + headers=headers, + ) + return GenieGetDownloadFullQueryResultResponse.from_dict(res) + def get_message(self, space_id: str, conversation_id: str, message_id: str) -> GenieMessage: """Get conversation message. diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/service/jobs.py index 5885ace01..5ecccf9fa 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -16,11 +16,300 @@ _LOG = logging.getLogger("databricks.sdk") -from databricks.sdk.service import compute - # all definitions in this file are in alphabetical order +@dataclass +class Adlsgen2Info: + """A storage location in Adls Gen2""" + + destination: str + """abfss destination, e.g. + `abfss://@.dfs.core.windows.net/`.""" + + def as_dict(self) -> dict: + """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: + """Deserializes the Adlsgen2Info from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class AutoScale: + max_workers: Optional[int] = None + """The maximum number of workers to which the cluster can scale up when overloaded. Note that + `max_workers` must be strictly greater than `min_workers`.""" + + min_workers: Optional[int] = None + """The minimum number of workers to which the cluster can scale down when underutilized. It is also + the initial number of workers the cluster will have after creation.""" + + def as_dict(self) -> dict: + """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.max_workers is not None: + body["max_workers"] = self.max_workers + if self.min_workers is not None: + body["min_workers"] = self.min_workers + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" + body = {} + if self.max_workers is not None: + body["max_workers"] = self.max_workers + if self.min_workers is not None: + body["min_workers"] = self.min_workers + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AutoScale: + """Deserializes the AutoScale from a dictionary.""" + return cls(max_workers=d.get("max_workers", None), min_workers=d.get("min_workers", None)) + + +@dataclass +class AwsAttributes: + """Attributes set during cluster creation which are related to Amazon Web Services.""" + + availability: Optional[AwsAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ebs_volume_count: Optional[int] = None + """The number of volumes launched for each instance. Users can choose up to 10 volumes. This + feature is only enabled for supported node types. Legacy node types cannot specify custom EBS + volumes. For node types with no instance store, at least one EBS volume needs to be specified; + otherwise, cluster creation will fail. + + These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. Instance store volumes will be + mounted at `/local_disk0`, `/local_disk1`, and etc. + + If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for + scratch storage because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance + store volumes. + + Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + will be overridden.""" + + ebs_volume_iops: Optional[int] = None + """If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance + of a gp2 volume with the same volume size will be used.""" + + ebs_volume_size: Optional[int] = None + """The size of each EBS volume (in GiB) launched for each instance. For general purpose SSD, this + value must be within the range 100 - 4096. For throughput optimized HDD, this value must be + within the range 500 - 4096.""" + + ebs_volume_throughput: Optional[int] = None + """If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum + performance of a gp2 volume with the same volume size will be used.""" + + ebs_volume_type: Optional[EbsVolumeType] = None + """The type of EBS volumes that will be launched with this cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. If this + value is greater than 0, the cluster driver node in particular will be placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + instance_profile_arn: Optional[str] = None + """Nodes for this cluster will only be placed on AWS instances with this instance profile. If + ommitted, nodes will be placed on instances without an IAM instance profile. The instance + profile must have previously been added to the Databricks environment by an account + administrator. + + This feature may only be available to certain customer plans.""" + + spot_bid_price_percent: Optional[int] = None + """The bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. For example, if this field is set to 50, and the cluster needs a new + `r3.xlarge` spot instance, then the bid price is half of the price of on-demand `r3.xlarge` + instances. Similarly, if this field is set to 200, the bid price is twice the price of on-demand + `r3.xlarge` instances. If not specified, the default value is 100. When spot instances are + requested for this cluster, only spot instances whose bid price percentage matches this field + will be considered. Note that, for safety, we enforce this field to be no more than 10000.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone/datacenter in which the cluster resides. This string will + be of a form like "us-west-2a". The provided availability zone must be in the same region as the + Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks + deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and + if not specified, a default zone will be used. If the zone specified is "auto", will try to + place cluster in a zone with high availability, and will retry placement in a different AZ if + there is not enough capacity. + + The list of available zones as well as the default value can be found by using the `List Zones` + method.""" + + def as_dict(self) -> dict: + """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: + """Deserializes the AwsAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AwsAvailability), + ebs_volume_count=d.get("ebs_volume_count", None), + ebs_volume_iops=d.get("ebs_volume_iops", None), + ebs_volume_size=d.get("ebs_volume_size", None), + ebs_volume_throughput=d.get("ebs_volume_throughput", None), + ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), + first_on_demand=d.get("first_on_demand", None), + instance_profile_arn=d.get("instance_profile_arn", None), + spot_bid_price_percent=d.get("spot_bid_price_percent", None), + zone_id=d.get("zone_id", None), + ) + + +class AwsAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND = "ON_DEMAND" + SPOT = "SPOT" + SPOT_WITH_FALLBACK = "SPOT_WITH_FALLBACK" + + +@dataclass +class AzureAttributes: + """Attributes set during cluster creation which are related to Microsoft Azure.""" + + availability: Optional[AzureAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This + value should be greater than 0, to make sure the cluster driver node is placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + log_analytics_info: Optional[LogAnalyticsInfo] = None + """Defines values necessary to configure and run Azure Log Analytics agent""" + + spot_bid_max_price: Optional[float] = None + """The max bid price to be used for Azure spot instances. The Max price for the bid cannot be + higher than the on-demand price of the instance. If not specified, the default value is -1, + which specifies that the instance cannot be evicted on the basis of price, and only on the basis + of availability. Further, the value should > 0 or -1.""" + + def as_dict(self) -> dict: + """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info.as_dict() + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: + """Deserializes the AzureAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AzureAvailability), + first_on_demand=d.get("first_on_demand", None), + log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), + spot_bid_max_price=d.get("spot_bid_max_price", None), + ) + + +class AzureAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND_AZURE = "ON_DEMAND_AZURE" + SPOT_AZURE = "SPOT_AZURE" + SPOT_WITH_FALLBACK_AZURE = "SPOT_WITH_FALLBACK_AZURE" + + @dataclass class BaseJob: created_time: Optional[int] = None @@ -37,9 +326,9 @@ class BaseJob: on accessible budget policies of the run_as identity on job creation or modification.""" has_more: Optional[bool] = None - """Indicates if the job has more sub-resources (`tasks`, `job_clusters`) that are not shown. They - can be accessed via :method:jobs/get endpoint. It is only relevant for API 2.2 :method:jobs/list - requests with `expand_tasks=true`.""" + """Indicates if the job has more array properties (`tasks`, `job_clusters`) that are not shown. + They can be accessed via :method:jobs/get endpoint. It is only relevant for API 2.2 + :method:jobs/list requests with `expand_tasks=true`.""" job_id: Optional[int] = None """The canonical identifier for this job.""" @@ -151,8 +440,8 @@ class BaseRun: are used, `git_source` must be defined on the job.""" has_more: Optional[bool] = None - """Indicates if the run has more sub-resources (`tasks`, `job_clusters`) that are not shown. They - can be accessed via :method:jobs/getrun endpoint. It is only relevant for API 2.2 + """Indicates if the run has more array properties (`tasks`, `job_clusters`) that are not shown. + They can be accessed via :method:jobs/getrun endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests with `expand_tasks=true`.""" job_clusters: Optional[List[JobCluster]] = None @@ -693,6 +982,38 @@ def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTaskCleanRoomsNoteboo ) +@dataclass +class ClientsTypes: + jobs: Optional[bool] = None + """With jobs set, the cluster can be used for jobs""" + + notebooks: Optional[bool] = None + """With notebooks set, this cluster can be used for notebooks""" + + def as_dict(self) -> dict: + """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.jobs is not None: + body["jobs"] = self.jobs + if self.notebooks is not None: + body["notebooks"] = self.notebooks + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.jobs is not None: + body["jobs"] = self.jobs + if self.notebooks is not None: + body["notebooks"] = self.notebooks + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: + """Deserializes the ClientsTypes from a dictionary.""" + return cls(jobs=d.get("jobs", None), notebooks=d.get("notebooks", None)) + + @dataclass class ClusterInstance: cluster_id: Optional[str] = None @@ -736,6 +1057,56 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterInstance: return cls(cluster_id=d.get("cluster_id", None), spark_context_id=d.get("spark_context_id", None)) +@dataclass +class ClusterLogConf: + """Cluster log delivery config""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } + }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ "s3": { "destination" + : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` Cluster iam role is used to + access s3, please make sure the cluster iam role in `instance_profile_arn` has permission to + write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided, e.g. `{ "volumes": { "destination": + "/Volumes/catalog/schema/volume/cluster_log" } }`""" + + def as_dict(self) -> dict: + """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: + """Deserializes the ClusterLogConf from a dictionary.""" + return cls( + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + ) + + @dataclass class ClusterSpec: existing_cluster_id: Optional[str] = None @@ -747,11 +1118,11 @@ class ClusterSpec: """If job_cluster_key, this task is executed reusing the cluster specified in `job.settings.job_clusters`.""" - libraries: Optional[List[compute.Library]] = None + libraries: Optional[List[Library]] = None """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[compute.ClusterSpec] = None + new_cluster: Optional[ClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" def as_dict(self) -> dict: @@ -786,8 +1157,8 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterSpec: return cls( existing_cluster_id=d.get("existing_cluster_id", None), job_cluster_key=d.get("job_cluster_key", None), - libraries=_repeated_dict(d, "libraries", compute.Library), - new_cluster=_from_dict(d, "new_cluster", compute.ClusterSpec), + libraries=_repeated_dict(d, "libraries", Library), + new_cluster=_from_dict(d, "new_cluster", ClusterSpec), ) @@ -1271,6 +1642,71 @@ def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: ) +class DataSecurityMode(Enum): + """Data security mode decides what data governance model to use when accessing data from a cluster. + + The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: + Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: + Alias for `SINGLE_USER`. + + The following modes can be used regardless of `kind`. * `NONE`: No security isolation for + multiple users sharing the cluster. Data governance features are not available in this mode. * + `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in + `single_user_name`. Most programming languages, cluster features and data governance features + are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple + users. Cluster users are fully isolated so that they cannot see each other's data and + credentials. Most data governance features are supported in this mode. But programming languages + and cluster features might be limited. + + The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for + future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * + `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high + concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy + Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that + doesn’t have UC nor passthrough enabled.""" + + DATA_SECURITY_MODE_AUTO = "DATA_SECURITY_MODE_AUTO" + DATA_SECURITY_MODE_DEDICATED = "DATA_SECURITY_MODE_DEDICATED" + DATA_SECURITY_MODE_STANDARD = "DATA_SECURITY_MODE_STANDARD" + LEGACY_PASSTHROUGH = "LEGACY_PASSTHROUGH" + LEGACY_SINGLE_USER = "LEGACY_SINGLE_USER" + LEGACY_SINGLE_USER_STANDARD = "LEGACY_SINGLE_USER_STANDARD" + LEGACY_TABLE_ACL = "LEGACY_TABLE_ACL" + NONE = "NONE" + SINGLE_USER = "SINGLE_USER" + USER_ISOLATION = "USER_ISOLATION" + + +@dataclass +class DbfsStorageInfo: + """A storage location in DBFS""" + + destination: str + """dbfs destination, e.g. `dbfs:/my/path`""" + + def as_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: + """Deserializes the DbfsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class DbtOutput: artifacts_headers: Optional[Dict[str, str]] = None @@ -1479,6 +1915,78 @@ def from_dict(cls, d: Dict[str, Any]) -> DeleteRunResponse: return cls() +@dataclass +class DockerBasicAuth: + password: Optional[str] = None + """Password of the user""" + + username: Optional[str] = None + """Name of the user""" + + def as_dict(self) -> dict: + """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.password is not None: + body["password"] = self.password + if self.username is not None: + body["username"] = self.username + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" + body = {} + if self.password is not None: + body["password"] = self.password + if self.username is not None: + body["username"] = self.username + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: + """Deserializes the DockerBasicAuth from a dictionary.""" + return cls(password=d.get("password", None), username=d.get("username", None)) + + +@dataclass +class DockerImage: + basic_auth: Optional[DockerBasicAuth] = None + """Basic auth with username and password""" + + url: Optional[str] = None + """URL of the docker image.""" + + def as_dict(self) -> dict: + """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.basic_auth: + body["basic_auth"] = self.basic_auth.as_dict() + if self.url is not None: + body["url"] = self.url + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" + body = {} + if self.basic_auth: + body["basic_auth"] = self.basic_auth + if self.url is not None: + body["url"] = self.url + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DockerImage: + """Deserializes the DockerImage from a dictionary.""" + return cls(basic_auth=_from_dict(d, "basic_auth", DockerBasicAuth), url=d.get("url", None)) + + +class EbsVolumeType(Enum): + """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for + details.""" + + GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" + THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" + + @dataclass class EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Represents a change to the job cluster's settings that would be required for the job clusters to @@ -1609,6 +2117,48 @@ def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceResponse: ) +@dataclass +class Environment: + """The environment entity used to preserve serverless environment side panel and jobs' environment + for non-notebook task. In this minimal environment spec, only pip dependencies are supported.""" + + client: str + """Client version used by the environment The client is the user-facing environment of the runtime. + Each client comes with a specific set of pre-installed libraries. The version is a string, + consisting of the major client version.""" + + dependencies: Optional[List[str]] = None + """List of pip dependencies, as supported by the version of pip in this environment. Each + dependency is a pip requirement file line + https://pip.pypa.io/en/stable/reference/requirements-file-format/ Allowed dependency could be + , , (WSFS or Volumes in + Databricks), E.g. dependencies: ["foo==0.0.1", "-r + /Workspace/test/requirements.txt"]""" + + def as_dict(self) -> dict: + """Serializes the Environment into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.client is not None: + body["client"] = self.client + if self.dependencies: + body["dependencies"] = [v for v in self.dependencies] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Environment into a shallow dictionary of its immediate attributes.""" + body = {} + if self.client is not None: + body["client"] = self.client + if self.dependencies: + body["dependencies"] = self.dependencies + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Environment: + """Deserializes the Environment from a dictionary.""" + return cls(client=d.get("client", None), dependencies=d.get("dependencies", None)) + + @dataclass class ExportRunOutput: """Run was exported successfully.""" @@ -1879,6 +2429,124 @@ class Format(Enum): SINGLE_TASK = "SINGLE_TASK" +@dataclass +class GcpAttributes: + """Attributes set during cluster creation which are related to GCP.""" + + availability: Optional[GcpAvailability] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs, + on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + boot_disk_size: Optional[int] = None + """Boot disk size in GB""" + + google_service_account: Optional[str] = None + """If provided, the cluster will impersonate the google service account when accessing gcloud + services (like GCS). The google service account must have previously been added to the + Databricks environment by an account administrator.""" + + local_ssd_count: Optional[int] = None + """If provided, each node (workers and driver) in the cluster will have this number of local SSDs + attached. Each local SSD is 375GB in size. Refer to [GCP documentation] for the supported number + of local SSDs for each instance type. + + [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds""" + + use_preemptible_executors: Optional[bool] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs + (when set to true) versus standard compute engine VMs (when set to false; default). Note: Soon + to be deprecated, use the 'availability' field instead.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone in which the cluster resides. This can be one of the + following: - "HA" => High availability, spread nodes across availability zones for a Databricks + deployment region [default]. - "AUTO" => Databricks picks an availability zone to schedule the + cluster on. - A GCP availability zone => Pick One of the available zones for (machine type + + region) from https://cloud.google.com/compute/docs/regions-zones.""" + + def as_dict(self) -> dict: + """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: + """Deserializes the GcpAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", GcpAvailability), + boot_disk_size=d.get("boot_disk_size", None), + google_service_account=d.get("google_service_account", None), + local_ssd_count=d.get("local_ssd_count", None), + use_preemptible_executors=d.get("use_preemptible_executors", None), + zone_id=d.get("zone_id", None), + ) + + +class GcpAvailability(Enum): + """This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or + preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + ON_DEMAND_GCP = "ON_DEMAND_GCP" + PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" + PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" + + +@dataclass +class GcsStorageInfo: + """A storage location in Google Cloud Platform's GCS""" + + destination: str + """GCS destination/URI, e.g. `gs://my-bucket/some-prefix`""" + + def as_dict(self) -> dict: + """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: + """Deserializes the GcsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class GenAiComputeTask: """Next field: 9""" @@ -2165,6 +2833,90 @@ def from_dict(cls, d: Dict[str, Any]) -> GitSource: ) +@dataclass +class InitScriptInfo: + """Config for an individual init script Next ID: 11""" + + abfss: Optional[Adlsgen2Info] = None + """destination needs to be provided, e.g. + `abfss://@.dfs.core.windows.net/`""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } + }`""" + + file: Optional[LocalFileInfo] = None + """destination needs to be provided, e.g. `{ "file": { "destination": "file:/my/local/file.sh" } }`""" + + gcs: Optional[GcsStorageInfo] = None + """destination needs to be provided, e.g. `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ \"s3\": { + \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` Cluster iam + role is used to access s3, please make sure the cluster iam role in `instance_profile_arn` has + permission to write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" : + \"/Volumes/my-init.sh\" } }`""" + + workspace: Optional[WorkspaceStorageInfo] = None + """destination needs to be provided, e.g. `{ "workspace": { "destination": + "/cluster-init-scripts/setup-datadog.sh" } }`""" + + def as_dict(self) -> dict: + """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss.as_dict() + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.file: + body["file"] = self.file.as_dict() + if self.gcs: + body["gcs"] = self.gcs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + if self.workspace: + body["workspace"] = self.workspace.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss + if self.dbfs: + body["dbfs"] = self.dbfs + if self.file: + body["file"] = self.file + if self.gcs: + body["gcs"] = self.gcs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + if self.workspace: + body["workspace"] = self.workspace + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: + """Deserializes the InitScriptInfo from a dictionary.""" + return cls( + abfss=_from_dict(d, "abfss", Adlsgen2Info), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + file=_from_dict(d, "file", LocalFileInfo), + gcs=_from_dict(d, "gcs", GcsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), + ) + + @dataclass class Job: """Job was retrieved successfully.""" @@ -2183,15 +2935,15 @@ class Job: on accessible budget policies of the run_as identity on job creation or modification.""" has_more: Optional[bool] = None - """Indicates if the job has more sub-resources (`tasks`, `job_clusters`) that are not shown. They - can be accessed via :method:jobs/get endpoint. It is only relevant for API 2.2 :method:jobs/list - requests with `expand_tasks=true`.""" + """Indicates if the job has more array properties (`tasks`, `job_clusters`) that are not shown. + They can be accessed via :method:jobs/get endpoint. It is only relevant for API 2.2 + :method:jobs/list requests with `expand_tasks=true`.""" job_id: Optional[int] = None """The canonical identifier for this job.""" next_page_token: Optional[str] = None - """A token that can be used to list the next page of sub-resources.""" + """A token that can be used to list the next page of array properties.""" run_as_user_name: Optional[str] = None """The email of an active workspace user or the application ID of a service principal that the job @@ -2380,7 +3132,7 @@ class JobCluster: `JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution.""" - new_cluster: compute.ClusterSpec + new_cluster: JobsClusterSpec """If new_cluster, a description of a cluster that is created for each task.""" def as_dict(self) -> dict: @@ -2405,8 +3157,7 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> JobCluster: """Deserializes the JobCluster from a dictionary.""" return cls( - job_cluster_key=d.get("job_cluster_key", None), - new_cluster=_from_dict(d, "new_cluster", compute.ClusterSpec), + job_cluster_key=d.get("job_cluster_key", None), new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec) ) @@ -2591,7 +3342,7 @@ class JobEnvironment: environment_key: str """The key of an environment. It has to be unique within a job.""" - spec: Optional[compute.Environment] = None + spec: Optional[Environment] = None """The environment entity used to preserve serverless environment side panel and jobs' environment for non-notebook task. In this minimal environment spec, only pip dependencies are supported.""" @@ -2616,7 +3367,7 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobEnvironment: """Deserializes the JobEnvironment from a dictionary.""" - return cls(environment_key=d.get("environment_key", None), spec=_from_dict(d, "spec", compute.Environment)) + return cls(environment_key=d.get("environment_key", None), spec=_from_dict(d, "spec", Environment)) @dataclass @@ -3241,6 +3992,369 @@ class JobSourceDirtyState(Enum): NOT_SYNCED = "NOT_SYNCED" +@dataclass +class JobsClusterSpec: + """Contains a snapshot of the latest user specified settings that were used to create/edit the + cluster.""" + + apply_policy_default_values: Optional[bool] = None + """When set to true, fixed and default values from the policy will be used for fields that are + omitted. When set to false, only fixed values from the policy will be applied.""" + + autoscale: Optional[AutoScale] = None + """Parameters needed in order to automatically scale clusters up and down based on load. Note: + autoscaling works best with DB runtime versions 3.0 or later.""" + + autotermination_minutes: Optional[int] = None + """Automatically terminates the cluster after it is inactive for this time in minutes. If not set, + this cluster will not be automatically terminated. If specified, the threshold must be between + 10 and 10000 minutes. Users can also set this value to 0 to explicitly disable automatic + termination.""" + + aws_attributes: Optional[AwsAttributes] = None + """Attributes related to clusters running on Amazon Web Services. If not specified at cluster + creation, a set of default values will be used.""" + + azure_attributes: Optional[AzureAttributes] = None + """Attributes related to clusters running on Microsoft Azure. If not specified at cluster creation, + a set of default values will be used.""" + + cluster_log_conf: Optional[ClusterLogConf] = None + """The configuration for delivering spark logs to a long-term storage destination. Three kinds of + destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be + specified for one cluster. If the conf is given, the logs will be delivered to the destination + every `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while the + destination of executor logs is `$destination/$clusterId/executor`.""" + + cluster_name: Optional[str] = None + """Cluster name requested by the user. This doesn't have to be unique. If not specified at + creation, the cluster name will be an empty string.""" + + custom_tags: Optional[Dict[str, str]] = None + """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + + - Currently, Databricks allows at most 45 custom tags + + - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster + tags""" + + data_security_mode: Optional[DataSecurityMode] = None + """Data security mode decides what data governance model to use when accessing data from a cluster. + + The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: + Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: + Alias for `SINGLE_USER`. + + The following modes can be used regardless of `kind`. * `NONE`: No security isolation for + multiple users sharing the cluster. Data governance features are not available in this mode. * + `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in + `single_user_name`. Most programming languages, cluster features and data governance features + are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple + users. Cluster users are fully isolated so that they cannot see each other's data and + credentials. Most data governance features are supported in this mode. But programming languages + and cluster features might be limited. + + The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for + future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * + `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high + concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy + Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that + doesn’t have UC nor passthrough enabled.""" + + docker_image: Optional[DockerImage] = None + """Custom docker image BYOC""" + + driver_instance_pool_id: Optional[str] = None + """The optional ID of the instance pool for the driver of the cluster belongs. The pool cluster + uses the instance pool with id (instance_pool_id) if the driver pool is not assigned.""" + + driver_node_type_id: Optional[str] = None + """The node type of the Spark driver. Note that this field is optional; if unset, the driver node + type will be set as the same value as `node_type_id` defined above. + + This field, along with node_type_id, should not be set if virtual_cluster_size is set. If both + driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id + and node_type_id take precedence.""" + + enable_elastic_disk: Optional[bool] = None + """Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + space when its Spark workers are running low on disk space. This feature requires specific AWS + permissions to function correctly - refer to the User Guide for more details.""" + + enable_local_disk_encryption: Optional[bool] = None + """Whether to enable LUKS on cluster VMs' local disks""" + + gcp_attributes: Optional[GcpAttributes] = None + """Attributes related to clusters running on Google Cloud Platform. If not specified at cluster + creation, a set of default values will be used.""" + + init_scripts: Optional[List[InitScriptInfo]] = None + """The configuration for storing init scripts. Any number of destinations can be specified. The + scripts are executed sequentially in the order provided. If `cluster_log_conf` is specified, + init script logs are sent to `//init_scripts`.""" + + instance_pool_id: Optional[str] = None + """The optional ID of the instance pool to which the cluster belongs.""" + + is_single_node: Optional[bool] = None + """This field can only be used when `kind = CLASSIC_PREVIEW`. + + When set to true, Databricks will automatically set single node related `custom_tags`, + `spark_conf`, and `num_workers`""" + + kind: Optional[Kind] = None + """The kind of compute described by this compute specification. + + Depending on `kind`, different validations and default values will be applied. + + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no + specified `kind` do not. * [is_single_node](/api/workspace/clusters/create#is_single_node) * + [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) * + [data_security_mode](/api/workspace/clusters/create#data_security_mode) set to + `DATA_SECURITY_MODE_AUTO`, `DATA_SECURITY_MODE_DEDICATED`, or `DATA_SECURITY_MODE_STANDARD` + + By using the [simple form], your clusters are automatically using `kind = CLASSIC_PREVIEW`. + + [simple form]: https://docs.databricks.com/compute/simple-form.html""" + + node_type_id: Optional[str] = None + """This field encodes, through a single value, the resources available to each of the Spark nodes + in this cluster. For example, the Spark nodes can be provisioned and optimized for memory or + compute intensive workloads. A list of available node types can be retrieved by using the + :method:clusters/listNodeTypes API call.""" + + num_workers: Optional[int] = None + """Number of worker nodes that this cluster should have. A cluster has one Spark Driver and + `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + + Note: When reading the properties of a cluster, this field reflects the desired number of + workers rather than the actual current number of workers. For instance, if a cluster is resized + from 5 to 10 workers, this field will immediately be updated to reflect the target size of 10 + workers, whereas the workers listed in `spark_info` will gradually increase from 5 to 10 as the + new nodes are provisioned.""" + + policy_id: Optional[str] = None + """The ID of the cluster policy used to create the cluster if applicable.""" + + runtime_engine: Optional[RuntimeEngine] = None + """Determines the cluster's runtime engine, either standard or Photon. + + This field is not compatible with legacy `spark_version` values that contain `-photon-`. Remove + `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. + + If left unspecified, the runtime engine defaults to standard unless the spark_version contains + -photon-, in which case Photon will be used.""" + + single_user_name: Optional[str] = None + """Single user name if data_security_mode is `SINGLE_USER`""" + + spark_conf: Optional[Dict[str, str]] = None + """An object containing a set of optional, user-specified Spark configuration key-value pairs. + Users can also pass in a string of extra JVM options to the driver and the executors via + `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively.""" + + spark_env_vars: Optional[Dict[str, str]] = None + """An object containing a set of optional, user-specified environment variable key-value pairs. + Please note that key-value pair of the form (X,Y) will be exported as is (i.e., `export X='Y'`) + while launching the driver and workers. + + In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending them + to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all default + databricks managed environmental variables are included as well. + + Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": + "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS + -Dspark.shuffle.service.enabled=true"}`""" + + spark_version: Optional[str] = None + """The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of available Spark versions can + be retrieved by using the :method:clusters/sparkVersions API call.""" + + ssh_public_keys: Optional[List[str]] = None + """SSH public key contents that will be added to each Spark node in this cluster. The corresponding + private keys can be used to login with the user name `ubuntu` on port `2200`. Up to 10 keys can + be specified.""" + + use_ml_runtime: Optional[bool] = None + """This field can only be used when `kind = CLASSIC_PREVIEW`. + + `effective_spark_version` is determined by `spark_version` (DBR release), this field + `use_ml_runtime`, and whether `node_type_id` is gpu node or not.""" + + workload_type: Optional[WorkloadType] = None + """Cluster Attributes showing for clusters workload types.""" + + def as_dict(self) -> dict: + """Serializes the JobsClusterSpec into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.apply_policy_default_values is not None: + body["apply_policy_default_values"] = self.apply_policy_default_values + if self.autoscale: + body["autoscale"] = self.autoscale.as_dict() + if self.autotermination_minutes is not None: + body["autotermination_minutes"] = self.autotermination_minutes + if self.aws_attributes: + body["aws_attributes"] = self.aws_attributes.as_dict() + if self.azure_attributes: + body["azure_attributes"] = self.azure_attributes.as_dict() + if self.cluster_log_conf: + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + if self.cluster_name is not None: + body["cluster_name"] = self.cluster_name + if self.custom_tags: + body["custom_tags"] = self.custom_tags + if self.data_security_mode is not None: + body["data_security_mode"] = self.data_security_mode.value + if self.docker_image: + body["docker_image"] = self.docker_image.as_dict() + if self.driver_instance_pool_id is not None: + body["driver_instance_pool_id"] = self.driver_instance_pool_id + if self.driver_node_type_id is not None: + body["driver_node_type_id"] = self.driver_node_type_id + if self.enable_elastic_disk is not None: + body["enable_elastic_disk"] = self.enable_elastic_disk + if self.enable_local_disk_encryption is not None: + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + if self.gcp_attributes: + body["gcp_attributes"] = self.gcp_attributes.as_dict() + if self.init_scripts: + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + if self.instance_pool_id is not None: + body["instance_pool_id"] = self.instance_pool_id + if self.is_single_node is not None: + body["is_single_node"] = self.is_single_node + if self.kind is not None: + body["kind"] = self.kind.value + if self.node_type_id is not None: + body["node_type_id"] = self.node_type_id + if self.num_workers is not None: + body["num_workers"] = self.num_workers + if self.policy_id is not None: + body["policy_id"] = self.policy_id + if self.runtime_engine is not None: + body["runtime_engine"] = self.runtime_engine.value + if self.single_user_name is not None: + body["single_user_name"] = self.single_user_name + if self.spark_conf: + body["spark_conf"] = self.spark_conf + if self.spark_env_vars: + body["spark_env_vars"] = self.spark_env_vars + if self.spark_version is not None: + body["spark_version"] = self.spark_version + if self.ssh_public_keys: + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + if self.use_ml_runtime is not None: + body["use_ml_runtime"] = self.use_ml_runtime + if self.workload_type: + body["workload_type"] = self.workload_type.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the JobsClusterSpec into a shallow dictionary of its immediate attributes.""" + body = {} + if self.apply_policy_default_values is not None: + body["apply_policy_default_values"] = self.apply_policy_default_values + if self.autoscale: + body["autoscale"] = self.autoscale + if self.autotermination_minutes is not None: + body["autotermination_minutes"] = self.autotermination_minutes + if self.aws_attributes: + body["aws_attributes"] = self.aws_attributes + if self.azure_attributes: + body["azure_attributes"] = self.azure_attributes + if self.cluster_log_conf: + body["cluster_log_conf"] = self.cluster_log_conf + if self.cluster_name is not None: + body["cluster_name"] = self.cluster_name + if self.custom_tags: + body["custom_tags"] = self.custom_tags + if self.data_security_mode is not None: + body["data_security_mode"] = self.data_security_mode + if self.docker_image: + body["docker_image"] = self.docker_image + if self.driver_instance_pool_id is not None: + body["driver_instance_pool_id"] = self.driver_instance_pool_id + if self.driver_node_type_id is not None: + body["driver_node_type_id"] = self.driver_node_type_id + if self.enable_elastic_disk is not None: + body["enable_elastic_disk"] = self.enable_elastic_disk + if self.enable_local_disk_encryption is not None: + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + if self.gcp_attributes: + body["gcp_attributes"] = self.gcp_attributes + if self.init_scripts: + body["init_scripts"] = self.init_scripts + if self.instance_pool_id is not None: + body["instance_pool_id"] = self.instance_pool_id + if self.is_single_node is not None: + body["is_single_node"] = self.is_single_node + if self.kind is not None: + body["kind"] = self.kind + if self.node_type_id is not None: + body["node_type_id"] = self.node_type_id + if self.num_workers is not None: + body["num_workers"] = self.num_workers + if self.policy_id is not None: + body["policy_id"] = self.policy_id + if self.runtime_engine is not None: + body["runtime_engine"] = self.runtime_engine + if self.single_user_name is not None: + body["single_user_name"] = self.single_user_name + if self.spark_conf: + body["spark_conf"] = self.spark_conf + if self.spark_env_vars: + body["spark_env_vars"] = self.spark_env_vars + if self.spark_version is not None: + body["spark_version"] = self.spark_version + if self.ssh_public_keys: + body["ssh_public_keys"] = self.ssh_public_keys + if self.use_ml_runtime is not None: + body["use_ml_runtime"] = self.use_ml_runtime + if self.workload_type: + body["workload_type"] = self.workload_type + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> JobsClusterSpec: + """Deserializes the JobsClusterSpec from a dictionary.""" + return cls( + apply_policy_default_values=d.get("apply_policy_default_values", None), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), + ) + + class JobsHealthMetric(Enum): """Specifies the health metric that is being evaluated for a particular health rule. @@ -3342,6 +4456,111 @@ def from_dict(cls, d: Dict[str, Any]) -> JobsHealthRules: return cls(rules=_repeated_dict(d, "rules", JobsHealthRule)) +class Kind(Enum): + """The kind of compute described by this compute specification. + + Depending on `kind`, different validations and default values will be applied. + + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no + specified `kind` do not. * [is_single_node](/api/workspace/clusters/create#is_single_node) * + [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) * + [data_security_mode](/api/workspace/clusters/create#data_security_mode) set to + `DATA_SECURITY_MODE_AUTO`, `DATA_SECURITY_MODE_DEDICATED`, or `DATA_SECURITY_MODE_STANDARD` + + By using the [simple form], your clusters are automatically using `kind = CLASSIC_PREVIEW`. + + [simple form]: https://docs.databricks.com/compute/simple-form.html""" + + CLASSIC_PREVIEW = "CLASSIC_PREVIEW" + + +@dataclass +class Library: + cran: Optional[RCranLibrary] = None + """Specification of a CRAN library to be installed as part of the library""" + + egg: Optional[str] = None + """Deprecated. URI of the egg library to install. Installing Python egg files is deprecated and is + not supported in Databricks Runtime 14.0 and above.""" + + jar: Optional[str] = None + """URI of the JAR library to install. Supported URIs include Workspace paths, Unity Catalog Volumes + paths, and S3 URIs. For example: `{ "jar": "/Workspace/path/to/library.jar" }`, `{ "jar" : + "/Volumes/path/to/library.jar" }` or `{ "jar": "s3://my-bucket/library.jar" }`. If S3 is used, + please make sure the cluster has read access on the library. You may need to launch the cluster + with an IAM role to access the S3 URI.""" + + maven: Optional[MavenLibrary] = None + """Specification of a maven library to be installed. For example: `{ "coordinates": + "org.jsoup:jsoup:1.7.2" }`""" + + pypi: Optional[PythonPyPiLibrary] = None + """Specification of a PyPi library to be installed. For example: `{ "package": "simplejson" }`""" + + requirements: Optional[str] = None + """URI of the requirements.txt file to install. Only Workspace paths and Unity Catalog Volumes + paths are supported. For example: `{ "requirements": "/Workspace/path/to/requirements.txt" }` or + `{ "requirements" : "/Volumes/path/to/requirements.txt" }`""" + + whl: Optional[str] = None + """URI of the wheel library to install. Supported URIs include Workspace paths, Unity Catalog + Volumes paths, and S3 URIs. For example: `{ "whl": "/Workspace/path/to/library.whl" }`, `{ "whl" + : "/Volumes/path/to/library.whl" }` or `{ "whl": "s3://my-bucket/library.whl" }`. If S3 is used, + please make sure the cluster has read access on the library. You may need to launch the cluster + with an IAM role to access the S3 URI.""" + + def as_dict(self) -> dict: + """Serializes the Library into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.cran: + body["cran"] = self.cran.as_dict() + if self.egg is not None: + body["egg"] = self.egg + if self.jar is not None: + body["jar"] = self.jar + if self.maven: + body["maven"] = self.maven.as_dict() + if self.pypi: + body["pypi"] = self.pypi.as_dict() + if self.requirements is not None: + body["requirements"] = self.requirements + if self.whl is not None: + body["whl"] = self.whl + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Library into a shallow dictionary of its immediate attributes.""" + body = {} + if self.cran: + body["cran"] = self.cran + if self.egg is not None: + body["egg"] = self.egg + if self.jar is not None: + body["jar"] = self.jar + if self.maven: + body["maven"] = self.maven + if self.pypi: + body["pypi"] = self.pypi + if self.requirements is not None: + body["requirements"] = self.requirements + if self.whl is not None: + body["whl"] = self.whl + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Library: + """Deserializes the Library from a dictionary.""" + return cls( + cran=_from_dict(d, "cran", RCranLibrary), + egg=d.get("egg", None), + jar=d.get("jar", None), + maven=_from_dict(d, "maven", MavenLibrary), + pypi=_from_dict(d, "pypi", PythonPyPiLibrary), + requirements=d.get("requirements", None), + whl=d.get("whl", None), + ) + + @dataclass class ListJobComplianceForPolicyResponse: jobs: Optional[List[JobCompliance]] = None @@ -3494,6 +4713,109 @@ def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: ) +@dataclass +class LocalFileInfo: + destination: str + """local file destination, e.g. `file:/my/local/file.sh`""" + + def as_dict(self) -> dict: + """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: + """Deserializes the LocalFileInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class LogAnalyticsInfo: + log_analytics_primary_key: Optional[str] = None + + log_analytics_workspace_id: Optional[str] = None + + def as_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: + """Deserializes the LogAnalyticsInfo from a dictionary.""" + return cls( + log_analytics_primary_key=d.get("log_analytics_primary_key", None), + log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), + ) + + +@dataclass +class MavenLibrary: + coordinates: str + """Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2".""" + + exclusions: Optional[List[str]] = None + """List of dependences to exclude. For example: `["slf4j:slf4j", "*:hadoop-client"]`. + + Maven dependency exclusions: + https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html.""" + + repo: Optional[str] = None + """Maven repo to install the Maven package from. If omitted, both Maven Central Repository and + Spark Packages are searched.""" + + def as_dict(self) -> dict: + """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.coordinates is not None: + body["coordinates"] = self.coordinates + if self.exclusions: + body["exclusions"] = [v for v in self.exclusions] + if self.repo is not None: + body["repo"] = self.repo + return body + + def as_shallow_dict(self) -> dict: + """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" + body = {} + if self.coordinates is not None: + body["coordinates"] = self.coordinates + if self.exclusions: + body["exclusions"] = self.exclusions + if self.repo is not None: + body["repo"] = self.repo + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: + """Deserializes the MavenLibrary from a dictionary.""" + return cls( + coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) + ) + + @dataclass class NotebookOutput: result: Optional[str] = None @@ -3760,6 +5082,39 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineTask: return cls(full_refresh=d.get("full_refresh", None), pipeline_id=d.get("pipeline_id", None)) +@dataclass +class PythonPyPiLibrary: + package: str + """The name of the pypi package to install. An optional exact version specification is also + supported. Examples: "simplejson" and "simplejson==3.8.0".""" + + repo: Optional[str] = None + """The repository where the package can be found. If not specified, the default pip index is used.""" + + def as_dict(self) -> dict: + """Serializes the PythonPyPiLibrary into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.package is not None: + body["package"] = self.package + if self.repo is not None: + body["repo"] = self.repo + return body + + def as_shallow_dict(self) -> dict: + """Serializes the PythonPyPiLibrary into a shallow dictionary of its immediate attributes.""" + body = {} + if self.package is not None: + body["package"] = self.package + if self.repo is not None: + body["repo"] = self.repo + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> PythonPyPiLibrary: + """Deserializes the PythonPyPiLibrary from a dictionary.""" + return cls(package=d.get("package", None), repo=d.get("repo", None)) + + @dataclass class PythonWheelTask: package_name: str @@ -3888,6 +5243,38 @@ def from_dict(cls, d: Dict[str, Any]) -> QueueSettings: return cls(enabled=d.get("enabled", None)) +@dataclass +class RCranLibrary: + package: str + """The name of the CRAN package to install.""" + + repo: Optional[str] = None + """The repository where the package can be found. If not specified, the default CRAN repo is used.""" + + def as_dict(self) -> dict: + """Serializes the RCranLibrary into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.package is not None: + body["package"] = self.package + if self.repo is not None: + body["repo"] = self.repo + return body + + def as_shallow_dict(self) -> dict: + """Serializes the RCranLibrary into a shallow dictionary of its immediate attributes.""" + body = {} + if self.package is not None: + body["package"] = self.package + if self.repo is not None: + body["repo"] = self.repo + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> RCranLibrary: + """Deserializes the RCranLibrary from a dictionary.""" + return cls(package=d.get("package", None), repo=d.get("repo", None)) + + @dataclass class RepairHistoryItem: end_time: Optional[int] = None @@ -4568,8 +5955,8 @@ class Run: are used, `git_source` must be defined on the job.""" has_more: Optional[bool] = None - """Indicates if the run has more sub-resources (`tasks`, `job_clusters`) that are not shown. They - can be accessed via :method:jobs/getrun endpoint. It is only relevant for API 2.2 + """Indicates if the run has more array properties (`tasks`, `job_clusters`) that are not shown. + They can be accessed via :method:jobs/getrun endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests with `expand_tasks=true`.""" iterations: Optional[List[RunTask]] = None @@ -4593,7 +5980,7 @@ class Run: that the task run belongs to.""" next_page_token: Optional[str] = None - """A token that can be used to list the next page of sub-resources.""" + """A token that can be used to list the next page of array properties.""" number_in_job: Optional[int] = None """A unique identifier for this job run. This is set to the same value as `run_id`.""" @@ -5924,11 +7311,11 @@ class RunTask: """If job_cluster_key, this task is executed reusing the cluster specified in `job.settings.job_clusters`.""" - libraries: Optional[List[compute.Library]] = None + libraries: Optional[List[Library]] = None """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[compute.ClusterSpec] = None + new_cluster: Optional[ClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -6225,8 +7612,8 @@ def from_dict(cls, d: Dict[str, Any]) -> RunTask: gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), git_source=_from_dict(d, "git_source", GitSource), job_cluster_key=d.get("job_cluster_key", None), - libraries=_repeated_dict(d, "libraries", compute.Library), - new_cluster=_from_dict(d, "new_cluster", compute.ClusterSpec), + libraries=_repeated_dict(d, "libraries", Library), + new_cluster=_from_dict(d, "new_cluster", ClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), @@ -6264,6 +7651,102 @@ class RunType(Enum): WORKFLOW_RUN = "WORKFLOW_RUN" +class RuntimeEngine(Enum): + + NULL = "NULL" + PHOTON = "PHOTON" + STANDARD = "STANDARD" + + +@dataclass +class S3StorageInfo: + """A storage location in Amazon S3""" + + destination: str + """S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using cluster + iam role, please make sure you set cluster iam role and the role has write access to the + destination. Please also note that you cannot use AWS keys to deliver logs.""" + + canned_acl: Optional[str] = None + """(Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. If + `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + the destination bucket and prefix. The full list of possible canned acl can be found at + http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. Please also note + that by default only the object owner gets full controls. If you are using cross account role + for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + read the logs.""" + + enable_encryption: Optional[bool] = None + """(Optional) Flag to enable server side encryption, `false` by default.""" + + encryption_type: Optional[str] = None + """(Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + encryption is enabled and the default type is `sse-s3`.""" + + endpoint: Optional[str] = None + """S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be + set. If both are set, endpoint will be used.""" + + kms_key: Optional[str] = None + """(Optional) Kms key which will be used if encryption is enabled and encryption type is set to + `sse-kms`.""" + + region: Optional[str] = None + """S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + endpoint will be used.""" + + def as_dict(self) -> dict: + """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + def as_shallow_dict(self) -> dict: + """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: + """Deserializes the S3StorageInfo from a dictionary.""" + return cls( + canned_acl=d.get("canned_acl", None), + destination=d.get("destination", None), + enable_encryption=d.get("enable_encryption", None), + encryption_type=d.get("encryption_type", None), + endpoint=d.get("endpoint", None), + kms_key=d.get("kms_key", None), + region=d.get("region", None), + ) + + class Source(Enum): """Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\ from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a @@ -7258,11 +8741,11 @@ class SubmitTask: health: Optional[JobsHealthRules] = None """An optional set of health rules that can be defined for this job.""" - libraries: Optional[List[compute.Library]] = None + libraries: Optional[List[Library]] = None """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[compute.ClusterSpec] = None + new_cluster: Optional[JobsClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -7451,8 +8934,8 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: for_each_task=_from_dict(d, "for_each_task", ForEachTask), gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), health=_from_dict(d, "health", JobsHealthRules), - libraries=_repeated_dict(d, "libraries", compute.Library), - new_cluster=_from_dict(d, "new_cluster", compute.ClusterSpec), + libraries=_repeated_dict(d, "libraries", Library), + new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), @@ -7584,7 +9067,7 @@ class Task: """If job_cluster_key, this task is executed reusing the cluster specified in `job.settings.job_clusters`.""" - libraries: Optional[List[compute.Library]] = None + libraries: Optional[List[Library]] = None """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" @@ -7598,7 +9081,7 @@ class Task: """An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.""" - new_cluster: Optional[compute.ClusterSpec] = None + new_cluster: Optional[JobsClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -7816,10 +9299,10 @@ def from_dict(cls, d: Dict[str, Any]) -> Task: gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), health=_from_dict(d, "health", JobsHealthRules), job_cluster_key=d.get("job_cluster_key", None), - libraries=_repeated_dict(d, "libraries", compute.Library), + libraries=_repeated_dict(d, "libraries", Library), max_retries=d.get("max_retries", None), min_retry_interval_millis=d.get("min_retry_interval_millis", None), - new_cluster=_from_dict(d, "new_cluster", compute.ClusterSpec), + new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), @@ -8392,6 +9875,34 @@ class ViewsToExport(Enum): DASHBOARDS = "DASHBOARDS" +@dataclass +class VolumesStorageInfo: + """A storage location back by UC Volumes.""" + + destination: str + """UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` or + `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: + """Deserializes the VolumesStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class Webhook: id: str @@ -8487,6 +9998,60 @@ def from_dict(cls, d: Dict[str, Any]) -> WebhookNotifications: ) +@dataclass +class WorkloadType: + """Cluster Attributes showing for clusters workload types.""" + + clients: ClientsTypes + """defined what type of clients can use the cluster. E.g. Notebooks, Jobs""" + + def as_dict(self) -> dict: + """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.clients: + body["clients"] = self.clients.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" + body = {} + if self.clients: + body["clients"] = self.clients + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: + """Deserializes the WorkloadType from a dictionary.""" + return cls(clients=_from_dict(d, "clients", ClientsTypes)) + + +@dataclass +class WorkspaceStorageInfo: + """A storage location in Workspace Filesystem (WSFS)""" + + destination: str + """wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: + """Deserializes the WorkspaceStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + class JobsAPI: """The Jobs API allows you to create, edit, and delete jobs. @@ -8848,16 +10413,18 @@ def get(self, job_id: int, *, page_token: Optional[str] = None) -> Job: Retrieves the details for a single job. - In Jobs API 2.2, requests for a single job support pagination of `tasks` and `job_clusters` when - either exceeds 100 elements. Use the `next_page_token` field to check for more results and pass its - value as the `page_token` in subsequent requests. Arrays with fewer than 100 elements in a page will - be empty on later pages. + Large arrays in the results will be paginated when they exceed 100 elements. A request for a single + job will return all properties for that job, and the first 100 elements of array properties (`tasks`, + `job_clusters`, `environments` and `parameters`). Use the `next_page_token` field to check for more + results and pass its value as the `page_token` in subsequent requests. If any array properties have + more than 100 elements, additional results will be returned on subsequent requests. Arrays without + additional results will be empty on later pages. :param job_id: int The canonical identifier of the job to retrieve information about. This field is required. :param page_token: str (optional) - Use `next_page_token` returned from the previous GetJob to request the next page of the job's - sub-resources. + Use `next_page_token` returned from the previous GetJob response to request the next page of the + job's array properties. :returns: :class:`Job` """ @@ -8922,10 +10489,12 @@ def get_run( Retrieves the metadata of a run. - In Jobs API 2.2, requests for a single job run support pagination of `tasks` and `job_clusters` when - either exceeds 100 elements. Use the `next_page_token` field to check for more results and pass its - value as the `page_token` in subsequent requests. Arrays with fewer than 100 elements in a page will - be empty on later pages. + Large arrays in the results will be paginated when they exceed 100 elements. A request for a single + run will return all properties for that run, and the first 100 elements of array properties (`tasks`, + `job_clusters`, `job_parameters` and `repair_history`). Use the next_page_token field to check for + more results and pass its value as the page_token in subsequent requests. If any array properties have + more than 100 elements, additional results will be returned on subsequent requests. Arrays without + additional results will be empty on later pages. :param run_id: int The canonical identifier of the run for which to retrieve the metadata. This field is required. @@ -8934,8 +10503,8 @@ def get_run( :param include_resolved_values: bool (optional) Whether to include resolved parameter values in the response. :param page_token: str (optional) - Use `next_page_token` returned from the previous GetRun to request the next page of the run's - sub-resources. + Use `next_page_token` returned from the previous GetRun response to request the next page of the + run's array properties. :returns: :class:`Run` """ diff --git a/databricks/sdk/service/marketplace.py b/databricks/sdk/service/marketplace.py index 41992fd69..6d3a8815b 100755 --- a/databricks/sdk/service/marketplace.py +++ b/databricks/sdk/service/marketplace.py @@ -1948,7 +1948,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ListProvidersResponse: @dataclass class Listing: summary: ListingSummary - """Next Number: 26""" detail: Optional[ListingDetail] = None @@ -2252,8 +2251,6 @@ class ListingStatus(Enum): @dataclass class ListingSummary: - """Next Number: 26""" - name: str listing_type: ListingType diff --git a/databricks/sdk/service/ml.py b/databricks/sdk/service/ml.py index 4a17541af..709f400e0 100755 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/service/ml.py @@ -489,63 +489,60 @@ def from_dict(cls, d: Dict[str, Any]) -> CreateExperimentResponse: @dataclass class CreateForecastingExperimentRequest: train_data_path: str - """The three-level (fully qualified) name of a unity catalog table. This table serves as the - training data for the forecasting model.""" + """The fully qualified name of a Unity Catalog table, formatted as + catalog_name.schema_name.table_name, used as training data for the forecasting model.""" target_column: str - """Name of the column in the input training table that serves as the prediction target. The values - in this column will be used as the ground truth for model training.""" + """The column in the input training table used as the prediction target for model training. The + values in this column are used as the ground truth for model training.""" time_column: str - """Name of the column in the input training table that represents the timestamp of each row.""" + """The column in the input training table that represents each row's timestamp.""" forecast_granularity: str - """The granularity of the forecast. This defines the time interval between consecutive rows in the - time series data. Possible values: '1 second', '1 minute', '5 minutes', '10 minutes', '15 - minutes', '30 minutes', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'.""" + """The time interval between consecutive rows in the time series data. Possible values include: '1 + second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 minutes', 'Hourly', 'Daily', + 'Weekly', 'Monthly', 'Quarterly', 'Yearly'.""" forecast_horizon: int - """The number of time steps into the future for which predictions should be made. This value - represents a multiple of forecast_granularity determining how far ahead the model will forecast.""" + """The number of time steps into the future to make predictions, calculated as a multiple of + forecast_granularity. This value represents how far ahead the model should forecast.""" custom_weights_column: Optional[str] = None - """Name of the column in the input training table used to customize the weight for each time series - to calculate weighted metrics.""" + """The column in the training table used to customize weights for each time series.""" experiment_path: Optional[str] = None - """The path to the created experiment. This is the path where the experiment will be stored in the - workspace.""" + """The path in the workspace to store the created experiment.""" holiday_regions: Optional[List[str]] = None - """Region code(s) to consider when automatically adding holiday features. When empty, no holiday - features are added. Only supports 1 holiday region for now.""" + """The region code(s) to automatically add holiday features. Currently supports only one region.""" max_runtime: Optional[int] = None - """The maximum duration in minutes for which the experiment is allowed to run. If the experiment - exceeds this time limit it will be stopped automatically.""" + """The maximum duration for the experiment in minutes. The experiment stops automatically if it + exceeds this limit.""" prediction_data_path: Optional[str] = None - """The three-level (fully qualified) path to a unity catalog table. This table path serves to store - the predictions.""" + """The fully qualified path of a Unity Catalog table, formatted as + catalog_name.schema_name.table_name, used to store predictions.""" primary_metric: Optional[str] = None """The evaluation metric used to optimize the forecasting model.""" register_to: Optional[str] = None - """The three-level (fully qualified) path to a unity catalog model. This model path serves to store - the best model.""" + """The fully qualified path of a Unity Catalog model, formatted as + catalog_name.schema_name.model_name, used to store the best model.""" split_column: Optional[str] = None - """Name of the column in the input training table used for custom data splits. The values in this - column must be "train", "validate", or "test" to indicate which split each row belongs to.""" + """// The column in the training table used for custom data splits. Values must be 'train', + 'validate', or 'test'.""" timeseries_identifier_columns: Optional[List[str]] = None - """Name of the column in the input training table used to group the dataset to predict individual - time series""" + """The column in the training table used to group the dataset for predicting individual time + series.""" training_frameworks: Optional[List[str]] = None - """The list of frameworks to include for model tuning. Possible values: 'Prophet', 'ARIMA', - 'DeepAR'. An empty list will include all supported frameworks.""" + """List of frameworks to include for model tuning. Possible values are 'Prophet', 'ARIMA', + 'DeepAR'. An empty list includes all supported frameworks.""" def as_dict(self) -> dict: """Serializes the CreateForecastingExperimentRequest into a dictionary suitable for use as a JSON request body.""" @@ -1946,13 +1943,13 @@ class FileInfo: """Metadata of a single artifact file or directory.""" file_size: Optional[int] = None - """Size in bytes. Unset for directories.""" + """The size in bytes of the file. Unset for directories.""" is_dir: Optional[bool] = None """Whether the path is a directory.""" path: Optional[str] = None - """Path relative to the root artifact directory run.""" + """The path relative to the root artifact directory run.""" def as_dict(self) -> dict: """Serializes the FileInfo into a dictionary suitable for use as a JSON request body.""" @@ -2536,13 +2533,13 @@ def from_dict(cls, d: Dict[str, Any]) -> JobSpecWithoutSecret: @dataclass class ListArtifactsResponse: files: Optional[List[FileInfo]] = None - """File location and metadata for artifacts.""" + """The file location and metadata for artifacts.""" next_page_token: Optional[str] = None - """Token that can be used to retrieve the next page of artifact results""" + """The token that can be used to retrieve the next page of artifact results.""" root_uri: Optional[str] = None - """Root artifact directory for the run.""" + """The root artifact directory for the run.""" def as_dict(self) -> dict: """Serializes the ListArtifactsResponse into a dictionary suitable for use as a JSON request body.""" @@ -2784,11 +2781,16 @@ class LogInputs: datasets: Optional[List[DatasetInput]] = None """Dataset inputs""" + models: Optional[List[ModelInput]] = None + """Model inputs""" + def as_dict(self) -> dict: """Serializes the LogInputs into a dictionary suitable for use as a JSON request body.""" body = {} if self.datasets: body["datasets"] = [v.as_dict() for v in self.datasets] + if self.models: + body["models"] = [v.as_dict() for v in self.models] if self.run_id is not None: body["run_id"] = self.run_id return body @@ -2798,6 +2800,8 @@ def as_shallow_dict(self) -> dict: body = {} if self.datasets: body["datasets"] = self.datasets + if self.models: + body["models"] = self.models if self.run_id is not None: body["run_id"] = self.run_id return body @@ -2805,7 +2809,11 @@ def as_shallow_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogInputs: """Deserializes the LogInputs from a dictionary.""" - return cls(datasets=_repeated_dict(d, "datasets", DatasetInput), run_id=d.get("run_id", None)) + return cls( + datasets=_repeated_dict(d, "datasets", DatasetInput), + models=_repeated_dict(d, "models", ModelInput), + run_id=d.get("run_id", None), + ) @dataclass @@ -2837,6 +2845,17 @@ class LogMetric: timestamp: int """Unix timestamp in milliseconds at the time metric was logged.""" + dataset_digest: Optional[str] = None + """Dataset digest of the dataset associated with the metric, e.g. an md5 hash of the dataset that + uniquely identifies it within datasets of the same name.""" + + dataset_name: Optional[str] = None + """The name of the dataset associated with the metric. E.g. “my.uc.table@2” + “nyc-taxi-dataset”, “fantastic-elk-3”""" + + model_id: Optional[str] = None + """ID of the logged model associated with the metric, if applicable""" + run_id: Optional[str] = None """ID of the run under which to log the metric. Must be provided.""" @@ -2850,8 +2869,14 @@ class LogMetric: def as_dict(self) -> dict: """Serializes the LogMetric into a dictionary suitable for use as a JSON request body.""" body = {} + if self.dataset_digest is not None: + body["dataset_digest"] = self.dataset_digest + if self.dataset_name is not None: + body["dataset_name"] = self.dataset_name if self.key is not None: body["key"] = self.key + if self.model_id is not None: + body["model_id"] = self.model_id if self.run_id is not None: body["run_id"] = self.run_id if self.run_uuid is not None: @@ -2867,8 +2892,14 @@ def as_dict(self) -> dict: def as_shallow_dict(self) -> dict: """Serializes the LogMetric into a shallow dictionary of its immediate attributes.""" body = {} + if self.dataset_digest is not None: + body["dataset_digest"] = self.dataset_digest + if self.dataset_name is not None: + body["dataset_name"] = self.dataset_name if self.key is not None: body["key"] = self.key + if self.model_id is not None: + body["model_id"] = self.model_id if self.run_id is not None: body["run_id"] = self.run_id if self.run_uuid is not None: @@ -2885,7 +2916,10 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> LogMetric: """Deserializes the LogMetric from a dictionary.""" return cls( + dataset_digest=d.get("dataset_digest", None), + dataset_name=d.get("dataset_name", None), key=d.get("key", None), + model_id=d.get("model_id", None), run_id=d.get("run_id", None), run_uuid=d.get("run_uuid", None), step=d.get("step", None), @@ -2962,6 +2996,38 @@ def from_dict(cls, d: Dict[str, Any]) -> LogModelResponse: return cls() +@dataclass +class LogOutputsRequest: + run_id: str + """The ID of the Run from which to log outputs.""" + + models: Optional[List[ModelOutput]] = None + """The model outputs from the Run.""" + + def as_dict(self) -> dict: + """Serializes the LogOutputsRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.models: + body["models"] = [v.as_dict() for v in self.models] + if self.run_id is not None: + body["run_id"] = self.run_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LogOutputsRequest into a shallow dictionary of its immediate attributes.""" + body = {} + if self.models: + body["models"] = self.models + if self.run_id is not None: + body["run_id"] = self.run_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LogOutputsRequest: + """Deserializes the LogOutputsRequest from a dictionary.""" + return cls(models=_repeated_dict(d, "models", ModelOutput), run_id=d.get("run_id", None)) + + @dataclass class LogParam: key: str @@ -3036,23 +3102,46 @@ def from_dict(cls, d: Dict[str, Any]) -> LogParamResponse: class Metric: """Metric associated with a run, represented as a key-value pair.""" + dataset_digest: Optional[str] = None + """The dataset digest of the dataset associated with the metric, e.g. an md5 hash of the dataset + that uniquely identifies it within datasets of the same name.""" + + dataset_name: Optional[str] = None + """The name of the dataset associated with the metric. E.g. “my.uc.table@2” + “nyc-taxi-dataset”, “fantastic-elk-3”""" + key: Optional[str] = None - """Key identifying this metric.""" + """The key identifying the metric.""" + + model_id: Optional[str] = None + """The ID of the logged model or registered model version associated with the metric, if + applicable.""" + + run_id: Optional[str] = None + """The ID of the run containing the metric.""" step: Optional[int] = None - """Step at which to log the metric.""" + """The step at which the metric was logged.""" timestamp: Optional[int] = None - """The timestamp at which this metric was recorded.""" + """The timestamp at which the metric was recorded.""" value: Optional[float] = None - """Value associated with this metric.""" + """The value of the metric.""" def as_dict(self) -> dict: """Serializes the Metric into a dictionary suitable for use as a JSON request body.""" body = {} + if self.dataset_digest is not None: + body["dataset_digest"] = self.dataset_digest + if self.dataset_name is not None: + body["dataset_name"] = self.dataset_name if self.key is not None: body["key"] = self.key + if self.model_id is not None: + body["model_id"] = self.model_id + if self.run_id is not None: + body["run_id"] = self.run_id if self.step is not None: body["step"] = self.step if self.timestamp is not None: @@ -3064,8 +3153,16 @@ def as_dict(self) -> dict: def as_shallow_dict(self) -> dict: """Serializes the Metric into a shallow dictionary of its immediate attributes.""" body = {} + if self.dataset_digest is not None: + body["dataset_digest"] = self.dataset_digest + if self.dataset_name is not None: + body["dataset_name"] = self.dataset_name if self.key is not None: body["key"] = self.key + if self.model_id is not None: + body["model_id"] = self.model_id + if self.run_id is not None: + body["run_id"] = self.run_id if self.step is not None: body["step"] = self.step if self.timestamp is not None: @@ -3078,7 +3175,11 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> Metric: """Deserializes the Metric from a dictionary.""" return cls( + dataset_digest=d.get("dataset_digest", None), + dataset_name=d.get("dataset_name", None), key=d.get("key", None), + model_id=d.get("model_id", None), + run_id=d.get("run_id", None), step=d.get("step", None), timestamp=d.get("timestamp", None), value=d.get("value", None), @@ -3253,6 +3354,33 @@ def from_dict(cls, d: Dict[str, Any]) -> ModelDatabricks: ) +@dataclass +class ModelInput: + """Represents a LoggedModel or Registered Model Version input to a Run.""" + + model_id: str + """The unique identifier of the model.""" + + def as_dict(self) -> dict: + """Serializes the ModelInput into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.model_id is not None: + body["model_id"] = self.model_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ModelInput into a shallow dictionary of its immediate attributes.""" + body = {} + if self.model_id is not None: + body["model_id"] = self.model_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ModelInput: + """Deserializes the ModelInput from a dictionary.""" + return cls(model_id=d.get("model_id", None)) + + @dataclass class ModelTag: key: Optional[str] = None @@ -4571,11 +4699,19 @@ class RunInputs: dataset_inputs: Optional[List[DatasetInput]] = None """Run metrics.""" + model_inputs: Optional[List[ModelInput]] = None + """**NOTE**: Experimental: This API field may change or be removed in a future release without + warning. + + Model inputs to the Run.""" + def as_dict(self) -> dict: """Serializes the RunInputs into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset_inputs: body["dataset_inputs"] = [v.as_dict() for v in self.dataset_inputs] + if self.model_inputs: + body["model_inputs"] = [v.as_dict() for v in self.model_inputs] return body def as_shallow_dict(self) -> dict: @@ -4583,12 +4719,17 @@ def as_shallow_dict(self) -> dict: body = {} if self.dataset_inputs: body["dataset_inputs"] = self.dataset_inputs + if self.model_inputs: + body["model_inputs"] = self.model_inputs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunInputs: """Deserializes the RunInputs from a dictionary.""" - return cls(dataset_inputs=_repeated_dict(d, "dataset_inputs", DatasetInput)) + return cls( + dataset_inputs=_repeated_dict(d, "dataset_inputs", DatasetInput), + model_inputs=_repeated_dict(d, "model_inputs", ModelInput), + ) @dataclass @@ -6257,10 +6398,11 @@ def list_artifacts( API](/api/workspace/files/listdirectorycontents). :param page_token: str (optional) - Token indicating the page of artifact results to fetch. `page_token` is not supported when listing - artifacts in UC Volumes. A maximum of 1000 artifacts will be retrieved for UC Volumes. Please call - `/api/2.0/fs/directories{directory_path}` for listing artifacts in UC Volumes, which supports - pagination. See [List directory contents | Files API](/api/workspace/files/listdirectorycontents). + The token indicating the page of artifact results to fetch. `page_token` is not supported when + listing artifacts in UC Volumes. A maximum of 1000 artifacts will be retrieved for UC Volumes. + Please call `/api/2.0/fs/directories{directory_path}` for listing artifacts in UC Volumes, which + supports pagination. See [List directory contents | Files + API](/api/workspace/files/listdirectorycontents). :param path: str (optional) Filter artifacts matching this path (a relative path from the root artifact directory). :param run_id: str (optional) @@ -6418,7 +6560,9 @@ def log_batch( self._api.do("POST", "/api/2.0/mlflow/runs/log-batch", body=body, headers=headers) - def log_inputs(self, run_id: str, *, datasets: Optional[List[DatasetInput]] = None): + def log_inputs( + self, run_id: str, *, datasets: Optional[List[DatasetInput]] = None, models: Optional[List[ModelInput]] = None + ): """Log inputs to a run. **NOTE:** Experimental: This API may change or be removed in a future release without warning. @@ -6429,12 +6573,16 @@ def log_inputs(self, run_id: str, *, datasets: Optional[List[DatasetInput]] = No ID of the run to log under :param datasets: List[:class:`DatasetInput`] (optional) Dataset inputs + :param models: List[:class:`ModelInput`] (optional) + Model inputs """ body = {} if datasets is not None: body["datasets"] = [v.as_dict() for v in datasets] + if models is not None: + body["models"] = [v.as_dict() for v in models] if run_id is not None: body["run_id"] = run_id headers = { @@ -6450,6 +6598,9 @@ def log_metric( value: float, timestamp: int, *, + dataset_digest: Optional[str] = None, + dataset_name: Optional[str] = None, + model_id: Optional[str] = None, run_id: Optional[str] = None, run_uuid: Optional[str] = None, step: Optional[int] = None, @@ -6466,6 +6617,14 @@ def log_metric( Double value of the metric being logged. :param timestamp: int Unix timestamp in milliseconds at the time metric was logged. + :param dataset_digest: str (optional) + Dataset digest of the dataset associated with the metric, e.g. an md5 hash of the dataset that + uniquely identifies it within datasets of the same name. + :param dataset_name: str (optional) + The name of the dataset associated with the metric. E.g. “my.uc.table@2” “nyc-taxi-dataset”, + “fantastic-elk-3” + :param model_id: str (optional) + ID of the logged model associated with the metric, if applicable :param run_id: str (optional) ID of the run under which to log the metric. Must be provided. :param run_uuid: str (optional) @@ -6477,8 +6636,14 @@ def log_metric( """ body = {} + if dataset_digest is not None: + body["dataset_digest"] = dataset_digest + if dataset_name is not None: + body["dataset_name"] = dataset_name if key is not None: body["key"] = key + if model_id is not None: + body["model_id"] = model_id if run_id is not None: body["run_id"] = run_id if run_uuid is not None: @@ -7006,49 +7171,45 @@ def create_experiment( Creates a serverless forecasting experiment. Returns the experiment ID. :param train_data_path: str - The three-level (fully qualified) name of a unity catalog table. This table serves as the training - data for the forecasting model. + The fully qualified name of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, + used as training data for the forecasting model. :param target_column: str - Name of the column in the input training table that serves as the prediction target. The values in - this column will be used as the ground truth for model training. + The column in the input training table used as the prediction target for model training. The values + in this column are used as the ground truth for model training. :param time_column: str - Name of the column in the input training table that represents the timestamp of each row. + The column in the input training table that represents each row's timestamp. :param forecast_granularity: str - The granularity of the forecast. This defines the time interval between consecutive rows in the time - series data. Possible values: '1 second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 - minutes', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'. + The time interval between consecutive rows in the time series data. Possible values include: '1 + second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 minutes', 'Hourly', 'Daily', + 'Weekly', 'Monthly', 'Quarterly', 'Yearly'. :param forecast_horizon: int - The number of time steps into the future for which predictions should be made. This value represents - a multiple of forecast_granularity determining how far ahead the model will forecast. + The number of time steps into the future to make predictions, calculated as a multiple of + forecast_granularity. This value represents how far ahead the model should forecast. :param custom_weights_column: str (optional) - Name of the column in the input training table used to customize the weight for each time series to - calculate weighted metrics. + The column in the training table used to customize weights for each time series. :param experiment_path: str (optional) - The path to the created experiment. This is the path where the experiment will be stored in the - workspace. + The path in the workspace to store the created experiment. :param holiday_regions: List[str] (optional) - Region code(s) to consider when automatically adding holiday features. When empty, no holiday - features are added. Only supports 1 holiday region for now. + The region code(s) to automatically add holiday features. Currently supports only one region. :param max_runtime: int (optional) - The maximum duration in minutes for which the experiment is allowed to run. If the experiment - exceeds this time limit it will be stopped automatically. + The maximum duration for the experiment in minutes. The experiment stops automatically if it exceeds + this limit. :param prediction_data_path: str (optional) - The three-level (fully qualified) path to a unity catalog table. This table path serves to store the - predictions. + The fully qualified path of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, + used to store predictions. :param primary_metric: str (optional) The evaluation metric used to optimize the forecasting model. :param register_to: str (optional) - The three-level (fully qualified) path to a unity catalog model. This model path serves to store the - best model. + The fully qualified path of a Unity Catalog model, formatted as catalog_name.schema_name.model_name, + used to store the best model. :param split_column: str (optional) - Name of the column in the input training table used for custom data splits. The values in this - column must be "train", "validate", or "test" to indicate which split each row belongs to. + // The column in the training table used for custom data splits. Values must be 'train', 'validate', + or 'test'. :param timeseries_identifier_columns: List[str] (optional) - Name of the column in the input training table used to group the dataset to predict individual time - series + The column in the training table used to group the dataset for predicting individual time series. :param training_frameworks: List[str] (optional) - The list of frameworks to include for model tuning. Possible values: 'Prophet', 'ARIMA', 'DeepAR'. - An empty list will include all supported frameworks. + List of frameworks to include for model tuning. Possible values are 'Prophet', 'ARIMA', 'DeepAR'. An + empty list includes all supported frameworks. :returns: Long-running operation waiter for :class:`ForecastingExperiment`. diff --git a/databricks/sdk/service/pipelines.py b/databricks/sdk/service/pipelines.py index 3081ef8ee..beeb365c2 100755 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/service/pipelines.py @@ -16,11 +16,316 @@ _LOG = logging.getLogger("databricks.sdk") -from databricks.sdk.service import compute - # all definitions in this file are in alphabetical order +@dataclass +class Adlsgen2Info: + """A storage location in Adls Gen2""" + + destination: str + """abfss destination, e.g. + `abfss://@.dfs.core.windows.net/`.""" + + def as_dict(self) -> dict: + """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: + """Deserializes the Adlsgen2Info from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class AwsAttributes: + """Attributes set during cluster creation which are related to Amazon Web Services.""" + + availability: Optional[AwsAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ebs_volume_count: Optional[int] = None + """The number of volumes launched for each instance. Users can choose up to 10 volumes. This + feature is only enabled for supported node types. Legacy node types cannot specify custom EBS + volumes. For node types with no instance store, at least one EBS volume needs to be specified; + otherwise, cluster creation will fail. + + These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. Instance store volumes will be + mounted at `/local_disk0`, `/local_disk1`, and etc. + + If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for + scratch storage because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance + store volumes. + + Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + will be overridden.""" + + ebs_volume_iops: Optional[int] = None + """If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance + of a gp2 volume with the same volume size will be used.""" + + ebs_volume_size: Optional[int] = None + """The size of each EBS volume (in GiB) launched for each instance. For general purpose SSD, this + value must be within the range 100 - 4096. For throughput optimized HDD, this value must be + within the range 500 - 4096.""" + + ebs_volume_throughput: Optional[int] = None + """If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum + performance of a gp2 volume with the same volume size will be used.""" + + ebs_volume_type: Optional[EbsVolumeType] = None + """The type of EBS volumes that will be launched with this cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. If this + value is greater than 0, the cluster driver node in particular will be placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + instance_profile_arn: Optional[str] = None + """Nodes for this cluster will only be placed on AWS instances with this instance profile. If + ommitted, nodes will be placed on instances without an IAM instance profile. The instance + profile must have previously been added to the Databricks environment by an account + administrator. + + This feature may only be available to certain customer plans.""" + + spot_bid_price_percent: Optional[int] = None + """The bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. For example, if this field is set to 50, and the cluster needs a new + `r3.xlarge` spot instance, then the bid price is half of the price of on-demand `r3.xlarge` + instances. Similarly, if this field is set to 200, the bid price is twice the price of on-demand + `r3.xlarge` instances. If not specified, the default value is 100. When spot instances are + requested for this cluster, only spot instances whose bid price percentage matches this field + will be considered. Note that, for safety, we enforce this field to be no more than 10000.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone/datacenter in which the cluster resides. This string will + be of a form like "us-west-2a". The provided availability zone must be in the same region as the + Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks + deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and + if not specified, a default zone will be used. If the zone specified is "auto", will try to + place cluster in a zone with high availability, and will retry placement in a different AZ if + there is not enough capacity. + + The list of available zones as well as the default value can be found by using the `List Zones` + method.""" + + def as_dict(self) -> dict: + """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: + """Deserializes the AwsAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AwsAvailability), + ebs_volume_count=d.get("ebs_volume_count", None), + ebs_volume_iops=d.get("ebs_volume_iops", None), + ebs_volume_size=d.get("ebs_volume_size", None), + ebs_volume_throughput=d.get("ebs_volume_throughput", None), + ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), + first_on_demand=d.get("first_on_demand", None), + instance_profile_arn=d.get("instance_profile_arn", None), + spot_bid_price_percent=d.get("spot_bid_price_percent", None), + zone_id=d.get("zone_id", None), + ) + + +class AwsAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND = "ON_DEMAND" + SPOT = "SPOT" + SPOT_WITH_FALLBACK = "SPOT_WITH_FALLBACK" + + +@dataclass +class AzureAttributes: + """Attributes set during cluster creation which are related to Microsoft Azure.""" + + availability: Optional[AzureAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This + value should be greater than 0, to make sure the cluster driver node is placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + log_analytics_info: Optional[LogAnalyticsInfo] = None + """Defines values necessary to configure and run Azure Log Analytics agent""" + + spot_bid_max_price: Optional[float] = None + """The max bid price to be used for Azure spot instances. The Max price for the bid cannot be + higher than the on-demand price of the instance. If not specified, the default value is -1, + which specifies that the instance cannot be evicted on the basis of price, and only on the basis + of availability. Further, the value should > 0 or -1.""" + + def as_dict(self) -> dict: + """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info.as_dict() + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: + """Deserializes the AzureAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AzureAvailability), + first_on_demand=d.get("first_on_demand", None), + log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), + spot_bid_max_price=d.get("spot_bid_max_price", None), + ) + + +class AzureAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND_AZURE = "ON_DEMAND_AZURE" + SPOT_AZURE = "SPOT_AZURE" + SPOT_WITH_FALLBACK_AZURE = "SPOT_WITH_FALLBACK_AZURE" + + +@dataclass +class ClusterLogConf: + """Cluster log delivery config""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } + }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ "s3": { "destination" + : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` Cluster iam role is used to + access s3, please make sure the cluster iam role in `instance_profile_arn` has permission to + write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided, e.g. `{ "volumes": { "destination": + "/Volumes/catalog/schema/volume/cluster_log" } }`""" + + def as_dict(self) -> dict: + """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: + """Deserializes the ClusterLogConf from a dictionary.""" + return cls( + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + ) + + @dataclass class CreatePipeline: allow_duplicate_names: Optional[bool] = None @@ -58,6 +363,9 @@ class CreatePipeline: edition: Optional[str] = None """Pipeline product edition.""" + event_log: Optional[EventLogSpec] = None + """Event log configuration for this pipeline""" + filters: Optional[Filters] = None """Filters on which Pipeline packages to include in the deployed graph.""" @@ -136,6 +444,8 @@ def as_dict(self) -> dict: body["dry_run"] = self.dry_run if self.edition is not None: body["edition"] = self.edition + if self.event_log: + body["event_log"] = self.event_log.as_dict() if self.filters: body["filters"] = self.filters.as_dict() if self.gateway_definition: @@ -193,6 +503,8 @@ def as_shallow_dict(self) -> dict: body["dry_run"] = self.dry_run if self.edition is not None: body["edition"] = self.edition + if self.event_log: + body["event_log"] = self.event_log if self.filters: body["filters"] = self.filters if self.gateway_definition: @@ -240,6 +552,7 @@ def from_dict(cls, d: Dict[str, Any]) -> CreatePipeline: development=d.get("development", None), dry_run=d.get("dry_run", None), edition=d.get("edition", None), + event_log=_from_dict(d, "event_log", EventLogSpec), filters=_from_dict(d, "filters", Filters), gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), id=d.get("id", None), @@ -367,6 +680,33 @@ class DayOfWeek(Enum): WEDNESDAY = "WEDNESDAY" +@dataclass +class DbfsStorageInfo: + """A storage location in DBFS""" + + destination: str + """dbfs destination, e.g. `dbfs:/my/path`""" + + def as_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: + """Deserializes the DbfsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class DeletePipelineResponse: def as_dict(self) -> dict: @@ -392,6 +732,14 @@ class DeploymentKind(Enum): BUNDLE = "BUNDLE" +class EbsVolumeType(Enum): + """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for + details.""" + + GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" + THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" + + @dataclass class EditPipeline: allow_duplicate_names: Optional[bool] = None @@ -427,6 +775,9 @@ class EditPipeline: edition: Optional[str] = None """Pipeline product edition.""" + event_log: Optional[EventLogSpec] = None + """Event log configuration for this pipeline""" + expected_last_modified: Optional[int] = None """If present, the last-modified time of the pipeline settings before the edit. If the settings were modified after that time, then the request will fail with a conflict.""" @@ -510,6 +861,8 @@ def as_dict(self) -> dict: body["development"] = self.development if self.edition is not None: body["edition"] = self.edition + if self.event_log: + body["event_log"] = self.event_log.as_dict() if self.expected_last_modified is not None: body["expected_last_modified"] = self.expected_last_modified if self.filters: @@ -569,6 +922,8 @@ def as_shallow_dict(self) -> dict: body["development"] = self.development if self.edition is not None: body["edition"] = self.edition + if self.event_log: + body["event_log"] = self.event_log if self.expected_last_modified is not None: body["expected_last_modified"] = self.expected_last_modified if self.filters: @@ -619,6 +974,7 @@ def from_dict(cls, d: Dict[str, Any]) -> EditPipeline: deployment=_from_dict(d, "deployment", PipelineDeployment), development=d.get("development", None), edition=d.get("edition", None), + event_log=_from_dict(d, "event_log", EventLogSpec), expected_last_modified=d.get("expected_last_modified", None), filters=_from_dict(d, "filters", Filters), gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), @@ -698,6 +1054,47 @@ class EventLevel(Enum): WARN = "WARN" +@dataclass +class EventLogSpec: + """Configurable event log parameters.""" + + catalog: Optional[str] = None + """The UC catalog the event log is published under.""" + + name: Optional[str] = None + """The name the event log is published to in UC.""" + + schema: Optional[str] = None + """The UC schema the event log is published under.""" + + def as_dict(self) -> dict: + """Serializes the EventLogSpec into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.catalog is not None: + body["catalog"] = self.catalog + if self.name is not None: + body["name"] = self.name + if self.schema is not None: + body["schema"] = self.schema + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EventLogSpec into a shallow dictionary of its immediate attributes.""" + body = {} + if self.catalog is not None: + body["catalog"] = self.catalog + if self.name is not None: + body["name"] = self.name + if self.schema is not None: + body["schema"] = self.schema + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> EventLogSpec: + """Deserializes the EventLogSpec from a dictionary.""" + return cls(catalog=d.get("catalog", None), name=d.get("name", None), schema=d.get("schema", None)) + + @dataclass class FileLibrary: path: Optional[str] = None @@ -755,6 +1152,124 @@ def from_dict(cls, d: Dict[str, Any]) -> Filters: return cls(exclude=d.get("exclude", None), include=d.get("include", None)) +@dataclass +class GcpAttributes: + """Attributes set during cluster creation which are related to GCP.""" + + availability: Optional[GcpAvailability] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs, + on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + boot_disk_size: Optional[int] = None + """Boot disk size in GB""" + + google_service_account: Optional[str] = None + """If provided, the cluster will impersonate the google service account when accessing gcloud + services (like GCS). The google service account must have previously been added to the + Databricks environment by an account administrator.""" + + local_ssd_count: Optional[int] = None + """If provided, each node (workers and driver) in the cluster will have this number of local SSDs + attached. Each local SSD is 375GB in size. Refer to [GCP documentation] for the supported number + of local SSDs for each instance type. + + [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds""" + + use_preemptible_executors: Optional[bool] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs + (when set to true) versus standard compute engine VMs (when set to false; default). Note: Soon + to be deprecated, use the 'availability' field instead.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone in which the cluster resides. This can be one of the + following: - "HA" => High availability, spread nodes across availability zones for a Databricks + deployment region [default]. - "AUTO" => Databricks picks an availability zone to schedule the + cluster on. - A GCP availability zone => Pick One of the available zones for (machine type + + region) from https://cloud.google.com/compute/docs/regions-zones.""" + + def as_dict(self) -> dict: + """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: + """Deserializes the GcpAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", GcpAvailability), + boot_disk_size=d.get("boot_disk_size", None), + google_service_account=d.get("google_service_account", None), + local_ssd_count=d.get("local_ssd_count", None), + use_preemptible_executors=d.get("use_preemptible_executors", None), + zone_id=d.get("zone_id", None), + ) + + +class GcpAvailability(Enum): + """This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or + preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + ON_DEMAND_GCP = "ON_DEMAND_GCP" + PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" + PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" + + +@dataclass +class GcsStorageInfo: + """A storage location in Google Cloud Platform's GCS""" + + destination: str + """GCS destination/URI, e.g. `gs://my-bucket/some-prefix`""" + + def as_dict(self) -> dict: + """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: + """Deserializes the GcsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class GetPipelinePermissionLevelsResponse: permission_levels: Optional[List[PipelinePermissionsDescription]] = None @@ -1087,6 +1602,90 @@ def from_dict(cls, d: Dict[str, Any]) -> IngestionPipelineDefinition: ) +@dataclass +class InitScriptInfo: + """Config for an individual init script Next ID: 11""" + + abfss: Optional[Adlsgen2Info] = None + """destination needs to be provided, e.g. + `abfss://@.dfs.core.windows.net/`""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } + }`""" + + file: Optional[LocalFileInfo] = None + """destination needs to be provided, e.g. `{ "file": { "destination": "file:/my/local/file.sh" } }`""" + + gcs: Optional[GcsStorageInfo] = None + """destination needs to be provided, e.g. `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ \"s3\": { + \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` Cluster iam + role is used to access s3, please make sure the cluster iam role in `instance_profile_arn` has + permission to write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" : + \"/Volumes/my-init.sh\" } }`""" + + workspace: Optional[WorkspaceStorageInfo] = None + """destination needs to be provided, e.g. `{ "workspace": { "destination": + "/cluster-init-scripts/setup-datadog.sh" } }`""" + + def as_dict(self) -> dict: + """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss.as_dict() + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.file: + body["file"] = self.file.as_dict() + if self.gcs: + body["gcs"] = self.gcs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + if self.workspace: + body["workspace"] = self.workspace.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss + if self.dbfs: + body["dbfs"] = self.dbfs + if self.file: + body["file"] = self.file + if self.gcs: + body["gcs"] = self.gcs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + if self.workspace: + body["workspace"] = self.workspace + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: + """Deserializes the InitScriptInfo from a dictionary.""" + return cls( + abfss=_from_dict(d, "abfss", Adlsgen2Info), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + file=_from_dict(d, "file", LocalFileInfo), + gcs=_from_dict(d, "gcs", GcsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), + ) + + @dataclass class ListPipelineEventsResponse: events: Optional[List[PipelineEvent]] = None @@ -1207,6 +1806,64 @@ def from_dict(cls, d: Dict[str, Any]) -> ListUpdatesResponse: ) +@dataclass +class LocalFileInfo: + destination: str + """local file destination, e.g. `file:/my/local/file.sh`""" + + def as_dict(self) -> dict: + """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: + """Deserializes the LocalFileInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class LogAnalyticsInfo: + log_analytics_primary_key: Optional[str] = None + + log_analytics_workspace_id: Optional[str] = None + + def as_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: + """Deserializes the LogAnalyticsInfo from a dictionary.""" + return cls( + log_analytics_primary_key=d.get("log_analytics_primary_key", None), + log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), + ) + + @dataclass class ManualTrigger: def as_dict(self) -> dict: @@ -1233,6 +1890,51 @@ class MaturityLevel(Enum): STABLE = "STABLE" +@dataclass +class MavenLibrary: + coordinates: str + """Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2".""" + + exclusions: Optional[List[str]] = None + """List of dependences to exclude. For example: `["slf4j:slf4j", "*:hadoop-client"]`. + + Maven dependency exclusions: + https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html.""" + + repo: Optional[str] = None + """Maven repo to install the Maven package from. If omitted, both Maven Central Repository and + Spark Packages are searched.""" + + def as_dict(self) -> dict: + """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.coordinates is not None: + body["coordinates"] = self.coordinates + if self.exclusions: + body["exclusions"] = [v for v in self.exclusions] + if self.repo is not None: + body["repo"] = self.repo + return body + + def as_shallow_dict(self) -> dict: + """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" + body = {} + if self.coordinates is not None: + body["coordinates"] = self.coordinates + if self.exclusions: + body["exclusions"] = self.exclusions + if self.repo is not None: + body["repo"] = self.repo + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: + """Deserializes the MavenLibrary from a dictionary.""" + return cls( + coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) + ) + + @dataclass class NotebookLibrary: path: Optional[str] = None @@ -1570,15 +2272,15 @@ class PipelineCluster: """Parameters needed in order to automatically scale clusters up and down based on load. Note: autoscaling works best with DB runtime versions 3.0 or later.""" - aws_attributes: Optional[compute.AwsAttributes] = None + aws_attributes: Optional[AwsAttributes] = None """Attributes related to clusters running on Amazon Web Services. If not specified at cluster creation, a set of default values will be used.""" - azure_attributes: Optional[compute.AzureAttributes] = None + azure_attributes: Optional[AzureAttributes] = None """Attributes related to clusters running on Microsoft Azure. If not specified at cluster creation, a set of default values will be used.""" - cluster_log_conf: Optional[compute.ClusterLogConf] = None + cluster_log_conf: Optional[ClusterLogConf] = None """The configuration for delivering spark logs to a long-term storage destination. Only dbfs destinations are supported. Only one destination can be specified for one cluster. If the conf is given, the logs will be delivered to the destination every `5 mins`. The destination of @@ -1605,11 +2307,11 @@ class PipelineCluster: enable_local_disk_encryption: Optional[bool] = None """Whether to enable local disk encryption for the cluster.""" - gcp_attributes: Optional[compute.GcpAttributes] = None + gcp_attributes: Optional[GcpAttributes] = None """Attributes related to clusters running on Google Cloud Platform. If not specified at cluster creation, a set of default values will be used.""" - init_scripts: Optional[List[compute.InitScriptInfo]] = None + init_scripts: Optional[List[InitScriptInfo]] = None """The configuration for storing init scripts. Any number of destinations can be specified. The scripts are executed sequentially in the order provided. If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`.""" @@ -1755,15 +2457,15 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineCluster: return cls( apply_policy_default_values=d.get("apply_policy_default_values", None), autoscale=_from_dict(d, "autoscale", PipelineClusterAutoscale), - aws_attributes=_from_dict(d, "aws_attributes", compute.AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", compute.AzureAttributes), - cluster_log_conf=_from_dict(d, "cluster_log_conf", compute.ClusterLogConf), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), custom_tags=d.get("custom_tags", None), driver_instance_pool_id=d.get("driver_instance_pool_id", None), driver_node_type_id=d.get("driver_node_type_id", None), enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", compute.GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", compute.InitScriptInfo), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), instance_pool_id=d.get("instance_pool_id", None), label=d.get("label", None), node_type_id=d.get("node_type_id", None), @@ -1964,7 +2666,7 @@ class PipelineLibrary: jar: Optional[str] = None """URI of the jar to be installed. Currently only DBFS is supported.""" - maven: Optional[compute.MavenLibrary] = None + maven: Optional[MavenLibrary] = None """Specification of a maven library to be installed.""" notebook: Optional[NotebookLibrary] = None @@ -2009,7 +2711,7 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineLibrary: return cls( file=_from_dict(d, "file", FileLibrary), jar=d.get("jar", None), - maven=_from_dict(d, "maven", compute.MavenLibrary), + maven=_from_dict(d, "maven", MavenLibrary), notebook=_from_dict(d, "notebook", NotebookLibrary), whl=d.get("whl", None), ) @@ -2205,6 +2907,9 @@ class PipelineSpec: edition: Optional[str] = None """Pipeline product edition.""" + event_log: Optional[EventLogSpec] = None + """Event log configuration for this pipeline""" + filters: Optional[Filters] = None """Filters on which Pipeline packages to include in the deployed graph.""" @@ -2271,6 +2976,8 @@ def as_dict(self) -> dict: body["development"] = self.development if self.edition is not None: body["edition"] = self.edition + if self.event_log: + body["event_log"] = self.event_log.as_dict() if self.filters: body["filters"] = self.filters.as_dict() if self.gateway_definition: @@ -2322,6 +3029,8 @@ def as_shallow_dict(self) -> dict: body["development"] = self.development if self.edition is not None: body["edition"] = self.edition + if self.event_log: + body["event_log"] = self.event_log if self.filters: body["filters"] = self.filters if self.gateway_definition: @@ -2365,6 +3074,7 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineSpec: deployment=_from_dict(d, "deployment", PipelineDeployment), development=d.get("development", None), edition=d.get("edition", None), + event_log=_from_dict(d, "event_log", EventLogSpec), filters=_from_dict(d, "filters", Filters), gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), id=d.get("id", None), @@ -2664,6 +3374,95 @@ def from_dict(cls, d: Dict[str, Any]) -> RunAs: return cls(service_principal_name=d.get("service_principal_name", None), user_name=d.get("user_name", None)) +@dataclass +class S3StorageInfo: + """A storage location in Amazon S3""" + + destination: str + """S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using cluster + iam role, please make sure you set cluster iam role and the role has write access to the + destination. Please also note that you cannot use AWS keys to deliver logs.""" + + canned_acl: Optional[str] = None + """(Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. If + `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + the destination bucket and prefix. The full list of possible canned acl can be found at + http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. Please also note + that by default only the object owner gets full controls. If you are using cross account role + for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + read the logs.""" + + enable_encryption: Optional[bool] = None + """(Optional) Flag to enable server side encryption, `false` by default.""" + + encryption_type: Optional[str] = None + """(Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + encryption is enabled and the default type is `sse-s3`.""" + + endpoint: Optional[str] = None + """S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be + set. If both are set, endpoint will be used.""" + + kms_key: Optional[str] = None + """(Optional) Kms key which will be used if encryption is enabled and encryption type is set to + `sse-kms`.""" + + region: Optional[str] = None + """S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + endpoint will be used.""" + + def as_dict(self) -> dict: + """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + def as_shallow_dict(self) -> dict: + """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: + """Deserializes the S3StorageInfo from a dictionary.""" + return cls( + canned_acl=d.get("canned_acl", None), + destination=d.get("destination", None), + enable_encryption=d.get("enable_encryption", None), + encryption_type=d.get("encryption_type", None), + endpoint=d.get("endpoint", None), + kms_key=d.get("kms_key", None), + region=d.get("region", None), + ) + + @dataclass class SchemaSpec: destination_catalog: Optional[str] = None @@ -3310,6 +4109,61 @@ class UpdateStateInfoState(Enum): WAITING_FOR_RESOURCES = "WAITING_FOR_RESOURCES" +@dataclass +class VolumesStorageInfo: + """A storage location back by UC Volumes.""" + + destination: str + """UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` or + `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: + """Deserializes the VolumesStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class WorkspaceStorageInfo: + """A storage location in Workspace Filesystem (WSFS)""" + + destination: str + """wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: + """Deserializes the WorkspaceStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + class PipelinesAPI: """The Delta Live Tables API allows you to create, edit, delete, start, and view details about pipelines. @@ -3403,6 +4257,7 @@ def create( development: Optional[bool] = None, dry_run: Optional[bool] = None, edition: Optional[str] = None, + event_log: Optional[EventLogSpec] = None, filters: Optional[Filters] = None, gateway_definition: Optional[IngestionGatewayPipelineDefinition] = None, id: Optional[str] = None, @@ -3447,6 +4302,8 @@ def create( :param dry_run: bool (optional) :param edition: str (optional) Pipeline product edition. + :param event_log: :class:`EventLogSpec` (optional) + Event log configuration for this pipeline :param filters: :class:`Filters` (optional) Filters on which Pipeline packages to include in the deployed graph. :param gateway_definition: :class:`IngestionGatewayPipelineDefinition` (optional) @@ -3510,6 +4367,8 @@ def create( body["dry_run"] = dry_run if edition is not None: body["edition"] = edition + if event_log is not None: + body["event_log"] = event_log.as_dict() if filters is not None: body["filters"] = filters.as_dict() if gateway_definition is not None: @@ -3903,6 +4762,7 @@ def update( deployment: Optional[PipelineDeployment] = None, development: Optional[bool] = None, edition: Optional[str] = None, + event_log: Optional[EventLogSpec] = None, expected_last_modified: Optional[int] = None, filters: Optional[Filters] = None, gateway_definition: Optional[IngestionGatewayPipelineDefinition] = None, @@ -3948,6 +4808,8 @@ def update( Whether the pipeline is in Development mode. Defaults to false. :param edition: str (optional) Pipeline product edition. + :param event_log: :class:`EventLogSpec` (optional) + Event log configuration for this pipeline :param expected_last_modified: int (optional) If present, the last-modified time of the pipeline settings before the edit. If the settings were modified after that time, then the request will fail with a conflict. @@ -4012,6 +4874,8 @@ def update( body["development"] = development if edition is not None: body["edition"] = edition + if event_log is not None: + body["event_log"] = event_log.as_dict() if expected_last_modified is not None: body["expected_last_modified"] = expected_last_modified if filters is not None: diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index 0a66ec777..eb8056b69 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -3294,6 +3294,7 @@ class ServedModelInputWorkloadSize(Enum): class ServedModelInputWorkloadType(Enum): + """Please keep this in sync with with workload types in InferenceEndpointEntities.scala""" CPU = "CPU" GPU_LARGE = "GPU_LARGE" @@ -4059,6 +4060,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissionsRequest: class ServingModelWorkloadType(Enum): + """Please keep this in sync with with workload types in InferenceEndpointEntities.scala""" CPU = "CPU" GPU_LARGE = "GPU_LARGE" diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index 317219e7f..4614b54d4 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -1662,305 +1662,6 @@ def from_dict(cls, d: Dict[str, Any]) -> DisableLegacyFeatures: ) -@dataclass -class EgressNetworkPolicy: - """The network policies applying for egress traffic. This message is used by the UI/REST API. We - translate this message to the format expected by the dataplane in Lakehouse Network Manager (for - the format expected by the dataplane, see networkconfig.textproto).""" - - internet_access: Optional[EgressNetworkPolicyInternetAccessPolicy] = None - """The access policy enforced for egress traffic to the internet.""" - - def as_dict(self) -> dict: - """Serializes the EgressNetworkPolicy into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.internet_access: - body["internet_access"] = self.internet_access.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the EgressNetworkPolicy into a shallow dictionary of its immediate attributes.""" - body = {} - if self.internet_access: - body["internet_access"] = self.internet_access - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicy: - """Deserializes the EgressNetworkPolicy from a dictionary.""" - return cls(internet_access=_from_dict(d, "internet_access", EgressNetworkPolicyInternetAccessPolicy)) - - -@dataclass -class EgressNetworkPolicyInternetAccessPolicy: - allowed_internet_destinations: Optional[List[EgressNetworkPolicyInternetAccessPolicyInternetDestination]] = None - - allowed_storage_destinations: Optional[List[EgressNetworkPolicyInternetAccessPolicyStorageDestination]] = None - - log_only_mode: Optional[EgressNetworkPolicyInternetAccessPolicyLogOnlyMode] = None - """Optional. If not specified, assume the policy is enforced for all workloads.""" - - restriction_mode: Optional[EgressNetworkPolicyInternetAccessPolicyRestrictionMode] = None - """At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: - Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can - only access explicitly allowed internet and storage destinations, as well as UC connections and - external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via - private link.""" - - def as_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicy into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.allowed_internet_destinations: - body["allowed_internet_destinations"] = [v.as_dict() for v in self.allowed_internet_destinations] - if self.allowed_storage_destinations: - body["allowed_storage_destinations"] = [v.as_dict() for v in self.allowed_storage_destinations] - if self.log_only_mode: - body["log_only_mode"] = self.log_only_mode.as_dict() - if self.restriction_mode is not None: - body["restriction_mode"] = self.restriction_mode.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicy into a shallow dictionary of its immediate attributes.""" - body = {} - if self.allowed_internet_destinations: - body["allowed_internet_destinations"] = self.allowed_internet_destinations - if self.allowed_storage_destinations: - body["allowed_storage_destinations"] = self.allowed_storage_destinations - if self.log_only_mode: - body["log_only_mode"] = self.log_only_mode - if self.restriction_mode is not None: - body["restriction_mode"] = self.restriction_mode - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicy: - """Deserializes the EgressNetworkPolicyInternetAccessPolicy from a dictionary.""" - return cls( - allowed_internet_destinations=_repeated_dict( - d, "allowed_internet_destinations", EgressNetworkPolicyInternetAccessPolicyInternetDestination - ), - allowed_storage_destinations=_repeated_dict( - d, "allowed_storage_destinations", EgressNetworkPolicyInternetAccessPolicyStorageDestination - ), - log_only_mode=_from_dict(d, "log_only_mode", EgressNetworkPolicyInternetAccessPolicyLogOnlyMode), - restriction_mode=_enum(d, "restriction_mode", EgressNetworkPolicyInternetAccessPolicyRestrictionMode), - ) - - -@dataclass -class EgressNetworkPolicyInternetAccessPolicyInternetDestination: - """Users can specify accessible internet destinations when outbound access is restricted. We only - support domain name (FQDN) destinations for the time being, though going forwards we want to - support host names and IP addresses.""" - - destination: Optional[str] = None - - protocol: Optional[ - EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol - ] = None - """The filtering protocol used by the DP. For private and public preview, SEG will only support TCP - filtering (i.e. DNS based filtering, filtering by destination IP address), so protocol will be - set to TCP by default and hidden from the user. In the future, users may be able to select HTTP - filtering (i.e. SNI based filtering, filtering by FQDN).""" - - type: Optional[EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType] = None - - def as_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - if self.protocol is not None: - body["protocol"] = self.protocol.value - if self.type is not None: - body["type"] = self.type.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - if self.protocol is not None: - body["protocol"] = self.protocol - if self.type is not None: - body["type"] = self.type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyInternetDestination: - """Deserializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination from a dictionary.""" - return cls( - destination=d.get("destination", None), - protocol=_enum( - d, - "protocol", - EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol, - ), - type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType), - ) - - -class EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol(Enum): - """The filtering protocol used by the DP. For private and public preview, SEG will only support TCP - filtering (i.e. DNS based filtering, filtering by destination IP address), so protocol will be - set to TCP by default and hidden from the user. In the future, users may be able to select HTTP - filtering (i.e. SNI based filtering, filtering by FQDN).""" - - TCP = "TCP" - - -class EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType(Enum): - - FQDN = "FQDN" - - -@dataclass -class EgressNetworkPolicyInternetAccessPolicyLogOnlyMode: - log_only_mode_type: Optional[EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType] = None - - workloads: Optional[List[EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType]] = None - - def as_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.log_only_mode_type is not None: - body["log_only_mode_type"] = self.log_only_mode_type.value - if self.workloads: - body["workloads"] = [v.value for v in self.workloads] - return body - - def as_shallow_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a shallow dictionary of its immediate attributes.""" - body = {} - if self.log_only_mode_type is not None: - body["log_only_mode_type"] = self.log_only_mode_type - if self.workloads: - body["workloads"] = self.workloads - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyLogOnlyMode: - """Deserializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode from a dictionary.""" - return cls( - log_only_mode_type=_enum( - d, "log_only_mode_type", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType - ), - workloads=_repeated_enum(d, "workloads", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType), - ) - - -class EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType(Enum): - - ALL_SERVICES = "ALL_SERVICES" - SELECTED_SERVICES = "SELECTED_SERVICES" - - -class EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType(Enum): - """The values should match the list of workloads used in networkconfig.proto""" - - DBSQL = "DBSQL" - ML_SERVING = "ML_SERVING" - - -class EgressNetworkPolicyInternetAccessPolicyRestrictionMode(Enum): - """At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: - Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can - only access explicitly allowed internet and storage destinations, as well as UC connections and - external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via - private link.""" - - FULL_ACCESS = "FULL_ACCESS" - PRIVATE_ACCESS_ONLY = "PRIVATE_ACCESS_ONLY" - RESTRICTED_ACCESS = "RESTRICTED_ACCESS" - - -@dataclass -class EgressNetworkPolicyInternetAccessPolicyStorageDestination: - """Users can specify accessible storage destinations.""" - - allowed_paths: Optional[List[str]] = None - - azure_container: Optional[str] = None - - azure_dns_zone: Optional[str] = None - - azure_storage_account: Optional[str] = None - - azure_storage_service: Optional[str] = None - - bucket_name: Optional[str] = None - - region: Optional[str] = None - - type: Optional[EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType] = None - - def as_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.allowed_paths: - body["allowed_paths"] = [v for v in self.allowed_paths] - if self.azure_container is not None: - body["azure_container"] = self.azure_container - if self.azure_dns_zone is not None: - body["azure_dns_zone"] = self.azure_dns_zone - if self.azure_storage_account is not None: - body["azure_storage_account"] = self.azure_storage_account - if self.azure_storage_service is not None: - body["azure_storage_service"] = self.azure_storage_service - if self.bucket_name is not None: - body["bucket_name"] = self.bucket_name - if self.region is not None: - body["region"] = self.region - if self.type is not None: - body["type"] = self.type.value - return body - - def as_shallow_dict(self) -> dict: - """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a shallow dictionary of its immediate attributes.""" - body = {} - if self.allowed_paths: - body["allowed_paths"] = self.allowed_paths - if self.azure_container is not None: - body["azure_container"] = self.azure_container - if self.azure_dns_zone is not None: - body["azure_dns_zone"] = self.azure_dns_zone - if self.azure_storage_account is not None: - body["azure_storage_account"] = self.azure_storage_account - if self.azure_storage_service is not None: - body["azure_storage_service"] = self.azure_storage_service - if self.bucket_name is not None: - body["bucket_name"] = self.bucket_name - if self.region is not None: - body["region"] = self.region - if self.type is not None: - body["type"] = self.type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyStorageDestination: - """Deserializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination from a dictionary.""" - return cls( - allowed_paths=d.get("allowed_paths", None), - azure_container=d.get("azure_container", None), - azure_dns_zone=d.get("azure_dns_zone", None), - azure_storage_account=d.get("azure_storage_account", None), - azure_storage_service=d.get("azure_storage_service", None), - bucket_name=d.get("bucket_name", None), - region=d.get("region", None), - type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType), - ) - - -class EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType(Enum): - - AWS_S3 = "AWS_S3" - AZURE_STORAGE = "AZURE_STORAGE" - CLOUDFLARE_R2 = "CLOUDFLARE_R2" - GOOGLE_CLOUD_STORAGE = "GOOGLE_CLOUD_STORAGE" - - @dataclass class EmailConfig: addresses: Optional[List[str]] = None @@ -4146,6 +3847,10 @@ class TokenType(Enum): ARCLIGHT_AZURE_EXCHANGE_TOKEN = "ARCLIGHT_AZURE_EXCHANGE_TOKEN" ARCLIGHT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY = "ARCLIGHT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY" + ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN = "ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN" + ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY = ( + "ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY" + ) AZURE_ACTIVE_DIRECTORY_TOKEN = "AZURE_ACTIVE_DIRECTORY_TOKEN" diff --git a/databricks/sdk/service/sharing.py b/databricks/sdk/service/sharing.py index 7325e5fdd..b8e93d5c0 100755 --- a/databricks/sdk/service/sharing.py +++ b/databricks/sdk/service/sharing.py @@ -12,8 +12,6 @@ _LOG = logging.getLogger("databricks.sdk") -from databricks.sdk.service import catalog - # all definitions in this file are in alphabetical order @@ -370,7 +368,7 @@ class DeltaSharingFunction: storage_location: Optional[str] = None """The storage location of the function.""" - tags: Optional[List[catalog.TagKeyValue]] = None + tags: Optional[List[TagKeyValue]] = None """The tags of the function.""" def as_dict(self) -> dict: @@ -466,7 +464,7 @@ def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingFunction: share=d.get("share", None), share_id=d.get("share_id", None), storage_location=d.get("storage_location", None), - tags=_repeated_dict(d, "tags", catalog.TagKeyValue), + tags=_repeated_dict(d, "tags", TagKeyValue), ) @@ -1011,7 +1009,7 @@ class NotebookFile: share_id: Optional[str] = None """The id of the share that the notebook file belongs to.""" - tags: Optional[List[catalog.TagKeyValue]] = None + tags: Optional[List[TagKeyValue]] = None """The tags of the notebook file.""" def as_dict(self) -> dict: @@ -1057,7 +1055,7 @@ def from_dict(cls, d: Dict[str, Any]) -> NotebookFile: name=d.get("name", None), share=d.get("share", None), share_id=d.get("share_id", None), - tags=_repeated_dict(d, "tags", catalog.TagKeyValue), + tags=_repeated_dict(d, "tags", TagKeyValue), ) @@ -2247,7 +2245,7 @@ class Table: share_id: Optional[str] = None """The id of the share that the table belongs to.""" - tags: Optional[List[catalog.TagKeyValue]] = None + tags: Optional[List[TagKeyValue]] = None """The Tags of the table.""" def as_dict(self) -> dict: @@ -2308,7 +2306,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Table: schema=d.get("schema", None), share=d.get("share", None), share_id=d.get("share_id", None), - tags=_repeated_dict(d, "tags", catalog.TagKeyValue), + tags=_repeated_dict(d, "tags", TagKeyValue), ) @@ -2380,6 +2378,38 @@ class TableInternalAttributesSharedTableType(Enum): VIEW = "VIEW" +@dataclass +class TagKeyValue: + key: Optional[str] = None + """name of the tag""" + + value: Optional[str] = None + """value of the tag associated with the key, could be optional""" + + def as_dict(self) -> dict: + """Serializes the TagKeyValue into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.key is not None: + body["key"] = self.key + if self.value is not None: + body["value"] = self.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the TagKeyValue into a shallow dictionary of its immediate attributes.""" + body = {} + if self.key is not None: + body["key"] = self.key + if self.value is not None: + body["value"] = self.value + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> TagKeyValue: + """Deserializes the TagKeyValue from a dictionary.""" + return cls(key=d.get("key", None), value=d.get("value", None)) + + @dataclass class UpdateProvider: comment: Optional[str] = None @@ -2665,7 +2695,7 @@ class Volume: share_id: Optional[str] = None """/ The id of the share that the volume belongs to.""" - tags: Optional[List[catalog.TagKeyValue]] = None + tags: Optional[List[TagKeyValue]] = None """The tags of the volume.""" def as_dict(self) -> dict: @@ -2721,7 +2751,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Volume: schema=d.get("schema", None), share=d.get("share", None), share_id=d.get("share_id", None), - tags=_repeated_dict(d, "tags", catalog.TagKeyValue), + tags=_repeated_dict(d, "tags", TagKeyValue), ) diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index 926d137a9..297661c11 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -3161,6 +3161,123 @@ def from_dict(cls, d: Dict[str, Any]) -> ExternalLink: ) +@dataclass +class ExternalQuerySource: + alert_id: Optional[str] = None + """The canonical identifier for this SQL alert""" + + dashboard_id: Optional[str] = None + """The canonical identifier for this Lakeview dashboard""" + + genie_space_id: Optional[str] = None + """The canonical identifier for this Genie space""" + + job_info: Optional[ExternalQuerySourceJobInfo] = None + + legacy_dashboard_id: Optional[str] = None + """The canonical identifier for this legacy dashboard""" + + notebook_id: Optional[str] = None + """The canonical identifier for this notebook""" + + sql_query_id: Optional[str] = None + """The canonical identifier for this SQL query""" + + def as_dict(self) -> dict: + """Serializes the ExternalQuerySource into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.alert_id is not None: + body["alert_id"] = self.alert_id + if self.dashboard_id is not None: + body["dashboard_id"] = self.dashboard_id + if self.genie_space_id is not None: + body["genie_space_id"] = self.genie_space_id + if self.job_info: + body["job_info"] = self.job_info.as_dict() + if self.legacy_dashboard_id is not None: + body["legacy_dashboard_id"] = self.legacy_dashboard_id + if self.notebook_id is not None: + body["notebook_id"] = self.notebook_id + if self.sql_query_id is not None: + body["sql_query_id"] = self.sql_query_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ExternalQuerySource into a shallow dictionary of its immediate attributes.""" + body = {} + if self.alert_id is not None: + body["alert_id"] = self.alert_id + if self.dashboard_id is not None: + body["dashboard_id"] = self.dashboard_id + if self.genie_space_id is not None: + body["genie_space_id"] = self.genie_space_id + if self.job_info: + body["job_info"] = self.job_info + if self.legacy_dashboard_id is not None: + body["legacy_dashboard_id"] = self.legacy_dashboard_id + if self.notebook_id is not None: + body["notebook_id"] = self.notebook_id + if self.sql_query_id is not None: + body["sql_query_id"] = self.sql_query_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ExternalQuerySource: + """Deserializes the ExternalQuerySource from a dictionary.""" + return cls( + alert_id=d.get("alert_id", None), + dashboard_id=d.get("dashboard_id", None), + genie_space_id=d.get("genie_space_id", None), + job_info=_from_dict(d, "job_info", ExternalQuerySourceJobInfo), + legacy_dashboard_id=d.get("legacy_dashboard_id", None), + notebook_id=d.get("notebook_id", None), + sql_query_id=d.get("sql_query_id", None), + ) + + +@dataclass +class ExternalQuerySourceJobInfo: + job_id: Optional[str] = None + """The canonical identifier for this job.""" + + job_run_id: Optional[str] = None + """The canonical identifier of the run. This ID is unique across all runs of all jobs.""" + + job_task_run_id: Optional[str] = None + """The canonical identifier of the task run.""" + + def as_dict(self) -> dict: + """Serializes the ExternalQuerySourceJobInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.job_id is not None: + body["job_id"] = self.job_id + if self.job_run_id is not None: + body["job_run_id"] = self.job_run_id + if self.job_task_run_id is not None: + body["job_task_run_id"] = self.job_task_run_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ExternalQuerySourceJobInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.job_id is not None: + body["job_id"] = self.job_id + if self.job_run_id is not None: + body["job_run_id"] = self.job_run_id + if self.job_task_run_id is not None: + body["job_task_run_id"] = self.job_task_run_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ExternalQuerySourceJobInfo: + """Deserializes the ExternalQuerySourceJobInfo from a dictionary.""" + return cls( + job_id=d.get("job_id", None), + job_run_id=d.get("job_run_id", None), + job_task_run_id=d.get("job_task_run_id", None), + ) + + class Format(Enum): ARROW_STREAM = "ARROW_STREAM" @@ -5113,6 +5230,11 @@ class QueryInfo: query_id: Optional[str] = None """The query ID.""" + query_source: Optional[ExternalQuerySource] = None + """A struct that contains key-value pairs representing Databricks entities that were involved in + the execution of this statement, such as jobs, notebooks, or dashboards. This field only records + Databricks entities.""" + query_start_time_ms: Optional[int] = None """The time the query started.""" @@ -5173,6 +5295,8 @@ def as_dict(self) -> dict: body["query_end_time_ms"] = self.query_end_time_ms if self.query_id is not None: body["query_id"] = self.query_id + if self.query_source: + body["query_source"] = self.query_source.as_dict() if self.query_start_time_ms is not None: body["query_start_time_ms"] = self.query_start_time_ms if self.query_text is not None: @@ -5222,6 +5346,8 @@ def as_shallow_dict(self) -> dict: body["query_end_time_ms"] = self.query_end_time_ms if self.query_id is not None: body["query_id"] = self.query_id + if self.query_source: + body["query_source"] = self.query_source if self.query_start_time_ms is not None: body["query_start_time_ms"] = self.query_start_time_ms if self.query_text is not None: @@ -5259,6 +5385,7 @@ def from_dict(cls, d: Dict[str, Any]) -> QueryInfo: plans_state=_enum(d, "plans_state", PlansState), query_end_time_ms=d.get("query_end_time_ms", None), query_id=d.get("query_id", None), + query_source=_from_dict(d, "query_source", ExternalQuerySource), query_start_time_ms=d.get("query_start_time_ms", None), query_text=d.get("query_text", None), rows_produced=d.get("rows_produced", None), @@ -7409,6 +7536,7 @@ class WarehousePermissionLevel(Enum): CAN_MANAGE = "CAN_MANAGE" CAN_MONITOR = "CAN_MONITOR" CAN_USE = "CAN_USE" + CAN_VIEW = "CAN_VIEW" IS_OWNER = "IS_OWNER" diff --git a/docs/account/iam/service_principals.rst b/docs/account/iam/service_principals.rst index e0fd8577a..302cf5f79 100644 --- a/docs/account/iam/service_principals.rst +++ b/docs/account/iam/service_principals.rst @@ -23,10 +23,7 @@ a = AccountClient() - sp_create = a.service_principals.create(active=True, display_name=f"sdk-{time.time_ns()}") - - # cleanup - a.service_principals.delete(id=sp_create.id) + spn = a.service_principals.create(display_name=f"sdk-{time.time_ns()}") Create a service principal. diff --git a/docs/account/iam/workspace_assignment.rst b/docs/account/iam/workspace_assignment.rst index 6f4c66be5..745bd75da 100644 --- a/docs/account/iam/workspace_assignment.rst +++ b/docs/account/iam/workspace_assignment.rst @@ -47,9 +47,9 @@ a = AccountClient() - workspace_id = os.environ["TEST_WORKSPACE_ID"] + workspace_id = os.environ["DUMMY_WORKSPACE_ID"] - all = a.workspace_assignment.list(list=workspace_id) + all = a.workspace_assignment.list(workspace_id=workspace_id) Get permission assignments. @@ -80,9 +80,9 @@ spn_id = spn.id - workspace_id = os.environ["DUMMY_WORKSPACE_ID"] + workspace_id = os.environ["TEST_WORKSPACE_ID"] - _ = a.workspace_assignment.update( + a.workspace_assignment.update( workspace_id=workspace_id, principal_id=spn_id, permissions=[iam.WorkspacePermission.USER], diff --git a/docs/account/provisioning/credentials.rst b/docs/account/provisioning/credentials.rst index d023d4f1f..e307588f1 100644 --- a/docs/account/provisioning/credentials.rst +++ b/docs/account/provisioning/credentials.rst @@ -24,15 +24,15 @@ a = AccountClient() - role = a.credentials.create( + creds = a.credentials.create( credentials_name=f"sdk-{time.time_ns()}", aws_credentials=provisioning.CreateCredentialAwsCredentials( - sts_role=provisioning.CreateCredentialStsRole(role_arn=os.environ["TEST_CROSSACCOUNT_ARN"]) + sts_role=provisioning.CreateCredentialStsRole(role_arn=os.environ["TEST_LOGDELIVERY_ARN"]) ), ) # cleanup - a.credentials.delete(credentials_id=role.credentials_id) + a.credentials.delete(credentials_id=creds.credentials_id) Create credential configuration. diff --git a/docs/account/provisioning/storage.rst b/docs/account/provisioning/storage.rst index b8e144f8c..010795885 100644 --- a/docs/account/provisioning/storage.rst +++ b/docs/account/provisioning/storage.rst @@ -16,7 +16,6 @@ .. code-block:: - import os import time from databricks.sdk import AccountClient @@ -24,13 +23,13 @@ a = AccountClient() - storage = a.storage.create( + bucket = a.storage.create( storage_configuration_name=f"sdk-{time.time_ns()}", - root_bucket_info=provisioning.RootBucketInfo(bucket_name=os.environ["TEST_ROOT_BUCKET"]), + root_bucket_info=provisioning.RootBucketInfo(bucket_name=f"sdk-{time.time_ns()}"), ) # cleanup - a.storage.delete(storage_configuration_id=storage.storage_configuration_id) + a.storage.delete(storage_configuration_id=bucket.storage_configuration_id) Create new storage configuration. diff --git a/docs/dbdataclasses/billing.rst b/docs/dbdataclasses/billing.rst index 590fd693e..cb89f4719 100644 --- a/docs/dbdataclasses/billing.rst +++ b/docs/dbdataclasses/billing.rst @@ -97,6 +97,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: CustomPolicyTag + :members: + :undoc-members: + .. autoclass:: DeleteBudgetConfigurationResponse :members: :undoc-members: diff --git a/docs/dbdataclasses/catalog.rst b/docs/dbdataclasses/catalog.rst index e302b781c..25d382f9c 100644 --- a/docs/dbdataclasses/catalog.rst +++ b/docs/dbdataclasses/catalog.rst @@ -130,6 +130,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: DELTASHARING_CATALOG :value: "DELTASHARING_CATALOG" + .. py:attribute:: FOREIGN_CATALOG + :value: "FOREIGN_CATALOG" + .. py:attribute:: MANAGED_CATALOG :value: "MANAGED_CATALOG" @@ -1023,6 +1026,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: APPLY_TAG :value: "APPLY_TAG" + .. py:attribute:: BROWSE + :value: "BROWSE" + .. py:attribute:: CREATE :value: "CREATE" @@ -1365,10 +1371,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: VIEW :value: "VIEW" -.. autoclass:: TagKeyValue - :members: - :undoc-members: - .. autoclass:: TemporaryCredentials :members: :undoc-members: @@ -1548,6 +1550,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: VolumeType + The type of the volume. An external volume is located in the specified external location. A managed volume is located in the default location which is specified by the parent schema, or the parent catalog, or the Metastore. [Learn more] + [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external + .. py:attribute:: EXTERNAL :value: "EXTERNAL" diff --git a/docs/dbdataclasses/cleanrooms.rst b/docs/dbdataclasses/cleanrooms.rst index 85ec98250..1983106d1 100644 --- a/docs/dbdataclasses/cleanrooms.rst +++ b/docs/dbdataclasses/cleanrooms.rst @@ -121,14 +121,211 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: PROVISIONING :value: "PROVISIONING" +.. py:class:: CleanRoomTaskRunLifeCycleState + + Copied from elastic-spark-common/api/messages/runs.proto. Using the original definition to remove coupling with jobs API definition + + .. py:attribute:: BLOCKED + :value: "BLOCKED" + + .. py:attribute:: INTERNAL_ERROR + :value: "INTERNAL_ERROR" + + .. py:attribute:: PENDING + :value: "PENDING" + + .. py:attribute:: QUEUED + :value: "QUEUED" + + .. py:attribute:: RUNNING + :value: "RUNNING" + + .. py:attribute:: RUN_LIFE_CYCLE_STATE_UNSPECIFIED + :value: "RUN_LIFE_CYCLE_STATE_UNSPECIFIED" + + .. py:attribute:: SKIPPED + :value: "SKIPPED" + + .. py:attribute:: TERMINATED + :value: "TERMINATED" + + .. py:attribute:: TERMINATING + :value: "TERMINATING" + + .. py:attribute:: WAITING_FOR_RETRY + :value: "WAITING_FOR_RETRY" + +.. py:class:: CleanRoomTaskRunResultState + + Copied from elastic-spark-common/api/messages/runs.proto. Using the original definition to avoid cyclic dependency. + + .. py:attribute:: CANCELED + :value: "CANCELED" + + .. py:attribute:: DISABLED + :value: "DISABLED" + + .. py:attribute:: EVICTED + :value: "EVICTED" + + .. py:attribute:: EXCLUDED + :value: "EXCLUDED" + + .. py:attribute:: FAILED + :value: "FAILED" + + .. py:attribute:: MAXIMUM_CONCURRENT_RUNS_REACHED + :value: "MAXIMUM_CONCURRENT_RUNS_REACHED" + + .. py:attribute:: RUN_RESULT_STATE_UNSPECIFIED + :value: "RUN_RESULT_STATE_UNSPECIFIED" + + .. py:attribute:: SUCCESS + :value: "SUCCESS" + + .. py:attribute:: SUCCESS_WITH_FAILURES + :value: "SUCCESS_WITH_FAILURES" + + .. py:attribute:: TIMEDOUT + :value: "TIMEDOUT" + + .. py:attribute:: UPSTREAM_CANCELED + :value: "UPSTREAM_CANCELED" + + .. py:attribute:: UPSTREAM_EVICTED + :value: "UPSTREAM_EVICTED" + + .. py:attribute:: UPSTREAM_FAILED + :value: "UPSTREAM_FAILED" + +.. autoclass:: CleanRoomTaskRunState + :members: + :undoc-members: + .. autoclass:: CollaboratorJobRunInfo :members: :undoc-members: +.. autoclass:: ColumnInfo + :members: + :undoc-members: + +.. autoclass:: ColumnMask + :members: + :undoc-members: + +.. py:class:: ColumnTypeName + + .. py:attribute:: ARRAY + :value: "ARRAY" + + .. py:attribute:: BINARY + :value: "BINARY" + + .. py:attribute:: BOOLEAN + :value: "BOOLEAN" + + .. py:attribute:: BYTE + :value: "BYTE" + + .. py:attribute:: CHAR + :value: "CHAR" + + .. py:attribute:: DATE + :value: "DATE" + + .. py:attribute:: DECIMAL + :value: "DECIMAL" + + .. py:attribute:: DOUBLE + :value: "DOUBLE" + + .. py:attribute:: FLOAT + :value: "FLOAT" + + .. py:attribute:: INT + :value: "INT" + + .. py:attribute:: INTERVAL + :value: "INTERVAL" + + .. py:attribute:: LONG + :value: "LONG" + + .. py:attribute:: MAP + :value: "MAP" + + .. py:attribute:: NULL + :value: "NULL" + + .. py:attribute:: SHORT + :value: "SHORT" + + .. py:attribute:: STRING + :value: "STRING" + + .. py:attribute:: STRUCT + :value: "STRUCT" + + .. py:attribute:: TABLE_TYPE + :value: "TABLE_TYPE" + + .. py:attribute:: TIMESTAMP + :value: "TIMESTAMP" + + .. py:attribute:: TIMESTAMP_NTZ + :value: "TIMESTAMP_NTZ" + + .. py:attribute:: USER_DEFINED_TYPE + :value: "USER_DEFINED_TYPE" + + .. py:attribute:: VARIANT + :value: "VARIANT" + .. autoclass:: ComplianceSecurityProfile :members: :undoc-members: +.. py:class:: ComplianceStandard + + Compliance stardard for SHIELD customers + + .. py:attribute:: CANADA_PROTECTED_B + :value: "CANADA_PROTECTED_B" + + .. py:attribute:: CYBER_ESSENTIAL_PLUS + :value: "CYBER_ESSENTIAL_PLUS" + + .. py:attribute:: FEDRAMP_HIGH + :value: "FEDRAMP_HIGH" + + .. py:attribute:: FEDRAMP_IL5 + :value: "FEDRAMP_IL5" + + .. py:attribute:: FEDRAMP_MODERATE + :value: "FEDRAMP_MODERATE" + + .. py:attribute:: HIPAA + :value: "HIPAA" + + .. py:attribute:: HITRUST + :value: "HITRUST" + + .. py:attribute:: IRAP_PROTECTED + :value: "IRAP_PROTECTED" + + .. py:attribute:: ISMAP + :value: "ISMAP" + + .. py:attribute:: ITAR_EAR + :value: "ITAR_EAR" + + .. py:attribute:: NONE + :value: "NONE" + + .. py:attribute:: PCI_DSS + :value: "PCI_DSS" + .. autoclass:: CreateCleanRoomOutputCatalogResponse :members: :undoc-members: @@ -141,6 +338,83 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: EgressNetworkPolicy + :members: + :undoc-members: + +.. autoclass:: EgressNetworkPolicyInternetAccessPolicy + :members: + :undoc-members: + +.. autoclass:: EgressNetworkPolicyInternetAccessPolicyInternetDestination + :members: + :undoc-members: + +.. py:class:: EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol + + The filtering protocol used by the DP. For private and public preview, SEG will only support TCP filtering (i.e. DNS based filtering, filtering by destination IP address), so protocol will be set to TCP by default and hidden from the user. In the future, users may be able to select HTTP filtering (i.e. SNI based filtering, filtering by FQDN). + + .. py:attribute:: TCP + :value: "TCP" + +.. py:class:: EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType + + .. py:attribute:: FQDN + :value: "FQDN" + +.. autoclass:: EgressNetworkPolicyInternetAccessPolicyLogOnlyMode + :members: + :undoc-members: + +.. py:class:: EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType + + .. py:attribute:: ALL_SERVICES + :value: "ALL_SERVICES" + + .. py:attribute:: SELECTED_SERVICES + :value: "SELECTED_SERVICES" + +.. py:class:: EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType + + The values should match the list of workloads used in networkconfig.proto + + .. py:attribute:: DBSQL + :value: "DBSQL" + + .. py:attribute:: ML_SERVING + :value: "ML_SERVING" + +.. py:class:: EgressNetworkPolicyInternetAccessPolicyRestrictionMode + + At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can only access explicitly allowed internet and storage destinations, as well as UC connections and external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via private link. + + .. py:attribute:: FULL_ACCESS + :value: "FULL_ACCESS" + + .. py:attribute:: PRIVATE_ACCESS_ONLY + :value: "PRIVATE_ACCESS_ONLY" + + .. py:attribute:: RESTRICTED_ACCESS + :value: "RESTRICTED_ACCESS" + +.. autoclass:: EgressNetworkPolicyInternetAccessPolicyStorageDestination + :members: + :undoc-members: + +.. py:class:: EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType + + .. py:attribute:: AWS_S3 + :value: "AWS_S3" + + .. py:attribute:: AZURE_STORAGE + :value: "AZURE_STORAGE" + + .. py:attribute:: CLOUDFLARE_R2 + :value: "CLOUDFLARE_R2" + + .. py:attribute:: GOOGLE_CLOUD_STORAGE + :value: "GOOGLE_CLOUD_STORAGE" + .. autoclass:: ListCleanRoomAssetsResponse :members: :undoc-members: @@ -153,6 +427,22 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: Partition + :members: + :undoc-members: + +.. autoclass:: PartitionValue + :members: + :undoc-members: + +.. py:class:: PartitionValueOp + + .. py:attribute:: EQUAL + :value: "EQUAL" + + .. py:attribute:: LIKE + :value: "LIKE" + .. autoclass:: UpdateCleanRoomRequest :members: :undoc-members: diff --git a/docs/dbdataclasses/compute.rst b/docs/dbdataclasses/compute.rst index 2424cf4cf..387c8e23c 100644 --- a/docs/dbdataclasses/compute.rst +++ b/docs/dbdataclasses/compute.rst @@ -299,10 +299,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: -.. autoclass:: CustomPolicyTag - :members: - :undoc-members: - .. autoclass:: DataPlaneEventDetails :members: :undoc-members: @@ -475,10 +471,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: -.. autoclass:: Environment - :members: - :undoc-members: - .. autoclass:: EventDetails :members: :undoc-members: diff --git a/docs/dbdataclasses/dashboards.rst b/docs/dbdataclasses/dashboards.rst index 776aac603..7997c1796 100644 --- a/docs/dbdataclasses/dashboards.rst +++ b/docs/dbdataclasses/dashboards.rst @@ -4,6 +4,10 @@ Dashboards These dataclasses are used in the SDK to represent API requests and responses for services in the ``databricks.sdk.service.dashboards`` module. .. py:currentmodule:: databricks.sdk.service.dashboards +.. autoclass:: BaseChunkInfo + :members: + :undoc-members: + .. autoclass:: CancelQueryExecutionResponse :members: :undoc-members: @@ -12,6 +16,71 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: ColumnInfo + :members: + :undoc-members: + +.. py:class:: ColumnInfoTypeName + + The name of the base data type. This doesn't include details for complex types such as STRUCT, MAP or ARRAY. + + .. py:attribute:: ARRAY + :value: "ARRAY" + + .. py:attribute:: BINARY + :value: "BINARY" + + .. py:attribute:: BOOLEAN + :value: "BOOLEAN" + + .. py:attribute:: BYTE + :value: "BYTE" + + .. py:attribute:: CHAR + :value: "CHAR" + + .. py:attribute:: DATE + :value: "DATE" + + .. py:attribute:: DECIMAL + :value: "DECIMAL" + + .. py:attribute:: DOUBLE + :value: "DOUBLE" + + .. py:attribute:: FLOAT + :value: "FLOAT" + + .. py:attribute:: INT + :value: "INT" + + .. py:attribute:: INTERVAL + :value: "INTERVAL" + + .. py:attribute:: LONG + :value: "LONG" + + .. py:attribute:: MAP + :value: "MAP" + + .. py:attribute:: NULL + :value: "NULL" + + .. py:attribute:: SHORT + :value: "SHORT" + + .. py:attribute:: STRING + :value: "STRING" + + .. py:attribute:: STRUCT + :value: "STRUCT" + + .. py:attribute:: TIMESTAMP + :value: "TIMESTAMP" + + .. py:attribute:: USER_DEFINED_TYPE + :value: "USER_DEFINED_TYPE" + .. autoclass:: CronSchedule :members: :undoc-members: @@ -45,6 +114,21 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: ExternalLink + :members: + :undoc-members: + +.. py:class:: Format + + .. py:attribute:: ARROW_STREAM + :value: "ARROW_STREAM" + + .. py:attribute:: CSV + :value: "CSV" + + .. py:attribute:: JSON_ARRAY + :value: "JSON_ARRAY" + .. autoclass:: GenieAttachment :members: :undoc-members: @@ -57,6 +141,14 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: GenieGenerateDownloadFullQueryResultResponse + :members: + :undoc-members: + +.. autoclass:: GenieGetDownloadFullQueryResultResponse + :members: + :undoc-members: + .. autoclass:: GenieGetMessageQueryResultResponse :members: :undoc-members: @@ -319,6 +411,18 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: ResultData + :members: + :undoc-members: + +.. autoclass:: ResultManifest + :members: + :undoc-members: + +.. autoclass:: ResultSchema + :members: + :undoc-members: + .. autoclass:: Schedule :members: :undoc-members: @@ -331,6 +435,84 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: UNPAUSED :value: "UNPAUSED" +.. autoclass:: ServiceError + :members: + :undoc-members: + +.. py:class:: ServiceErrorCode + + .. py:attribute:: ABORTED + :value: "ABORTED" + + .. py:attribute:: ALREADY_EXISTS + :value: "ALREADY_EXISTS" + + .. py:attribute:: BAD_REQUEST + :value: "BAD_REQUEST" + + .. py:attribute:: CANCELLED + :value: "CANCELLED" + + .. py:attribute:: DEADLINE_EXCEEDED + :value: "DEADLINE_EXCEEDED" + + .. py:attribute:: INTERNAL_ERROR + :value: "INTERNAL_ERROR" + + .. py:attribute:: IO_ERROR + :value: "IO_ERROR" + + .. py:attribute:: NOT_FOUND + :value: "NOT_FOUND" + + .. py:attribute:: RESOURCE_EXHAUSTED + :value: "RESOURCE_EXHAUSTED" + + .. py:attribute:: SERVICE_UNDER_MAINTENANCE + :value: "SERVICE_UNDER_MAINTENANCE" + + .. py:attribute:: TEMPORARILY_UNAVAILABLE + :value: "TEMPORARILY_UNAVAILABLE" + + .. py:attribute:: UNAUTHENTICATED + :value: "UNAUTHENTICATED" + + .. py:attribute:: UNKNOWN + :value: "UNKNOWN" + + .. py:attribute:: WORKSPACE_TEMPORARILY_UNAVAILABLE + :value: "WORKSPACE_TEMPORARILY_UNAVAILABLE" + +.. autoclass:: StatementResponse + :members: + :undoc-members: + +.. py:class:: StatementState + + Statement execution state: - `PENDING`: waiting for warehouse - `RUNNING`: running - `SUCCEEDED`: execution was successful, result data available for fetch - `FAILED`: execution failed; reason for failure described in accomanying error message - `CANCELED`: user canceled; can come from explicit cancel call, or timeout with `on_wait_timeout=CANCEL` - `CLOSED`: execution successful, and statement closed; result no longer available for fetch + + .. py:attribute:: CANCELED + :value: "CANCELED" + + .. py:attribute:: CLOSED + :value: "CLOSED" + + .. py:attribute:: FAILED + :value: "FAILED" + + .. py:attribute:: PENDING + :value: "PENDING" + + .. py:attribute:: RUNNING + :value: "RUNNING" + + .. py:attribute:: SUCCEEDED + :value: "SUCCEEDED" + +.. autoclass:: StatementStatus + :members: + :undoc-members: + .. autoclass:: Subscriber :members: :undoc-members: diff --git a/docs/dbdataclasses/jobs.rst b/docs/dbdataclasses/jobs.rst index fa5af4189..9b8b496f2 100644 --- a/docs/dbdataclasses/jobs.rst +++ b/docs/dbdataclasses/jobs.rst @@ -4,6 +4,49 @@ Jobs These dataclasses are used in the SDK to represent API requests and responses for services in the ``databricks.sdk.service.jobs`` module. .. py:currentmodule:: databricks.sdk.service.jobs +.. autoclass:: Adlsgen2Info + :members: + :undoc-members: + +.. autoclass:: AutoScale + :members: + :undoc-members: + +.. autoclass:: AwsAttributes + :members: + :undoc-members: + +.. py:class:: AwsAvailability + + Availability type used for all subsequent nodes past the `first_on_demand` ones. + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + + .. py:attribute:: ON_DEMAND + :value: "ON_DEMAND" + + .. py:attribute:: SPOT + :value: "SPOT" + + .. py:attribute:: SPOT_WITH_FALLBACK + :value: "SPOT_WITH_FALLBACK" + +.. autoclass:: AzureAttributes + :members: + :undoc-members: + +.. py:class:: AzureAvailability + + Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + + .. py:attribute:: ON_DEMAND_AZURE + :value: "ON_DEMAND_AZURE" + + .. py:attribute:: SPOT_AZURE + :value: "SPOT_AZURE" + + .. py:attribute:: SPOT_WITH_FALLBACK_AZURE + :value: "SPOT_WITH_FALLBACK_AZURE" + .. autoclass:: BaseJob :members: :undoc-members: @@ -117,10 +160,18 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: ClientsTypes + :members: + :undoc-members: + .. autoclass:: ClusterInstance :members: :undoc-members: +.. autoclass:: ClusterLogConf + :members: + :undoc-members: + .. autoclass:: ClusterSpec :members: :undoc-members: @@ -180,6 +231,48 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. py:class:: DataSecurityMode + + Data security mode decides what data governance model to use when accessing data from a cluster. + The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate access mode depending on your compute configuration. * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: Alias for `SINGLE_USER`. + The following modes can be used regardless of `kind`. * `NONE`: No security isolation for multiple users sharing the cluster. Data governance features are not available in this mode. * `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in `single_user_name`. Most programming languages, cluster features and data governance features are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other's data and credentials. Most data governance features are supported in this mode. But programming languages and cluster features might be limited. + The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for future Databricks Runtime versions: + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have UC nor passthrough enabled. + + .. py:attribute:: DATA_SECURITY_MODE_AUTO + :value: "DATA_SECURITY_MODE_AUTO" + + .. py:attribute:: DATA_SECURITY_MODE_DEDICATED + :value: "DATA_SECURITY_MODE_DEDICATED" + + .. py:attribute:: DATA_SECURITY_MODE_STANDARD + :value: "DATA_SECURITY_MODE_STANDARD" + + .. py:attribute:: LEGACY_PASSTHROUGH + :value: "LEGACY_PASSTHROUGH" + + .. py:attribute:: LEGACY_SINGLE_USER + :value: "LEGACY_SINGLE_USER" + + .. py:attribute:: LEGACY_SINGLE_USER_STANDARD + :value: "LEGACY_SINGLE_USER_STANDARD" + + .. py:attribute:: LEGACY_TABLE_ACL + :value: "LEGACY_TABLE_ACL" + + .. py:attribute:: NONE + :value: "NONE" + + .. py:attribute:: SINGLE_USER + :value: "SINGLE_USER" + + .. py:attribute:: USER_ISOLATION + :value: "USER_ISOLATION" + +.. autoclass:: DbfsStorageInfo + :members: + :undoc-members: + .. autoclass:: DbtOutput :members: :undoc-members: @@ -204,6 +297,24 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: DockerBasicAuth + :members: + :undoc-members: + +.. autoclass:: DockerImage + :members: + :undoc-members: + +.. py:class:: EbsVolumeType + + All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for details. + + .. py:attribute:: GENERAL_PURPOSE_SSD + :value: "GENERAL_PURPOSE_SSD" + + .. py:attribute:: THROUGHPUT_OPTIMIZED_HDD + :value: "THROUGHPUT_OPTIMIZED_HDD" + .. autoclass:: EnforcePolicyComplianceForJobResponseJobClusterSettingsChange :members: :undoc-members: @@ -216,6 +327,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: Environment + :members: + :undoc-members: + .. autoclass:: ExportRunOutput :members: :undoc-members: @@ -248,6 +363,27 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: SINGLE_TASK :value: "SINGLE_TASK" +.. autoclass:: GcpAttributes + :members: + :undoc-members: + +.. py:class:: GcpAvailability + + This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + + .. py:attribute:: ON_DEMAND_GCP + :value: "ON_DEMAND_GCP" + + .. py:attribute:: PREEMPTIBLE_GCP + :value: "PREEMPTIBLE_GCP" + + .. py:attribute:: PREEMPTIBLE_WITH_FALLBACK_GCP + :value: "PREEMPTIBLE_WITH_FALLBACK_GCP" + +.. autoclass:: GcsStorageInfo + :members: + :undoc-members: + .. autoclass:: GenAiComputeTask :members: :undoc-members: @@ -294,6 +430,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: InitScriptInfo + :members: + :undoc-members: + .. autoclass:: Job :members: :undoc-members: @@ -411,6 +551,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: NOT_SYNCED :value: "NOT_SYNCED" +.. autoclass:: JobsClusterSpec + :members: + :undoc-members: + .. py:class:: JobsHealthMetric Specifies the health metric that is being evaluated for a particular health rule. @@ -446,6 +590,21 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. py:class:: Kind + + The kind of compute described by this compute specification. + Depending on `kind`, different validations and default values will be applied. + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no specified `kind` do not. * [is_single_node](/api/workspace/clusters/create#is_single_node) * [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) * [data_security_mode](/api/workspace/clusters/create#data_security_mode) set to `DATA_SECURITY_MODE_AUTO`, `DATA_SECURITY_MODE_DEDICATED`, or `DATA_SECURITY_MODE_STANDARD` + By using the [simple form], your clusters are automatically using `kind = CLASSIC_PREVIEW`. + [simple form]: https://docs.databricks.com/compute/simple-form.html + + .. py:attribute:: CLASSIC_PREVIEW + :value: "CLASSIC_PREVIEW" + +.. autoclass:: Library + :members: + :undoc-members: + .. autoclass:: ListJobComplianceForPolicyResponse :members: :undoc-members: @@ -458,6 +617,18 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: LocalFileInfo + :members: + :undoc-members: + +.. autoclass:: LogAnalyticsInfo + :members: + :undoc-members: + +.. autoclass:: MavenLibrary + :members: + :undoc-members: + .. autoclass:: NotebookOutput :members: :undoc-members: @@ -514,6 +685,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: PythonPyPiLibrary + :members: + :undoc-members: + .. autoclass:: PythonWheelTask :members: :undoc-members: @@ -539,6 +714,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: RCranLibrary + :members: + :undoc-members: + .. autoclass:: RepairHistoryItem :members: :undoc-members: @@ -776,6 +955,21 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: WORKFLOW_RUN :value: "WORKFLOW_RUN" +.. py:class:: RuntimeEngine + + .. py:attribute:: NULL + :value: "NULL" + + .. py:attribute:: PHOTON + :value: "PHOTON" + + .. py:attribute:: STANDARD + :value: "STANDARD" + +.. autoclass:: S3StorageInfo + :members: + :undoc-members: + .. py:class:: Source Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. @@ -1075,6 +1269,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: DASHBOARDS :value: "DASHBOARDS" +.. autoclass:: VolumesStorageInfo + :members: + :undoc-members: + .. autoclass:: Webhook :members: :undoc-members: @@ -1082,3 +1280,11 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. autoclass:: WebhookNotifications :members: :undoc-members: + +.. autoclass:: WorkloadType + :members: + :undoc-members: + +.. autoclass:: WorkspaceStorageInfo + :members: + :undoc-members: diff --git a/docs/dbdataclasses/ml.rst b/docs/dbdataclasses/ml.rst index 860a4ffbc..6045bfea0 100644 --- a/docs/dbdataclasses/ml.rst +++ b/docs/dbdataclasses/ml.rst @@ -408,6 +408,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: LogOutputsRequest + :members: + :undoc-members: + .. autoclass:: LogParam :members: :undoc-members: @@ -428,6 +432,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: ModelInput + :members: + :undoc-members: + .. autoclass:: ModelTag :members: :undoc-members: diff --git a/docs/dbdataclasses/pipelines.rst b/docs/dbdataclasses/pipelines.rst index 903cb52ff..9d2d85a0e 100644 --- a/docs/dbdataclasses/pipelines.rst +++ b/docs/dbdataclasses/pipelines.rst @@ -4,6 +4,49 @@ Delta Live Tables These dataclasses are used in the SDK to represent API requests and responses for services in the ``databricks.sdk.service.pipelines`` module. .. py:currentmodule:: databricks.sdk.service.pipelines +.. autoclass:: Adlsgen2Info + :members: + :undoc-members: + +.. autoclass:: AwsAttributes + :members: + :undoc-members: + +.. py:class:: AwsAvailability + + Availability type used for all subsequent nodes past the `first_on_demand` ones. + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + + .. py:attribute:: ON_DEMAND + :value: "ON_DEMAND" + + .. py:attribute:: SPOT + :value: "SPOT" + + .. py:attribute:: SPOT_WITH_FALLBACK + :value: "SPOT_WITH_FALLBACK" + +.. autoclass:: AzureAttributes + :members: + :undoc-members: + +.. py:class:: AzureAvailability + + Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + + .. py:attribute:: ON_DEMAND_AZURE + :value: "ON_DEMAND_AZURE" + + .. py:attribute:: SPOT_AZURE + :value: "SPOT_AZURE" + + .. py:attribute:: SPOT_WITH_FALLBACK_AZURE + :value: "SPOT_WITH_FALLBACK_AZURE" + +.. autoclass:: ClusterLogConf + :members: + :undoc-members: + .. autoclass:: CreatePipeline :members: :undoc-members: @@ -45,6 +88,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: WEDNESDAY :value: "WEDNESDAY" +.. autoclass:: DbfsStorageInfo + :members: + :undoc-members: + .. autoclass:: DeletePipelineResponse :members: :undoc-members: @@ -56,6 +103,16 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: BUNDLE :value: "BUNDLE" +.. py:class:: EbsVolumeType + + All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for details. + + .. py:attribute:: GENERAL_PURPOSE_SSD + :value: "GENERAL_PURPOSE_SSD" + + .. py:attribute:: THROUGHPUT_OPTIMIZED_HDD + :value: "THROUGHPUT_OPTIMIZED_HDD" + .. autoclass:: EditPipeline :members: :undoc-members: @@ -84,6 +141,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: WARN :value: "WARN" +.. autoclass:: EventLogSpec + :members: + :undoc-members: + .. autoclass:: FileLibrary :members: :undoc-members: @@ -92,6 +153,27 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: GcpAttributes + :members: + :undoc-members: + +.. py:class:: GcpAvailability + + This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + + .. py:attribute:: ON_DEMAND_GCP + :value: "ON_DEMAND_GCP" + + .. py:attribute:: PREEMPTIBLE_GCP + :value: "PREEMPTIBLE_GCP" + + .. py:attribute:: PREEMPTIBLE_WITH_FALLBACK_GCP + :value: "PREEMPTIBLE_WITH_FALLBACK_GCP" + +.. autoclass:: GcsStorageInfo + :members: + :undoc-members: + .. autoclass:: GetPipelinePermissionLevelsResponse :members: :undoc-members: @@ -126,6 +208,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: InitScriptInfo + :members: + :undoc-members: + .. autoclass:: ListPipelineEventsResponse :members: :undoc-members: @@ -138,6 +224,14 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: LocalFileInfo + :members: + :undoc-members: + +.. autoclass:: LogAnalyticsInfo + :members: + :undoc-members: + .. autoclass:: ManualTrigger :members: :undoc-members: @@ -155,6 +249,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: STABLE :value: "STABLE" +.. autoclass:: MavenLibrary + :members: + :undoc-members: + .. autoclass:: NotebookLibrary :members: :undoc-members: @@ -302,6 +400,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: S3StorageInfo + :members: + :undoc-members: + .. autoclass:: SchemaSpec :members: :undoc-members: @@ -469,3 +571,11 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: WAITING_FOR_RESOURCES :value: "WAITING_FOR_RESOURCES" + +.. autoclass:: VolumesStorageInfo + :members: + :undoc-members: + +.. autoclass:: WorkspaceStorageInfo + :members: + :undoc-members: diff --git a/docs/dbdataclasses/serving.rst b/docs/dbdataclasses/serving.rst index 367f41b90..ed6c73ffb 100644 --- a/docs/dbdataclasses/serving.rst +++ b/docs/dbdataclasses/serving.rst @@ -406,6 +406,8 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServedModelInputWorkloadType + Please keep this in sync with with workload types in InferenceEndpointEntities.scala + .. py:attribute:: CPU :value: "CPU" @@ -512,6 +514,8 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ServingModelWorkloadType + Please keep this in sync with with workload types in InferenceEndpointEntities.scala + .. py:attribute:: CPU :value: "CPU" diff --git a/docs/dbdataclasses/settings.rst b/docs/dbdataclasses/settings.rst index 2325c4023..7582ab9df 100644 --- a/docs/dbdataclasses/settings.rst +++ b/docs/dbdataclasses/settings.rst @@ -298,83 +298,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: -.. autoclass:: EgressNetworkPolicy - :members: - :undoc-members: - -.. autoclass:: EgressNetworkPolicyInternetAccessPolicy - :members: - :undoc-members: - -.. autoclass:: EgressNetworkPolicyInternetAccessPolicyInternetDestination - :members: - :undoc-members: - -.. py:class:: EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol - - The filtering protocol used by the DP. For private and public preview, SEG will only support TCP filtering (i.e. DNS based filtering, filtering by destination IP address), so protocol will be set to TCP by default and hidden from the user. In the future, users may be able to select HTTP filtering (i.e. SNI based filtering, filtering by FQDN). - - .. py:attribute:: TCP - :value: "TCP" - -.. py:class:: EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType - - .. py:attribute:: FQDN - :value: "FQDN" - -.. autoclass:: EgressNetworkPolicyInternetAccessPolicyLogOnlyMode - :members: - :undoc-members: - -.. py:class:: EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType - - .. py:attribute:: ALL_SERVICES - :value: "ALL_SERVICES" - - .. py:attribute:: SELECTED_SERVICES - :value: "SELECTED_SERVICES" - -.. py:class:: EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType - - The values should match the list of workloads used in networkconfig.proto - - .. py:attribute:: DBSQL - :value: "DBSQL" - - .. py:attribute:: ML_SERVING - :value: "ML_SERVING" - -.. py:class:: EgressNetworkPolicyInternetAccessPolicyRestrictionMode - - At which level can Databricks and Databricks managed compute access Internet. FULL_ACCESS: Databricks can access Internet. No blocking rules will apply. RESTRICTED_ACCESS: Databricks can only access explicitly allowed internet and storage destinations, as well as UC connections and external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via private link. - - .. py:attribute:: FULL_ACCESS - :value: "FULL_ACCESS" - - .. py:attribute:: PRIVATE_ACCESS_ONLY - :value: "PRIVATE_ACCESS_ONLY" - - .. py:attribute:: RESTRICTED_ACCESS - :value: "RESTRICTED_ACCESS" - -.. autoclass:: EgressNetworkPolicyInternetAccessPolicyStorageDestination - :members: - :undoc-members: - -.. py:class:: EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType - - .. py:attribute:: AWS_S3 - :value: "AWS_S3" - - .. py:attribute:: AZURE_STORAGE - :value: "AZURE_STORAGE" - - .. py:attribute:: CLOUDFLARE_R2 - :value: "CLOUDFLARE_R2" - - .. py:attribute:: GOOGLE_CLOUD_STORAGE - :value: "GOOGLE_CLOUD_STORAGE" - .. autoclass:: EmailConfig :members: :undoc-members: @@ -669,6 +592,12 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: ARCLIGHT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY :value: "ARCLIGHT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY" + .. py:attribute:: ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN + :value: "ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN" + + .. py:attribute:: ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY + :value: "ARCLIGHT_MULTI_TENANT_AZURE_EXCHANGE_TOKEN_WITH_USER_DELEGATION_KEY" + .. py:attribute:: AZURE_ACTIVE_DIRECTORY_TOKEN :value: "AZURE_ACTIVE_DIRECTORY_TOKEN" diff --git a/docs/dbdataclasses/sharing.rst b/docs/dbdataclasses/sharing.rst index f72c59b21..9135a9f47 100644 --- a/docs/dbdataclasses/sharing.rst +++ b/docs/dbdataclasses/sharing.rst @@ -500,6 +500,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: VIEW :value: "VIEW" +.. autoclass:: TagKeyValue + :members: + :undoc-members: + .. autoclass:: UpdateProvider :members: :undoc-members: diff --git a/docs/dbdataclasses/sql.rst b/docs/dbdataclasses/sql.rst index c63fe7cd2..fe84a3b89 100644 --- a/docs/dbdataclasses/sql.rst +++ b/docs/dbdataclasses/sql.rst @@ -443,6 +443,14 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: ExternalQuerySource + :members: + :undoc-members: + +.. autoclass:: ExternalQuerySourceJobInfo + :members: + :undoc-members: + .. py:class:: Format .. py:attribute:: ARROW_STREAM @@ -1370,6 +1378,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: CAN_USE :value: "CAN_USE" + .. py:attribute:: CAN_VIEW + :value: "CAN_VIEW" + .. py:attribute:: IS_OWNER :value: "IS_OWNER" diff --git a/docs/workspace/catalog/catalogs.rst b/docs/workspace/catalog/catalogs.rst index 60959cad4..2505551cd 100644 --- a/docs/workspace/catalog/catalogs.rst +++ b/docs/workspace/catalog/catalogs.rst @@ -24,10 +24,10 @@ w = WorkspaceClient() - created = w.catalogs.create(name=f"sdk-{time.time_ns()}") + created_catalog = w.catalogs.create(name=f"sdk-{time.time_ns()}") # cleanup - w.catalogs.delete(name=created.name, force=True) + w.catalogs.delete(name=created_catalog.name, force=True) Create a catalog. diff --git a/docs/workspace/catalog/external_locations.rst b/docs/workspace/catalog/external_locations.rst index 980467306..5828bf245 100644 --- a/docs/workspace/catalog/external_locations.rst +++ b/docs/workspace/catalog/external_locations.rst @@ -30,22 +30,20 @@ w = WorkspaceClient() - storage_credential = w.storage_credentials.create( + credential = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), - comment="created via SDK", ) - external_location = w.external_locations.create( + created = w.external_locations.create( name=f"sdk-{time.time_ns()}", - credential_name=storage_credential.name, - comment="created via SDK", - url="s3://" + os.environ["TEST_BUCKET"] + "/" + f"sdk-{time.time_ns()}", + credential_name=credential.name, + url="s3://%s/%s" % (os.environ["TEST_BUCKET"], f"sdk-{time.time_ns()}"), ) # cleanup - w.storage_credentials.delete(name=storage_credential.name) - w.external_locations.delete(name=external_location.name) + w.storage_credentials.delete(name=credential.name) + w.external_locations.delete(name=created.name) Create an external location. @@ -109,20 +107,20 @@ credential = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", - aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), + aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), ) created = w.external_locations.create( name=f"sdk-{time.time_ns()}", credential_name=credential.name, - url=f's3://{os.environ["TEST_BUCKET"]}/sdk-{time.time_ns()}', + url="s3://%s/%s" % (os.environ["TEST_BUCKET"], f"sdk-{time.time_ns()}"), ) - _ = w.external_locations.get(get=created.name) + _ = w.external_locations.get(name=created.name) # cleanup - w.storage_credentials.delete(delete=credential.name) - w.external_locations.delete(delete=created.name) + w.storage_credentials.delete(name=credential.name) + w.external_locations.delete(name=created.name) Get an external location. @@ -146,11 +144,10 @@ .. code-block:: from databricks.sdk import WorkspaceClient - from databricks.sdk.service import catalog w = WorkspaceClient() - all = w.external_locations.list(catalog.ListExternalLocationsRequest()) + all = w.external_locations.list() List external locations. diff --git a/docs/workspace/catalog/storage_credentials.rst b/docs/workspace/catalog/storage_credentials.rst index ea2aece71..9a5ed0a46 100644 --- a/docs/workspace/catalog/storage_credentials.rst +++ b/docs/workspace/catalog/storage_credentials.rst @@ -30,13 +30,13 @@ w = WorkspaceClient() - created = w.storage_credentials.create( + credential = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", - aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), + aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), ) # cleanup - w.storage_credentials.delete(delete=created.name) + w.storage_credentials.delete(name=credential.name) Create a storage credential. @@ -96,13 +96,13 @@ created = w.storage_credentials.create( name=f"sdk-{time.time_ns()}", - aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), + aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), ) - by_name = w.storage_credentials.get(name=created.name) + by_name = w.storage_credentials.get(get=created.name) # cleanup - w.storage_credentials.delete(name=created.name) + w.storage_credentials.delete(delete=created.name) Get a credential. @@ -123,10 +123,11 @@ .. code-block:: from databricks.sdk import WorkspaceClient + from databricks.sdk.service import catalog w = WorkspaceClient() - all = w.storage_credentials.list() + all = w.storage_credentials.list(catalog.ListStorageCredentialsRequest()) List credentials. diff --git a/docs/workspace/catalog/volumes.rst b/docs/workspace/catalog/volumes.rst index 700659cc5..5b6662f48 100644 --- a/docs/workspace/catalog/volumes.rst +++ b/docs/workspace/catalog/volumes.rst @@ -83,6 +83,11 @@ :param name: str The name of the volume :param volume_type: :class:`VolumeType` + The type of the volume. An external volume is located in the specified external location. A managed + volume is located in the default location which is specified by the parent schema, or the parent + catalog, or the Metastore. [Learn more] + + [Learn more]: https://docs.databricks.com/aws/en/volumes/managed-vs-external :param comment: str (optional) The comment attached to the volume :param storage_location: str (optional) diff --git a/docs/workspace/compute/clusters.rst b/docs/workspace/compute/clusters.rst index e4423bc98..ca496d3a0 100644 --- a/docs/workspace/compute/clusters.rst +++ b/docs/workspace/compute/clusters.rst @@ -713,11 +713,10 @@ .. code-block:: from databricks.sdk import WorkspaceClient - from databricks.sdk.service import compute w = WorkspaceClient() - all = w.clusters.list(compute.ListClustersRequest()) + nodes = w.clusters.list_node_types() List clusters. diff --git a/docs/workspace/dashboards/genie.rst b/docs/workspace/dashboards/genie.rst index eb92d299f..360517812 100644 --- a/docs/workspace/dashboards/genie.rst +++ b/docs/workspace/dashboards/genie.rst @@ -66,6 +66,57 @@ :returns: :class:`GenieGetMessageQueryResultResponse` + .. py:method:: generate_download_full_query_result(space_id: str, conversation_id: str, message_id: str, attachment_id: str) -> GenieGenerateDownloadFullQueryResultResponse + + Generate full query result download. + + Initiate full SQL query result download and obtain a transient ID for tracking the download progress. + This call initiates a new SQL execution to generate the query result. The result is stored in an + external link can be retrieved using the [Get Download Full Query + Result](:method:genie/getdownloadfullqueryresult) API. Warning: Databricks strongly recommends that + you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition. See [Execute + Statement](:method:statementexecution/executestatement) for more details. + + :param space_id: str + Space ID + :param conversation_id: str + Conversation ID + :param message_id: str + Message ID + :param attachment_id: str + Attachment ID + + :returns: :class:`GenieGenerateDownloadFullQueryResultResponse` + + + .. py:method:: get_download_full_query_result(space_id: str, conversation_id: str, message_id: str, attachment_id: str, transient_statement_id: str) -> GenieGetDownloadFullQueryResultResponse + + Get download full query result status. + + Poll download progress and retrieve the SQL query result external link(s) upon completion. Warning: + Databricks strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` + disposition. When you use the `EXTERNAL_LINKS` disposition, a short-lived, presigned URL is generated, + which can be used to download the results directly from Amazon S3. As a short-lived access credential + is embedded in this presigned URL, you should protect the URL. Because presigned URLs are already + generated with embedded temporary access credentials, you must not set an Authorization header in the + download requests. See [Execute Statement](:method:statementexecution/executestatement) for more + details. + + :param space_id: str + Space ID + :param conversation_id: str + Conversation ID + :param message_id: str + Message ID + :param attachment_id: str + Attachment ID + :param transient_statement_id: str + Transient Statement ID. This ID is provided by the [Start Download + endpoint](:method:genie/startdownloadfullqueryresult) + + :returns: :class:`GenieGetDownloadFullQueryResultResponse` + + .. py:method:: get_message(space_id: str, conversation_id: str, message_id: str) -> GenieMessage Get conversation message. diff --git a/docs/workspace/iam/current_user.rst b/docs/workspace/iam/current_user.rst index 1df3adf9f..bf739025c 100644 --- a/docs/workspace/iam/current_user.rst +++ b/docs/workspace/iam/current_user.rst @@ -17,7 +17,7 @@ w = WorkspaceClient() - me2 = w.current_user.me() + me = w.current_user.me() Get current user info. diff --git a/docs/workspace/iam/groups.rst b/docs/workspace/iam/groups.rst index 0b62b675a..fe0187cd6 100644 --- a/docs/workspace/iam/groups.rst +++ b/docs/workspace/iam/groups.rst @@ -71,6 +71,9 @@ group = w.groups.create(display_name=f"sdk-{time.time_ns()}") w.groups.delete(id=group.id) + + # cleanup + w.groups.delete(id=group.id) Delete a group. diff --git a/docs/workspace/iam/permissions.rst b/docs/workspace/iam/permissions.rst index 8d504eb37..6cd5b269b 100644 --- a/docs/workspace/iam/permissions.rst +++ b/docs/workspace/iam/permissions.rst @@ -71,7 +71,7 @@ obj = w.workspace.get_status(path=notebook_path) - levels = w.permissions.get_permission_levels(request_object_type="notebooks", request_object_id="%d" % (obj.object_id)) + _ = w.permissions.get(request_object_type="notebooks", request_object_id="%d" % (obj.object_id)) Get object permissions. diff --git a/docs/workspace/jobs/jobs.rst b/docs/workspace/jobs/jobs.rst index 923b05901..184ff9bd9 100644 --- a/docs/workspace/jobs/jobs.rst +++ b/docs/workspace/jobs/jobs.rst @@ -362,21 +362,23 @@ w.clusters.ensure_cluster_is_running(os.environ["DATABRICKS_CLUSTER_ID"]) and os.environ["DATABRICKS_CLUSTER_ID"] ) - run = w.jobs.submit( - run_name=f"sdk-{time.time_ns()}", + created_job = w.jobs.create( + name=f"sdk-{time.time_ns()}", tasks=[ - jobs.SubmitTask( + jobs.Task( + description="test", existing_cluster_id=cluster_id, notebook_task=jobs.NotebookTask(notebook_path=notebook_path), - task_key=f"sdk-{time.time_ns()}", + task_key="test", + timeout_seconds=0, ) ], - ).result() + ) - output = w.jobs.get_run_output(run_id=run.tasks[0].run_id) + by_id = w.jobs.get(job_id=created_job.job_id) # cleanup - w.jobs.delete_run(run_id=run.run_id) + w.jobs.delete(job_id=created_job.job_id) Get a single job. diff --git a/docs/workspace/ml/experiments.rst b/docs/workspace/ml/experiments.rst index a8863edcd..33d366301 100644 --- a/docs/workspace/ml/experiments.rst +++ b/docs/workspace/ml/experiments.rst @@ -280,10 +280,11 @@ API](/api/workspace/files/listdirectorycontents). :param page_token: str (optional) - Token indicating the page of artifact results to fetch. `page_token` is not supported when listing - artifacts in UC Volumes. A maximum of 1000 artifacts will be retrieved for UC Volumes. Please call - `/api/2.0/fs/directories{directory_path}` for listing artifacts in UC Volumes, which supports - pagination. See [List directory contents | Files API](/api/workspace/files/listdirectorycontents). + The token indicating the page of artifact results to fetch. `page_token` is not supported when + listing artifacts in UC Volumes. A maximum of 1000 artifacts will be retrieved for UC Volumes. + Please call `/api/2.0/fs/directories{directory_path}` for listing artifacts in UC Volumes, which + supports pagination. See [List directory contents | Files + API](/api/workspace/files/listdirectorycontents). :param path: str (optional) Filter artifacts matching this path (a relative path from the root artifact directory). :param run_id: str (optional) @@ -385,7 +386,7 @@ - .. py:method:: log_inputs(run_id: str [, datasets: Optional[List[DatasetInput]]]) + .. py:method:: log_inputs(run_id: str [, datasets: Optional[List[DatasetInput]], models: Optional[List[ModelInput]]]) Log inputs to a run. @@ -397,11 +398,13 @@ ID of the run to log under :param datasets: List[:class:`DatasetInput`] (optional) Dataset inputs + :param models: List[:class:`ModelInput`] (optional) + Model inputs - .. py:method:: log_metric(key: str, value: float, timestamp: int [, run_id: Optional[str], run_uuid: Optional[str], step: Optional[int]]) + .. py:method:: log_metric(key: str, value: float, timestamp: int [, dataset_digest: Optional[str], dataset_name: Optional[str], model_id: Optional[str], run_id: Optional[str], run_uuid: Optional[str], step: Optional[int]]) Log a metric for a run. @@ -415,6 +418,14 @@ Double value of the metric being logged. :param timestamp: int Unix timestamp in milliseconds at the time metric was logged. + :param dataset_digest: str (optional) + Dataset digest of the dataset associated with the metric, e.g. an md5 hash of the dataset that + uniquely identifies it within datasets of the same name. + :param dataset_name: str (optional) + The name of the dataset associated with the metric. E.g. “my.uc.table@2” “nyc-taxi-dataset”, + “fantastic-elk-3” + :param model_id: str (optional) + ID of the logged model associated with the metric, if applicable :param run_id: str (optional) ID of the run under which to log the metric. Must be provided. :param run_uuid: str (optional) diff --git a/docs/workspace/ml/forecasting.rst b/docs/workspace/ml/forecasting.rst index bb667b3fc..a8f5d2899 100644 --- a/docs/workspace/ml/forecasting.rst +++ b/docs/workspace/ml/forecasting.rst @@ -13,49 +13,45 @@ Creates a serverless forecasting experiment. Returns the experiment ID. :param train_data_path: str - The three-level (fully qualified) name of a unity catalog table. This table serves as the training - data for the forecasting model. + The fully qualified name of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, + used as training data for the forecasting model. :param target_column: str - Name of the column in the input training table that serves as the prediction target. The values in - this column will be used as the ground truth for model training. + The column in the input training table used as the prediction target for model training. The values + in this column are used as the ground truth for model training. :param time_column: str - Name of the column in the input training table that represents the timestamp of each row. + The column in the input training table that represents each row's timestamp. :param forecast_granularity: str - The granularity of the forecast. This defines the time interval between consecutive rows in the time - series data. Possible values: '1 second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 - minutes', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'. + The time interval between consecutive rows in the time series data. Possible values include: '1 + second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 minutes', 'Hourly', 'Daily', + 'Weekly', 'Monthly', 'Quarterly', 'Yearly'. :param forecast_horizon: int - The number of time steps into the future for which predictions should be made. This value represents - a multiple of forecast_granularity determining how far ahead the model will forecast. + The number of time steps into the future to make predictions, calculated as a multiple of + forecast_granularity. This value represents how far ahead the model should forecast. :param custom_weights_column: str (optional) - Name of the column in the input training table used to customize the weight for each time series to - calculate weighted metrics. + The column in the training table used to customize weights for each time series. :param experiment_path: str (optional) - The path to the created experiment. This is the path where the experiment will be stored in the - workspace. + The path in the workspace to store the created experiment. :param holiday_regions: List[str] (optional) - Region code(s) to consider when automatically adding holiday features. When empty, no holiday - features are added. Only supports 1 holiday region for now. + The region code(s) to automatically add holiday features. Currently supports only one region. :param max_runtime: int (optional) - The maximum duration in minutes for which the experiment is allowed to run. If the experiment - exceeds this time limit it will be stopped automatically. + The maximum duration for the experiment in minutes. The experiment stops automatically if it exceeds + this limit. :param prediction_data_path: str (optional) - The three-level (fully qualified) path to a unity catalog table. This table path serves to store the - predictions. + The fully qualified path of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, + used to store predictions. :param primary_metric: str (optional) The evaluation metric used to optimize the forecasting model. :param register_to: str (optional) - The three-level (fully qualified) path to a unity catalog model. This model path serves to store the - best model. + The fully qualified path of a Unity Catalog model, formatted as catalog_name.schema_name.model_name, + used to store the best model. :param split_column: str (optional) - Name of the column in the input training table used for custom data splits. The values in this - column must be "train", "validate", or "test" to indicate which split each row belongs to. + // The column in the training table used for custom data splits. Values must be 'train', 'validate', + or 'test'. :param timeseries_identifier_columns: List[str] (optional) - Name of the column in the input training table used to group the dataset to predict individual time - series + The column in the training table used to group the dataset for predicting individual time series. :param training_frameworks: List[str] (optional) - The list of frameworks to include for model tuning. Possible values: 'Prophet', 'ARIMA', 'DeepAR'. - An empty list will include all supported frameworks. + List of frameworks to include for model tuning. Possible values are 'Prophet', 'ARIMA', 'DeepAR'. An + empty list includes all supported frameworks. :returns: Long-running operation waiter for :class:`ForecastingExperiment`. diff --git a/docs/workspace/ml/model_registry.rst b/docs/workspace/ml/model_registry.rst index 0f6b49ac8..b56fba95f 100644 --- a/docs/workspace/ml/model_registry.rst +++ b/docs/workspace/ml/model_registry.rst @@ -94,7 +94,7 @@ w = WorkspaceClient() - model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}") + created = w.model_registry.create_model(name=f"sdk-{time.time_ns()}") Create a model. @@ -127,7 +127,7 @@ model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}") - mv = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp") + created = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp") Create a model version. @@ -773,14 +773,13 @@ w = WorkspaceClient() - model = w.model_registry.create_model(name=f"sdk-{time.time_ns()}") + created = w.model_registry.create_model(name=f"sdk-{time.time_ns()}") - created = w.model_registry.create_model_version(name=model.registered_model.name, source="dbfs:/tmp") + model = w.model_registry.get_model(name=created.registered_model.name) - w.model_registry.update_model_version( + w.model_registry.update_model( + name=model.registered_model_databricks.name, description=f"sdk-{time.time_ns()}", - name=created.model_version.name, - version=created.model_version.version, ) Update model. diff --git a/docs/workspace/pipelines/pipelines.rst b/docs/workspace/pipelines/pipelines.rst index 935724d82..71f0cdff4 100644 --- a/docs/workspace/pipelines/pipelines.rst +++ b/docs/workspace/pipelines/pipelines.rst @@ -15,7 +15,7 @@ also enforce data quality with Delta Live Tables expectations. Expectations allow you to define expected data quality and specify how to handle records that fail those expectations. - .. py:method:: create( [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], dry_run: Optional[bool], edition: Optional[str], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) -> CreatePipelineResponse + .. py:method:: create( [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], dry_run: Optional[bool], edition: Optional[str], event_log: Optional[EventLogSpec], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) -> CreatePipelineResponse Usage: @@ -79,6 +79,8 @@ :param dry_run: bool (optional) :param edition: str (optional) Pipeline product edition. + :param event_log: :class:`EventLogSpec` (optional) + Event log configuration for this pipeline :param filters: :class:`Filters` (optional) Filters on which Pipeline packages to include in the deployed graph. :param gateway_definition: :class:`IngestionGatewayPipelineDefinition` (optional) @@ -394,7 +396,7 @@ .. py:method:: stop_and_wait(pipeline_id: str, timeout: datetime.timedelta = 0:20:00) -> GetPipelineResponse - .. py:method:: update(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) + .. py:method:: update(pipeline_id: str [, allow_duplicate_names: Optional[bool], budget_policy_id: Optional[str], catalog: Optional[str], channel: Optional[str], clusters: Optional[List[PipelineCluster]], configuration: Optional[Dict[str, str]], continuous: Optional[bool], deployment: Optional[PipelineDeployment], development: Optional[bool], edition: Optional[str], event_log: Optional[EventLogSpec], expected_last_modified: Optional[int], filters: Optional[Filters], gateway_definition: Optional[IngestionGatewayPipelineDefinition], id: Optional[str], ingestion_definition: Optional[IngestionPipelineDefinition], libraries: Optional[List[PipelineLibrary]], name: Optional[str], notifications: Optional[List[Notifications]], photon: Optional[bool], restart_window: Optional[RestartWindow], run_as: Optional[RunAs], schema: Optional[str], serverless: Optional[bool], storage: Optional[str], target: Optional[str], trigger: Optional[PipelineTrigger]]) Usage: @@ -474,6 +476,8 @@ Whether the pipeline is in Development mode. Defaults to false. :param edition: str (optional) Pipeline product edition. + :param event_log: :class:`EventLogSpec` (optional) + Event log configuration for this pipeline :param expected_last_modified: int (optional) If present, the last-modified time of the pipeline settings before the edit. If the settings were modified after that time, then the request will fail with a conflict. diff --git a/docs/workspace/sharing/providers.rst b/docs/workspace/sharing/providers.rst index 263545400..d78dd62a0 100644 --- a/docs/workspace/sharing/providers.rst +++ b/docs/workspace/sharing/providers.rst @@ -108,12 +108,25 @@ .. code-block:: + import time + from databricks.sdk import WorkspaceClient - from databricks.sdk.service import sharing w = WorkspaceClient() - all = w.providers.list(sharing.ListProvidersRequest()) + public_share_recipient = """{ + "shareCredentialsVersion":1, + "bearerToken":"dapiabcdefghijklmonpqrstuvwxyz", + "endpoint":"https://sharing.delta.io/delta-sharing/" + } + """ + + created = w.providers.create(name=f"sdk-{time.time_ns()}", recipient_profile_str=public_share_recipient) + + shares = w.providers.list_shares(name=created.name) + + # cleanup + w.providers.delete(name=created.name) List providers. diff --git a/docs/workspace/sql/queries.rst b/docs/workspace/sql/queries.rst index 4cc9b5b52..fe5442485 100644 --- a/docs/workspace/sql/queries.rst +++ b/docs/workspace/sql/queries.rst @@ -29,7 +29,7 @@ display_name=f"sdk-{time.time_ns()}", warehouse_id=srcs[0].warehouse_id, description="test query from Go SDK", - query_text="SHOW TABLES", + query_text="SELECT 1", ) ) diff --git a/docs/workspace/workspace/workspace.rst b/docs/workspace/workspace/workspace.rst index 3eae91432..abfc30860 100644 --- a/docs/workspace/workspace/workspace.rst +++ b/docs/workspace/workspace/workspace.rst @@ -188,7 +188,7 @@ content=base64.b64encode(("CREATE LIVE TABLE dlt_sample AS SELECT 1").encode()).decode(), format=workspace.ImportFormat.SOURCE, language=workspace.Language.SQL, - overwrite=True, + overwrite=true_, path=notebook_path, ) From 52fe6b9c2742ebbb9918f587ab68ce7e09c2d266 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 09:54:41 +0000 Subject: [PATCH 02/20] add inits --- databricks/sdk/apps/__init__.py | 0 databricks/sdk/apps/v2/__init__.py | 0 databricks/sdk/billing/__init__.py | 0 databricks/sdk/billing/v2/__init__.py | 0 databricks/sdk/catalog/__init__.py | 0 databricks/sdk/catalog/v2/__init__.py | 0 databricks/sdk/cleanrooms/__init__.py | 0 databricks/sdk/cleanrooms/v2/__init__.py | 0 databricks/sdk/compute/__init__.py | 0 databricks/sdk/compute/v2/__init__.py | 0 databricks/sdk/dashboards/__init__.py | 0 databricks/sdk/dashboards/v2/__init__.py | 0 databricks/sdk/files/__init__.py | 0 databricks/sdk/files/v2/__init__.py | 0 databricks/sdk/iam/__init__.py | 0 databricks/sdk/iam/v2/__init__.py | 0 databricks/sdk/jobs/__init__.py | 0 databricks/sdk/jobs/v2/__init__.py | 0 databricks/sdk/marketplace/__init__.py | 0 databricks/sdk/marketplace/v2/__init__.py | 0 databricks/sdk/ml/__init__.py | 0 databricks/sdk/ml/v2/__init__.py | 0 databricks/sdk/oauth2/__init__.py | 0 databricks/sdk/oauth2/v2/__init__.py | 0 databricks/sdk/pipelines/__init__.py | 0 databricks/sdk/pipelines/v2/__init__.py | 0 databricks/sdk/provisioning/__init__.py | 0 databricks/sdk/provisioning/v2/__init__.py | 0 databricks/sdk/serving/__init__.py | 0 databricks/sdk/serving/v2/__init__.py | 0 databricks/sdk/settings/__init__.py | 0 databricks/sdk/settings/v2/__init__.py | 0 databricks/sdk/sharing/__init__.py | 0 databricks/sdk/sharing/v2/__init__.py | 0 databricks/sdk/sql/__init__.py | 0 databricks/sdk/sql/v2/__init__.py | 0 databricks/sdk/vectorsearch/__init__.py | 0 databricks/sdk/vectorsearch/v2/__init__.py | 0 databricks/sdk/workspace/__init__.py | 0 databricks/sdk/workspace/v2/__init__.py | 0 40 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 databricks/sdk/apps/__init__.py create mode 100644 databricks/sdk/apps/v2/__init__.py create mode 100644 databricks/sdk/billing/__init__.py create mode 100644 databricks/sdk/billing/v2/__init__.py create mode 100644 databricks/sdk/catalog/__init__.py create mode 100644 databricks/sdk/catalog/v2/__init__.py create mode 100644 databricks/sdk/cleanrooms/__init__.py create mode 100644 databricks/sdk/cleanrooms/v2/__init__.py create mode 100644 databricks/sdk/compute/__init__.py create mode 100644 databricks/sdk/compute/v2/__init__.py create mode 100644 databricks/sdk/dashboards/__init__.py create mode 100644 databricks/sdk/dashboards/v2/__init__.py create mode 100644 databricks/sdk/files/__init__.py create mode 100644 databricks/sdk/files/v2/__init__.py create mode 100644 databricks/sdk/iam/__init__.py create mode 100644 databricks/sdk/iam/v2/__init__.py create mode 100644 databricks/sdk/jobs/__init__.py create mode 100644 databricks/sdk/jobs/v2/__init__.py create mode 100644 databricks/sdk/marketplace/__init__.py create mode 100644 databricks/sdk/marketplace/v2/__init__.py create mode 100644 databricks/sdk/ml/__init__.py create mode 100644 databricks/sdk/ml/v2/__init__.py create mode 100644 databricks/sdk/oauth2/__init__.py create mode 100644 databricks/sdk/oauth2/v2/__init__.py create mode 100644 databricks/sdk/pipelines/__init__.py create mode 100644 databricks/sdk/pipelines/v2/__init__.py create mode 100644 databricks/sdk/provisioning/__init__.py create mode 100644 databricks/sdk/provisioning/v2/__init__.py create mode 100644 databricks/sdk/serving/__init__.py create mode 100644 databricks/sdk/serving/v2/__init__.py create mode 100644 databricks/sdk/settings/__init__.py create mode 100644 databricks/sdk/settings/v2/__init__.py create mode 100644 databricks/sdk/sharing/__init__.py create mode 100644 databricks/sdk/sharing/v2/__init__.py create mode 100644 databricks/sdk/sql/__init__.py create mode 100644 databricks/sdk/sql/v2/__init__.py create mode 100644 databricks/sdk/vectorsearch/__init__.py create mode 100644 databricks/sdk/vectorsearch/v2/__init__.py create mode 100644 databricks/sdk/workspace/__init__.py create mode 100644 databricks/sdk/workspace/v2/__init__.py diff --git a/databricks/sdk/apps/__init__.py b/databricks/sdk/apps/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/apps/v2/__init__.py b/databricks/sdk/apps/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/billing/__init__.py b/databricks/sdk/billing/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/billing/v2/__init__.py b/databricks/sdk/billing/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/catalog/__init__.py b/databricks/sdk/catalog/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/catalog/v2/__init__.py b/databricks/sdk/catalog/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/cleanrooms/__init__.py b/databricks/sdk/cleanrooms/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/cleanrooms/v2/__init__.py b/databricks/sdk/cleanrooms/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/compute/__init__.py b/databricks/sdk/compute/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/compute/v2/__init__.py b/databricks/sdk/compute/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/dashboards/__init__.py b/databricks/sdk/dashboards/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/dashboards/v2/__init__.py b/databricks/sdk/dashboards/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/files/__init__.py b/databricks/sdk/files/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/files/v2/__init__.py b/databricks/sdk/files/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/iam/__init__.py b/databricks/sdk/iam/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/iam/v2/__init__.py b/databricks/sdk/iam/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/jobs/__init__.py b/databricks/sdk/jobs/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/jobs/v2/__init__.py b/databricks/sdk/jobs/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/marketplace/__init__.py b/databricks/sdk/marketplace/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/marketplace/v2/__init__.py b/databricks/sdk/marketplace/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/ml/__init__.py b/databricks/sdk/ml/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/ml/v2/__init__.py b/databricks/sdk/ml/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/oauth2/__init__.py b/databricks/sdk/oauth2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/oauth2/v2/__init__.py b/databricks/sdk/oauth2/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/pipelines/__init__.py b/databricks/sdk/pipelines/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/pipelines/v2/__init__.py b/databricks/sdk/pipelines/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/provisioning/__init__.py b/databricks/sdk/provisioning/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/provisioning/v2/__init__.py b/databricks/sdk/provisioning/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/serving/__init__.py b/databricks/sdk/serving/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/serving/v2/__init__.py b/databricks/sdk/serving/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/settings/__init__.py b/databricks/sdk/settings/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/settings/v2/__init__.py b/databricks/sdk/settings/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/sharing/__init__.py b/databricks/sdk/sharing/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/sharing/v2/__init__.py b/databricks/sdk/sharing/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/sql/__init__.py b/databricks/sdk/sql/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/sql/v2/__init__.py b/databricks/sdk/sql/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/vectorsearch/__init__.py b/databricks/sdk/vectorsearch/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/vectorsearch/v2/__init__.py b/databricks/sdk/vectorsearch/v2/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/workspace/__init__.py b/databricks/sdk/workspace/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/databricks/sdk/workspace/v2/__init__.py b/databricks/sdk/workspace/v2/__init__.py new file mode 100644 index 000000000..e69de29bb From 2c215c864c6f3ef43e12736801d26fc8ae184239 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 10:33:33 +0000 Subject: [PATCH 03/20] update --- .../sdk/{service/apps.py => apps/v2/impl.py} | 647 +- .../billing.py => billing/v2/impl.py} | 700 +- .../catalog.py => catalog/v2/impl.py} | 5632 ++++++++--------- .../cleanrooms.py => cleanrooms/v2/impl.py} | 724 +-- .../compute.py => compute/v2/impl.py} | 4705 +++++++------- .../dashboards.py => dashboards/v2/impl.py} | 1210 ++-- .../{service/files.py => files/v2/impl.py} | 300 +- .../sdk/{service/iam.py => iam/v2/impl.py} | 1441 ++--- .../sdk/{service/jobs.py => jobs/v2/impl.py} | 4518 +++++++------ .../marketplace.py => marketplace/v2/impl.py} | 1938 +++--- .../sdk/{service/ml.py => ml/v2/impl.py} | 2919 +++++---- .../{service/oauth2.py => oauth2/v2/impl.py} | 660 +- .../pipelines.py => pipelines/v2/impl.py} | 2157 +++---- .../v2/impl.py} | 1211 ++-- .../serving.py => serving/v2/impl.py} | 2058 +++--- .../settings.py => settings/v2/impl.py} | 2133 +++---- .../sharing.py => sharing/v2/impl.py} | 1452 ++--- .../sdk/{service/sql.py => sql/v2/impl.py} | 4257 ++++++------- .../v2/impl.py} | 766 ++- .../workspace.py => workspace/v2/impl.py} | 1044 +-- 20 files changed, 19887 insertions(+), 20585 deletions(-) rename databricks/sdk/{service/apps.py => apps/v2/impl.py} (64%) rename databricks/sdk/{service/billing.py => billing/v2/impl.py} (78%) rename databricks/sdk/{service/catalog.py => catalog/v2/impl.py} (72%) rename databricks/sdk/{service/cleanrooms.py => cleanrooms/v2/impl.py} (73%) rename databricks/sdk/{service/compute.py => compute/v2/impl.py} (75%) rename databricks/sdk/{service/dashboards.py => dashboards/v2/impl.py} (75%) rename databricks/sdk/{service/files.py => files/v2/impl.py} (83%) rename databricks/sdk/{service/iam.py => iam/v2/impl.py} (77%) rename databricks/sdk/{service/jobs.py => jobs/v2/impl.py} (74%) rename databricks/sdk/{service/marketplace.py => marketplace/v2/impl.py} (69%) rename databricks/sdk/{service/ml.py => ml/v2/impl.py} (76%) rename databricks/sdk/{service/oauth2.py => oauth2/v2/impl.py} (77%) rename databricks/sdk/{service/pipelines.py => pipelines/v2/impl.py} (70%) rename databricks/sdk/{service/provisioning.py => provisioning/v2/impl.py} (77%) rename databricks/sdk/{service/serving.py => serving/v2/impl.py} (71%) rename databricks/sdk/{service/settings.py => settings/v2/impl.py} (80%) rename databricks/sdk/{service/sharing.py => sharing/v2/impl.py} (72%) rename databricks/sdk/{service/sql.py => sql/v2/impl.py} (72%) rename databricks/sdk/{service/vectorsearch.py => vectorsearch/v2/impl.py} (71%) rename databricks/sdk/{service/workspace.py => workspace/v2/impl.py} (78%) diff --git a/databricks/sdk/service/apps.py b/databricks/sdk/apps/v2/impl.py similarity index 64% rename from databricks/sdk/service/apps.py rename to databricks/sdk/apps/v2/impl.py index 37c317f42..0fc522305 100755 --- a/databricks/sdk/service/apps.py +++ b/databricks/sdk/apps/v2/impl.py @@ -3,19 +3,15 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import Wait, _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -88,131 +84,131 @@ def as_dict(self) -> dict: """Serializes the App into a dictionary suitable for use as a JSON request body.""" body = {} if self.active_deployment: - body["active_deployment"] = self.active_deployment.as_dict() + body["{active_deployment}"] = self.active_deployment.as_dict() if self.app_status: - body["app_status"] = self.app_status.as_dict() + body["{app_status}"] = self.app_status.as_dict() if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.compute_status: - body["compute_status"] = self.compute_status.as_dict() + body["{compute_status}"] = self.compute_status.as_dict() if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.default_source_code_path is not None: - body["default_source_code_path"] = self.default_source_code_path + body["{default_source_code_path}"] = self.default_source_code_path if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.effective_user_api_scopes: - body["effective_user_api_scopes"] = [v for v in self.effective_user_api_scopes] + body["{effective_user_api_scopes}"] = [v for v in self.effective_user_api_scopes] if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.oauth2_app_client_id is not None: - body["oauth2_app_client_id"] = self.oauth2_app_client_id + body["{oauth2_app_client_id}"] = self.oauth2_app_client_id if self.oauth2_app_integration_id is not None: - body["oauth2_app_integration_id"] = self.oauth2_app_integration_id + body["{oauth2_app_integration_id}"] = self.oauth2_app_integration_id if self.pending_deployment: - body["pending_deployment"] = self.pending_deployment.as_dict() + body["{pending_deployment}"] = self.pending_deployment.as_dict() if self.resources: - body["resources"] = [v.as_dict() for v in self.resources] + body["{resources}"] = [v.as_dict() for v in self.resources] if self.service_principal_client_id is not None: - body["service_principal_client_id"] = self.service_principal_client_id + body["{service_principal_client_id}"] = self.service_principal_client_id if self.service_principal_id is not None: - body["service_principal_id"] = self.service_principal_id + body["{service_principal_id}"] = self.service_principal_id if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.updater is not None: - body["updater"] = self.updater + body["{updater}"] = self.updater if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.user_api_scopes: - body["user_api_scopes"] = [v for v in self.user_api_scopes] + body["{user_api_scopes}"] = [v for v in self.user_api_scopes] return body def as_shallow_dict(self) -> dict: """Serializes the App into a shallow dictionary of its immediate attributes.""" body = {} if self.active_deployment: - body["active_deployment"] = self.active_deployment + body["{active_deployment}"] = self.active_deployment if self.app_status: - body["app_status"] = self.app_status + body["{app_status}"] = self.app_status if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.compute_status: - body["compute_status"] = self.compute_status + body["{compute_status}"] = self.compute_status if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.default_source_code_path is not None: - body["default_source_code_path"] = self.default_source_code_path + body["{default_source_code_path}"] = self.default_source_code_path if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.effective_user_api_scopes: - body["effective_user_api_scopes"] = self.effective_user_api_scopes + body["{effective_user_api_scopes}"] = self.effective_user_api_scopes if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.oauth2_app_client_id is not None: - body["oauth2_app_client_id"] = self.oauth2_app_client_id + body["{oauth2_app_client_id}"] = self.oauth2_app_client_id if self.oauth2_app_integration_id is not None: - body["oauth2_app_integration_id"] = self.oauth2_app_integration_id + body["{oauth2_app_integration_id}"] = self.oauth2_app_integration_id if self.pending_deployment: - body["pending_deployment"] = self.pending_deployment + body["{pending_deployment}"] = self.pending_deployment if self.resources: - body["resources"] = self.resources + body["{resources}"] = self.resources if self.service_principal_client_id is not None: - body["service_principal_client_id"] = self.service_principal_client_id + body["{service_principal_client_id}"] = self.service_principal_client_id if self.service_principal_id is not None: - body["service_principal_id"] = self.service_principal_id + body["{service_principal_id}"] = self.service_principal_id if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.updater is not None: - body["updater"] = self.updater + body["{updater}"] = self.updater if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.user_api_scopes: - body["user_api_scopes"] = self.user_api_scopes + body["{user_api_scopes}"] = self.user_api_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> App: """Deserializes the App from a dictionary.""" return cls( - active_deployment=_from_dict(d, "active_deployment", AppDeployment), - app_status=_from_dict(d, "app_status", ApplicationStatus), - budget_policy_id=d.get("budget_policy_id", None), - compute_status=_from_dict(d, "compute_status", ComputeStatus), - create_time=d.get("create_time", None), - creator=d.get("creator", None), - default_source_code_path=d.get("default_source_code_path", None), - description=d.get("description", None), - effective_budget_policy_id=d.get("effective_budget_policy_id", None), - effective_user_api_scopes=d.get("effective_user_api_scopes", None), - id=d.get("id", None), - name=d.get("name", None), - oauth2_app_client_id=d.get("oauth2_app_client_id", None), - oauth2_app_integration_id=d.get("oauth2_app_integration_id", None), - pending_deployment=_from_dict(d, "pending_deployment", AppDeployment), - resources=_repeated_dict(d, "resources", AppResource), - service_principal_client_id=d.get("service_principal_client_id", None), - service_principal_id=d.get("service_principal_id", None), - service_principal_name=d.get("service_principal_name", None), - update_time=d.get("update_time", None), - updater=d.get("updater", None), - url=d.get("url", None), - user_api_scopes=d.get("user_api_scopes", None), + active_deployment=_from_dict(d, "{active_deployment}", AppDeployment), + app_status=_from_dict(d, "{app_status}", ApplicationStatus), + budget_policy_id=d.get("{budget_policy_id}", None), + compute_status=_from_dict(d, "{compute_status}", ComputeStatus), + create_time=d.get("{create_time}", None), + creator=d.get("{creator}", None), + default_source_code_path=d.get("{default_source_code_path}", None), + description=d.get("{description}", None), + effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), + effective_user_api_scopes=d.get("{effective_user_api_scopes}", None), + id=d.get("{id}", None), + name=d.get("{name}", None), + oauth2_app_client_id=d.get("{oauth2_app_client_id}", None), + oauth2_app_integration_id=d.get("{oauth2_app_integration_id}", None), + pending_deployment=_from_dict(d, "{pending_deployment}", AppDeployment), + resources=_repeated_dict(d, "{resources}", AppResource), + service_principal_client_id=d.get("{service_principal_client_id}", None), + service_principal_id=d.get("{service_principal_id}", None), + service_principal_name=d.get("{service_principal_name}", None), + update_time=d.get("{update_time}", None), + updater=d.get("{updater}", None), + url=d.get("{url}", None), + user_api_scopes=d.get("{user_api_scopes}", None), ) @@ -234,36 +230,36 @@ def as_dict(self) -> dict: """Serializes the AppAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the AppAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppAccessControlRequest: """Deserializes the AppAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", AppPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", AppPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -288,41 +284,41 @@ def as_dict(self) -> dict: """Serializes the AppAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the AppAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppAccessControlResponse: """Deserializes the AppAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", AppPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", AppPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -360,56 +356,56 @@ def as_dict(self) -> dict: """Serializes the AppDeployment into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.deployment_artifacts: - body["deployment_artifacts"] = self.deployment_artifacts.as_dict() + body["{deployment_artifacts}"] = self.deployment_artifacts.as_dict() if self.deployment_id is not None: - body["deployment_id"] = self.deployment_id + body["{deployment_id}"] = self.deployment_id if self.mode is not None: - body["mode"] = self.mode.value + body["{mode}"] = self.mode.value if self.source_code_path is not None: - body["source_code_path"] = self.source_code_path + body["{source_code_path}"] = self.source_code_path if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the AppDeployment into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.deployment_artifacts: - body["deployment_artifacts"] = self.deployment_artifacts + body["{deployment_artifacts}"] = self.deployment_artifacts if self.deployment_id is not None: - body["deployment_id"] = self.deployment_id + body["{deployment_id}"] = self.deployment_id if self.mode is not None: - body["mode"] = self.mode + body["{mode}"] = self.mode if self.source_code_path is not None: - body["source_code_path"] = self.source_code_path + body["{source_code_path}"] = self.source_code_path if self.status: - body["status"] = self.status + body["{status}"] = self.status if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppDeployment: """Deserializes the AppDeployment from a dictionary.""" return cls( - create_time=d.get("create_time", None), - creator=d.get("creator", None), - deployment_artifacts=_from_dict(d, "deployment_artifacts", AppDeploymentArtifacts), - deployment_id=d.get("deployment_id", None), - mode=_enum(d, "mode", AppDeploymentMode), - source_code_path=d.get("source_code_path", None), - status=_from_dict(d, "status", AppDeploymentStatus), - update_time=d.get("update_time", None), + create_time=d.get("{create_time}", None), + creator=d.get("{creator}", None), + deployment_artifacts=_from_dict(d, "{deployment_artifacts}", AppDeploymentArtifacts), + deployment_id=d.get("{deployment_id}", None), + mode=_enum(d, "{mode}", AppDeploymentMode), + source_code_path=d.get("{source_code_path}", None), + status=_from_dict(d, "{status}", AppDeploymentStatus), + update_time=d.get("{update_time}", None), ) @@ -422,20 +418,20 @@ def as_dict(self) -> dict: """Serializes the AppDeploymentArtifacts into a dictionary suitable for use as a JSON request body.""" body = {} if self.source_code_path is not None: - body["source_code_path"] = self.source_code_path + body["{source_code_path}"] = self.source_code_path return body def as_shallow_dict(self) -> dict: """Serializes the AppDeploymentArtifacts into a shallow dictionary of its immediate attributes.""" body = {} if self.source_code_path is not None: - body["source_code_path"] = self.source_code_path + body["{source_code_path}"] = self.source_code_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppDeploymentArtifacts: """Deserializes the AppDeploymentArtifacts from a dictionary.""" - return cls(source_code_path=d.get("source_code_path", None)) + return cls(source_code_path=d.get("{source_code_path}", None)) class AppDeploymentMode(Enum): @@ -464,24 +460,24 @@ def as_dict(self) -> dict: """Serializes the AppDeploymentStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the AppDeploymentStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppDeploymentStatus: """Deserializes the AppDeploymentStatus from a dictionary.""" - return cls(message=d.get("message", None), state=_enum(d, "state", AppDeploymentState)) + return cls(message=d.get("{message}", None), state=_enum(d, "{state}", AppDeploymentState)) @dataclass @@ -497,31 +493,31 @@ def as_dict(self) -> dict: """Serializes the AppPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the AppPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermission: """Deserializes the AppPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", AppPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", AppPermissionLevel), ) @@ -544,31 +540,31 @@ def as_dict(self) -> dict: """Serializes the AppPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the AppPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermissions: """Deserializes the AppPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", AppAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", AppAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -583,25 +579,26 @@ def as_dict(self) -> dict: """Serializes the AppPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the AppPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermissionsDescription: """Deserializes the AppPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", AppPermissionLevel) + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", AppPermissionLevel), ) @@ -616,26 +613,26 @@ def as_dict(self) -> dict: """Serializes the AppPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.app_name is not None: - body["app_name"] = self.app_name + body["{app_name}"] = self.app_name return body def as_shallow_dict(self) -> dict: """Serializes the AppPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.app_name is not None: - body["app_name"] = self.app_name + body["{app_name}"] = self.app_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermissionsRequest: """Deserializes the AppPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", AppAccessControlRequest), - app_name=d.get("app_name", None), + access_control_list=_repeated_dict(d, "{access_control_list}", AppAccessControlRequest), + app_name=d.get("{app_name}", None), ) @@ -659,46 +656,46 @@ def as_dict(self) -> dict: """Serializes the AppResource into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.job: - body["job"] = self.job.as_dict() + body["{job}"] = self.job.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.secret: - body["secret"] = self.secret.as_dict() + body["{secret}"] = self.secret.as_dict() if self.serving_endpoint: - body["serving_endpoint"] = self.serving_endpoint.as_dict() + body["{serving_endpoint}"] = self.serving_endpoint.as_dict() if self.sql_warehouse: - body["sql_warehouse"] = self.sql_warehouse.as_dict() + body["{sql_warehouse}"] = self.sql_warehouse.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AppResource into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.job: - body["job"] = self.job + body["{job}"] = self.job if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.secret: - body["secret"] = self.secret + body["{secret}"] = self.secret if self.serving_endpoint: - body["serving_endpoint"] = self.serving_endpoint + body["{serving_endpoint}"] = self.serving_endpoint if self.sql_warehouse: - body["sql_warehouse"] = self.sql_warehouse + body["{sql_warehouse}"] = self.sql_warehouse return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResource: """Deserializes the AppResource from a dictionary.""" return cls( - description=d.get("description", None), - job=_from_dict(d, "job", AppResourceJob), - name=d.get("name", None), - secret=_from_dict(d, "secret", AppResourceSecret), - serving_endpoint=_from_dict(d, "serving_endpoint", AppResourceServingEndpoint), - sql_warehouse=_from_dict(d, "sql_warehouse", AppResourceSqlWarehouse), + description=d.get("{description}", None), + job=_from_dict(d, "{job}", AppResourceJob), + name=d.get("{name}", None), + secret=_from_dict(d, "{secret}", AppResourceSecret), + serving_endpoint=_from_dict(d, "{serving_endpoint}", AppResourceServingEndpoint), + sql_warehouse=_from_dict(d, "{sql_warehouse}", AppResourceSqlWarehouse), ) @@ -715,24 +712,24 @@ def as_dict(self) -> dict: """Serializes the AppResourceJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.permission is not None: - body["permission"] = self.permission.value + body["{permission}"] = self.permission.value return body def as_shallow_dict(self) -> dict: """Serializes the AppResourceJob into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.permission is not None: - body["permission"] = self.permission + body["{permission}"] = self.permission return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceJob: """Deserializes the AppResourceJob from a dictionary.""" - return cls(id=d.get("id", None), permission=_enum(d, "permission", AppResourceJobJobPermission)) + return cls(id=d.get("{id}", None), permission=_enum(d, "{permission}", AppResourceJobJobPermission)) class AppResourceJobJobPermission(Enum): @@ -759,31 +756,31 @@ def as_dict(self) -> dict: """Serializes the AppResourceSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.permission is not None: - body["permission"] = self.permission.value + body["{permission}"] = self.permission.value if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body def as_shallow_dict(self) -> dict: """Serializes the AppResourceSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.permission is not None: - body["permission"] = self.permission + body["{permission}"] = self.permission if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceSecret: """Deserializes the AppResourceSecret from a dictionary.""" return cls( - key=d.get("key", None), - permission=_enum(d, "permission", AppResourceSecretSecretPermission), - scope=d.get("scope", None), + key=d.get("{key}", None), + permission=_enum(d, "{permission}", AppResourceSecretSecretPermission), + scope=d.get("{scope}", None), ) @@ -808,26 +805,26 @@ def as_dict(self) -> dict: """Serializes the AppResourceServingEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.permission is not None: - body["permission"] = self.permission.value + body["{permission}"] = self.permission.value return body def as_shallow_dict(self) -> dict: """Serializes the AppResourceServingEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.permission is not None: - body["permission"] = self.permission + body["{permission}"] = self.permission return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceServingEndpoint: """Deserializes the AppResourceServingEndpoint from a dictionary.""" return cls( - name=d.get("name", None), - permission=_enum(d, "permission", AppResourceServingEndpointServingEndpointPermission), + name=d.get("{name}", None), + permission=_enum(d, "{permission}", AppResourceServingEndpointServingEndpointPermission), ) @@ -851,25 +848,25 @@ def as_dict(self) -> dict: """Serializes the AppResourceSqlWarehouse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.permission is not None: - body["permission"] = self.permission.value + body["{permission}"] = self.permission.value return body def as_shallow_dict(self) -> dict: """Serializes the AppResourceSqlWarehouse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.permission is not None: - body["permission"] = self.permission + body["{permission}"] = self.permission return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceSqlWarehouse: """Deserializes the AppResourceSqlWarehouse from a dictionary.""" return cls( - id=d.get("id", None), permission=_enum(d, "permission", AppResourceSqlWarehouseSqlWarehousePermission) + id=d.get("{id}", None), permission=_enum(d, "{permission}", AppResourceSqlWarehouseSqlWarehousePermission) ) @@ -900,24 +897,24 @@ def as_dict(self) -> dict: """Serializes the ApplicationStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the ApplicationStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApplicationStatus: """Deserializes the ApplicationStatus from a dictionary.""" - return cls(message=d.get("message", None), state=_enum(d, "state", ApplicationState)) + return cls(message=d.get("{message}", None), state=_enum(d, "{state}", ApplicationState)) class ComputeState(Enum): @@ -943,24 +940,24 @@ def as_dict(self) -> dict: """Serializes the ComputeStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the ComputeStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComputeStatus: """Deserializes the ComputeStatus from a dictionary.""" - return cls(message=d.get("message", None), state=_enum(d, "state", ComputeState)) + return cls(message=d.get("{message}", None), state=_enum(d, "{state}", ComputeState)) @dataclass @@ -972,20 +969,20 @@ def as_dict(self) -> dict: """Serializes the GetAppPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetAppPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetAppPermissionLevelsResponse: """Deserializes the GetAppPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", AppPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", AppPermissionsDescription)) @dataclass @@ -1000,26 +997,26 @@ def as_dict(self) -> dict: """Serializes the ListAppDeploymentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_deployments: - body["app_deployments"] = [v.as_dict() for v in self.app_deployments] + body["{app_deployments}"] = [v.as_dict() for v in self.app_deployments] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListAppDeploymentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.app_deployments: - body["app_deployments"] = self.app_deployments + body["{app_deployments}"] = self.app_deployments if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAppDeploymentsResponse: """Deserializes the ListAppDeploymentsResponse from a dictionary.""" return cls( - app_deployments=_repeated_dict(d, "app_deployments", AppDeployment), - next_page_token=d.get("next_page_token", None), + app_deployments=_repeated_dict(d, "{app_deployments}", AppDeployment), + next_page_token=d.get("{next_page_token}", None), ) @@ -1034,24 +1031,24 @@ def as_dict(self) -> dict: """Serializes the ListAppsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["apps"] = [v.as_dict() for v in self.apps] + body["{apps}"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListAppsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["apps"] = self.apps + body["{apps}"] = self.apps if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAppsResponse: """Deserializes the ListAppsResponse from a dictionary.""" - return cls(apps=_repeated_dict(d, "apps", App), next_page_token=d.get("next_page_token", None)) + return cls(apps=_repeated_dict(d, "{apps}", App), next_page_token=d.get("{next_page_token}", None)) @dataclass @@ -1073,106 +1070,6 @@ class AppsAPI: def __init__(self, api_client): self._api = api_client - def wait_get_app_active( - self, name: str, timeout=timedelta(minutes=20), callback: Optional[Callable[[App], None]] = None - ) -> App: - deadline = time.time() + timeout.total_seconds() - target_states = (ComputeState.ACTIVE,) - failure_states = ( - ComputeState.ERROR, - ComputeState.STOPPED, - ) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(name=name) - status = poll.compute_status.state - status_message = f"current status: {status}" - if poll.compute_status: - status_message = poll.compute_status.message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach ACTIVE, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"name={name}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - - def wait_get_deployment_app_succeeded( - self, - app_name: str, - deployment_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[AppDeployment], None]] = None, - ) -> AppDeployment: - deadline = time.time() + timeout.total_seconds() - target_states = (AppDeploymentState.SUCCEEDED,) - failure_states = (AppDeploymentState.FAILED,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get_deployment(app_name=app_name, deployment_id=deployment_id) - status = poll.status.state - status_message = f"current status: {status}" - if poll.status: - status_message = poll.status.message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach SUCCEEDED, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"app_name={app_name}, deployment_id={deployment_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - - def wait_get_app_stopped( - self, name: str, timeout=timedelta(minutes=20), callback: Optional[Callable[[App], None]] = None - ) -> App: - deadline = time.time() + timeout.total_seconds() - target_states = (ComputeState.STOPPED,) - failure_states = (ComputeState.ERROR,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(name=name) - status = poll.compute_status.state - status_message = f"current status: {status}" - if poll.compute_status: - status_message = poll.compute_status.message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach STOPPED, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"name={name}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None) -> Wait[App]: """Create an app. @@ -1184,19 +1081,19 @@ def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None :returns: Long-running operation waiter for :class:`App`. - See :method:wait_get_app_active for more details. + See :method:WaitGetAppActive for more details. """ body = app.as_dict() query = {} if no_compute is not None: - query["no_compute"] = no_compute + query["{no_compute}"] = no_compute headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.0/apps", query=query, body=body, headers=headers) - return Wait(self.wait_get_app_active, response=App.from_dict(op_response), name=op_response["name"]) + return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["{name}"]) def create_and_wait( self, *, app: Optional[App] = None, no_compute: Optional[bool] = None, timeout=timedelta(minutes=20) @@ -1215,7 +1112,7 @@ def delete(self, name: str) -> App: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("DELETE", f"/api/2.0/apps/{name}", headers=headers) @@ -1232,20 +1129,20 @@ def deploy(self, app_name: str, *, app_deployment: Optional[AppDeployment] = Non :returns: Long-running operation waiter for :class:`AppDeployment`. - See :method:wait_get_deployment_app_succeeded for more details. + See :method:WaitGetDeploymentAppSucceeded for more details. """ body = app_deployment.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", f"/api/2.0/apps/{app_name}/deployments", body=body, headers=headers) return Wait( - self.wait_get_deployment_app_succeeded, + self.WaitGetDeploymentAppSucceeded, response=AppDeployment.from_dict(op_response), app_name=app_name, - deployment_id=op_response["deployment_id"], + deployment_id=op_response["{deployment_id}"], ) def deploy_and_wait( @@ -1265,7 +1162,7 @@ def get(self, name: str) -> App: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/apps/{name}", headers=headers) @@ -1285,7 +1182,7 @@ def get_deployment(self, app_name: str, deployment_id: str) -> AppDeployment: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/apps/{app_name}/deployments/{deployment_id}", headers=headers) @@ -1303,7 +1200,7 @@ def get_permission_levels(self, app_name: str) -> GetAppPermissionLevelsResponse """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/apps/{app_name}/permissionLevels", headers=headers) @@ -1321,7 +1218,7 @@ def get_permissions(self, app_name: str) -> AppPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/apps/{app_name}", headers=headers) @@ -1342,21 +1239,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/apps", query=query, headers=headers) - if "apps" in json: - for v in json["apps"]: + if "{apps}" in json: + for v in json["{apps}"]: yield App.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_deployments( self, app_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -1377,21 +1274,21 @@ def list_deployments( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/apps/{app_name}/deployments", query=query, headers=headers) - if "app_deployments" in json: - for v in json["app_deployments"]: + if "{app_deployments}" in json: + for v in json["{app_deployments}"]: yield AppDeployment.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def set_permissions( self, app_name: str, *, access_control_list: Optional[List[AppAccessControlRequest]] = None @@ -1409,10 +1306,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) @@ -1428,16 +1325,16 @@ def start(self, name: str) -> Wait[App]: :returns: Long-running operation waiter for :class:`App`. - See :method:wait_get_app_active for more details. + See :method:WaitGetAppActive for more details. """ headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) - return Wait(self.wait_get_app_active, response=App.from_dict(op_response), name=op_response["name"]) + return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["{name}"]) def start_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: return self.start(name=name).result(timeout=timeout) @@ -1452,16 +1349,16 @@ def stop(self, name: str) -> Wait[App]: :returns: Long-running operation waiter for :class:`App`. - See :method:wait_get_app_stopped for more details. + See :method:WaitGetAppStopped for more details. """ headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) - return Wait(self.wait_get_app_stopped, response=App.from_dict(op_response), name=op_response["name"]) + return Wait(self.WaitGetAppStopped, response=App.from_dict(op_response), name=op_response["{name}"]) def stop_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: return self.stop(name=name).result(timeout=timeout) @@ -1480,8 +1377,8 @@ def update(self, name: str, *, app: Optional[App] = None) -> App: """ body = app.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/apps/{name}", body=body, headers=headers) @@ -1502,10 +1399,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) diff --git a/databricks/sdk/service/billing.py b/databricks/sdk/billing/v2/impl.py similarity index 78% rename from databricks/sdk/service/billing.py rename to databricks/sdk/billing/v2/impl.py index e0a589d9d..3fba90cb3 100755 --- a/databricks/sdk/service/billing.py +++ b/databricks/sdk/billing/v2/impl.py @@ -7,11 +7,10 @@ from enum import Enum from typing import Any, BinaryIO, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict +from ...service._internal import _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -30,31 +29,31 @@ def as_dict(self) -> dict: """Serializes the ActionConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_configuration_id is not None: - body["action_configuration_id"] = self.action_configuration_id + body["{action_configuration_id}"] = self.action_configuration_id if self.action_type is not None: - body["action_type"] = self.action_type.value + body["{action_type}"] = self.action_type.value if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target return body def as_shallow_dict(self) -> dict: """Serializes the ActionConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.action_configuration_id is not None: - body["action_configuration_id"] = self.action_configuration_id + body["{action_configuration_id}"] = self.action_configuration_id if self.action_type is not None: - body["action_type"] = self.action_type + body["{action_type}"] = self.action_type if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ActionConfiguration: """Deserializes the ActionConfiguration from a dictionary.""" return cls( - action_configuration_id=d.get("action_configuration_id", None), - action_type=_enum(d, "action_type", ActionConfigurationType), - target=d.get("target", None), + action_configuration_id=d.get("{action_configuration_id}", None), + action_type=_enum(d, "{action_type}", ActionConfigurationType), + target=d.get("{target}", None), ) @@ -90,46 +89,46 @@ def as_dict(self) -> dict: """Serializes the AlertConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_configurations: - body["action_configurations"] = [v.as_dict() for v in self.action_configurations] + body["{action_configurations}"] = [v.as_dict() for v in self.action_configurations] if self.alert_configuration_id is not None: - body["alert_configuration_id"] = self.alert_configuration_id + body["{alert_configuration_id}"] = self.alert_configuration_id if self.quantity_threshold is not None: - body["quantity_threshold"] = self.quantity_threshold + body["{quantity_threshold}"] = self.quantity_threshold if self.quantity_type is not None: - body["quantity_type"] = self.quantity_type.value + body["{quantity_type}"] = self.quantity_type.value if self.time_period is not None: - body["time_period"] = self.time_period.value + body["{time_period}"] = self.time_period.value if self.trigger_type is not None: - body["trigger_type"] = self.trigger_type.value + body["{trigger_type}"] = self.trigger_type.value return body def as_shallow_dict(self) -> dict: """Serializes the AlertConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.action_configurations: - body["action_configurations"] = self.action_configurations + body["{action_configurations}"] = self.action_configurations if self.alert_configuration_id is not None: - body["alert_configuration_id"] = self.alert_configuration_id + body["{alert_configuration_id}"] = self.alert_configuration_id if self.quantity_threshold is not None: - body["quantity_threshold"] = self.quantity_threshold + body["{quantity_threshold}"] = self.quantity_threshold if self.quantity_type is not None: - body["quantity_type"] = self.quantity_type + body["{quantity_type}"] = self.quantity_type if self.time_period is not None: - body["time_period"] = self.time_period + body["{time_period}"] = self.time_period if self.trigger_type is not None: - body["trigger_type"] = self.trigger_type + body["{trigger_type}"] = self.trigger_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertConfiguration: """Deserializes the AlertConfiguration from a dictionary.""" return cls( - action_configurations=_repeated_dict(d, "action_configurations", ActionConfiguration), - alert_configuration_id=d.get("alert_configuration_id", None), - quantity_threshold=d.get("quantity_threshold", None), - quantity_type=_enum(d, "quantity_type", AlertConfigurationQuantityType), - time_period=_enum(d, "time_period", AlertConfigurationTimePeriod), - trigger_type=_enum(d, "trigger_type", AlertConfigurationTriggerType), + action_configurations=_repeated_dict(d, "{action_configurations}", ActionConfiguration), + alert_configuration_id=d.get("{alert_configuration_id}", None), + quantity_threshold=d.get("{quantity_threshold}", None), + quantity_type=_enum(d, "{quantity_type}", AlertConfigurationQuantityType), + time_period=_enum(d, "{time_period}", AlertConfigurationTimePeriod), + trigger_type=_enum(d, "{trigger_type}", AlertConfigurationTriggerType), ) @@ -178,51 +177,51 @@ def as_dict(self) -> dict: """Serializes the BudgetConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.alert_configurations: - body["alert_configurations"] = [v.as_dict() for v in self.alert_configurations] + body["{alert_configurations}"] = [v.as_dict() for v in self.alert_configurations] if self.budget_configuration_id is not None: - body["budget_configuration_id"] = self.budget_configuration_id + body["{budget_configuration_id}"] = self.budget_configuration_id if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.filter: - body["filter"] = self.filter.as_dict() + body["{filter}"] = self.filter.as_dict() if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the BudgetConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.alert_configurations: - body["alert_configurations"] = self.alert_configurations + body["{alert_configurations}"] = self.alert_configurations if self.budget_configuration_id is not None: - body["budget_configuration_id"] = self.budget_configuration_id + body["{budget_configuration_id}"] = self.budget_configuration_id if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.filter: - body["filter"] = self.filter + body["{filter}"] = self.filter if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfiguration: """Deserializes the BudgetConfiguration from a dictionary.""" return cls( - account_id=d.get("account_id", None), - alert_configurations=_repeated_dict(d, "alert_configurations", AlertConfiguration), - budget_configuration_id=d.get("budget_configuration_id", None), - create_time=d.get("create_time", None), - display_name=d.get("display_name", None), - filter=_from_dict(d, "filter", BudgetConfigurationFilter), - update_time=d.get("update_time", None), + account_id=d.get("{account_id}", None), + alert_configurations=_repeated_dict(d, "{alert_configurations}", AlertConfiguration), + budget_configuration_id=d.get("{budget_configuration_id}", None), + create_time=d.get("{create_time}", None), + display_name=d.get("{display_name}", None), + filter=_from_dict(d, "{filter}", BudgetConfigurationFilter), + update_time=d.get("{update_time}", None), ) @@ -240,26 +239,26 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.workspace_id: - body["workspace_id"] = self.workspace_id.as_dict() + body["{workspace_id}"] = self.workspace_id.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.workspace_id: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilter: """Deserializes the BudgetConfigurationFilter from a dictionary.""" return cls( - tags=_repeated_dict(d, "tags", BudgetConfigurationFilterTagClause), - workspace_id=_from_dict(d, "workspace_id", BudgetConfigurationFilterWorkspaceIdClause), + tags=_repeated_dict(d, "{tags}", BudgetConfigurationFilterTagClause), + workspace_id=_from_dict(d, "{workspace_id}", BudgetConfigurationFilterWorkspaceIdClause), ) @@ -273,24 +272,24 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilterClause into a dictionary suitable for use as a JSON request body.""" body = {} if self.operator is not None: - body["operator"] = self.operator.value + body["{operator}"] = self.operator.value if self.values: - body["values"] = [v for v in self.values] + body["{values}"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilterClause into a shallow dictionary of its immediate attributes.""" body = {} if self.operator is not None: - body["operator"] = self.operator + body["{operator}"] = self.operator if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterClause: """Deserializes the BudgetConfigurationFilterClause from a dictionary.""" - return cls(operator=_enum(d, "operator", BudgetConfigurationFilterOperator), values=d.get("values", None)) + return cls(operator=_enum(d, "{operator}", BudgetConfigurationFilterOperator), values=d.get("{values}", None)) class BudgetConfigurationFilterOperator(Enum): @@ -308,24 +307,24 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilterTagClause into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value: - body["value"] = self.value.as_dict() + body["{value}"] = self.value.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilterTagClause into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterTagClause: """Deserializes the BudgetConfigurationFilterTagClause from a dictionary.""" - return cls(key=d.get("key", None), value=_from_dict(d, "value", BudgetConfigurationFilterClause)) + return cls(key=d.get("{key}", None), value=_from_dict(d, "{value}", BudgetConfigurationFilterClause)) @dataclass @@ -338,24 +337,24 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilterWorkspaceIdClause into a dictionary suitable for use as a JSON request body.""" body = {} if self.operator is not None: - body["operator"] = self.operator.value + body["{operator}"] = self.operator.value if self.values: - body["values"] = [v for v in self.values] + body["{values}"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilterWorkspaceIdClause into a shallow dictionary of its immediate attributes.""" body = {} if self.operator is not None: - body["operator"] = self.operator + body["{operator}"] = self.operator if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterWorkspaceIdClause: """Deserializes the BudgetConfigurationFilterWorkspaceIdClause from a dictionary.""" - return cls(operator=_enum(d, "operator", BudgetConfigurationFilterOperator), values=d.get("values", None)) + return cls(operator=_enum(d, "{operator}", BudgetConfigurationFilterOperator), values=d.get("{values}", None)) @dataclass @@ -377,31 +376,31 @@ def as_dict(self) -> dict: """Serializes the BudgetPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_tags: - body["custom_tags"] = [v.as_dict() for v in self.custom_tags] + body["{custom_tags}"] = [v.as_dict() for v in self.custom_tags] if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.policy_name is not None: - body["policy_name"] = self.policy_name + body["{policy_name}"] = self.policy_name return body def as_shallow_dict(self) -> dict: """Serializes the BudgetPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.policy_name is not None: - body["policy_name"] = self.policy_name + body["{policy_name}"] = self.policy_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetPolicy: """Deserializes the BudgetPolicy from a dictionary.""" return cls( - custom_tags=_repeated_dict(d, "custom_tags", CustomPolicyTag), - policy_id=d.get("policy_id", None), - policy_name=d.get("policy_name", None), + custom_tags=_repeated_dict(d, "{custom_tags}", CustomPolicyTag), + policy_id=d.get("{policy_id}", None), + policy_name=d.get("{policy_name}", None), ) @@ -418,25 +417,25 @@ def as_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_type is not None: - body["dashboard_type"] = self.dashboard_type.value + body["{dashboard_type}"] = self.dashboard_type.value if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_type is not None: - body["dashboard_type"] = self.dashboard_type + body["{dashboard_type}"] = self.dashboard_type if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBillingUsageDashboardRequest: """Deserializes the CreateBillingUsageDashboardRequest from a dictionary.""" return cls( - dashboard_type=_enum(d, "dashboard_type", UsageDashboardType), workspace_id=d.get("workspace_id", None) + dashboard_type=_enum(d, "{dashboard_type}", UsageDashboardType), workspace_id=d.get("{workspace_id}", None) ) @@ -449,20 +448,20 @@ def as_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBillingUsageDashboardResponse: """Deserializes the CreateBillingUsageDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("dashboard_id", None)) + return cls(dashboard_id=d.get("{dashboard_id}", None)) @dataclass @@ -486,38 +485,38 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudget into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.alert_configurations: - body["alert_configurations"] = [v.as_dict() for v in self.alert_configurations] + body["{alert_configurations}"] = [v.as_dict() for v in self.alert_configurations] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.filter: - body["filter"] = self.filter.as_dict() + body["{filter}"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudget into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.alert_configurations: - body["alert_configurations"] = self.alert_configurations + body["{alert_configurations}"] = self.alert_configurations if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.filter: - body["filter"] = self.filter + body["{filter}"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationBudget: """Deserializes the CreateBudgetConfigurationBudget from a dictionary.""" return cls( - account_id=d.get("account_id", None), + account_id=d.get("{account_id}", None), alert_configurations=_repeated_dict( - d, "alert_configurations", CreateBudgetConfigurationBudgetAlertConfigurations + d, "{alert_configurations}", CreateBudgetConfigurationBudgetAlertConfigurations ), - display_name=d.get("display_name", None), - filter=_from_dict(d, "filter", BudgetConfigurationFilter), + display_name=d.get("{display_name}", None), + filter=_from_dict(d, "{filter}", BudgetConfigurationFilter), ) @@ -533,24 +532,24 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetActionConfigurations into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_type is not None: - body["action_type"] = self.action_type.value + body["{action_type}"] = self.action_type.value if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target return body def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetActionConfigurations into a shallow dictionary of its immediate attributes.""" body = {} if self.action_type is not None: - body["action_type"] = self.action_type + body["{action_type}"] = self.action_type if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationBudgetActionConfigurations: """Deserializes the CreateBudgetConfigurationBudgetActionConfigurations from a dictionary.""" - return cls(action_type=_enum(d, "action_type", ActionConfigurationType), target=d.get("target", None)) + return cls(action_type=_enum(d, "{action_type}", ActionConfigurationType), target=d.get("{target}", None)) @dataclass @@ -577,30 +576,30 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetAlertConfigurations into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_configurations: - body["action_configurations"] = [v.as_dict() for v in self.action_configurations] + body["{action_configurations}"] = [v.as_dict() for v in self.action_configurations] if self.quantity_threshold is not None: - body["quantity_threshold"] = self.quantity_threshold + body["{quantity_threshold}"] = self.quantity_threshold if self.quantity_type is not None: - body["quantity_type"] = self.quantity_type.value + body["{quantity_type}"] = self.quantity_type.value if self.time_period is not None: - body["time_period"] = self.time_period.value + body["{time_period}"] = self.time_period.value if self.trigger_type is not None: - body["trigger_type"] = self.trigger_type.value + body["{trigger_type}"] = self.trigger_type.value return body def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetAlertConfigurations into a shallow dictionary of its immediate attributes.""" body = {} if self.action_configurations: - body["action_configurations"] = self.action_configurations + body["{action_configurations}"] = self.action_configurations if self.quantity_threshold is not None: - body["quantity_threshold"] = self.quantity_threshold + body["{quantity_threshold}"] = self.quantity_threshold if self.quantity_type is not None: - body["quantity_type"] = self.quantity_type + body["{quantity_type}"] = self.quantity_type if self.time_period is not None: - body["time_period"] = self.time_period + body["{time_period}"] = self.time_period if self.trigger_type is not None: - body["trigger_type"] = self.trigger_type + body["{trigger_type}"] = self.trigger_type return body @classmethod @@ -608,12 +607,12 @@ def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationBudgetAlertCon """Deserializes the CreateBudgetConfigurationBudgetAlertConfigurations from a dictionary.""" return cls( action_configurations=_repeated_dict( - d, "action_configurations", CreateBudgetConfigurationBudgetActionConfigurations + d, "{action_configurations}", CreateBudgetConfigurationBudgetActionConfigurations ), - quantity_threshold=d.get("quantity_threshold", None), - quantity_type=_enum(d, "quantity_type", AlertConfigurationQuantityType), - time_period=_enum(d, "time_period", AlertConfigurationTimePeriod), - trigger_type=_enum(d, "trigger_type", AlertConfigurationTriggerType), + quantity_threshold=d.get("{quantity_threshold}", None), + quantity_type=_enum(d, "{quantity_type}", AlertConfigurationQuantityType), + time_period=_enum(d, "{time_period}", AlertConfigurationTimePeriod), + trigger_type=_enum(d, "{trigger_type}", AlertConfigurationTriggerType), ) @@ -626,20 +625,20 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["budget"] = self.budget.as_dict() + body["{budget}"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["budget"] = self.budget + body["{budget}"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationRequest: """Deserializes the CreateBudgetConfigurationRequest from a dictionary.""" - return cls(budget=_from_dict(d, "budget", CreateBudgetConfigurationBudget)) + return cls(budget=_from_dict(d, "{budget}", CreateBudgetConfigurationBudget)) @dataclass @@ -651,20 +650,20 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["budget"] = self.budget.as_dict() + body["{budget}"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["budget"] = self.budget + body["{budget}"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationResponse: """Deserializes the CreateBudgetConfigurationResponse from a dictionary.""" - return cls(budget=_from_dict(d, "budget", BudgetConfiguration)) + return cls(budget=_from_dict(d, "{budget}", BudgetConfiguration)) @dataclass @@ -684,24 +683,24 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetPolicyRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.policy: - body["policy"] = self.policy.as_dict() + body["{policy}"] = self.policy.as_dict() if self.request_id is not None: - body["request_id"] = self.request_id + body["{request_id}"] = self.request_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetPolicyRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.policy: - body["policy"] = self.policy + body["{policy}"] = self.policy if self.request_id is not None: - body["request_id"] = self.request_id + body["{request_id}"] = self.request_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetPolicyRequest: """Deserializes the CreateBudgetPolicyRequest from a dictionary.""" - return cls(policy=_from_dict(d, "policy", BudgetPolicy), request_id=d.get("request_id", None)) + return cls(policy=_from_dict(d, "{policy}", BudgetPolicy), request_id=d.get("{request_id}", None)) @dataclass @@ -779,61 +778,61 @@ def as_dict(self) -> dict: """Serializes the CreateLogDeliveryConfigurationParams into a dictionary suitable for use as a JSON request body.""" body = {} if self.config_name is not None: - body["config_name"] = self.config_name + body["{config_name}"] = self.config_name if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.delivery_path_prefix is not None: - body["delivery_path_prefix"] = self.delivery_path_prefix + body["{delivery_path_prefix}"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["delivery_start_time"] = self.delivery_start_time + body["{delivery_start_time}"] = self.delivery_start_time if self.log_type is not None: - body["log_type"] = self.log_type.value + body["{log_type}"] = self.log_type.value if self.output_format is not None: - body["output_format"] = self.output_format.value + body["{output_format}"] = self.output_format.value if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.workspace_ids_filter: - body["workspace_ids_filter"] = [v for v in self.workspace_ids_filter] + body["{workspace_ids_filter}"] = [v for v in self.workspace_ids_filter] return body def as_shallow_dict(self) -> dict: """Serializes the CreateLogDeliveryConfigurationParams into a shallow dictionary of its immediate attributes.""" body = {} if self.config_name is not None: - body["config_name"] = self.config_name + body["{config_name}"] = self.config_name if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.delivery_path_prefix is not None: - body["delivery_path_prefix"] = self.delivery_path_prefix + body["{delivery_path_prefix}"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["delivery_start_time"] = self.delivery_start_time + body["{delivery_start_time}"] = self.delivery_start_time if self.log_type is not None: - body["log_type"] = self.log_type + body["{log_type}"] = self.log_type if self.output_format is not None: - body["output_format"] = self.output_format + body["{output_format}"] = self.output_format if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.workspace_ids_filter: - body["workspace_ids_filter"] = self.workspace_ids_filter + body["{workspace_ids_filter}"] = self.workspace_ids_filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateLogDeliveryConfigurationParams: """Deserializes the CreateLogDeliveryConfigurationParams from a dictionary.""" return cls( - config_name=d.get("config_name", None), - credentials_id=d.get("credentials_id", None), - delivery_path_prefix=d.get("delivery_path_prefix", None), - delivery_start_time=d.get("delivery_start_time", None), - log_type=_enum(d, "log_type", LogType), - output_format=_enum(d, "output_format", OutputFormat), - status=_enum(d, "status", LogDeliveryConfigStatus), - storage_configuration_id=d.get("storage_configuration_id", None), - workspace_ids_filter=d.get("workspace_ids_filter", None), + config_name=d.get("{config_name}", None), + credentials_id=d.get("{credentials_id}", None), + delivery_path_prefix=d.get("{delivery_path_prefix}", None), + delivery_start_time=d.get("{delivery_start_time}", None), + log_type=_enum(d, "{log_type}", LogType), + output_format=_enum(d, "{output_format}", OutputFormat), + status=_enum(d, "{status}", LogDeliveryConfigStatus), + storage_configuration_id=d.get("{storage_configuration_id}", None), + workspace_ids_filter=d.get("{workspace_ids_filter}", None), ) @@ -857,24 +856,24 @@ def as_dict(self) -> dict: """Serializes the CustomPolicyTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the CustomPolicyTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomPolicyTag: """Deserializes the CustomPolicyTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -937,20 +936,20 @@ def as_dict(self) -> dict: """Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body def as_shallow_dict(self) -> dict: """Serializes the DownloadResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DownloadResponse: """Deserializes the DownloadResponse from a dictionary.""" - return cls(contents=d.get("contents", None)) + return cls(contents=d.get("{contents}", None)) @dataclass @@ -971,31 +970,31 @@ def as_dict(self) -> dict: """Serializes the Filter into a dictionary suitable for use as a JSON request body.""" body = {} if self.creator_user_id is not None: - body["creator_user_id"] = self.creator_user_id + body["{creator_user_id}"] = self.creator_user_id if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.policy_name is not None: - body["policy_name"] = self.policy_name + body["{policy_name}"] = self.policy_name return body def as_shallow_dict(self) -> dict: """Serializes the Filter into a shallow dictionary of its immediate attributes.""" body = {} if self.creator_user_id is not None: - body["creator_user_id"] = self.creator_user_id + body["{creator_user_id}"] = self.creator_user_id if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.policy_name is not None: - body["policy_name"] = self.policy_name + body["{policy_name}"] = self.policy_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Filter: """Deserializes the Filter from a dictionary.""" return cls( - creator_user_id=d.get("creator_user_id", None), - creator_user_name=d.get("creator_user_name", None), - policy_name=d.get("policy_name", None), + creator_user_id=d.get("{creator_user_id}", None), + creator_user_name=d.get("{creator_user_name}", None), + policy_name=d.get("{policy_name}", None), ) @@ -1011,24 +1010,24 @@ def as_dict(self) -> dict: """Serializes the GetBillingUsageDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.dashboard_url is not None: - body["dashboard_url"] = self.dashboard_url + body["{dashboard_url}"] = self.dashboard_url return body def as_shallow_dict(self) -> dict: """Serializes the GetBillingUsageDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.dashboard_url is not None: - body["dashboard_url"] = self.dashboard_url + body["{dashboard_url}"] = self.dashboard_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetBillingUsageDashboardResponse: """Deserializes the GetBillingUsageDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("dashboard_id", None), dashboard_url=d.get("dashboard_url", None)) + return cls(dashboard_id=d.get("{dashboard_id}", None), dashboard_url=d.get("{dashboard_url}", None)) @dataclass @@ -1039,20 +1038,20 @@ def as_dict(self) -> dict: """Serializes the GetBudgetConfigurationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["budget"] = self.budget.as_dict() + body["{budget}"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetBudgetConfigurationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["budget"] = self.budget + body["{budget}"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetBudgetConfigurationResponse: """Deserializes the GetBudgetConfigurationResponse from a dictionary.""" - return cls(budget=_from_dict(d, "budget", BudgetConfiguration)) + return cls(budget=_from_dict(d, "{budget}", BudgetConfiguration)) @dataclass @@ -1088,25 +1087,26 @@ def as_dict(self) -> dict: """Serializes the ListBudgetConfigurationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budgets: - body["budgets"] = [v.as_dict() for v in self.budgets] + body["{budgets}"] = [v.as_dict() for v in self.budgets] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListBudgetConfigurationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budgets: - body["budgets"] = self.budgets + body["{budgets}"] = self.budgets if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListBudgetConfigurationsResponse: """Deserializes the ListBudgetConfigurationsResponse from a dictionary.""" return cls( - budgets=_repeated_dict(d, "budgets", BudgetConfiguration), next_page_token=d.get("next_page_token", None) + budgets=_repeated_dict(d, "{budgets}", BudgetConfiguration), + next_page_token=d.get("{next_page_token}", None), ) @@ -1128,31 +1128,31 @@ def as_dict(self) -> dict: """Serializes the ListBudgetPoliciesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.policies: - body["policies"] = [v.as_dict() for v in self.policies] + body["{policies}"] = [v.as_dict() for v in self.policies] if self.previous_page_token is not None: - body["previous_page_token"] = self.previous_page_token + body["{previous_page_token}"] = self.previous_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListBudgetPoliciesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.policies: - body["policies"] = self.policies + body["{policies}"] = self.policies if self.previous_page_token is not None: - body["previous_page_token"] = self.previous_page_token + body["{previous_page_token}"] = self.previous_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListBudgetPoliciesResponse: """Deserializes the ListBudgetPoliciesResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - policies=_repeated_dict(d, "policies", BudgetPolicy), - previous_page_token=d.get("previous_page_token", None), + next_page_token=d.get("{next_page_token}", None), + policies=_repeated_dict(d, "{policies}", BudgetPolicy), + previous_page_token=d.get("{previous_page_token}", None), ) @@ -1256,86 +1256,86 @@ def as_dict(self) -> dict: """Serializes the LogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.config_id is not None: - body["config_id"] = self.config_id + body["{config_id}"] = self.config_id if self.config_name is not None: - body["config_name"] = self.config_name + body["{config_name}"] = self.config_name if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.delivery_path_prefix is not None: - body["delivery_path_prefix"] = self.delivery_path_prefix + body["{delivery_path_prefix}"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["delivery_start_time"] = self.delivery_start_time + body["{delivery_start_time}"] = self.delivery_start_time if self.log_delivery_status: - body["log_delivery_status"] = self.log_delivery_status.as_dict() + body["{log_delivery_status}"] = self.log_delivery_status.as_dict() if self.log_type is not None: - body["log_type"] = self.log_type.value + body["{log_type}"] = self.log_type.value if self.output_format is not None: - body["output_format"] = self.output_format.value + body["{output_format}"] = self.output_format.value if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.workspace_ids_filter: - body["workspace_ids_filter"] = [v for v in self.workspace_ids_filter] + body["{workspace_ids_filter}"] = [v for v in self.workspace_ids_filter] return body def as_shallow_dict(self) -> dict: """Serializes the LogDeliveryConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.config_id is not None: - body["config_id"] = self.config_id + body["{config_id}"] = self.config_id if self.config_name is not None: - body["config_name"] = self.config_name + body["{config_name}"] = self.config_name if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.delivery_path_prefix is not None: - body["delivery_path_prefix"] = self.delivery_path_prefix + body["{delivery_path_prefix}"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["delivery_start_time"] = self.delivery_start_time + body["{delivery_start_time}"] = self.delivery_start_time if self.log_delivery_status: - body["log_delivery_status"] = self.log_delivery_status + body["{log_delivery_status}"] = self.log_delivery_status if self.log_type is not None: - body["log_type"] = self.log_type + body["{log_type}"] = self.log_type if self.output_format is not None: - body["output_format"] = self.output_format + body["{output_format}"] = self.output_format if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.workspace_ids_filter: - body["workspace_ids_filter"] = self.workspace_ids_filter + body["{workspace_ids_filter}"] = self.workspace_ids_filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogDeliveryConfiguration: """Deserializes the LogDeliveryConfiguration from a dictionary.""" return cls( - account_id=d.get("account_id", None), - config_id=d.get("config_id", None), - config_name=d.get("config_name", None), - creation_time=d.get("creation_time", None), - credentials_id=d.get("credentials_id", None), - delivery_path_prefix=d.get("delivery_path_prefix", None), - delivery_start_time=d.get("delivery_start_time", None), - log_delivery_status=_from_dict(d, "log_delivery_status", LogDeliveryStatus), - log_type=_enum(d, "log_type", LogType), - output_format=_enum(d, "output_format", OutputFormat), - status=_enum(d, "status", LogDeliveryConfigStatus), - storage_configuration_id=d.get("storage_configuration_id", None), - update_time=d.get("update_time", None), - workspace_ids_filter=d.get("workspace_ids_filter", None), + account_id=d.get("{account_id}", None), + config_id=d.get("{config_id}", None), + config_name=d.get("{config_name}", None), + creation_time=d.get("{creation_time}", None), + credentials_id=d.get("{credentials_id}", None), + delivery_path_prefix=d.get("{delivery_path_prefix}", None), + delivery_start_time=d.get("{delivery_start_time}", None), + log_delivery_status=_from_dict(d, "{log_delivery_status}", LogDeliveryStatus), + log_type=_enum(d, "{log_type}", LogType), + output_format=_enum(d, "{output_format}", OutputFormat), + status=_enum(d, "{status}", LogDeliveryConfigStatus), + storage_configuration_id=d.get("{storage_configuration_id}", None), + update_time=d.get("{update_time}", None), + workspace_ids_filter=d.get("{workspace_ids_filter}", None), ) @@ -1366,36 +1366,36 @@ def as_dict(self) -> dict: """Serializes the LogDeliveryStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_attempt_time is not None: - body["last_attempt_time"] = self.last_attempt_time + body["{last_attempt_time}"] = self.last_attempt_time if self.last_successful_attempt_time is not None: - body["last_successful_attempt_time"] = self.last_successful_attempt_time + body["{last_successful_attempt_time}"] = self.last_successful_attempt_time if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the LogDeliveryStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_attempt_time is not None: - body["last_attempt_time"] = self.last_attempt_time + body["{last_attempt_time}"] = self.last_attempt_time if self.last_successful_attempt_time is not None: - body["last_successful_attempt_time"] = self.last_successful_attempt_time + body["{last_successful_attempt_time}"] = self.last_successful_attempt_time if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogDeliveryStatus: """Deserializes the LogDeliveryStatus from a dictionary.""" return cls( - last_attempt_time=d.get("last_attempt_time", None), - last_successful_attempt_time=d.get("last_successful_attempt_time", None), - message=d.get("message", None), - status=_enum(d, "status", DeliveryStatus), + last_attempt_time=d.get("{last_attempt_time}", None), + last_successful_attempt_time=d.get("{last_successful_attempt_time}", None), + message=d.get("{message}", None), + status=_enum(d, "{status}", DeliveryStatus), ) @@ -1463,24 +1463,24 @@ def as_dict(self) -> dict: """Serializes the SortSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.descending is not None: - body["descending"] = self.descending + body["{descending}"] = self.descending if self.field is not None: - body["field"] = self.field.value + body["{field}"] = self.field.value return body def as_shallow_dict(self) -> dict: """Serializes the SortSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.descending is not None: - body["descending"] = self.descending + body["{descending}"] = self.descending if self.field is not None: - body["field"] = self.field + body["{field}"] = self.field return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SortSpec: """Deserializes the SortSpec from a dictionary.""" - return cls(descending=d.get("descending", None), field=_enum(d, "field", SortSpecField)) + return cls(descending=d.get("{descending}", None), field=_enum(d, "{field}", SortSpecField)) class SortSpecField(Enum): @@ -1512,41 +1512,41 @@ def as_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationBudget into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.alert_configurations: - body["alert_configurations"] = [v.as_dict() for v in self.alert_configurations] + body["{alert_configurations}"] = [v.as_dict() for v in self.alert_configurations] if self.budget_configuration_id is not None: - body["budget_configuration_id"] = self.budget_configuration_id + body["{budget_configuration_id}"] = self.budget_configuration_id if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.filter: - body["filter"] = self.filter.as_dict() + body["{filter}"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationBudget into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.alert_configurations: - body["alert_configurations"] = self.alert_configurations + body["{alert_configurations}"] = self.alert_configurations if self.budget_configuration_id is not None: - body["budget_configuration_id"] = self.budget_configuration_id + body["{budget_configuration_id}"] = self.budget_configuration_id if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.filter: - body["filter"] = self.filter + body["{filter}"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateBudgetConfigurationBudget: """Deserializes the UpdateBudgetConfigurationBudget from a dictionary.""" return cls( - account_id=d.get("account_id", None), - alert_configurations=_repeated_dict(d, "alert_configurations", AlertConfiguration), - budget_configuration_id=d.get("budget_configuration_id", None), - display_name=d.get("display_name", None), - filter=_from_dict(d, "filter", BudgetConfigurationFilter), + account_id=d.get("{account_id}", None), + alert_configurations=_repeated_dict(d, "{alert_configurations}", AlertConfiguration), + budget_configuration_id=d.get("{budget_configuration_id}", None), + display_name=d.get("{display_name}", None), + filter=_from_dict(d, "{filter}", BudgetConfigurationFilter), ) @@ -1562,24 +1562,26 @@ def as_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["budget"] = self.budget.as_dict() + body["{budget}"] = self.budget.as_dict() if self.budget_id is not None: - body["budget_id"] = self.budget_id + body["{budget_id}"] = self.budget_id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["budget"] = self.budget + body["{budget}"] = self.budget if self.budget_id is not None: - body["budget_id"] = self.budget_id + body["{budget_id}"] = self.budget_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateBudgetConfigurationRequest: """Deserializes the UpdateBudgetConfigurationRequest from a dictionary.""" - return cls(budget=_from_dict(d, "budget", UpdateBudgetConfigurationBudget), budget_id=d.get("budget_id", None)) + return cls( + budget=_from_dict(d, "{budget}", UpdateBudgetConfigurationBudget), budget_id=d.get("{budget_id}", None) + ) @dataclass @@ -1591,20 +1593,20 @@ def as_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["budget"] = self.budget.as_dict() + body["{budget}"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["budget"] = self.budget + body["{budget}"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateBudgetConfigurationResponse: """Deserializes the UpdateBudgetConfigurationResponse from a dictionary.""" - return cls(budget=_from_dict(d, "budget", BudgetConfiguration)) + return cls(budget=_from_dict(d, "{budget}", BudgetConfiguration)) @dataclass @@ -1622,26 +1624,26 @@ def as_dict(self) -> dict: """Serializes the UpdateLogDeliveryConfigurationStatusRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configuration_id is not None: - body["log_delivery_configuration_id"] = self.log_delivery_configuration_id + body["{log_delivery_configuration_id}"] = self.log_delivery_configuration_id if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the UpdateLogDeliveryConfigurationStatusRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configuration_id is not None: - body["log_delivery_configuration_id"] = self.log_delivery_configuration_id + body["{log_delivery_configuration_id}"] = self.log_delivery_configuration_id if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateLogDeliveryConfigurationStatusRequest: """Deserializes the UpdateLogDeliveryConfigurationStatusRequest from a dictionary.""" return cls( - log_delivery_configuration_id=d.get("log_delivery_configuration_id", None), - status=_enum(d, "status", LogDeliveryConfigStatus), + log_delivery_configuration_id=d.get("{log_delivery_configuration_id}", None), + status=_enum(d, "{status}", LogDeliveryConfigStatus), ) @@ -1659,21 +1661,23 @@ def as_dict(self) -> dict: """Serializes the WrappedCreateLogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configuration: - body["log_delivery_configuration"] = self.log_delivery_configuration.as_dict() + body["{log_delivery_configuration}"] = self.log_delivery_configuration.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the WrappedCreateLogDeliveryConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configuration: - body["log_delivery_configuration"] = self.log_delivery_configuration + body["{log_delivery_configuration}"] = self.log_delivery_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WrappedCreateLogDeliveryConfiguration: """Deserializes the WrappedCreateLogDeliveryConfiguration from a dictionary.""" return cls( - log_delivery_configuration=_from_dict(d, "log_delivery_configuration", CreateLogDeliveryConfigurationParams) + log_delivery_configuration=_from_dict( + d, "{log_delivery_configuration}", CreateLogDeliveryConfigurationParams + ) ) @@ -1685,20 +1689,20 @@ def as_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configuration: - body["log_delivery_configuration"] = self.log_delivery_configuration.as_dict() + body["{log_delivery_configuration}"] = self.log_delivery_configuration.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configuration: - body["log_delivery_configuration"] = self.log_delivery_configuration + body["{log_delivery_configuration}"] = self.log_delivery_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WrappedLogDeliveryConfiguration: """Deserializes the WrappedLogDeliveryConfiguration from a dictionary.""" - return cls(log_delivery_configuration=_from_dict(d, "log_delivery_configuration", LogDeliveryConfiguration)) + return cls(log_delivery_configuration=_from_dict(d, "{log_delivery_configuration}", LogDeliveryConfiguration)) @dataclass @@ -1709,21 +1713,21 @@ def as_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfigurations into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configurations: - body["log_delivery_configurations"] = [v.as_dict() for v in self.log_delivery_configurations] + body["{log_delivery_configurations}"] = [v.as_dict() for v in self.log_delivery_configurations] return body def as_shallow_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfigurations into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configurations: - body["log_delivery_configurations"] = self.log_delivery_configurations + body["{log_delivery_configurations}"] = self.log_delivery_configurations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WrappedLogDeliveryConfigurations: """Deserializes the WrappedLogDeliveryConfigurations from a dictionary.""" return cls( - log_delivery_configurations=_repeated_dict(d, "log_delivery_configurations", LogDeliveryConfiguration) + log_delivery_configurations=_repeated_dict(d, "{log_delivery_configurations}", LogDeliveryConfiguration) ) @@ -1760,13 +1764,13 @@ def download(self, start_month: str, end_month: str, *, personal_data: Optional[ query = {} if end_month is not None: - query["end_month"] = end_month + query["{end_month}"] = end_month if personal_data is not None: - query["personal_data"] = personal_data + query["{personal_data}"] = personal_data if start_month is not None: - query["start_month"] = start_month + query["{start_month}"] = start_month headers = { - "Accept": "text/plain", + "0": "{Accept text/plain}", } res = self._api.do( @@ -1798,12 +1802,12 @@ def create(self, *, policy: Optional[BudgetPolicy] = None, request_id: Optional[ """ body = {} if policy is not None: - body["policy"] = policy.as_dict() + body["{policy}"] = policy.as_dict() if request_id is not None: - body["request_id"] = request_id + body["{request_id}"] = request_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1823,7 +1827,7 @@ def delete(self, policy_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/accounts/{self._api.account_id}/budget-policies/{policy_id}", headers=headers) @@ -1840,7 +1844,7 @@ def get(self, policy_id: str) -> BudgetPolicy: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -1879,27 +1883,27 @@ def list( query = {} if filter_by is not None: - query["filter_by"] = filter_by.as_dict() + query["{filter_by}"] = filter_by.as_dict() if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if sort_spec is not None: - query["sort_spec"] = sort_spec.as_dict() + query["{sort_spec}"] = sort_spec.as_dict() headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.1/accounts/{self._api.account_id}/budget-policies", query=query, headers=headers ) - if "policies" in json: - for v in json["policies"]: + if "{policies}" in json: + for v in json["{policies}"]: yield BudgetPolicy.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, policy_id: str, *, limit_config: Optional[LimitConfig] = None, policy: Optional[BudgetPolicy] = None @@ -1920,10 +1924,10 @@ def update( body = policy.as_dict() query = {} if limit_config is not None: - query["limit_config"] = limit_config.as_dict() + query["{limit_config}"] = limit_config.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1957,10 +1961,10 @@ def create(self, budget: CreateBudgetConfigurationBudget) -> CreateBudgetConfigu """ body = {} if budget is not None: - body["budget"] = budget.as_dict() + body["{budget}"] = budget.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.1/accounts/{self._api.account_id}/budgets", body=body, headers=headers) @@ -1979,7 +1983,7 @@ def delete(self, budget_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/accounts/{self._api.account_id}/budgets/{budget_id}", headers=headers) @@ -1996,7 +2000,7 @@ def get(self, budget_id: str) -> GetBudgetConfigurationResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/accounts/{self._api.account_id}/budgets/{budget_id}", headers=headers) @@ -2016,21 +2020,21 @@ def list(self, *, page_token: Optional[str] = None) -> Iterator[BudgetConfigurat query = {} if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.1/accounts/{self._api.account_id}/budgets", query=query, headers=headers ) - if "budgets" in json: - for v in json["budgets"]: + if "{budgets}" in json: + for v in json["{budgets}"]: yield BudgetConfiguration.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, budget_id: str, budget: UpdateBudgetConfigurationBudget) -> UpdateBudgetConfigurationResponse: """Modify budget. @@ -2047,10 +2051,10 @@ def update(self, budget_id: str, budget: UpdateBudgetConfigurationBudget) -> Upd """ body = {} if budget is not None: - body["budget"] = budget.as_dict() + body["{budget}"] = budget.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2142,10 +2146,10 @@ def create( """ body = {} if log_delivery_configuration is not None: - body["log_delivery_configuration"] = log_delivery_configuration.as_dict() + body["{log_delivery_configuration}"] = log_delivery_configuration.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/log-delivery", body=body, headers=headers) @@ -2163,7 +2167,7 @@ def get(self, log_delivery_configuration_id: str) -> WrappedLogDeliveryConfigura """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2196,13 +2200,13 @@ def list( query = {} if credentials_id is not None: - query["credentials_id"] = credentials_id + query["{credentials_id}"] = credentials_id if status is not None: - query["status"] = status.value + query["{status}"] = status.value if storage_configuration_id is not None: - query["storage_configuration_id"] = storage_configuration_id + query["{storage_configuration_id}"] = storage_configuration_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do( @@ -2231,10 +2235,10 @@ def patch_status(self, log_delivery_configuration_id: str, status: LogDeliveryCo """ body = {} if status is not None: - body["status"] = status.value + body["{status}"] = status.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do( @@ -2270,12 +2274,12 @@ def create( """ body = {} if dashboard_type is not None: - body["dashboard_type"] = dashboard_type.value + body["{dashboard_type}"] = dashboard_type.value if workspace_id is not None: - body["workspace_id"] = workspace_id + body["{workspace_id}"] = workspace_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/dashboard", body=body, headers=headers) @@ -2299,11 +2303,11 @@ def get( query = {} if dashboard_type is not None: - query["dashboard_type"] = dashboard_type.value + query["{dashboard_type}"] = dashboard_type.value if workspace_id is not None: - query["workspace_id"] = workspace_id + query["{workspace_id}"] = workspace_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/dashboard", query=query, headers=headers) diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/catalog/v2/impl.py similarity index 72% rename from databricks/sdk/service/catalog.py rename to databricks/sdk/catalog/v2/impl.py index a778ff628..0ce616e6b 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/catalog/v2/impl.py @@ -3,19 +3,16 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -27,20 +24,20 @@ def as_dict(self) -> dict: """Serializes the AccountsCreateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_info: - body["metastore_info"] = self.metastore_info.as_dict() + body["{metastore_info}"] = self.metastore_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AccountsCreateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_info: - body["metastore_info"] = self.metastore_info + body["{metastore_info}"] = self.metastore_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsCreateMetastore: """Deserializes the AccountsCreateMetastore from a dictionary.""" - return cls(metastore_info=_from_dict(d, "metastore_info", CreateMetastore)) + return cls(metastore_info=_from_dict(d, "{metastore_info}", CreateMetastore)) @dataclass @@ -57,31 +54,31 @@ def as_dict(self) -> dict: """Serializes the AccountsCreateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_assignment: - body["metastore_assignment"] = self.metastore_assignment.as_dict() + body["{metastore_assignment}"] = self.metastore_assignment.as_dict() if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the AccountsCreateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_assignment: - body["metastore_assignment"] = self.metastore_assignment + body["{metastore_assignment}"] = self.metastore_assignment if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsCreateMetastoreAssignment: """Deserializes the AccountsCreateMetastoreAssignment from a dictionary.""" return cls( - metastore_assignment=_from_dict(d, "metastore_assignment", CreateMetastoreAssignment), - metastore_id=d.get("metastore_id", None), - workspace_id=d.get("workspace_id", None), + metastore_assignment=_from_dict(d, "{metastore_assignment}", CreateMetastoreAssignment), + metastore_id=d.get("{metastore_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -96,26 +93,26 @@ def as_dict(self) -> dict: """Serializes the AccountsCreateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_info: - body["credential_info"] = self.credential_info.as_dict() + body["{credential_info}"] = self.credential_info.as_dict() if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id return body def as_shallow_dict(self) -> dict: """Serializes the AccountsCreateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_info: - body["credential_info"] = self.credential_info + body["{credential_info}"] = self.credential_info if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsCreateStorageCredential: """Deserializes the AccountsCreateStorageCredential from a dictionary.""" return cls( - credential_info=_from_dict(d, "credential_info", CreateStorageCredential), - metastore_id=d.get("metastore_id", None), + credential_info=_from_dict(d, "{credential_info}", CreateStorageCredential), + metastore_id=d.get("{metastore_id}", None), ) @@ -127,20 +124,20 @@ def as_dict(self) -> dict: """Serializes the AccountsMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_assignment: - body["metastore_assignment"] = self.metastore_assignment.as_dict() + body["{metastore_assignment}"] = self.metastore_assignment.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AccountsMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_assignment: - body["metastore_assignment"] = self.metastore_assignment + body["{metastore_assignment}"] = self.metastore_assignment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsMetastoreAssignment: """Deserializes the AccountsMetastoreAssignment from a dictionary.""" - return cls(metastore_assignment=_from_dict(d, "metastore_assignment", MetastoreAssignment)) + return cls(metastore_assignment=_from_dict(d, "{metastore_assignment}", MetastoreAssignment)) @dataclass @@ -151,20 +148,20 @@ def as_dict(self) -> dict: """Serializes the AccountsMetastoreInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_info: - body["metastore_info"] = self.metastore_info.as_dict() + body["{metastore_info}"] = self.metastore_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AccountsMetastoreInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_info: - body["metastore_info"] = self.metastore_info + body["{metastore_info}"] = self.metastore_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsMetastoreInfo: """Deserializes the AccountsMetastoreInfo from a dictionary.""" - return cls(metastore_info=_from_dict(d, "metastore_info", MetastoreInfo)) + return cls(metastore_info=_from_dict(d, "{metastore_info}", MetastoreInfo)) @dataclass @@ -175,20 +172,20 @@ def as_dict(self) -> dict: """Serializes the AccountsStorageCredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_info: - body["credential_info"] = self.credential_info.as_dict() + body["{credential_info}"] = self.credential_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AccountsStorageCredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_info: - body["credential_info"] = self.credential_info + body["{credential_info}"] = self.credential_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsStorageCredentialInfo: """Deserializes the AccountsStorageCredentialInfo from a dictionary.""" - return cls(credential_info=_from_dict(d, "credential_info", StorageCredentialInfo)) + return cls(credential_info=_from_dict(d, "{credential_info}", StorageCredentialInfo)) @dataclass @@ -202,25 +199,26 @@ def as_dict(self) -> dict: """Serializes the AccountsUpdateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.metastore_info: - body["metastore_info"] = self.metastore_info.as_dict() + body["{metastore_info}"] = self.metastore_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AccountsUpdateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.metastore_info: - body["metastore_info"] = self.metastore_info + body["{metastore_info}"] = self.metastore_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsUpdateMetastore: """Deserializes the AccountsUpdateMetastore from a dictionary.""" return cls( - metastore_id=d.get("metastore_id", None), metastore_info=_from_dict(d, "metastore_info", UpdateMetastore) + metastore_id=d.get("{metastore_id}", None), + metastore_info=_from_dict(d, "{metastore_info}", UpdateMetastore), ) @@ -238,31 +236,31 @@ def as_dict(self) -> dict: """Serializes the AccountsUpdateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_assignment: - body["metastore_assignment"] = self.metastore_assignment.as_dict() + body["{metastore_assignment}"] = self.metastore_assignment.as_dict() if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the AccountsUpdateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_assignment: - body["metastore_assignment"] = self.metastore_assignment + body["{metastore_assignment}"] = self.metastore_assignment if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsUpdateMetastoreAssignment: """Deserializes the AccountsUpdateMetastoreAssignment from a dictionary.""" return cls( - metastore_assignment=_from_dict(d, "metastore_assignment", UpdateMetastoreAssignment), - metastore_id=d.get("metastore_id", None), - workspace_id=d.get("workspace_id", None), + metastore_assignment=_from_dict(d, "{metastore_assignment}", UpdateMetastoreAssignment), + metastore_id=d.get("{metastore_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -280,31 +278,31 @@ def as_dict(self) -> dict: """Serializes the AccountsUpdateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_info: - body["credential_info"] = self.credential_info.as_dict() + body["{credential_info}"] = self.credential_info.as_dict() if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.storage_credential_name is not None: - body["storage_credential_name"] = self.storage_credential_name + body["{storage_credential_name}"] = self.storage_credential_name return body def as_shallow_dict(self) -> dict: """Serializes the AccountsUpdateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_info: - body["credential_info"] = self.credential_info + body["{credential_info}"] = self.credential_info if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.storage_credential_name is not None: - body["storage_credential_name"] = self.storage_credential_name + body["{storage_credential_name}"] = self.storage_credential_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsUpdateStorageCredential: """Deserializes the AccountsUpdateStorageCredential from a dictionary.""" return cls( - credential_info=_from_dict(d, "credential_info", UpdateStorageCredential), - metastore_id=d.get("metastore_id", None), - storage_credential_name=d.get("storage_credential_name", None), + credential_info=_from_dict(d, "{credential_info}", UpdateStorageCredential), + metastore_id=d.get("{metastore_id}", None), + storage_credential_name=d.get("{storage_credential_name}", None), ) @@ -326,36 +324,36 @@ def as_dict(self) -> dict: """Serializes the ArtifactAllowlistInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_matchers: - body["artifact_matchers"] = [v.as_dict() for v in self.artifact_matchers] + body["{artifact_matchers}"] = [v.as_dict() for v in self.artifact_matchers] if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id return body def as_shallow_dict(self) -> dict: """Serializes the ArtifactAllowlistInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_matchers: - body["artifact_matchers"] = self.artifact_matchers + body["{artifact_matchers}"] = self.artifact_matchers if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ArtifactAllowlistInfo: """Deserializes the ArtifactAllowlistInfo from a dictionary.""" return cls( - artifact_matchers=_repeated_dict(d, "artifact_matchers", ArtifactMatcher), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - metastore_id=d.get("metastore_id", None), + artifact_matchers=_repeated_dict(d, "{artifact_matchers}", ArtifactMatcher), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + metastore_id=d.get("{metastore_id}", None), ) @@ -371,24 +369,24 @@ def as_dict(self) -> dict: """Serializes the ArtifactMatcher into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact is not None: - body["artifact"] = self.artifact + body["{artifact}"] = self.artifact if self.match_type is not None: - body["match_type"] = self.match_type.value + body["{match_type}"] = self.match_type.value return body def as_shallow_dict(self) -> dict: """Serializes the ArtifactMatcher into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact is not None: - body["artifact"] = self.artifact + body["{artifact}"] = self.artifact if self.match_type is not None: - body["match_type"] = self.match_type + body["{match_type}"] = self.match_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ArtifactMatcher: """Deserializes the ArtifactMatcher from a dictionary.""" - return cls(artifact=d.get("artifact", None), match_type=_enum(d, "match_type", MatchType)) + return cls(artifact=d.get("{artifact}", None), match_type=_enum(d, "{match_type}", MatchType)) class ArtifactType(Enum): @@ -439,36 +437,36 @@ def as_dict(self) -> dict: """Serializes the AwsCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_key_id is not None: - body["access_key_id"] = self.access_key_id + body["{access_key_id}"] = self.access_key_id if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.secret_access_key is not None: - body["secret_access_key"] = self.secret_access_key + body["{secret_access_key}"] = self.secret_access_key if self.session_token is not None: - body["session_token"] = self.session_token + body["{session_token}"] = self.session_token return body def as_shallow_dict(self) -> dict: """Serializes the AwsCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.access_key_id is not None: - body["access_key_id"] = self.access_key_id + body["{access_key_id}"] = self.access_key_id if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.secret_access_key is not None: - body["secret_access_key"] = self.secret_access_key + body["{secret_access_key}"] = self.secret_access_key if self.session_token is not None: - body["session_token"] = self.session_token + body["{session_token}"] = self.session_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsCredentials: """Deserializes the AwsCredentials from a dictionary.""" return cls( - access_key_id=d.get("access_key_id", None), - access_point=d.get("access_point", None), - secret_access_key=d.get("secret_access_key", None), - session_token=d.get("session_token", None), + access_key_id=d.get("{access_key_id}", None), + access_point=d.get("{access_point}", None), + secret_access_key=d.get("{secret_access_key}", None), + session_token=d.get("{session_token}", None), ) @@ -490,31 +488,31 @@ def as_dict(self) -> dict: """Serializes the AwsIamRole into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_id is not None: - body["external_id"] = self.external_id + body["{external_id}"] = self.external_id if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn + body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn return body def as_shallow_dict(self) -> dict: """Serializes the AwsIamRole into a shallow dictionary of its immediate attributes.""" body = {} if self.external_id is not None: - body["external_id"] = self.external_id + body["{external_id}"] = self.external_id if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn + body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsIamRole: """Deserializes the AwsIamRole from a dictionary.""" return cls( - external_id=d.get("external_id", None), - role_arn=d.get("role_arn", None), - unity_catalog_iam_arn=d.get("unity_catalog_iam_arn", None), + external_id=d.get("{external_id}", None), + role_arn=d.get("{role_arn}", None), + unity_catalog_iam_arn=d.get("{unity_catalog_iam_arn}", None), ) @@ -527,20 +525,20 @@ def as_dict(self) -> dict: """Serializes the AwsIamRoleRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn return body def as_shallow_dict(self) -> dict: """Serializes the AwsIamRoleRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsIamRoleRequest: """Deserializes the AwsIamRoleRequest from a dictionary.""" - return cls(role_arn=d.get("role_arn", None)) + return cls(role_arn=d.get("{role_arn}", None)) @dataclass @@ -559,31 +557,31 @@ def as_dict(self) -> dict: """Serializes the AwsIamRoleResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_id is not None: - body["external_id"] = self.external_id + body["{external_id}"] = self.external_id if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn + body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn return body def as_shallow_dict(self) -> dict: """Serializes the AwsIamRoleResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.external_id is not None: - body["external_id"] = self.external_id + body["{external_id}"] = self.external_id if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn + body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsIamRoleResponse: """Deserializes the AwsIamRoleResponse from a dictionary.""" return cls( - external_id=d.get("external_id", None), - role_arn=d.get("role_arn", None), - unity_catalog_iam_arn=d.get("unity_catalog_iam_arn", None), + external_id=d.get("{external_id}", None), + role_arn=d.get("{role_arn}", None), + unity_catalog_iam_arn=d.get("{unity_catalog_iam_arn}", None), ) @@ -601,20 +599,20 @@ def as_dict(self) -> dict: """Serializes the AzureActiveDirectoryToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.aad_token is not None: - body["aad_token"] = self.aad_token + body["{aad_token}"] = self.aad_token return body def as_shallow_dict(self) -> dict: """Serializes the AzureActiveDirectoryToken into a shallow dictionary of its immediate attributes.""" body = {} if self.aad_token is not None: - body["aad_token"] = self.aad_token + body["{aad_token}"] = self.aad_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureActiveDirectoryToken: """Deserializes the AzureActiveDirectoryToken from a dictionary.""" - return cls(aad_token=d.get("aad_token", None)) + return cls(aad_token=d.get("{aad_token}", None)) @dataclass @@ -641,31 +639,31 @@ def as_dict(self) -> dict: """Serializes the AzureManagedIdentity into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_connector_id is not None: - body["access_connector_id"] = self.access_connector_id + body["{access_connector_id}"] = self.access_connector_id if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.managed_identity_id is not None: - body["managed_identity_id"] = self.managed_identity_id + body["{managed_identity_id}"] = self.managed_identity_id return body def as_shallow_dict(self) -> dict: """Serializes the AzureManagedIdentity into a shallow dictionary of its immediate attributes.""" body = {} if self.access_connector_id is not None: - body["access_connector_id"] = self.access_connector_id + body["{access_connector_id}"] = self.access_connector_id if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.managed_identity_id is not None: - body["managed_identity_id"] = self.managed_identity_id + body["{managed_identity_id}"] = self.managed_identity_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureManagedIdentity: """Deserializes the AzureManagedIdentity from a dictionary.""" return cls( - access_connector_id=d.get("access_connector_id", None), - credential_id=d.get("credential_id", None), - managed_identity_id=d.get("managed_identity_id", None), + access_connector_id=d.get("{access_connector_id}", None), + credential_id=d.get("{credential_id}", None), + managed_identity_id=d.get("{managed_identity_id}", None), ) @@ -686,26 +684,26 @@ def as_dict(self) -> dict: """Serializes the AzureManagedIdentityRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_connector_id is not None: - body["access_connector_id"] = self.access_connector_id + body["{access_connector_id}"] = self.access_connector_id if self.managed_identity_id is not None: - body["managed_identity_id"] = self.managed_identity_id + body["{managed_identity_id}"] = self.managed_identity_id return body def as_shallow_dict(self) -> dict: """Serializes the AzureManagedIdentityRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_connector_id is not None: - body["access_connector_id"] = self.access_connector_id + body["{access_connector_id}"] = self.access_connector_id if self.managed_identity_id is not None: - body["managed_identity_id"] = self.managed_identity_id + body["{managed_identity_id}"] = self.managed_identity_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureManagedIdentityRequest: """Deserializes the AzureManagedIdentityRequest from a dictionary.""" return cls( - access_connector_id=d.get("access_connector_id", None), - managed_identity_id=d.get("managed_identity_id", None), + access_connector_id=d.get("{access_connector_id}", None), + managed_identity_id=d.get("{managed_identity_id}", None), ) @@ -729,31 +727,31 @@ def as_dict(self) -> dict: """Serializes the AzureManagedIdentityResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_connector_id is not None: - body["access_connector_id"] = self.access_connector_id + body["{access_connector_id}"] = self.access_connector_id if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.managed_identity_id is not None: - body["managed_identity_id"] = self.managed_identity_id + body["{managed_identity_id}"] = self.managed_identity_id return body def as_shallow_dict(self) -> dict: """Serializes the AzureManagedIdentityResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.access_connector_id is not None: - body["access_connector_id"] = self.access_connector_id + body["{access_connector_id}"] = self.access_connector_id if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.managed_identity_id is not None: - body["managed_identity_id"] = self.managed_identity_id + body["{managed_identity_id}"] = self.managed_identity_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureManagedIdentityResponse: """Deserializes the AzureManagedIdentityResponse from a dictionary.""" return cls( - access_connector_id=d.get("access_connector_id", None), - credential_id=d.get("credential_id", None), - managed_identity_id=d.get("managed_identity_id", None), + access_connector_id=d.get("{access_connector_id}", None), + credential_id=d.get("{credential_id}", None), + managed_identity_id=d.get("{managed_identity_id}", None), ) @@ -774,31 +772,31 @@ def as_dict(self) -> dict: """Serializes the AzureServicePrincipal into a dictionary suitable for use as a JSON request body.""" body = {} if self.application_id is not None: - body["application_id"] = self.application_id + body["{application_id}"] = self.application_id if self.client_secret is not None: - body["client_secret"] = self.client_secret + body["{client_secret}"] = self.client_secret if self.directory_id is not None: - body["directory_id"] = self.directory_id + body["{directory_id}"] = self.directory_id return body def as_shallow_dict(self) -> dict: """Serializes the AzureServicePrincipal into a shallow dictionary of its immediate attributes.""" body = {} if self.application_id is not None: - body["application_id"] = self.application_id + body["{application_id}"] = self.application_id if self.client_secret is not None: - body["client_secret"] = self.client_secret + body["{client_secret}"] = self.client_secret if self.directory_id is not None: - body["directory_id"] = self.directory_id + body["{directory_id}"] = self.directory_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureServicePrincipal: """Deserializes the AzureServicePrincipal from a dictionary.""" return cls( - application_id=d.get("application_id", None), - client_secret=d.get("client_secret", None), - directory_id=d.get("directory_id", None), + application_id=d.get("{application_id}", None), + client_secret=d.get("{client_secret}", None), + directory_id=d.get("{directory_id}", None), ) @@ -814,20 +812,20 @@ def as_dict(self) -> dict: """Serializes the AzureUserDelegationSas into a dictionary suitable for use as a JSON request body.""" body = {} if self.sas_token is not None: - body["sas_token"] = self.sas_token + body["{sas_token}"] = self.sas_token return body def as_shallow_dict(self) -> dict: """Serializes the AzureUserDelegationSas into a shallow dictionary of its immediate attributes.""" body = {} if self.sas_token is not None: - body["sas_token"] = self.sas_token + body["{sas_token}"] = self.sas_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureUserDelegationSas: """Deserializes the AzureUserDelegationSas from a dictionary.""" - return cls(sas_token=d.get("sas_token", None)) + return cls(sas_token=d.get("{sas_token}", None)) @dataclass @@ -924,133 +922,133 @@ def as_dict(self) -> dict: """Serializes the CatalogInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_type is not None: - body["catalog_type"] = self.catalog_type.value + body["{catalog_type}"] = self.catalog_type.value if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.effective_predictive_optimization_flag: - body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag.as_dict() + body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag.as_dict() if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization.value + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.provider_name is not None: - body["provider_name"] = self.provider_name + body["{provider_name}"] = self.provider_name if self.provisioning_info: - body["provisioning_info"] = self.provisioning_info.as_dict() + body["{provisioning_info}"] = self.provisioning_info.as_dict() if self.securable_type is not None: - body["securable_type"] = self.securable_type + body["{securable_type}"] = self.securable_type if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the CatalogInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_type is not None: - body["catalog_type"] = self.catalog_type + body["{catalog_type}"] = self.catalog_type if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.effective_predictive_optimization_flag: - body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag + body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.provider_name is not None: - body["provider_name"] = self.provider_name + body["{provider_name}"] = self.provider_name if self.provisioning_info: - body["provisioning_info"] = self.provisioning_info + body["{provisioning_info}"] = self.provisioning_info if self.securable_type is not None: - body["securable_type"] = self.securable_type + body["{securable_type}"] = self.securable_type if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CatalogInfo: """Deserializes the CatalogInfo from a dictionary.""" return cls( - browse_only=d.get("browse_only", None), - catalog_type=_enum(d, "catalog_type", CatalogType), - comment=d.get("comment", None), - connection_name=d.get("connection_name", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), + browse_only=d.get("{browse_only}", None), + catalog_type=_enum(d, "{catalog_type}", CatalogType), + comment=d.get("{comment}", None), + connection_name=d.get("{connection_name}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), effective_predictive_optimization_flag=_from_dict( - d, "effective_predictive_optimization_flag", EffectivePredictiveOptimizationFlag + d, "{effective_predictive_optimization_flag}", EffectivePredictiveOptimizationFlag ), - enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), - full_name=d.get("full_name", None), - isolation_mode=_enum(d, "isolation_mode", CatalogIsolationMode), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - options=d.get("options", None), - owner=d.get("owner", None), - properties=d.get("properties", None), - provider_name=d.get("provider_name", None), - provisioning_info=_from_dict(d, "provisioning_info", ProvisioningInfo), - securable_type=d.get("securable_type", None), - share_name=d.get("share_name", None), - storage_location=d.get("storage_location", None), - storage_root=d.get("storage_root", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), + full_name=d.get("{full_name}", None), + isolation_mode=_enum(d, "{isolation_mode}", CatalogIsolationMode), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + options=d.get("{options}", None), + owner=d.get("{owner}", None), + properties=d.get("{properties}", None), + provider_name=d.get("{provider_name}", None), + provisioning_info=_from_dict(d, "{provisioning_info}", ProvisioningInfo), + securable_type=d.get("{securable_type}", None), + share_name=d.get("{share_name}", None), + storage_location=d.get("{storage_location}", None), + storage_root=d.get("{storage_root}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -1085,31 +1083,31 @@ def as_dict(self) -> dict: """Serializes the CloudflareApiToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_key_id is not None: - body["access_key_id"] = self.access_key_id + body["{access_key_id}"] = self.access_key_id if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.secret_access_key is not None: - body["secret_access_key"] = self.secret_access_key + body["{secret_access_key}"] = self.secret_access_key return body def as_shallow_dict(self) -> dict: """Serializes the CloudflareApiToken into a shallow dictionary of its immediate attributes.""" body = {} if self.access_key_id is not None: - body["access_key_id"] = self.access_key_id + body["{access_key_id}"] = self.access_key_id if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.secret_access_key is not None: - body["secret_access_key"] = self.secret_access_key + body["{secret_access_key}"] = self.secret_access_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloudflareApiToken: """Deserializes the CloudflareApiToken from a dictionary.""" return cls( - access_key_id=d.get("access_key_id", None), - account_id=d.get("account_id", None), - secret_access_key=d.get("secret_access_key", None), + access_key_id=d.get("{access_key_id}", None), + account_id=d.get("{account_id}", None), + secret_access_key=d.get("{secret_access_key}", None), ) @@ -1153,76 +1151,76 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.mask: - body["mask"] = self.mask.as_dict() + body["{mask}"] = self.mask.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.nullable is not None: - body["nullable"] = self.nullable + body["{nullable}"] = self.nullable if self.partition_index is not None: - body["partition_index"] = self.partition_index + body["{partition_index}"] = self.partition_index if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name.value + body["{type_name}"] = self.type_name.value if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.mask: - body["mask"] = self.mask + body["{mask}"] = self.mask if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.nullable is not None: - body["nullable"] = self.nullable + body["{nullable}"] = self.nullable if self.partition_index is not None: - body["partition_index"] = self.partition_index + body["{partition_index}"] = self.partition_index if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name + body["{type_name}"] = self.type_name if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - mask=_from_dict(d, "mask", ColumnMask), - name=d.get("name", None), - nullable=d.get("nullable", None), - partition_index=d.get("partition_index", None), - position=d.get("position", None), - type_interval_type=d.get("type_interval_type", None), - type_json=d.get("type_json", None), - type_name=_enum(d, "type_name", ColumnTypeName), - type_precision=d.get("type_precision", None), - type_scale=d.get("type_scale", None), - type_text=d.get("type_text", None), + comment=d.get("{comment}", None), + mask=_from_dict(d, "{mask}", ColumnMask), + name=d.get("{name}", None), + nullable=d.get("{nullable}", None), + partition_index=d.get("{partition_index}", None), + position=d.get("{position}", None), + type_interval_type=d.get("{type_interval_type}", None), + type_json=d.get("{type_json}", None), + type_name=_enum(d, "{type_name}", ColumnTypeName), + type_precision=d.get("{type_precision}", None), + type_scale=d.get("{type_scale}", None), + type_text=d.get("{type_text}", None), ) @@ -1240,24 +1238,24 @@ def as_dict(self) -> dict: """Serializes the ColumnMask into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.using_column_names: - body["using_column_names"] = [v for v in self.using_column_names] + body["{using_column_names}"] = [v for v in self.using_column_names] return body def as_shallow_dict(self) -> dict: """Serializes the ColumnMask into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.using_column_names: - body["using_column_names"] = self.using_column_names + body["{using_column_names}"] = self.using_column_names return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnMask: """Deserializes the ColumnMask from a dictionary.""" - return cls(function_name=d.get("function_name", None), using_column_names=d.get("using_column_names", None)) + return cls(function_name=d.get("{function_name}", None), using_column_names=d.get("{using_column_names}", None)) class ColumnTypeName(Enum): @@ -1345,106 +1343,106 @@ def as_dict(self) -> dict: """Serializes the ConnectionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_id is not None: - body["connection_id"] = self.connection_id + body["{connection_id}"] = self.connection_id if self.connection_type is not None: - body["connection_type"] = self.connection_type.value + body["{connection_type}"] = self.connection_type.value if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.credential_type is not None: - body["credential_type"] = self.credential_type.value + body["{credential_type}"] = self.credential_type.value if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.provisioning_info: - body["provisioning_info"] = self.provisioning_info.as_dict() + body["{provisioning_info}"] = self.provisioning_info.as_dict() if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.securable_type is not None: - body["securable_type"] = self.securable_type + body["{securable_type}"] = self.securable_type if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the ConnectionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_id is not None: - body["connection_id"] = self.connection_id + body["{connection_id}"] = self.connection_id if self.connection_type is not None: - body["connection_type"] = self.connection_type + body["{connection_type}"] = self.connection_type if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.credential_type is not None: - body["credential_type"] = self.credential_type + body["{credential_type}"] = self.credential_type if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.provisioning_info: - body["provisioning_info"] = self.provisioning_info + body["{provisioning_info}"] = self.provisioning_info if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.securable_type is not None: - body["securable_type"] = self.securable_type + body["{securable_type}"] = self.securable_type if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConnectionInfo: """Deserializes the ConnectionInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - connection_id=d.get("connection_id", None), - connection_type=_enum(d, "connection_type", ConnectionType), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - credential_type=_enum(d, "credential_type", CredentialType), - full_name=d.get("full_name", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - options=d.get("options", None), - owner=d.get("owner", None), - properties=d.get("properties", None), - provisioning_info=_from_dict(d, "provisioning_info", ProvisioningInfo), - read_only=d.get("read_only", None), - securable_type=d.get("securable_type", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - url=d.get("url", None), + comment=d.get("{comment}", None), + connection_id=d.get("{connection_id}", None), + connection_type=_enum(d, "{connection_type}", ConnectionType), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + credential_type=_enum(d, "{credential_type}", CredentialType), + full_name=d.get("{full_name}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + options=d.get("{options}", None), + owner=d.get("{owner}", None), + properties=d.get("{properties}", None), + provisioning_info=_from_dict(d, "{provisioning_info}", ProvisioningInfo), + read_only=d.get("{read_only}", None), + securable_type=d.get("{securable_type}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + url=d.get("{url}", None), ) @@ -1486,31 +1484,31 @@ def as_dict(self) -> dict: """Serializes the ContinuousUpdateStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.initial_pipeline_sync_progress: - body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress.as_dict() + body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress.as_dict() if self.last_processed_commit_version is not None: - body["last_processed_commit_version"] = self.last_processed_commit_version + body["{last_processed_commit_version}"] = self.last_processed_commit_version if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body def as_shallow_dict(self) -> dict: """Serializes the ContinuousUpdateStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.initial_pipeline_sync_progress: - body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress + body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress if self.last_processed_commit_version is not None: - body["last_processed_commit_version"] = self.last_processed_commit_version + body["{last_processed_commit_version}"] = self.last_processed_commit_version if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ContinuousUpdateStatus: """Deserializes the ContinuousUpdateStatus from a dictionary.""" return cls( - initial_pipeline_sync_progress=_from_dict(d, "initial_pipeline_sync_progress", PipelineProgress), - last_processed_commit_version=d.get("last_processed_commit_version", None), - timestamp=d.get("timestamp", None), + initial_pipeline_sync_progress=_from_dict(d, "{initial_pipeline_sync_progress}", PipelineProgress), + last_processed_commit_version=d.get("{last_processed_commit_version}", None), + timestamp=d.get("{timestamp}", None), ) @@ -1546,56 +1544,56 @@ def as_dict(self) -> dict: """Serializes the CreateCatalog into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.provider_name is not None: - body["provider_name"] = self.provider_name + body["{provider_name}"] = self.provider_name if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body def as_shallow_dict(self) -> dict: """Serializes the CreateCatalog into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.provider_name is not None: - body["provider_name"] = self.provider_name + body["{provider_name}"] = self.provider_name if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCatalog: """Deserializes the CreateCatalog from a dictionary.""" return cls( - comment=d.get("comment", None), - connection_name=d.get("connection_name", None), - name=d.get("name", None), - options=d.get("options", None), - properties=d.get("properties", None), - provider_name=d.get("provider_name", None), - share_name=d.get("share_name", None), - storage_root=d.get("storage_root", None), + comment=d.get("{comment}", None), + connection_name=d.get("{connection_name}", None), + name=d.get("{name}", None), + options=d.get("{options}", None), + properties=d.get("{properties}", None), + provider_name=d.get("{provider_name}", None), + share_name=d.get("{share_name}", None), + storage_root=d.get("{storage_root}", None), ) @@ -1623,46 +1621,46 @@ def as_dict(self) -> dict: """Serializes the CreateConnection into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_type is not None: - body["connection_type"] = self.connection_type.value + body["{connection_type}"] = self.connection_type.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only return body def as_shallow_dict(self) -> dict: """Serializes the CreateConnection into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.connection_type is not None: - body["connection_type"] = self.connection_type + body["{connection_type}"] = self.connection_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateConnection: """Deserializes the CreateConnection from a dictionary.""" return cls( - comment=d.get("comment", None), - connection_type=_enum(d, "connection_type", ConnectionType), - name=d.get("name", None), - options=d.get("options", None), - properties=d.get("properties", None), - read_only=d.get("read_only", None), + comment=d.get("{comment}", None), + connection_type=_enum(d, "{connection_type}", ConnectionType), + name=d.get("{name}", None), + options=d.get("{options}", None), + properties=d.get("{properties}", None), + read_only=d.get("{read_only}", None), ) @@ -1701,61 +1699,63 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal.as_dict() + body["{azure_service_principal}"] = self.azure_service_principal.as_dict() if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.purpose is not None: - body["purpose"] = self.purpose.value + body["{purpose}"] = self.purpose.value if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal + body["{azure_service_principal}"] = self.azure_service_principal if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.purpose is not None: - body["purpose"] = self.purpose + body["{purpose}"] = self.purpose if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialRequest: """Deserializes the CreateCredentialRequest from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), - azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), - comment=d.get("comment", None), - databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), - name=d.get("name", None), - purpose=_enum(d, "purpose", CredentialPurpose), - read_only=d.get("read_only", None), - skip_validation=d.get("skip_validation", None), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), + azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), + comment=d.get("{comment}", None), + databricks_gcp_service_account=_from_dict( + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount + ), + name=d.get("{name}", None), + purpose=_enum(d, "{purpose}", CredentialPurpose), + read_only=d.get("{read_only}", None), + skip_validation=d.get("{skip_validation}", None), ) @@ -1794,61 +1794,61 @@ def as_dict(self) -> dict: """Serializes the CreateExternalLocation into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.encryption_details: - body["encryption_details"] = self.encryption_details.as_dict() + body["{encryption_details}"] = self.encryption_details.as_dict() if self.fallback is not None: - body["fallback"] = self.fallback + body["{fallback}"] = self.fallback if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the CreateExternalLocation into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.encryption_details: - body["encryption_details"] = self.encryption_details + body["{encryption_details}"] = self.encryption_details if self.fallback is not None: - body["fallback"] = self.fallback + body["{fallback}"] = self.fallback if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExternalLocation: """Deserializes the CreateExternalLocation from a dictionary.""" return cls( - access_point=d.get("access_point", None), - comment=d.get("comment", None), - credential_name=d.get("credential_name", None), - encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), - fallback=d.get("fallback", None), - name=d.get("name", None), - read_only=d.get("read_only", None), - skip_validation=d.get("skip_validation", None), - url=d.get("url", None), + access_point=d.get("{access_point}", None), + comment=d.get("{comment}", None), + credential_name=d.get("{credential_name}", None), + encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), + fallback=d.get("{fallback}", None), + name=d.get("{name}", None), + read_only=d.get("{read_only}", None), + skip_validation=d.get("{skip_validation}", None), + url=d.get("{url}", None), ) @@ -1923,121 +1923,121 @@ def as_dict(self) -> dict: """Serializes the CreateFunction into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.data_type is not None: - body["data_type"] = self.data_type.value + body["{data_type}"] = self.data_type.value if self.external_language is not None: - body["external_language"] = self.external_language + body["{external_language}"] = self.external_language if self.external_name is not None: - body["external_name"] = self.external_name + body["{external_name}"] = self.external_name if self.full_data_type is not None: - body["full_data_type"] = self.full_data_type + body["{full_data_type}"] = self.full_data_type if self.input_params: - body["input_params"] = self.input_params.as_dict() + body["{input_params}"] = self.input_params.as_dict() if self.is_deterministic is not None: - body["is_deterministic"] = self.is_deterministic + body["{is_deterministic}"] = self.is_deterministic if self.is_null_call is not None: - body["is_null_call"] = self.is_null_call + body["{is_null_call}"] = self.is_null_call if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parameter_style is not None: - body["parameter_style"] = self.parameter_style.value + body["{parameter_style}"] = self.parameter_style.value if self.properties is not None: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.return_params: - body["return_params"] = self.return_params.as_dict() + body["{return_params}"] = self.return_params.as_dict() if self.routine_body is not None: - body["routine_body"] = self.routine_body.value + body["{routine_body}"] = self.routine_body.value if self.routine_definition is not None: - body["routine_definition"] = self.routine_definition + body["{routine_definition}"] = self.routine_definition if self.routine_dependencies: - body["routine_dependencies"] = self.routine_dependencies.as_dict() + body["{routine_dependencies}"] = self.routine_dependencies.as_dict() if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.security_type is not None: - body["security_type"] = self.security_type.value + body["{security_type}"] = self.security_type.value if self.specific_name is not None: - body["specific_name"] = self.specific_name + body["{specific_name}"] = self.specific_name if self.sql_data_access is not None: - body["sql_data_access"] = self.sql_data_access.value + body["{sql_data_access}"] = self.sql_data_access.value if self.sql_path is not None: - body["sql_path"] = self.sql_path + body["{sql_path}"] = self.sql_path return body def as_shallow_dict(self) -> dict: """Serializes the CreateFunction into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.data_type is not None: - body["data_type"] = self.data_type + body["{data_type}"] = self.data_type if self.external_language is not None: - body["external_language"] = self.external_language + body["{external_language}"] = self.external_language if self.external_name is not None: - body["external_name"] = self.external_name + body["{external_name}"] = self.external_name if self.full_data_type is not None: - body["full_data_type"] = self.full_data_type + body["{full_data_type}"] = self.full_data_type if self.input_params: - body["input_params"] = self.input_params + body["{input_params}"] = self.input_params if self.is_deterministic is not None: - body["is_deterministic"] = self.is_deterministic + body["{is_deterministic}"] = self.is_deterministic if self.is_null_call is not None: - body["is_null_call"] = self.is_null_call + body["{is_null_call}"] = self.is_null_call if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parameter_style is not None: - body["parameter_style"] = self.parameter_style + body["{parameter_style}"] = self.parameter_style if self.properties is not None: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.return_params: - body["return_params"] = self.return_params + body["{return_params}"] = self.return_params if self.routine_body is not None: - body["routine_body"] = self.routine_body + body["{routine_body}"] = self.routine_body if self.routine_definition is not None: - body["routine_definition"] = self.routine_definition + body["{routine_definition}"] = self.routine_definition if self.routine_dependencies: - body["routine_dependencies"] = self.routine_dependencies + body["{routine_dependencies}"] = self.routine_dependencies if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.security_type is not None: - body["security_type"] = self.security_type + body["{security_type}"] = self.security_type if self.specific_name is not None: - body["specific_name"] = self.specific_name + body["{specific_name}"] = self.specific_name if self.sql_data_access is not None: - body["sql_data_access"] = self.sql_data_access + body["{sql_data_access}"] = self.sql_data_access if self.sql_path is not None: - body["sql_path"] = self.sql_path + body["{sql_path}"] = self.sql_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFunction: """Deserializes the CreateFunction from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - data_type=_enum(d, "data_type", ColumnTypeName), - external_language=d.get("external_language", None), - external_name=d.get("external_name", None), - full_data_type=d.get("full_data_type", None), - input_params=_from_dict(d, "input_params", FunctionParameterInfos), - is_deterministic=d.get("is_deterministic", None), - is_null_call=d.get("is_null_call", None), - name=d.get("name", None), - parameter_style=_enum(d, "parameter_style", CreateFunctionParameterStyle), - properties=d.get("properties", None), - return_params=_from_dict(d, "return_params", FunctionParameterInfos), - routine_body=_enum(d, "routine_body", CreateFunctionRoutineBody), - routine_definition=d.get("routine_definition", None), - routine_dependencies=_from_dict(d, "routine_dependencies", DependencyList), - schema_name=d.get("schema_name", None), - security_type=_enum(d, "security_type", CreateFunctionSecurityType), - specific_name=d.get("specific_name", None), - sql_data_access=_enum(d, "sql_data_access", CreateFunctionSqlDataAccess), - sql_path=d.get("sql_path", None), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + data_type=_enum(d, "{data_type}", ColumnTypeName), + external_language=d.get("{external_language}", None), + external_name=d.get("{external_name}", None), + full_data_type=d.get("{full_data_type}", None), + input_params=_from_dict(d, "{input_params}", FunctionParameterInfos), + is_deterministic=d.get("{is_deterministic}", None), + is_null_call=d.get("{is_null_call}", None), + name=d.get("{name}", None), + parameter_style=_enum(d, "{parameter_style}", CreateFunctionParameterStyle), + properties=d.get("{properties}", None), + return_params=_from_dict(d, "{return_params}", FunctionParameterInfos), + routine_body=_enum(d, "{routine_body}", CreateFunctionRoutineBody), + routine_definition=d.get("{routine_definition}", None), + routine_dependencies=_from_dict(d, "{routine_dependencies}", DependencyList), + schema_name=d.get("{schema_name}", None), + security_type=_enum(d, "{security_type}", CreateFunctionSecurityType), + specific_name=d.get("{specific_name}", None), + sql_data_access=_enum(d, "{sql_data_access}", CreateFunctionSqlDataAccess), + sql_path=d.get("{sql_path}", None), ) @@ -2056,20 +2056,20 @@ def as_dict(self) -> dict: """Serializes the CreateFunctionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_info: - body["function_info"] = self.function_info.as_dict() + body["{function_info}"] = self.function_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateFunctionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.function_info: - body["function_info"] = self.function_info + body["{function_info}"] = self.function_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFunctionRequest: """Deserializes the CreateFunctionRequest from a dictionary.""" - return cls(function_info=_from_dict(d, "function_info", CreateFunction)) + return cls(function_info=_from_dict(d, "{function_info}", CreateFunction)) class CreateFunctionRoutineBody(Enum): @@ -2113,28 +2113,30 @@ def as_dict(self) -> dict: """Serializes the CreateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body def as_shallow_dict(self) -> dict: """Serializes the CreateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateMetastore: """Deserializes the CreateMetastore from a dictionary.""" - return cls(name=d.get("name", None), region=d.get("region", None), storage_root=d.get("storage_root", None)) + return cls( + name=d.get("{name}", None), region=d.get("{region}", None), storage_root=d.get("{storage_root}", None) + ) @dataclass @@ -2153,31 +2155,31 @@ def as_dict(self) -> dict: """Serializes the CreateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_catalog_name is not None: - body["default_catalog_name"] = self.default_catalog_name + body["{default_catalog_name}"] = self.default_catalog_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.default_catalog_name is not None: - body["default_catalog_name"] = self.default_catalog_name + body["{default_catalog_name}"] = self.default_catalog_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateMetastoreAssignment: """Deserializes the CreateMetastoreAssignment from a dictionary.""" return cls( - default_catalog_name=d.get("default_catalog_name", None), - metastore_id=d.get("metastore_id", None), - workspace_id=d.get("workspace_id", None), + default_catalog_name=d.get("{default_catalog_name}", None), + metastore_id=d.get("{metastore_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -2235,86 +2237,86 @@ def as_dict(self) -> dict: """Serializes the CreateMonitor into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets_dir is not None: - body["assets_dir"] = self.assets_dir + body["{assets_dir}"] = self.assets_dir if self.baseline_table_name is not None: - body["baseline_table_name"] = self.baseline_table_name + body["{baseline_table_name}"] = self.baseline_table_name if self.custom_metrics: - body["custom_metrics"] = [v.as_dict() for v in self.custom_metrics] + body["{custom_metrics}"] = [v.as_dict() for v in self.custom_metrics] if self.data_classification_config: - body["data_classification_config"] = self.data_classification_config.as_dict() + body["{data_classification_config}"] = self.data_classification_config.as_dict() if self.inference_log: - body["inference_log"] = self.inference_log.as_dict() + body["{inference_log}"] = self.inference_log.as_dict() if self.notifications: - body["notifications"] = self.notifications.as_dict() + body["{notifications}"] = self.notifications.as_dict() if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.schedule: - body["schedule"] = self.schedule.as_dict() + body["{schedule}"] = self.schedule.as_dict() if self.skip_builtin_dashboard is not None: - body["skip_builtin_dashboard"] = self.skip_builtin_dashboard + body["{skip_builtin_dashboard}"] = self.skip_builtin_dashboard if self.slicing_exprs: - body["slicing_exprs"] = [v for v in self.slicing_exprs] + body["{slicing_exprs}"] = [v for v in self.slicing_exprs] if self.snapshot: - body["snapshot"] = self.snapshot.as_dict() + body["{snapshot}"] = self.snapshot.as_dict() if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.time_series: - body["time_series"] = self.time_series.as_dict() + body["{time_series}"] = self.time_series.as_dict() if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateMonitor into a shallow dictionary of its immediate attributes.""" body = {} if self.assets_dir is not None: - body["assets_dir"] = self.assets_dir + body["{assets_dir}"] = self.assets_dir if self.baseline_table_name is not None: - body["baseline_table_name"] = self.baseline_table_name + body["{baseline_table_name}"] = self.baseline_table_name if self.custom_metrics: - body["custom_metrics"] = self.custom_metrics + body["{custom_metrics}"] = self.custom_metrics if self.data_classification_config: - body["data_classification_config"] = self.data_classification_config + body["{data_classification_config}"] = self.data_classification_config if self.inference_log: - body["inference_log"] = self.inference_log + body["{inference_log}"] = self.inference_log if self.notifications: - body["notifications"] = self.notifications + body["{notifications}"] = self.notifications if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.schedule: - body["schedule"] = self.schedule + body["{schedule}"] = self.schedule if self.skip_builtin_dashboard is not None: - body["skip_builtin_dashboard"] = self.skip_builtin_dashboard + body["{skip_builtin_dashboard}"] = self.skip_builtin_dashboard if self.slicing_exprs: - body["slicing_exprs"] = self.slicing_exprs + body["{slicing_exprs}"] = self.slicing_exprs if self.snapshot: - body["snapshot"] = self.snapshot + body["{snapshot}"] = self.snapshot if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.time_series: - body["time_series"] = self.time_series + body["{time_series}"] = self.time_series if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateMonitor: """Deserializes the CreateMonitor from a dictionary.""" return cls( - assets_dir=d.get("assets_dir", None), - baseline_table_name=d.get("baseline_table_name", None), - custom_metrics=_repeated_dict(d, "custom_metrics", MonitorMetric), - data_classification_config=_from_dict(d, "data_classification_config", MonitorDataClassificationConfig), - inference_log=_from_dict(d, "inference_log", MonitorInferenceLog), - notifications=_from_dict(d, "notifications", MonitorNotifications), - output_schema_name=d.get("output_schema_name", None), - schedule=_from_dict(d, "schedule", MonitorCronSchedule), - skip_builtin_dashboard=d.get("skip_builtin_dashboard", None), - slicing_exprs=d.get("slicing_exprs", None), - snapshot=_from_dict(d, "snapshot", MonitorSnapshot), - table_name=d.get("table_name", None), - time_series=_from_dict(d, "time_series", MonitorTimeSeries), - warehouse_id=d.get("warehouse_id", None), + assets_dir=d.get("{assets_dir}", None), + baseline_table_name=d.get("{baseline_table_name}", None), + custom_metrics=_repeated_dict(d, "{custom_metrics}", MonitorMetric), + data_classification_config=_from_dict(d, "{data_classification_config}", MonitorDataClassificationConfig), + inference_log=_from_dict(d, "{inference_log}", MonitorInferenceLog), + notifications=_from_dict(d, "{notifications}", MonitorNotifications), + output_schema_name=d.get("{output_schema_name}", None), + schedule=_from_dict(d, "{schedule}", MonitorCronSchedule), + skip_builtin_dashboard=d.get("{skip_builtin_dashboard}", None), + slicing_exprs=d.get("{slicing_exprs}", None), + snapshot=_from_dict(d, "{snapshot}", MonitorSnapshot), + table_name=d.get("{table_name}", None), + time_series=_from_dict(d, "{time_series}", MonitorTimeSeries), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -2339,41 +2341,41 @@ def as_dict(self) -> dict: """Serializes the CreateRegisteredModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location return body def as_shallow_dict(self) -> dict: """Serializes the CreateRegisteredModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRegisteredModelRequest: """Deserializes the CreateRegisteredModelRequest from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - name=d.get("name", None), - schema_name=d.get("schema_name", None), - storage_location=d.get("storage_location", None), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + schema_name=d.get("{schema_name}", None), + storage_location=d.get("{storage_location}", None), ) @@ -2416,41 +2418,41 @@ def as_dict(self) -> dict: """Serializes the CreateSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body def as_shallow_dict(self) -> dict: """Serializes the CreateSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateSchema: """Deserializes the CreateSchema from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - name=d.get("name", None), - properties=d.get("properties", None), - storage_root=d.get("storage_root", None), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + properties=d.get("{properties}", None), + storage_root=d.get("{storage_root}", None), ) @@ -2487,63 +2489,63 @@ def as_dict(self) -> dict: """Serializes the CreateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal.as_dict() + body["{azure_service_principal}"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() + body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body def as_shallow_dict(self) -> dict: """Serializes the CreateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal + body["{azure_service_principal}"] = self.azure_service_principal if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token + body["{cloudflare_api_token}"] = self.cloudflare_api_token if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateStorageCredential: """Deserializes the CreateStorageCredential from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleRequest), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityRequest), - azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), - comment=d.get("comment", None), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleRequest), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityRequest), + azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), + comment=d.get("{comment}", None), databricks_gcp_service_account=_from_dict( - d, "databricks_gcp_service_account", DatabricksGcpServiceAccountRequest + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountRequest ), - name=d.get("name", None), - read_only=d.get("read_only", None), - skip_validation=d.get("skip_validation", None), + name=d.get("{name}", None), + read_only=d.get("{read_only}", None), + skip_validation=d.get("{skip_validation}", None), ) @@ -2560,24 +2562,26 @@ def as_dict(self) -> dict: """Serializes the CreateTableConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.constraint: - body["constraint"] = self.constraint.as_dict() + body["{constraint}"] = self.constraint.as_dict() if self.full_name_arg is not None: - body["full_name_arg"] = self.full_name_arg + body["{full_name_arg}"] = self.full_name_arg return body def as_shallow_dict(self) -> dict: """Serializes the CreateTableConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.constraint: - body["constraint"] = self.constraint + body["{constraint}"] = self.constraint if self.full_name_arg is not None: - body["full_name_arg"] = self.full_name_arg + body["{full_name_arg}"] = self.full_name_arg return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTableConstraint: """Deserializes the CreateTableConstraint from a dictionary.""" - return cls(constraint=_from_dict(d, "constraint", TableConstraint), full_name_arg=d.get("full_name_arg", None)) + return cls( + constraint=_from_dict(d, "{constraint}", TableConstraint), full_name_arg=d.get("{full_name_arg}", None) + ) @dataclass @@ -2608,46 +2612,46 @@ def as_dict(self) -> dict: """Serializes the CreateVolumeRequestContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.volume_type is not None: - body["volume_type"] = self.volume_type.value + body["{volume_type}"] = self.volume_type.value return body def as_shallow_dict(self) -> dict: """Serializes the CreateVolumeRequestContent into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.volume_type is not None: - body["volume_type"] = self.volume_type + body["{volume_type}"] = self.volume_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVolumeRequestContent: """Deserializes the CreateVolumeRequestContent from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - name=d.get("name", None), - schema_name=d.get("schema_name", None), - storage_location=d.get("storage_location", None), - volume_type=_enum(d, "volume_type", VolumeType), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + schema_name=d.get("{schema_name}", None), + storage_location=d.get("{storage_location}", None), + volume_type=_enum(d, "{volume_type}", VolumeType), ) @@ -2714,106 +2718,108 @@ def as_dict(self) -> dict: """Serializes the CredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal.as_dict() + body["{azure_service_principal}"] = self.azure_service_principal.as_dict() if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.purpose is not None: - body["purpose"] = self.purpose.value + body["{purpose}"] = self.purpose.value if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.used_for_managed_storage is not None: - body["used_for_managed_storage"] = self.used_for_managed_storage + body["{used_for_managed_storage}"] = self.used_for_managed_storage return body def as_shallow_dict(self) -> dict: """Serializes the CredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal + body["{azure_service_principal}"] = self.azure_service_principal if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.purpose is not None: - body["purpose"] = self.purpose + body["{purpose}"] = self.purpose if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.used_for_managed_storage is not None: - body["used_for_managed_storage"] = self.used_for_managed_storage + body["{used_for_managed_storage}"] = self.used_for_managed_storage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CredentialInfo: """Deserializes the CredentialInfo from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), - azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), - full_name=d.get("full_name", None), - id=d.get("id", None), - isolation_mode=_enum(d, "isolation_mode", IsolationMode), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - purpose=_enum(d, "purpose", CredentialPurpose), - read_only=d.get("read_only", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - used_for_managed_storage=d.get("used_for_managed_storage", None), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), + azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + databricks_gcp_service_account=_from_dict( + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount + ), + full_name=d.get("{full_name}", None), + id=d.get("{id}", None), + isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + purpose=_enum(d, "{purpose}", CredentialPurpose), + read_only=d.get("{read_only}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + used_for_managed_storage=d.get("{used_for_managed_storage}", None), ) @@ -2842,24 +2848,24 @@ def as_dict(self) -> dict: """Serializes the CredentialValidationResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.result is not None: - body["result"] = self.result.value + body["{result}"] = self.result.value return body def as_shallow_dict(self) -> dict: """Serializes the CredentialValidationResult into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.result is not None: - body["result"] = self.result + body["{result}"] = self.result return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CredentialValidationResult: """Deserializes the CredentialValidationResult from a dictionary.""" - return cls(message=d.get("message", None), result=_enum(d, "result", ValidateCredentialResult)) + return cls(message=d.get("{message}", None), result=_enum(d, "{result}", ValidateCredentialResult)) @dataclass @@ -2873,20 +2879,20 @@ def as_dict(self) -> dict: """Serializes the CurrentWorkspaceBindings into a dictionary suitable for use as a JSON request body.""" body = {} if self.workspaces: - body["workspaces"] = [v for v in self.workspaces] + body["{workspaces}"] = [v for v in self.workspaces] return body def as_shallow_dict(self) -> dict: """Serializes the CurrentWorkspaceBindings into a shallow dictionary of its immediate attributes.""" body = {} if self.workspaces: - body["workspaces"] = self.workspaces + body["{workspaces}"] = self.workspaces return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CurrentWorkspaceBindings: """Deserializes the CurrentWorkspaceBindings from a dictionary.""" - return cls(workspaces=d.get("workspaces", None)) + return cls(workspaces=d.get("{workspaces}", None)) class DataSourceFormat(Enum): @@ -2936,31 +2942,31 @@ def as_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccount into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email if self.private_key_id is not None: - body["private_key_id"] = self.private_key_id + body["{private_key_id}"] = self.private_key_id return body def as_shallow_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccount into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email if self.private_key_id is not None: - body["private_key_id"] = self.private_key_id + body["{private_key_id}"] = self.private_key_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatabricksGcpServiceAccount: """Deserializes the DatabricksGcpServiceAccount from a dictionary.""" return cls( - credential_id=d.get("credential_id", None), - email=d.get("email", None), - private_key_id=d.get("private_key_id", None), + credential_id=d.get("{credential_id}", None), + email=d.get("{email}", None), + private_key_id=d.get("{private_key_id}", None), ) @@ -2994,24 +3000,24 @@ def as_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccountResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email return body def as_shallow_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccountResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatabricksGcpServiceAccountResponse: """Deserializes the DatabricksGcpServiceAccountResponse from a dictionary.""" - return cls(credential_id=d.get("credential_id", None), email=d.get("email", None)) + return cls(credential_id=d.get("{credential_id}", None), email=d.get("{email}", None)) @dataclass @@ -3080,20 +3086,20 @@ def as_dict(self) -> dict: """Serializes the DeltaRuntimePropertiesKvPairs into a dictionary suitable for use as a JSON request body.""" body = {} if self.delta_runtime_properties: - body["delta_runtime_properties"] = self.delta_runtime_properties + body["{delta_runtime_properties}"] = self.delta_runtime_properties return body def as_shallow_dict(self) -> dict: """Serializes the DeltaRuntimePropertiesKvPairs into a shallow dictionary of its immediate attributes.""" body = {} if self.delta_runtime_properties: - body["delta_runtime_properties"] = self.delta_runtime_properties + body["{delta_runtime_properties}"] = self.delta_runtime_properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaRuntimePropertiesKvPairs: """Deserializes the DeltaRuntimePropertiesKvPairs from a dictionary.""" - return cls(delta_runtime_properties=d.get("delta_runtime_properties", None)) + return cls(delta_runtime_properties=d.get("{delta_runtime_properties}", None)) @dataclass @@ -3111,25 +3117,25 @@ def as_dict(self) -> dict: """Serializes the Dependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function: - body["function"] = self.function.as_dict() + body["{function}"] = self.function.as_dict() if self.table: - body["table"] = self.table.as_dict() + body["{table}"] = self.table.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Dependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function: - body["function"] = self.function + body["{function}"] = self.function if self.table: - body["table"] = self.table + body["{table}"] = self.table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dependency: """Deserializes the Dependency from a dictionary.""" return cls( - function=_from_dict(d, "function", FunctionDependency), table=_from_dict(d, "table", TableDependency) + function=_from_dict(d, "{function}", FunctionDependency), table=_from_dict(d, "{table}", TableDependency) ) @@ -3144,20 +3150,20 @@ def as_dict(self) -> dict: """Serializes the DependencyList into a dictionary suitable for use as a JSON request body.""" body = {} if self.dependencies: - body["dependencies"] = [v.as_dict() for v in self.dependencies] + body["{dependencies}"] = [v.as_dict() for v in self.dependencies] return body def as_shallow_dict(self) -> dict: """Serializes the DependencyList into a shallow dictionary of its immediate attributes.""" body = {} if self.dependencies: - body["dependencies"] = self.dependencies + body["{dependencies}"] = self.dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DependencyList: """Deserializes the DependencyList from a dictionary.""" - return cls(dependencies=_repeated_dict(d, "dependencies", Dependency)) + return cls(dependencies=_repeated_dict(d, "{dependencies}", Dependency)) @dataclass @@ -3187,20 +3193,20 @@ def as_dict(self) -> dict: """Serializes the EffectivePermissionsList into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] + body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: """Serializes the EffectivePermissionsList into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = self.privilege_assignments + body["{privilege_assignments}"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePermissionsList: """Deserializes the EffectivePermissionsList from a dictionary.""" - return cls(privilege_assignments=_repeated_dict(d, "privilege_assignments", EffectivePrivilegeAssignment)) + return cls(privilege_assignments=_repeated_dict(d, "{privilege_assignments}", EffectivePrivilegeAssignment)) @dataclass @@ -3220,31 +3226,31 @@ def as_dict(self) -> dict: """Serializes the EffectivePredictiveOptimizationFlag into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited_from_name is not None: - body["inherited_from_name"] = self.inherited_from_name + body["{inherited_from_name}"] = self.inherited_from_name if self.inherited_from_type is not None: - body["inherited_from_type"] = self.inherited_from_type.value + body["{inherited_from_type}"] = self.inherited_from_type.value if self.value is not None: - body["value"] = self.value.value + body["{value}"] = self.value.value return body def as_shallow_dict(self) -> dict: """Serializes the EffectivePredictiveOptimizationFlag into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited_from_name is not None: - body["inherited_from_name"] = self.inherited_from_name + body["{inherited_from_name}"] = self.inherited_from_name if self.inherited_from_type is not None: - body["inherited_from_type"] = self.inherited_from_type + body["{inherited_from_type}"] = self.inherited_from_type if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePredictiveOptimizationFlag: """Deserializes the EffectivePredictiveOptimizationFlag from a dictionary.""" return cls( - inherited_from_name=d.get("inherited_from_name", None), - inherited_from_type=_enum(d, "inherited_from_type", EffectivePredictiveOptimizationFlagInheritedFromType), - value=_enum(d, "value", EnablePredictiveOptimization), + inherited_from_name=d.get("{inherited_from_name}", None), + inherited_from_type=_enum(d, "{inherited_from_type}", EffectivePredictiveOptimizationFlagInheritedFromType), + value=_enum(d, "{value}", EnablePredictiveOptimization), ) @@ -3273,31 +3279,31 @@ def as_dict(self) -> dict: """Serializes the EffectivePrivilege into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited_from_name is not None: - body["inherited_from_name"] = self.inherited_from_name + body["{inherited_from_name}"] = self.inherited_from_name if self.inherited_from_type is not None: - body["inherited_from_type"] = self.inherited_from_type.value + body["{inherited_from_type}"] = self.inherited_from_type.value if self.privilege is not None: - body["privilege"] = self.privilege.value + body["{privilege}"] = self.privilege.value return body def as_shallow_dict(self) -> dict: """Serializes the EffectivePrivilege into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited_from_name is not None: - body["inherited_from_name"] = self.inherited_from_name + body["{inherited_from_name}"] = self.inherited_from_name if self.inherited_from_type is not None: - body["inherited_from_type"] = self.inherited_from_type + body["{inherited_from_type}"] = self.inherited_from_type if self.privilege is not None: - body["privilege"] = self.privilege + body["{privilege}"] = self.privilege return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePrivilege: """Deserializes the EffectivePrivilege from a dictionary.""" return cls( - inherited_from_name=d.get("inherited_from_name", None), - inherited_from_type=_enum(d, "inherited_from_type", SecurableType), - privilege=_enum(d, "privilege", Privilege), + inherited_from_name=d.get("{inherited_from_name}", None), + inherited_from_type=_enum(d, "{inherited_from_type}", SecurableType), + privilege=_enum(d, "{privilege}", Privilege), ) @@ -3313,24 +3319,26 @@ def as_dict(self) -> dict: """Serializes the EffectivePrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.privileges: - body["privileges"] = [v.as_dict() for v in self.privileges] + body["{privileges}"] = [v.as_dict() for v in self.privileges] return body def as_shallow_dict(self) -> dict: """Serializes the EffectivePrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.privileges: - body["privileges"] = self.privileges + body["{privileges}"] = self.privileges return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePrivilegeAssignment: """Deserializes the EffectivePrivilegeAssignment from a dictionary.""" - return cls(principal=d.get("principal", None), privileges=_repeated_dict(d, "privileges", EffectivePrivilege)) + return cls( + principal=d.get("{principal}", None), privileges=_repeated_dict(d, "{privileges}", EffectivePrivilege) + ) class EnablePredictiveOptimization(Enum): @@ -3370,20 +3378,20 @@ def as_dict(self) -> dict: """Serializes the EncryptionDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.sse_encryption_details: - body["sse_encryption_details"] = self.sse_encryption_details.as_dict() + body["{sse_encryption_details}"] = self.sse_encryption_details.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EncryptionDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.sse_encryption_details: - body["sse_encryption_details"] = self.sse_encryption_details + body["{sse_encryption_details}"] = self.sse_encryption_details return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EncryptionDetails: """Deserializes the EncryptionDetails from a dictionary.""" - return cls(sse_encryption_details=_from_dict(d, "sse_encryption_details", SseEncryptionDetails)) + return cls(sse_encryption_details=_from_dict(d, "{sse_encryption_details}", SseEncryptionDetails)) @dataclass @@ -3445,101 +3453,101 @@ def as_dict(self) -> dict: """Serializes the ExternalLocationInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.encryption_details: - body["encryption_details"] = self.encryption_details.as_dict() + body["{encryption_details}"] = self.encryption_details.as_dict() if self.fallback is not None: - body["fallback"] = self.fallback + body["{fallback}"] = self.fallback if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the ExternalLocationInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.encryption_details: - body["encryption_details"] = self.encryption_details + body["{encryption_details}"] = self.encryption_details if self.fallback is not None: - body["fallback"] = self.fallback + body["{fallback}"] = self.fallback if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalLocationInfo: """Deserializes the ExternalLocationInfo from a dictionary.""" return cls( - access_point=d.get("access_point", None), - browse_only=d.get("browse_only", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - credential_id=d.get("credential_id", None), - credential_name=d.get("credential_name", None), - encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), - fallback=d.get("fallback", None), - isolation_mode=_enum(d, "isolation_mode", IsolationMode), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - read_only=d.get("read_only", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - url=d.get("url", None), + access_point=d.get("{access_point}", None), + browse_only=d.get("{browse_only}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + credential_id=d.get("{credential_id}", None), + credential_name=d.get("{credential_name}", None), + encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), + fallback=d.get("{fallback}", None), + isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + read_only=d.get("{read_only}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + url=d.get("{url}", None), ) @@ -3561,26 +3569,26 @@ def as_dict(self) -> dict: """Serializes the FailedStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_processed_commit_version is not None: - body["last_processed_commit_version"] = self.last_processed_commit_version + body["{last_processed_commit_version}"] = self.last_processed_commit_version if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body def as_shallow_dict(self) -> dict: """Serializes the FailedStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_processed_commit_version is not None: - body["last_processed_commit_version"] = self.last_processed_commit_version + body["{last_processed_commit_version}"] = self.last_processed_commit_version if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FailedStatus: """Deserializes the FailedStatus from a dictionary.""" return cls( - last_processed_commit_version=d.get("last_processed_commit_version", None), - timestamp=d.get("timestamp", None), + last_processed_commit_version=d.get("{last_processed_commit_version}", None), + timestamp=d.get("{timestamp}", None), ) @@ -3602,36 +3610,36 @@ def as_dict(self) -> dict: """Serializes the ForeignKeyConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.child_columns: - body["child_columns"] = [v for v in self.child_columns] + body["{child_columns}"] = [v for v in self.child_columns] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parent_columns: - body["parent_columns"] = [v for v in self.parent_columns] + body["{parent_columns}"] = [v for v in self.parent_columns] if self.parent_table is not None: - body["parent_table"] = self.parent_table + body["{parent_table}"] = self.parent_table return body def as_shallow_dict(self) -> dict: """Serializes the ForeignKeyConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.child_columns: - body["child_columns"] = self.child_columns + body["{child_columns}"] = self.child_columns if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parent_columns: - body["parent_columns"] = self.parent_columns + body["{parent_columns}"] = self.parent_columns if self.parent_table is not None: - body["parent_table"] = self.parent_table + body["{parent_table}"] = self.parent_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForeignKeyConstraint: """Deserializes the ForeignKeyConstraint from a dictionary.""" return cls( - child_columns=d.get("child_columns", None), - name=d.get("name", None), - parent_columns=d.get("parent_columns", None), - parent_table=d.get("parent_table", None), + child_columns=d.get("{child_columns}", None), + name=d.get("{name}", None), + parent_columns=d.get("{parent_columns}", None), + parent_table=d.get("{parent_table}", None), ) @@ -3647,20 +3655,20 @@ def as_dict(self) -> dict: """Serializes the FunctionDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_full_name is not None: - body["function_full_name"] = self.function_full_name + body["{function_full_name}"] = self.function_full_name return body def as_shallow_dict(self) -> dict: """Serializes the FunctionDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function_full_name is not None: - body["function_full_name"] = self.function_full_name + body["{function_full_name}"] = self.function_full_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionDependency: """Deserializes the FunctionDependency from a dictionary.""" - return cls(function_full_name=d.get("function_full_name", None)) + return cls(function_full_name=d.get("{function_full_name}", None)) @dataclass @@ -3762,166 +3770,166 @@ def as_dict(self) -> dict: """Serializes the FunctionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_type is not None: - body["data_type"] = self.data_type.value + body["{data_type}"] = self.data_type.value if self.external_language is not None: - body["external_language"] = self.external_language + body["{external_language}"] = self.external_language if self.external_name is not None: - body["external_name"] = self.external_name + body["{external_name}"] = self.external_name if self.full_data_type is not None: - body["full_data_type"] = self.full_data_type + body["{full_data_type}"] = self.full_data_type if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.function_id is not None: - body["function_id"] = self.function_id + body["{function_id}"] = self.function_id if self.input_params: - body["input_params"] = self.input_params.as_dict() + body["{input_params}"] = self.input_params.as_dict() if self.is_deterministic is not None: - body["is_deterministic"] = self.is_deterministic + body["{is_deterministic}"] = self.is_deterministic if self.is_null_call is not None: - body["is_null_call"] = self.is_null_call + body["{is_null_call}"] = self.is_null_call if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.parameter_style is not None: - body["parameter_style"] = self.parameter_style.value + body["{parameter_style}"] = self.parameter_style.value if self.properties is not None: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.return_params: - body["return_params"] = self.return_params.as_dict() + body["{return_params}"] = self.return_params.as_dict() if self.routine_body is not None: - body["routine_body"] = self.routine_body.value + body["{routine_body}"] = self.routine_body.value if self.routine_definition is not None: - body["routine_definition"] = self.routine_definition + body["{routine_definition}"] = self.routine_definition if self.routine_dependencies: - body["routine_dependencies"] = self.routine_dependencies.as_dict() + body["{routine_dependencies}"] = self.routine_dependencies.as_dict() if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.security_type is not None: - body["security_type"] = self.security_type.value + body["{security_type}"] = self.security_type.value if self.specific_name is not None: - body["specific_name"] = self.specific_name + body["{specific_name}"] = self.specific_name if self.sql_data_access is not None: - body["sql_data_access"] = self.sql_data_access.value + body["{sql_data_access}"] = self.sql_data_access.value if self.sql_path is not None: - body["sql_path"] = self.sql_path + body["{sql_path}"] = self.sql_path if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the FunctionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_type is not None: - body["data_type"] = self.data_type + body["{data_type}"] = self.data_type if self.external_language is not None: - body["external_language"] = self.external_language + body["{external_language}"] = self.external_language if self.external_name is not None: - body["external_name"] = self.external_name + body["{external_name}"] = self.external_name if self.full_data_type is not None: - body["full_data_type"] = self.full_data_type + body["{full_data_type}"] = self.full_data_type if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.function_id is not None: - body["function_id"] = self.function_id + body["{function_id}"] = self.function_id if self.input_params: - body["input_params"] = self.input_params + body["{input_params}"] = self.input_params if self.is_deterministic is not None: - body["is_deterministic"] = self.is_deterministic + body["{is_deterministic}"] = self.is_deterministic if self.is_null_call is not None: - body["is_null_call"] = self.is_null_call + body["{is_null_call}"] = self.is_null_call if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.parameter_style is not None: - body["parameter_style"] = self.parameter_style + body["{parameter_style}"] = self.parameter_style if self.properties is not None: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.return_params: - body["return_params"] = self.return_params + body["{return_params}"] = self.return_params if self.routine_body is not None: - body["routine_body"] = self.routine_body + body["{routine_body}"] = self.routine_body if self.routine_definition is not None: - body["routine_definition"] = self.routine_definition + body["{routine_definition}"] = self.routine_definition if self.routine_dependencies: - body["routine_dependencies"] = self.routine_dependencies + body["{routine_dependencies}"] = self.routine_dependencies if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.security_type is not None: - body["security_type"] = self.security_type + body["{security_type}"] = self.security_type if self.specific_name is not None: - body["specific_name"] = self.specific_name + body["{specific_name}"] = self.specific_name if self.sql_data_access is not None: - body["sql_data_access"] = self.sql_data_access + body["{sql_data_access}"] = self.sql_data_access if self.sql_path is not None: - body["sql_path"] = self.sql_path + body["{sql_path}"] = self.sql_path if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionInfo: """Deserializes the FunctionInfo from a dictionary.""" return cls( - browse_only=d.get("browse_only", None), - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - data_type=_enum(d, "data_type", ColumnTypeName), - external_language=d.get("external_language", None), - external_name=d.get("external_name", None), - full_data_type=d.get("full_data_type", None), - full_name=d.get("full_name", None), - function_id=d.get("function_id", None), - input_params=_from_dict(d, "input_params", FunctionParameterInfos), - is_deterministic=d.get("is_deterministic", None), - is_null_call=d.get("is_null_call", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - parameter_style=_enum(d, "parameter_style", FunctionInfoParameterStyle), - properties=d.get("properties", None), - return_params=_from_dict(d, "return_params", FunctionParameterInfos), - routine_body=_enum(d, "routine_body", FunctionInfoRoutineBody), - routine_definition=d.get("routine_definition", None), - routine_dependencies=_from_dict(d, "routine_dependencies", DependencyList), - schema_name=d.get("schema_name", None), - security_type=_enum(d, "security_type", FunctionInfoSecurityType), - specific_name=d.get("specific_name", None), - sql_data_access=_enum(d, "sql_data_access", FunctionInfoSqlDataAccess), - sql_path=d.get("sql_path", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + browse_only=d.get("{browse_only}", None), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + data_type=_enum(d, "{data_type}", ColumnTypeName), + external_language=d.get("{external_language}", None), + external_name=d.get("{external_name}", None), + full_data_type=d.get("{full_data_type}", None), + full_name=d.get("{full_name}", None), + function_id=d.get("{function_id}", None), + input_params=_from_dict(d, "{input_params}", FunctionParameterInfos), + is_deterministic=d.get("{is_deterministic}", None), + is_null_call=d.get("{is_null_call}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + parameter_style=_enum(d, "{parameter_style}", FunctionInfoParameterStyle), + properties=d.get("{properties}", None), + return_params=_from_dict(d, "{return_params}", FunctionParameterInfos), + routine_body=_enum(d, "{routine_body}", FunctionInfoRoutineBody), + routine_definition=d.get("{routine_definition}", None), + routine_dependencies=_from_dict(d, "{routine_dependencies}", DependencyList), + schema_name=d.get("{schema_name}", None), + security_type=_enum(d, "{security_type}", FunctionInfoSecurityType), + specific_name=d.get("{specific_name}", None), + sql_data_access=_enum(d, "{sql_data_access}", FunctionInfoSqlDataAccess), + sql_path=d.get("{sql_path}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -3996,76 +4004,76 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parameter_default is not None: - body["parameter_default"] = self.parameter_default + body["{parameter_default}"] = self.parameter_default if self.parameter_mode is not None: - body["parameter_mode"] = self.parameter_mode.value + body["{parameter_mode}"] = self.parameter_mode.value if self.parameter_type is not None: - body["parameter_type"] = self.parameter_type.value + body["{parameter_type}"] = self.parameter_type.value if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name.value + body["{type_name}"] = self.type_name.value if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parameter_default is not None: - body["parameter_default"] = self.parameter_default + body["{parameter_default}"] = self.parameter_default if self.parameter_mode is not None: - body["parameter_mode"] = self.parameter_mode + body["{parameter_mode}"] = self.parameter_mode if self.parameter_type is not None: - body["parameter_type"] = self.parameter_type + body["{parameter_type}"] = self.parameter_type if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name + body["{type_name}"] = self.type_name if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfo: """Deserializes the FunctionParameterInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - name=d.get("name", None), - parameter_default=d.get("parameter_default", None), - parameter_mode=_enum(d, "parameter_mode", FunctionParameterMode), - parameter_type=_enum(d, "parameter_type", FunctionParameterType), - position=d.get("position", None), - type_interval_type=d.get("type_interval_type", None), - type_json=d.get("type_json", None), - type_name=_enum(d, "type_name", ColumnTypeName), - type_precision=d.get("type_precision", None), - type_scale=d.get("type_scale", None), - type_text=d.get("type_text", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + parameter_default=d.get("{parameter_default}", None), + parameter_mode=_enum(d, "{parameter_mode}", FunctionParameterMode), + parameter_type=_enum(d, "{parameter_type}", FunctionParameterType), + position=d.get("{position}", None), + type_interval_type=d.get("{type_interval_type}", None), + type_json=d.get("{type_json}", None), + type_name=_enum(d, "{type_name}", ColumnTypeName), + type_precision=d.get("{type_precision}", None), + type_scale=d.get("{type_scale}", None), + type_text=d.get("{type_text}", None), ) @@ -4078,20 +4086,20 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfos into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] return body def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfos into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfos: """Deserializes the FunctionParameterInfos from a dictionary.""" - return cls(parameters=_repeated_dict(d, "parameters", FunctionParameterInfo)) + return cls(parameters=_repeated_dict(d, "{parameters}", FunctionParameterInfo)) class FunctionParameterMode(Enum): @@ -4118,20 +4126,20 @@ def as_dict(self) -> dict: """Serializes the GcpOauthToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.oauth_token is not None: - body["oauth_token"] = self.oauth_token + body["{oauth_token}"] = self.oauth_token return body def as_shallow_dict(self) -> dict: """Serializes the GcpOauthToken into a shallow dictionary of its immediate attributes.""" body = {} if self.oauth_token is not None: - body["oauth_token"] = self.oauth_token + body["{oauth_token}"] = self.oauth_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpOauthToken: """Deserializes the GcpOauthToken from a dictionary.""" - return cls(oauth_token=d.get("oauth_token", None)) + return cls(oauth_token=d.get("{oauth_token}", None)) @dataclass @@ -4147,20 +4155,20 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialAzureOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.resources: - body["resources"] = [v for v in self.resources] + body["{resources}"] = [v for v in self.resources] return body def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialAzureOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.resources: - body["resources"] = self.resources + body["{resources}"] = self.resources return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryServiceCredentialAzureOptions: """Deserializes the GenerateTemporaryServiceCredentialAzureOptions from a dictionary.""" - return cls(resources=d.get("resources", None)) + return cls(resources=d.get("{resources}", None)) @dataclass @@ -4176,20 +4184,20 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialGcpOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.scopes: - body["scopes"] = [v for v in self.scopes] + body["{scopes}"] = [v for v in self.scopes] return body def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialGcpOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryServiceCredentialGcpOptions: """Deserializes the GenerateTemporaryServiceCredentialGcpOptions from a dictionary.""" - return cls(scopes=d.get("scopes", None)) + return cls(scopes=d.get("{scopes}", None)) @dataclass @@ -4207,31 +4215,31 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.azure_options: - body["azure_options"] = self.azure_options.as_dict() + body["{azure_options}"] = self.azure_options.as_dict() if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.gcp_options: - body["gcp_options"] = self.gcp_options.as_dict() + body["{gcp_options}"] = self.gcp_options.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.azure_options: - body["azure_options"] = self.azure_options + body["{azure_options}"] = self.azure_options if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.gcp_options: - body["gcp_options"] = self.gcp_options + body["{gcp_options}"] = self.gcp_options return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryServiceCredentialRequest: """Deserializes the GenerateTemporaryServiceCredentialRequest from a dictionary.""" return cls( - azure_options=_from_dict(d, "azure_options", GenerateTemporaryServiceCredentialAzureOptions), - credential_name=d.get("credential_name", None), - gcp_options=_from_dict(d, "gcp_options", GenerateTemporaryServiceCredentialGcpOptions), + azure_options=_from_dict(d, "{azure_options}", GenerateTemporaryServiceCredentialAzureOptions), + credential_name=d.get("{credential_name}", None), + gcp_options=_from_dict(d, "{gcp_options}", GenerateTemporaryServiceCredentialGcpOptions), ) @@ -4249,24 +4257,24 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.operation is not None: - body["operation"] = self.operation.value + body["{operation}"] = self.operation.value if self.table_id is not None: - body["table_id"] = self.table_id + body["{table_id}"] = self.table_id return body def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.operation is not None: - body["operation"] = self.operation + body["{operation}"] = self.operation if self.table_id is not None: - body["table_id"] = self.table_id + body["{table_id}"] = self.table_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryTableCredentialRequest: """Deserializes the GenerateTemporaryTableCredentialRequest from a dictionary.""" - return cls(operation=_enum(d, "operation", TableOperation), table_id=d.get("table_id", None)) + return cls(operation=_enum(d, "{operation}", TableOperation), table_id=d.get("{table_id}", None)) @dataclass @@ -4303,51 +4311,51 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_temp_credentials: - body["aws_temp_credentials"] = self.aws_temp_credentials.as_dict() + body["{aws_temp_credentials}"] = self.aws_temp_credentials.as_dict() if self.azure_aad: - body["azure_aad"] = self.azure_aad.as_dict() + body["{azure_aad}"] = self.azure_aad.as_dict() if self.azure_user_delegation_sas: - body["azure_user_delegation_sas"] = self.azure_user_delegation_sas.as_dict() + body["{azure_user_delegation_sas}"] = self.azure_user_delegation_sas.as_dict() if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.gcp_oauth_token: - body["gcp_oauth_token"] = self.gcp_oauth_token.as_dict() + body["{gcp_oauth_token}"] = self.gcp_oauth_token.as_dict() if self.r2_temp_credentials: - body["r2_temp_credentials"] = self.r2_temp_credentials.as_dict() + body["{r2_temp_credentials}"] = self.r2_temp_credentials.as_dict() if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_temp_credentials: - body["aws_temp_credentials"] = self.aws_temp_credentials + body["{aws_temp_credentials}"] = self.aws_temp_credentials if self.azure_aad: - body["azure_aad"] = self.azure_aad + body["{azure_aad}"] = self.azure_aad if self.azure_user_delegation_sas: - body["azure_user_delegation_sas"] = self.azure_user_delegation_sas + body["{azure_user_delegation_sas}"] = self.azure_user_delegation_sas if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.gcp_oauth_token: - body["gcp_oauth_token"] = self.gcp_oauth_token + body["{gcp_oauth_token}"] = self.gcp_oauth_token if self.r2_temp_credentials: - body["r2_temp_credentials"] = self.r2_temp_credentials + body["{r2_temp_credentials}"] = self.r2_temp_credentials if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryTableCredentialResponse: """Deserializes the GenerateTemporaryTableCredentialResponse from a dictionary.""" return cls( - aws_temp_credentials=_from_dict(d, "aws_temp_credentials", AwsCredentials), - azure_aad=_from_dict(d, "azure_aad", AzureActiveDirectoryToken), - azure_user_delegation_sas=_from_dict(d, "azure_user_delegation_sas", AzureUserDelegationSas), - expiration_time=d.get("expiration_time", None), - gcp_oauth_token=_from_dict(d, "gcp_oauth_token", GcpOauthToken), - r2_temp_credentials=_from_dict(d, "r2_temp_credentials", R2Credentials), - url=d.get("url", None), + aws_temp_credentials=_from_dict(d, "{aws_temp_credentials}", AwsCredentials), + azure_aad=_from_dict(d, "{azure_aad}", AzureActiveDirectoryToken), + azure_user_delegation_sas=_from_dict(d, "{azure_user_delegation_sas}", AzureUserDelegationSas), + expiration_time=d.get("{expiration_time}", None), + gcp_oauth_token=_from_dict(d, "{gcp_oauth_token}", GcpOauthToken), + r2_temp_credentials=_from_dict(d, "{r2_temp_credentials}", R2Credentials), + url=d.get("{url}", None), ) @@ -4423,117 +4431,117 @@ def as_dict(self) -> dict: """Serializes the GetMetastoreSummaryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.default_data_access_config_id is not None: - body["default_data_access_config_id"] = self.default_data_access_config_id + body["{default_data_access_config_id}"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["delta_sharing_organization_name"] = self.delta_sharing_organization_name + body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( + body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["delta_sharing_scope"] = self.delta_sharing_scope.value + body["{delta_sharing_scope}"] = self.delta_sharing_scope.value if self.external_access_enabled is not None: - body["external_access_enabled"] = self.external_access_enabled + body["{external_access_enabled}"] = self.external_access_enabled if self.global_metastore_id is not None: - body["global_metastore_id"] = self.global_metastore_id + body["{global_metastore_id}"] = self.global_metastore_id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.privilege_model_version is not None: - body["privilege_model_version"] = self.privilege_model_version + body["{privilege_model_version}"] = self.privilege_model_version if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.storage_root_credential_id is not None: - body["storage_root_credential_id"] = self.storage_root_credential_id + body["{storage_root_credential_id}"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["storage_root_credential_name"] = self.storage_root_credential_name + body["{storage_root_credential_name}"] = self.storage_root_credential_name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the GetMetastoreSummaryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.default_data_access_config_id is not None: - body["default_data_access_config_id"] = self.default_data_access_config_id + body["{default_data_access_config_id}"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["delta_sharing_organization_name"] = self.delta_sharing_organization_name + body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( + body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["delta_sharing_scope"] = self.delta_sharing_scope + body["{delta_sharing_scope}"] = self.delta_sharing_scope if self.external_access_enabled is not None: - body["external_access_enabled"] = self.external_access_enabled + body["{external_access_enabled}"] = self.external_access_enabled if self.global_metastore_id is not None: - body["global_metastore_id"] = self.global_metastore_id + body["{global_metastore_id}"] = self.global_metastore_id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.privilege_model_version is not None: - body["privilege_model_version"] = self.privilege_model_version + body["{privilege_model_version}"] = self.privilege_model_version if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.storage_root_credential_id is not None: - body["storage_root_credential_id"] = self.storage_root_credential_id + body["{storage_root_credential_id}"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["storage_root_credential_name"] = self.storage_root_credential_name + body["{storage_root_credential_name}"] = self.storage_root_credential_name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetMetastoreSummaryResponse: """Deserializes the GetMetastoreSummaryResponse from a dictionary.""" return cls( - cloud=d.get("cloud", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - default_data_access_config_id=d.get("default_data_access_config_id", None), - delta_sharing_organization_name=d.get("delta_sharing_organization_name", None), + cloud=d.get("{cloud}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + default_data_access_config_id=d.get("{default_data_access_config_id}", None), + delta_sharing_organization_name=d.get("{delta_sharing_organization_name}", None), delta_sharing_recipient_token_lifetime_in_seconds=d.get( - "delta_sharing_recipient_token_lifetime_in_seconds", None + "{delta_sharing_recipient_token_lifetime_in_seconds}", None ), - delta_sharing_scope=_enum(d, "delta_sharing_scope", GetMetastoreSummaryResponseDeltaSharingScope), - external_access_enabled=d.get("external_access_enabled", None), - global_metastore_id=d.get("global_metastore_id", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - privilege_model_version=d.get("privilege_model_version", None), - region=d.get("region", None), - storage_root=d.get("storage_root", None), - storage_root_credential_id=d.get("storage_root_credential_id", None), - storage_root_credential_name=d.get("storage_root_credential_name", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + delta_sharing_scope=_enum(d, "{delta_sharing_scope}", GetMetastoreSummaryResponseDeltaSharingScope), + external_access_enabled=d.get("{external_access_enabled}", None), + global_metastore_id=d.get("{global_metastore_id}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + privilege_model_version=d.get("{privilege_model_version}", None), + region=d.get("{region}", None), + storage_root=d.get("{storage_root}", None), + storage_root_credential_id=d.get("{storage_root_credential_id}", None), + storage_root_credential_name=d.get("{storage_root_credential_name}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -4553,20 +4561,20 @@ def as_dict(self) -> dict: """Serializes the GetQuotaResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.quota_info: - body["quota_info"] = self.quota_info.as_dict() + body["{quota_info}"] = self.quota_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetQuotaResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.quota_info: - body["quota_info"] = self.quota_info + body["{quota_info}"] = self.quota_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetQuotaResponse: """Deserializes the GetQuotaResponse from a dictionary.""" - return cls(quota_info=_from_dict(d, "quota_info", QuotaInfo)) + return cls(quota_info=_from_dict(d, "{quota_info}", QuotaInfo)) class IsolationMode(Enum): @@ -4585,20 +4593,20 @@ def as_dict(self) -> dict: """Serializes the ListAccountMetastoreAssignmentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.workspace_ids: - body["workspace_ids"] = [v for v in self.workspace_ids] + body["{workspace_ids}"] = [v for v in self.workspace_ids] return body def as_shallow_dict(self) -> dict: """Serializes the ListAccountMetastoreAssignmentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.workspace_ids: - body["workspace_ids"] = self.workspace_ids + body["{workspace_ids}"] = self.workspace_ids return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAccountMetastoreAssignmentsResponse: """Deserializes the ListAccountMetastoreAssignmentsResponse from a dictionary.""" - return cls(workspace_ids=d.get("workspace_ids", None)) + return cls(workspace_ids=d.get("{workspace_ids}", None)) @dataclass @@ -4610,20 +4618,20 @@ def as_dict(self) -> dict: """Serializes the ListAccountStorageCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.storage_credentials: - body["storage_credentials"] = [v.as_dict() for v in self.storage_credentials] + body["{storage_credentials}"] = [v.as_dict() for v in self.storage_credentials] return body def as_shallow_dict(self) -> dict: """Serializes the ListAccountStorageCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.storage_credentials: - body["storage_credentials"] = self.storage_credentials + body["{storage_credentials}"] = self.storage_credentials return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAccountStorageCredentialsResponse: """Deserializes the ListAccountStorageCredentialsResponse from a dictionary.""" - return cls(storage_credentials=_repeated_dict(d, "storage_credentials", StorageCredentialInfo)) + return cls(storage_credentials=_repeated_dict(d, "{storage_credentials}", StorageCredentialInfo)) @dataclass @@ -4639,24 +4647,26 @@ def as_dict(self) -> dict: """Serializes the ListCatalogsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalogs: - body["catalogs"] = [v.as_dict() for v in self.catalogs] + body["{catalogs}"] = [v.as_dict() for v in self.catalogs] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListCatalogsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.catalogs: - body["catalogs"] = self.catalogs + body["{catalogs}"] = self.catalogs if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCatalogsResponse: """Deserializes the ListCatalogsResponse from a dictionary.""" - return cls(catalogs=_repeated_dict(d, "catalogs", CatalogInfo), next_page_token=d.get("next_page_token", None)) + return cls( + catalogs=_repeated_dict(d, "{catalogs}", CatalogInfo), next_page_token=d.get("{next_page_token}", None) + ) @dataclass @@ -4672,25 +4682,26 @@ def as_dict(self) -> dict: """Serializes the ListConnectionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.connections: - body["connections"] = [v.as_dict() for v in self.connections] + body["{connections}"] = [v.as_dict() for v in self.connections] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListConnectionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.connections: - body["connections"] = self.connections + body["{connections}"] = self.connections if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListConnectionsResponse: """Deserializes the ListConnectionsResponse from a dictionary.""" return cls( - connections=_repeated_dict(d, "connections", ConnectionInfo), next_page_token=d.get("next_page_token", None) + connections=_repeated_dict(d, "{connections}", ConnectionInfo), + next_page_token=d.get("{next_page_token}", None), ) @@ -4706,25 +4717,26 @@ def as_dict(self) -> dict: """Serializes the ListCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credentials: - body["credentials"] = [v.as_dict() for v in self.credentials] + body["{credentials}"] = [v.as_dict() for v in self.credentials] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credentials: - body["credentials"] = self.credentials + body["{credentials}"] = self.credentials if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCredentialsResponse: """Deserializes the ListCredentialsResponse from a dictionary.""" return cls( - credentials=_repeated_dict(d, "credentials", CredentialInfo), next_page_token=d.get("next_page_token", None) + credentials=_repeated_dict(d, "{credentials}", CredentialInfo), + next_page_token=d.get("{next_page_token}", None), ) @@ -4741,26 +4753,26 @@ def as_dict(self) -> dict: """Serializes the ListExternalLocationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_locations: - body["external_locations"] = [v.as_dict() for v in self.external_locations] + body["{external_locations}"] = [v.as_dict() for v in self.external_locations] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListExternalLocationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.external_locations: - body["external_locations"] = self.external_locations + body["{external_locations}"] = self.external_locations if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExternalLocationsResponse: """Deserializes the ListExternalLocationsResponse from a dictionary.""" return cls( - external_locations=_repeated_dict(d, "external_locations", ExternalLocationInfo), - next_page_token=d.get("next_page_token", None), + external_locations=_repeated_dict(d, "{external_locations}", ExternalLocationInfo), + next_page_token=d.get("{next_page_token}", None), ) @@ -4777,25 +4789,25 @@ def as_dict(self) -> dict: """Serializes the ListFunctionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.functions: - body["functions"] = [v.as_dict() for v in self.functions] + body["{functions}"] = [v.as_dict() for v in self.functions] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListFunctionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.functions: - body["functions"] = self.functions + body["{functions}"] = self.functions if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFunctionsResponse: """Deserializes the ListFunctionsResponse from a dictionary.""" return cls( - functions=_repeated_dict(d, "functions", FunctionInfo), next_page_token=d.get("next_page_token", None) + functions=_repeated_dict(d, "{functions}", FunctionInfo), next_page_token=d.get("{next_page_token}", None) ) @@ -4808,20 +4820,20 @@ def as_dict(self) -> dict: """Serializes the ListMetastoresResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastores: - body["metastores"] = [v.as_dict() for v in self.metastores] + body["{metastores}"] = [v.as_dict() for v in self.metastores] return body def as_shallow_dict(self) -> dict: """Serializes the ListMetastoresResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.metastores: - body["metastores"] = self.metastores + body["{metastores}"] = self.metastores return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListMetastoresResponse: """Deserializes the ListMetastoresResponse from a dictionary.""" - return cls(metastores=_repeated_dict(d, "metastores", MetastoreInfo)) + return cls(metastores=_repeated_dict(d, "{metastores}", MetastoreInfo)) @dataclass @@ -4836,26 +4848,26 @@ def as_dict(self) -> dict: """Serializes the ListModelVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_versions: - body["model_versions"] = [v.as_dict() for v in self.model_versions] + body["{model_versions}"] = [v.as_dict() for v in self.model_versions] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListModelVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_versions: - body["model_versions"] = self.model_versions + body["{model_versions}"] = self.model_versions if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListModelVersionsResponse: """Deserializes the ListModelVersionsResponse from a dictionary.""" return cls( - model_versions=_repeated_dict(d, "model_versions", ModelVersionInfo), - next_page_token=d.get("next_page_token", None), + model_versions=_repeated_dict(d, "{model_versions}", ModelVersionInfo), + next_page_token=d.get("{next_page_token}", None), ) @@ -4872,24 +4884,24 @@ def as_dict(self) -> dict: """Serializes the ListQuotasResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.quotas: - body["quotas"] = [v.as_dict() for v in self.quotas] + body["{quotas}"] = [v.as_dict() for v in self.quotas] return body def as_shallow_dict(self) -> dict: """Serializes the ListQuotasResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.quotas: - body["quotas"] = self.quotas + body["{quotas}"] = self.quotas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQuotasResponse: """Deserializes the ListQuotasResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), quotas=_repeated_dict(d, "quotas", QuotaInfo)) + return cls(next_page_token=d.get("{next_page_token}", None), quotas=_repeated_dict(d, "{quotas}", QuotaInfo)) @dataclass @@ -4904,26 +4916,26 @@ def as_dict(self) -> dict: """Serializes the ListRegisteredModelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.registered_models: - body["registered_models"] = [v.as_dict() for v in self.registered_models] + body["{registered_models}"] = [v.as_dict() for v in self.registered_models] return body def as_shallow_dict(self) -> dict: """Serializes the ListRegisteredModelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.registered_models: - body["registered_models"] = self.registered_models + body["{registered_models}"] = self.registered_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListRegisteredModelsResponse: """Deserializes the ListRegisteredModelsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - registered_models=_repeated_dict(d, "registered_models", RegisteredModelInfo), + next_page_token=d.get("{next_page_token}", None), + registered_models=_repeated_dict(d, "{registered_models}", RegisteredModelInfo), ) @@ -4940,24 +4952,24 @@ def as_dict(self) -> dict: """Serializes the ListSchemasResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.schemas: - body["schemas"] = [v.as_dict() for v in self.schemas] + body["{schemas}"] = [v.as_dict() for v in self.schemas] return body def as_shallow_dict(self) -> dict: """Serializes the ListSchemasResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSchemasResponse: """Deserializes the ListSchemasResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), schemas=_repeated_dict(d, "schemas", SchemaInfo)) + return cls(next_page_token=d.get("{next_page_token}", None), schemas=_repeated_dict(d, "{schemas}", SchemaInfo)) @dataclass @@ -4972,26 +4984,26 @@ def as_dict(self) -> dict: """Serializes the ListStorageCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.storage_credentials: - body["storage_credentials"] = [v.as_dict() for v in self.storage_credentials] + body["{storage_credentials}"] = [v.as_dict() for v in self.storage_credentials] return body def as_shallow_dict(self) -> dict: """Serializes the ListStorageCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.storage_credentials: - body["storage_credentials"] = self.storage_credentials + body["{storage_credentials}"] = self.storage_credentials return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListStorageCredentialsResponse: """Deserializes the ListStorageCredentialsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - storage_credentials=_repeated_dict(d, "storage_credentials", StorageCredentialInfo), + next_page_token=d.get("{next_page_token}", None), + storage_credentials=_repeated_dict(d, "{storage_credentials}", StorageCredentialInfo), ) @@ -5008,25 +5020,25 @@ def as_dict(self) -> dict: """Serializes the ListSystemSchemasResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.schemas: - body["schemas"] = [v.as_dict() for v in self.schemas] + body["{schemas}"] = [v.as_dict() for v in self.schemas] return body def as_shallow_dict(self) -> dict: """Serializes the ListSystemSchemasResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSystemSchemasResponse: """Deserializes the ListSystemSchemasResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), schemas=_repeated_dict(d, "schemas", SystemSchemaInfo) + next_page_token=d.get("{next_page_token}", None), schemas=_repeated_dict(d, "{schemas}", SystemSchemaInfo) ) @@ -5043,24 +5055,24 @@ def as_dict(self) -> dict: """Serializes the ListTableSummariesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.tables: - body["tables"] = [v.as_dict() for v in self.tables] + body["{tables}"] = [v.as_dict() for v in self.tables] return body def as_shallow_dict(self) -> dict: """Serializes the ListTableSummariesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.tables: - body["tables"] = self.tables + body["{tables}"] = self.tables return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTableSummariesResponse: """Deserializes the ListTableSummariesResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), tables=_repeated_dict(d, "tables", TableSummary)) + return cls(next_page_token=d.get("{next_page_token}", None), tables=_repeated_dict(d, "{tables}", TableSummary)) @dataclass @@ -5076,24 +5088,24 @@ def as_dict(self) -> dict: """Serializes the ListTablesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.tables: - body["tables"] = [v.as_dict() for v in self.tables] + body["{tables}"] = [v.as_dict() for v in self.tables] return body def as_shallow_dict(self) -> dict: """Serializes the ListTablesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.tables: - body["tables"] = self.tables + body["{tables}"] = self.tables return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTablesResponse: """Deserializes the ListTablesResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), tables=_repeated_dict(d, "tables", TableInfo)) + return cls(next_page_token=d.get("{next_page_token}", None), tables=_repeated_dict(d, "{tables}", TableInfo)) @dataclass @@ -5109,24 +5121,24 @@ def as_dict(self) -> dict: """Serializes the ListVolumesResponseContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.volumes: - body["volumes"] = [v.as_dict() for v in self.volumes] + body["{volumes}"] = [v.as_dict() for v in self.volumes] return body def as_shallow_dict(self) -> dict: """Serializes the ListVolumesResponseContent into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListVolumesResponseContent: """Deserializes the ListVolumesResponseContent from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), volumes=_repeated_dict(d, "volumes", VolumeInfo)) + return cls(next_page_token=d.get("{next_page_token}", None), volumes=_repeated_dict(d, "{volumes}", VolumeInfo)) class MatchType(Enum): @@ -5150,31 +5162,31 @@ def as_dict(self) -> dict: """Serializes the MetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_catalog_name is not None: - body["default_catalog_name"] = self.default_catalog_name + body["{default_catalog_name}"] = self.default_catalog_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the MetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.default_catalog_name is not None: - body["default_catalog_name"] = self.default_catalog_name + body["{default_catalog_name}"] = self.default_catalog_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MetastoreAssignment: """Deserializes the MetastoreAssignment from a dictionary.""" return cls( - default_catalog_name=d.get("default_catalog_name", None), - metastore_id=d.get("metastore_id", None), - workspace_id=d.get("workspace_id", None), + default_catalog_name=d.get("{default_catalog_name}", None), + metastore_id=d.get("{metastore_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -5242,117 +5254,117 @@ def as_dict(self) -> dict: """Serializes the MetastoreInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.default_data_access_config_id is not None: - body["default_data_access_config_id"] = self.default_data_access_config_id + body["{default_data_access_config_id}"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["delta_sharing_organization_name"] = self.delta_sharing_organization_name + body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( + body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["delta_sharing_scope"] = self.delta_sharing_scope.value + body["{delta_sharing_scope}"] = self.delta_sharing_scope.value if self.external_access_enabled is not None: - body["external_access_enabled"] = self.external_access_enabled + body["{external_access_enabled}"] = self.external_access_enabled if self.global_metastore_id is not None: - body["global_metastore_id"] = self.global_metastore_id + body["{global_metastore_id}"] = self.global_metastore_id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.privilege_model_version is not None: - body["privilege_model_version"] = self.privilege_model_version + body["{privilege_model_version}"] = self.privilege_model_version if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.storage_root_credential_id is not None: - body["storage_root_credential_id"] = self.storage_root_credential_id + body["{storage_root_credential_id}"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["storage_root_credential_name"] = self.storage_root_credential_name + body["{storage_root_credential_name}"] = self.storage_root_credential_name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the MetastoreInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.default_data_access_config_id is not None: - body["default_data_access_config_id"] = self.default_data_access_config_id + body["{default_data_access_config_id}"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["delta_sharing_organization_name"] = self.delta_sharing_organization_name + body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( + body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["delta_sharing_scope"] = self.delta_sharing_scope + body["{delta_sharing_scope}"] = self.delta_sharing_scope if self.external_access_enabled is not None: - body["external_access_enabled"] = self.external_access_enabled + body["{external_access_enabled}"] = self.external_access_enabled if self.global_metastore_id is not None: - body["global_metastore_id"] = self.global_metastore_id + body["{global_metastore_id}"] = self.global_metastore_id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.privilege_model_version is not None: - body["privilege_model_version"] = self.privilege_model_version + body["{privilege_model_version}"] = self.privilege_model_version if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.storage_root_credential_id is not None: - body["storage_root_credential_id"] = self.storage_root_credential_id + body["{storage_root_credential_id}"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["storage_root_credential_name"] = self.storage_root_credential_name + body["{storage_root_credential_name}"] = self.storage_root_credential_name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MetastoreInfo: """Deserializes the MetastoreInfo from a dictionary.""" return cls( - cloud=d.get("cloud", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - default_data_access_config_id=d.get("default_data_access_config_id", None), - delta_sharing_organization_name=d.get("delta_sharing_organization_name", None), + cloud=d.get("{cloud}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + default_data_access_config_id=d.get("{default_data_access_config_id}", None), + delta_sharing_organization_name=d.get("{delta_sharing_organization_name}", None), delta_sharing_recipient_token_lifetime_in_seconds=d.get( - "delta_sharing_recipient_token_lifetime_in_seconds", None + "{delta_sharing_recipient_token_lifetime_in_seconds}", None ), - delta_sharing_scope=_enum(d, "delta_sharing_scope", MetastoreInfoDeltaSharingScope), - external_access_enabled=d.get("external_access_enabled", None), - global_metastore_id=d.get("global_metastore_id", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - privilege_model_version=d.get("privilege_model_version", None), - region=d.get("region", None), - storage_root=d.get("storage_root", None), - storage_root_credential_id=d.get("storage_root_credential_id", None), - storage_root_credential_name=d.get("storage_root_credential_name", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + delta_sharing_scope=_enum(d, "{delta_sharing_scope}", MetastoreInfoDeltaSharingScope), + external_access_enabled=d.get("{external_access_enabled}", None), + global_metastore_id=d.get("{global_metastore_id}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + privilege_model_version=d.get("{privilege_model_version}", None), + region=d.get("{region}", None), + storage_root=d.get("{storage_root}", None), + storage_root_credential_id=d.get("{storage_root_credential_id}", None), + storage_root_credential_name=d.get("{storage_root_credential_name}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -5429,111 +5441,111 @@ def as_dict(self) -> dict: """Serializes the ModelVersionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aliases: - body["aliases"] = [v.as_dict() for v in self.aliases] + body["{aliases}"] = [v.as_dict() for v in self.aliases] if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version_dependencies: - body["model_version_dependencies"] = self.model_version_dependencies.as_dict() + body["{model_version_dependencies}"] = self.model_version_dependencies.as_dict() if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_workspace_id is not None: - body["run_workspace_id"] = self.run_workspace_id + body["{run_workspace_id}"] = self.run_workspace_id if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the ModelVersionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aliases: - body["aliases"] = self.aliases + body["{aliases}"] = self.aliases if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version_dependencies: - body["model_version_dependencies"] = self.model_version_dependencies + body["{model_version_dependencies}"] = self.model_version_dependencies if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_workspace_id is not None: - body["run_workspace_id"] = self.run_workspace_id + body["{run_workspace_id}"] = self.run_workspace_id if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersionInfo: """Deserializes the ModelVersionInfo from a dictionary.""" return cls( - aliases=_repeated_dict(d, "aliases", RegisteredModelAlias), - browse_only=d.get("browse_only", None), - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - id=d.get("id", None), - metastore_id=d.get("metastore_id", None), - model_name=d.get("model_name", None), - model_version_dependencies=_from_dict(d, "model_version_dependencies", DependencyList), - run_id=d.get("run_id", None), - run_workspace_id=d.get("run_workspace_id", None), - schema_name=d.get("schema_name", None), - source=d.get("source", None), - status=_enum(d, "status", ModelVersionInfoStatus), - storage_location=d.get("storage_location", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - version=d.get("version", None), + aliases=_repeated_dict(d, "{aliases}", RegisteredModelAlias), + browse_only=d.get("{browse_only}", None), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + id=d.get("{id}", None), + metastore_id=d.get("{metastore_id}", None), + model_name=d.get("{model_name}", None), + model_version_dependencies=_from_dict(d, "{model_version_dependencies}", DependencyList), + run_id=d.get("{run_id}", None), + run_workspace_id=d.get("{run_workspace_id}", None), + schema_name=d.get("{schema_name}", None), + source=d.get("{source}", None), + status=_enum(d, "{status}", ModelVersionInfoStatus), + storage_location=d.get("{storage_location}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + version=d.get("{version}", None), ) @@ -5564,31 +5576,31 @@ def as_dict(self) -> dict: """Serializes the MonitorCronSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.pause_status is not None: - body["pause_status"] = self.pause_status.value + body["{pause_status}"] = self.pause_status.value if self.quartz_cron_expression is not None: - body["quartz_cron_expression"] = self.quartz_cron_expression + body["{quartz_cron_expression}"] = self.quartz_cron_expression if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body def as_shallow_dict(self) -> dict: """Serializes the MonitorCronSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.pause_status is not None: - body["pause_status"] = self.pause_status + body["{pause_status}"] = self.pause_status if self.quartz_cron_expression is not None: - body["quartz_cron_expression"] = self.quartz_cron_expression + body["{quartz_cron_expression}"] = self.quartz_cron_expression if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorCronSchedule: """Deserializes the MonitorCronSchedule from a dictionary.""" return cls( - pause_status=_enum(d, "pause_status", MonitorCronSchedulePauseStatus), - quartz_cron_expression=d.get("quartz_cron_expression", None), - timezone_id=d.get("timezone_id", None), + pause_status=_enum(d, "{pause_status}", MonitorCronSchedulePauseStatus), + quartz_cron_expression=d.get("{quartz_cron_expression}", None), + timezone_id=d.get("{timezone_id}", None), ) @@ -5608,20 +5620,20 @@ def as_dict(self) -> dict: """Serializes the MonitorDataClassificationConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body def as_shallow_dict(self) -> dict: """Serializes the MonitorDataClassificationConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorDataClassificationConfig: """Deserializes the MonitorDataClassificationConfig from a dictionary.""" - return cls(enabled=d.get("enabled", None)) + return cls(enabled=d.get("{enabled}", None)) @dataclass @@ -5634,20 +5646,20 @@ def as_dict(self) -> dict: """Serializes the MonitorDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.email_addresses: - body["email_addresses"] = [v for v in self.email_addresses] + body["{email_addresses}"] = [v for v in self.email_addresses] return body def as_shallow_dict(self) -> dict: """Serializes the MonitorDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.email_addresses: - body["email_addresses"] = self.email_addresses + body["{email_addresses}"] = self.email_addresses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorDestination: """Deserializes the MonitorDestination from a dictionary.""" - return cls(email_addresses=d.get("email_addresses", None)) + return cls(email_addresses=d.get("{email_addresses}", None)) @dataclass @@ -5687,51 +5699,51 @@ def as_dict(self) -> dict: """Serializes the MonitorInferenceLog into a dictionary suitable for use as a JSON request body.""" body = {} if self.granularities: - body["granularities"] = [v for v in self.granularities] + body["{granularities}"] = [v for v in self.granularities] if self.label_col is not None: - body["label_col"] = self.label_col + body["{label_col}"] = self.label_col if self.model_id_col is not None: - body["model_id_col"] = self.model_id_col + body["{model_id_col}"] = self.model_id_col if self.prediction_col is not None: - body["prediction_col"] = self.prediction_col + body["{prediction_col}"] = self.prediction_col if self.prediction_proba_col is not None: - body["prediction_proba_col"] = self.prediction_proba_col + body["{prediction_proba_col}"] = self.prediction_proba_col if self.problem_type is not None: - body["problem_type"] = self.problem_type.value + body["{problem_type}"] = self.problem_type.value if self.timestamp_col is not None: - body["timestamp_col"] = self.timestamp_col + body["{timestamp_col}"] = self.timestamp_col return body def as_shallow_dict(self) -> dict: """Serializes the MonitorInferenceLog into a shallow dictionary of its immediate attributes.""" body = {} if self.granularities: - body["granularities"] = self.granularities + body["{granularities}"] = self.granularities if self.label_col is not None: - body["label_col"] = self.label_col + body["{label_col}"] = self.label_col if self.model_id_col is not None: - body["model_id_col"] = self.model_id_col + body["{model_id_col}"] = self.model_id_col if self.prediction_col is not None: - body["prediction_col"] = self.prediction_col + body["{prediction_col}"] = self.prediction_col if self.prediction_proba_col is not None: - body["prediction_proba_col"] = self.prediction_proba_col + body["{prediction_proba_col}"] = self.prediction_proba_col if self.problem_type is not None: - body["problem_type"] = self.problem_type + body["{problem_type}"] = self.problem_type if self.timestamp_col is not None: - body["timestamp_col"] = self.timestamp_col + body["{timestamp_col}"] = self.timestamp_col return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorInferenceLog: """Deserializes the MonitorInferenceLog from a dictionary.""" return cls( - granularities=d.get("granularities", None), - label_col=d.get("label_col", None), - model_id_col=d.get("model_id_col", None), - prediction_col=d.get("prediction_col", None), - prediction_proba_col=d.get("prediction_proba_col", None), - problem_type=_enum(d, "problem_type", MonitorInferenceLogProblemType), - timestamp_col=d.get("timestamp_col", None), + granularities=d.get("{granularities}", None), + label_col=d.get("{label_col}", None), + model_id_col=d.get("{model_id_col}", None), + prediction_col=d.get("{prediction_col}", None), + prediction_proba_col=d.get("{prediction_proba_col}", None), + problem_type=_enum(d, "{problem_type}", MonitorInferenceLogProblemType), + timestamp_col=d.get("{timestamp_col}", None), ) @@ -5811,106 +5823,106 @@ def as_dict(self) -> dict: """Serializes the MonitorInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets_dir is not None: - body["assets_dir"] = self.assets_dir + body["{assets_dir}"] = self.assets_dir if self.baseline_table_name is not None: - body["baseline_table_name"] = self.baseline_table_name + body["{baseline_table_name}"] = self.baseline_table_name if self.custom_metrics: - body["custom_metrics"] = [v.as_dict() for v in self.custom_metrics] + body["{custom_metrics}"] = [v.as_dict() for v in self.custom_metrics] if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.data_classification_config: - body["data_classification_config"] = self.data_classification_config.as_dict() + body["{data_classification_config}"] = self.data_classification_config.as_dict() if self.drift_metrics_table_name is not None: - body["drift_metrics_table_name"] = self.drift_metrics_table_name + body["{drift_metrics_table_name}"] = self.drift_metrics_table_name if self.inference_log: - body["inference_log"] = self.inference_log.as_dict() + body["{inference_log}"] = self.inference_log.as_dict() if self.latest_monitor_failure_msg is not None: - body["latest_monitor_failure_msg"] = self.latest_monitor_failure_msg + body["{latest_monitor_failure_msg}"] = self.latest_monitor_failure_msg if self.monitor_version is not None: - body["monitor_version"] = self.monitor_version + body["{monitor_version}"] = self.monitor_version if self.notifications: - body["notifications"] = self.notifications.as_dict() + body["{notifications}"] = self.notifications.as_dict() if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.profile_metrics_table_name is not None: - body["profile_metrics_table_name"] = self.profile_metrics_table_name + body["{profile_metrics_table_name}"] = self.profile_metrics_table_name if self.schedule: - body["schedule"] = self.schedule.as_dict() + body["{schedule}"] = self.schedule.as_dict() if self.slicing_exprs: - body["slicing_exprs"] = [v for v in self.slicing_exprs] + body["{slicing_exprs}"] = [v for v in self.slicing_exprs] if self.snapshot: - body["snapshot"] = self.snapshot.as_dict() + body["{snapshot}"] = self.snapshot.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.time_series: - body["time_series"] = self.time_series.as_dict() + body["{time_series}"] = self.time_series.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the MonitorInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.assets_dir is not None: - body["assets_dir"] = self.assets_dir + body["{assets_dir}"] = self.assets_dir if self.baseline_table_name is not None: - body["baseline_table_name"] = self.baseline_table_name + body["{baseline_table_name}"] = self.baseline_table_name if self.custom_metrics: - body["custom_metrics"] = self.custom_metrics + body["{custom_metrics}"] = self.custom_metrics if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.data_classification_config: - body["data_classification_config"] = self.data_classification_config + body["{data_classification_config}"] = self.data_classification_config if self.drift_metrics_table_name is not None: - body["drift_metrics_table_name"] = self.drift_metrics_table_name + body["{drift_metrics_table_name}"] = self.drift_metrics_table_name if self.inference_log: - body["inference_log"] = self.inference_log + body["{inference_log}"] = self.inference_log if self.latest_monitor_failure_msg is not None: - body["latest_monitor_failure_msg"] = self.latest_monitor_failure_msg + body["{latest_monitor_failure_msg}"] = self.latest_monitor_failure_msg if self.monitor_version is not None: - body["monitor_version"] = self.monitor_version + body["{monitor_version}"] = self.monitor_version if self.notifications: - body["notifications"] = self.notifications + body["{notifications}"] = self.notifications if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.profile_metrics_table_name is not None: - body["profile_metrics_table_name"] = self.profile_metrics_table_name + body["{profile_metrics_table_name}"] = self.profile_metrics_table_name if self.schedule: - body["schedule"] = self.schedule + body["{schedule}"] = self.schedule if self.slicing_exprs: - body["slicing_exprs"] = self.slicing_exprs + body["{slicing_exprs}"] = self.slicing_exprs if self.snapshot: - body["snapshot"] = self.snapshot + body["{snapshot}"] = self.snapshot if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.time_series: - body["time_series"] = self.time_series + body["{time_series}"] = self.time_series return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorInfo: """Deserializes the MonitorInfo from a dictionary.""" return cls( - assets_dir=d.get("assets_dir", None), - baseline_table_name=d.get("baseline_table_name", None), - custom_metrics=_repeated_dict(d, "custom_metrics", MonitorMetric), - dashboard_id=d.get("dashboard_id", None), - data_classification_config=_from_dict(d, "data_classification_config", MonitorDataClassificationConfig), - drift_metrics_table_name=d.get("drift_metrics_table_name", None), - inference_log=_from_dict(d, "inference_log", MonitorInferenceLog), - latest_monitor_failure_msg=d.get("latest_monitor_failure_msg", None), - monitor_version=d.get("monitor_version", None), - notifications=_from_dict(d, "notifications", MonitorNotifications), - output_schema_name=d.get("output_schema_name", None), - profile_metrics_table_name=d.get("profile_metrics_table_name", None), - schedule=_from_dict(d, "schedule", MonitorCronSchedule), - slicing_exprs=d.get("slicing_exprs", None), - snapshot=_from_dict(d, "snapshot", MonitorSnapshot), - status=_enum(d, "status", MonitorInfoStatus), - table_name=d.get("table_name", None), - time_series=_from_dict(d, "time_series", MonitorTimeSeries), + assets_dir=d.get("{assets_dir}", None), + baseline_table_name=d.get("{baseline_table_name}", None), + custom_metrics=_repeated_dict(d, "{custom_metrics}", MonitorMetric), + dashboard_id=d.get("{dashboard_id}", None), + data_classification_config=_from_dict(d, "{data_classification_config}", MonitorDataClassificationConfig), + drift_metrics_table_name=d.get("{drift_metrics_table_name}", None), + inference_log=_from_dict(d, "{inference_log}", MonitorInferenceLog), + latest_monitor_failure_msg=d.get("{latest_monitor_failure_msg}", None), + monitor_version=d.get("{monitor_version}", None), + notifications=_from_dict(d, "{notifications}", MonitorNotifications), + output_schema_name=d.get("{output_schema_name}", None), + profile_metrics_table_name=d.get("{profile_metrics_table_name}", None), + schedule=_from_dict(d, "{schedule}", MonitorCronSchedule), + slicing_exprs=d.get("{slicing_exprs}", None), + snapshot=_from_dict(d, "{snapshot}", MonitorSnapshot), + status=_enum(d, "{status}", MonitorInfoStatus), + table_name=d.get("{table_name}", None), + time_series=_from_dict(d, "{time_series}", MonitorTimeSeries), ) @@ -5955,41 +5967,41 @@ def as_dict(self) -> dict: """Serializes the MonitorMetric into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.input_columns: - body["input_columns"] = [v for v in self.input_columns] + body["{input_columns}"] = [v for v in self.input_columns] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.output_data_type is not None: - body["output_data_type"] = self.output_data_type + body["{output_data_type}"] = self.output_data_type if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the MonitorMetric into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.input_columns: - body["input_columns"] = self.input_columns + body["{input_columns}"] = self.input_columns if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.output_data_type is not None: - body["output_data_type"] = self.output_data_type + body["{output_data_type}"] = self.output_data_type if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorMetric: """Deserializes the MonitorMetric from a dictionary.""" return cls( - definition=d.get("definition", None), - input_columns=d.get("input_columns", None), - name=d.get("name", None), - output_data_type=d.get("output_data_type", None), - type=_enum(d, "type", MonitorMetricType), + definition=d.get("{definition}", None), + input_columns=d.get("{input_columns}", None), + name=d.get("{name}", None), + output_data_type=d.get("{output_data_type}", None), + type=_enum(d, "{type}", MonitorMetricType), ) @@ -6019,26 +6031,28 @@ def as_dict(self) -> dict: """Serializes the MonitorNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.on_failure: - body["on_failure"] = self.on_failure.as_dict() + body["{on_failure}"] = self.on_failure.as_dict() if self.on_new_classification_tag_detected: - body["on_new_classification_tag_detected"] = self.on_new_classification_tag_detected.as_dict() + body["{on_new_classification_tag_detected}"] = self.on_new_classification_tag_detected.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the MonitorNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.on_failure: - body["on_failure"] = self.on_failure + body["{on_failure}"] = self.on_failure if self.on_new_classification_tag_detected: - body["on_new_classification_tag_detected"] = self.on_new_classification_tag_detected + body["{on_new_classification_tag_detected}"] = self.on_new_classification_tag_detected return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorNotifications: """Deserializes the MonitorNotifications from a dictionary.""" return cls( - on_failure=_from_dict(d, "on_failure", MonitorDestination), - on_new_classification_tag_detected=_from_dict(d, "on_new_classification_tag_detected", MonitorDestination), + on_failure=_from_dict(d, "{on_failure}", MonitorDestination), + on_new_classification_tag_detected=_from_dict( + d, "{on_new_classification_tag_detected}", MonitorDestination + ), ) @@ -6066,46 +6080,46 @@ def as_dict(self) -> dict: """Serializes the MonitorRefreshInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time_ms is not None: - body["end_time_ms"] = self.end_time_ms + body["{end_time_ms}"] = self.end_time_ms if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.refresh_id is not None: - body["refresh_id"] = self.refresh_id + body["{refresh_id}"] = self.refresh_id if self.start_time_ms is not None: - body["start_time_ms"] = self.start_time_ms + body["{start_time_ms}"] = self.start_time_ms if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.trigger is not None: - body["trigger"] = self.trigger.value + body["{trigger}"] = self.trigger.value return body def as_shallow_dict(self) -> dict: """Serializes the MonitorRefreshInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time_ms is not None: - body["end_time_ms"] = self.end_time_ms + body["{end_time_ms}"] = self.end_time_ms if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.refresh_id is not None: - body["refresh_id"] = self.refresh_id + body["{refresh_id}"] = self.refresh_id if self.start_time_ms is not None: - body["start_time_ms"] = self.start_time_ms + body["{start_time_ms}"] = self.start_time_ms if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.trigger is not None: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorRefreshInfo: """Deserializes the MonitorRefreshInfo from a dictionary.""" return cls( - end_time_ms=d.get("end_time_ms", None), - message=d.get("message", None), - refresh_id=d.get("refresh_id", None), - start_time_ms=d.get("start_time_ms", None), - state=_enum(d, "state", MonitorRefreshInfoState), - trigger=_enum(d, "trigger", MonitorRefreshInfoTrigger), + end_time_ms=d.get("{end_time_ms}", None), + message=d.get("{message}", None), + refresh_id=d.get("{refresh_id}", None), + start_time_ms=d.get("{start_time_ms}", None), + state=_enum(d, "{state}", MonitorRefreshInfoState), + trigger=_enum(d, "{trigger}", MonitorRefreshInfoTrigger), ) @@ -6135,20 +6149,20 @@ def as_dict(self) -> dict: """Serializes the MonitorRefreshListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.refreshes: - body["refreshes"] = [v.as_dict() for v in self.refreshes] + body["{refreshes}"] = [v.as_dict() for v in self.refreshes] return body def as_shallow_dict(self) -> dict: """Serializes the MonitorRefreshListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.refreshes: - body["refreshes"] = self.refreshes + body["{refreshes}"] = self.refreshes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorRefreshListResponse: """Deserializes the MonitorRefreshListResponse from a dictionary.""" - return cls(refreshes=_repeated_dict(d, "refreshes", MonitorRefreshInfo)) + return cls(refreshes=_repeated_dict(d, "{refreshes}", MonitorRefreshInfo)) @dataclass @@ -6187,24 +6201,24 @@ def as_dict(self) -> dict: """Serializes the MonitorTimeSeries into a dictionary suitable for use as a JSON request body.""" body = {} if self.granularities: - body["granularities"] = [v for v in self.granularities] + body["{granularities}"] = [v for v in self.granularities] if self.timestamp_col is not None: - body["timestamp_col"] = self.timestamp_col + body["{timestamp_col}"] = self.timestamp_col return body def as_shallow_dict(self) -> dict: """Serializes the MonitorTimeSeries into a shallow dictionary of its immediate attributes.""" body = {} if self.granularities: - body["granularities"] = self.granularities + body["{granularities}"] = self.granularities if self.timestamp_col is not None: - body["timestamp_col"] = self.timestamp_col + body["{timestamp_col}"] = self.timestamp_col return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorTimeSeries: """Deserializes the MonitorTimeSeries from a dictionary.""" - return cls(granularities=d.get("granularities", None), timestamp_col=d.get("timestamp_col", None)) + return cls(granularities=d.get("{granularities}", None), timestamp_col=d.get("{timestamp_col}", None)) @dataclass @@ -6216,20 +6230,20 @@ def as_dict(self) -> dict: """Serializes the NamedTableConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the NamedTableConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NamedTableConstraint: """Deserializes the NamedTableConstraint from a dictionary.""" - return cls(name=d.get("name", None)) + return cls(name=d.get("{name}", None)) @dataclass @@ -6257,41 +6271,41 @@ def as_dict(self) -> dict: """Serializes the OnlineTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.spec: - body["spec"] = self.spec.as_dict() + body["{spec}"] = self.spec.as_dict() if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() if self.table_serving_url is not None: - body["table_serving_url"] = self.table_serving_url + body["{table_serving_url}"] = self.table_serving_url if self.unity_catalog_provisioning_state is not None: - body["unity_catalog_provisioning_state"] = self.unity_catalog_provisioning_state.value + body["{unity_catalog_provisioning_state}"] = self.unity_catalog_provisioning_state.value return body def as_shallow_dict(self) -> dict: """Serializes the OnlineTable into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.spec: - body["spec"] = self.spec + body["{spec}"] = self.spec if self.status: - body["status"] = self.status + body["{status}"] = self.status if self.table_serving_url is not None: - body["table_serving_url"] = self.table_serving_url + body["{table_serving_url}"] = self.table_serving_url if self.unity_catalog_provisioning_state is not None: - body["unity_catalog_provisioning_state"] = self.unity_catalog_provisioning_state + body["{unity_catalog_provisioning_state}"] = self.unity_catalog_provisioning_state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OnlineTable: """Deserializes the OnlineTable from a dictionary.""" return cls( - name=d.get("name", None), - spec=_from_dict(d, "spec", OnlineTableSpec), - status=_from_dict(d, "status", OnlineTableStatus), - table_serving_url=d.get("table_serving_url", None), - unity_catalog_provisioning_state=_enum(d, "unity_catalog_provisioning_state", ProvisioningInfoState), + name=d.get("{name}", None), + spec=_from_dict(d, "{spec}", OnlineTableSpec), + status=_from_dict(d, "{status}", OnlineTableStatus), + table_serving_url=d.get("{table_serving_url}", None), + unity_catalog_provisioning_state=_enum(d, "{unity_catalog_provisioning_state}", ProvisioningInfoState), ) @@ -6330,51 +6344,51 @@ def as_dict(self) -> dict: """Serializes the OnlineTableSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.perform_full_copy is not None: - body["perform_full_copy"] = self.perform_full_copy + body["{perform_full_copy}"] = self.perform_full_copy if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.primary_key_columns: - body["primary_key_columns"] = [v for v in self.primary_key_columns] + body["{primary_key_columns}"] = [v for v in self.primary_key_columns] if self.run_continuously: - body["run_continuously"] = self.run_continuously.as_dict() + body["{run_continuously}"] = self.run_continuously.as_dict() if self.run_triggered: - body["run_triggered"] = self.run_triggered.as_dict() + body["{run_triggered}"] = self.run_triggered.as_dict() if self.source_table_full_name is not None: - body["source_table_full_name"] = self.source_table_full_name + body["{source_table_full_name}"] = self.source_table_full_name if self.timeseries_key is not None: - body["timeseries_key"] = self.timeseries_key + body["{timeseries_key}"] = self.timeseries_key return body def as_shallow_dict(self) -> dict: """Serializes the OnlineTableSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.perform_full_copy is not None: - body["perform_full_copy"] = self.perform_full_copy + body["{perform_full_copy}"] = self.perform_full_copy if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.primary_key_columns: - body["primary_key_columns"] = self.primary_key_columns + body["{primary_key_columns}"] = self.primary_key_columns if self.run_continuously: - body["run_continuously"] = self.run_continuously + body["{run_continuously}"] = self.run_continuously if self.run_triggered: - body["run_triggered"] = self.run_triggered + body["{run_triggered}"] = self.run_triggered if self.source_table_full_name is not None: - body["source_table_full_name"] = self.source_table_full_name + body["{source_table_full_name}"] = self.source_table_full_name if self.timeseries_key is not None: - body["timeseries_key"] = self.timeseries_key + body["{timeseries_key}"] = self.timeseries_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OnlineTableSpec: """Deserializes the OnlineTableSpec from a dictionary.""" return cls( - perform_full_copy=d.get("perform_full_copy", None), - pipeline_id=d.get("pipeline_id", None), - primary_key_columns=d.get("primary_key_columns", None), - run_continuously=_from_dict(d, "run_continuously", OnlineTableSpecContinuousSchedulingPolicy), - run_triggered=_from_dict(d, "run_triggered", OnlineTableSpecTriggeredSchedulingPolicy), - source_table_full_name=d.get("source_table_full_name", None), - timeseries_key=d.get("timeseries_key", None), + perform_full_copy=d.get("{perform_full_copy}", None), + pipeline_id=d.get("{pipeline_id}", None), + primary_key_columns=d.get("{primary_key_columns}", None), + run_continuously=_from_dict(d, "{run_continuously}", OnlineTableSpecContinuousSchedulingPolicy), + run_triggered=_from_dict(d, "{run_triggered}", OnlineTableSpecTriggeredSchedulingPolicy), + source_table_full_name=d.get("{source_table_full_name}", None), + timeseries_key=d.get("{timeseries_key}", None), ) @@ -6460,46 +6474,46 @@ def as_dict(self) -> dict: """Serializes the OnlineTableStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.continuous_update_status: - body["continuous_update_status"] = self.continuous_update_status.as_dict() + body["{continuous_update_status}"] = self.continuous_update_status.as_dict() if self.detailed_state is not None: - body["detailed_state"] = self.detailed_state.value + body["{detailed_state}"] = self.detailed_state.value if self.failed_status: - body["failed_status"] = self.failed_status.as_dict() + body["{failed_status}"] = self.failed_status.as_dict() if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.provisioning_status: - body["provisioning_status"] = self.provisioning_status.as_dict() + body["{provisioning_status}"] = self.provisioning_status.as_dict() if self.triggered_update_status: - body["triggered_update_status"] = self.triggered_update_status.as_dict() + body["{triggered_update_status}"] = self.triggered_update_status.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the OnlineTableStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.continuous_update_status: - body["continuous_update_status"] = self.continuous_update_status + body["{continuous_update_status}"] = self.continuous_update_status if self.detailed_state is not None: - body["detailed_state"] = self.detailed_state + body["{detailed_state}"] = self.detailed_state if self.failed_status: - body["failed_status"] = self.failed_status + body["{failed_status}"] = self.failed_status if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.provisioning_status: - body["provisioning_status"] = self.provisioning_status + body["{provisioning_status}"] = self.provisioning_status if self.triggered_update_status: - body["triggered_update_status"] = self.triggered_update_status + body["{triggered_update_status}"] = self.triggered_update_status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OnlineTableStatus: """Deserializes the OnlineTableStatus from a dictionary.""" return cls( - continuous_update_status=_from_dict(d, "continuous_update_status", ContinuousUpdateStatus), - detailed_state=_enum(d, "detailed_state", OnlineTableState), - failed_status=_from_dict(d, "failed_status", FailedStatus), - message=d.get("message", None), - provisioning_status=_from_dict(d, "provisioning_status", ProvisioningStatus), - triggered_update_status=_from_dict(d, "triggered_update_status", TriggeredUpdateStatus), + continuous_update_status=_from_dict(d, "{continuous_update_status}", ContinuousUpdateStatus), + detailed_state=_enum(d, "{detailed_state}", OnlineTableState), + failed_status=_from_dict(d, "{failed_status}", FailedStatus), + message=d.get("{message}", None), + provisioning_status=_from_dict(d, "{provisioning_status}", ProvisioningStatus), + triggered_update_status=_from_dict(d, "{triggered_update_status}", TriggeredUpdateStatus), ) @@ -6518,31 +6532,31 @@ def as_dict(self) -> dict: """Serializes the PermissionsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.add: - body["add"] = [v.value for v in self.add] + body["{add}"] = [v.value for v in self.add] if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.remove: - body["remove"] = [v.value for v in self.remove] + body["{remove}"] = [v.value for v in self.remove] return body def as_shallow_dict(self) -> dict: """Serializes the PermissionsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.add: - body["add"] = self.add + body["{add}"] = self.add if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.remove: - body["remove"] = self.remove + body["{remove}"] = self.remove return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsChange: """Deserializes the PermissionsChange from a dictionary.""" return cls( - add=_repeated_enum(d, "add", Privilege), - principal=d.get("principal", None), - remove=_repeated_enum(d, "remove", Privilege), + add=_repeated_enum(d, "{add}", Privilege), + principal=d.get("{principal}", None), + remove=_repeated_enum(d, "{remove}", Privilege), ) @@ -6555,20 +6569,20 @@ def as_dict(self) -> dict: """Serializes the PermissionsList into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] + body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: """Serializes the PermissionsList into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = self.privilege_assignments + body["{privilege_assignments}"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsList: """Deserializes the PermissionsList from a dictionary.""" - return cls(privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment)) + return cls(privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment)) @dataclass @@ -6595,41 +6609,41 @@ def as_dict(self) -> dict: """Serializes the PipelineProgress into a dictionary suitable for use as a JSON request body.""" body = {} if self.estimated_completion_time_seconds is not None: - body["estimated_completion_time_seconds"] = self.estimated_completion_time_seconds + body["{estimated_completion_time_seconds}"] = self.estimated_completion_time_seconds if self.latest_version_currently_processing is not None: - body["latest_version_currently_processing"] = self.latest_version_currently_processing + body["{latest_version_currently_processing}"] = self.latest_version_currently_processing if self.sync_progress_completion is not None: - body["sync_progress_completion"] = self.sync_progress_completion + body["{sync_progress_completion}"] = self.sync_progress_completion if self.synced_row_count is not None: - body["synced_row_count"] = self.synced_row_count + body["{synced_row_count}"] = self.synced_row_count if self.total_row_count is not None: - body["total_row_count"] = self.total_row_count + body["{total_row_count}"] = self.total_row_count return body def as_shallow_dict(self) -> dict: """Serializes the PipelineProgress into a shallow dictionary of its immediate attributes.""" body = {} if self.estimated_completion_time_seconds is not None: - body["estimated_completion_time_seconds"] = self.estimated_completion_time_seconds + body["{estimated_completion_time_seconds}"] = self.estimated_completion_time_seconds if self.latest_version_currently_processing is not None: - body["latest_version_currently_processing"] = self.latest_version_currently_processing + body["{latest_version_currently_processing}"] = self.latest_version_currently_processing if self.sync_progress_completion is not None: - body["sync_progress_completion"] = self.sync_progress_completion + body["{sync_progress_completion}"] = self.sync_progress_completion if self.synced_row_count is not None: - body["synced_row_count"] = self.synced_row_count + body["{synced_row_count}"] = self.synced_row_count if self.total_row_count is not None: - body["total_row_count"] = self.total_row_count + body["{total_row_count}"] = self.total_row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineProgress: """Deserializes the PipelineProgress from a dictionary.""" return cls( - estimated_completion_time_seconds=d.get("estimated_completion_time_seconds", None), - latest_version_currently_processing=d.get("latest_version_currently_processing", None), - sync_progress_completion=d.get("sync_progress_completion", None), - synced_row_count=d.get("synced_row_count", None), - total_row_count=d.get("total_row_count", None), + estimated_completion_time_seconds=d.get("{estimated_completion_time_seconds}", None), + latest_version_currently_processing=d.get("{latest_version_currently_processing}", None), + sync_progress_completion=d.get("{sync_progress_completion}", None), + synced_row_count=d.get("{synced_row_count}", None), + total_row_count=d.get("{total_row_count}", None), ) @@ -6645,24 +6659,24 @@ def as_dict(self) -> dict: """Serializes the PrimaryKeyConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.child_columns: - body["child_columns"] = [v for v in self.child_columns] + body["{child_columns}"] = [v for v in self.child_columns] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the PrimaryKeyConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.child_columns: - body["child_columns"] = self.child_columns + body["{child_columns}"] = self.child_columns if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrimaryKeyConstraint: """Deserializes the PrimaryKeyConstraint from a dictionary.""" - return cls(child_columns=d.get("child_columns", None), name=d.get("name", None)) + return cls(child_columns=d.get("{child_columns}", None), name=d.get("{name}", None)) class Privilege(Enum): @@ -6727,24 +6741,24 @@ def as_dict(self) -> dict: """Serializes the PrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.privileges: - body["privileges"] = [v.value for v in self.privileges] + body["{privileges}"] = [v.value for v in self.privileges] return body def as_shallow_dict(self) -> dict: """Serializes the PrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.privileges: - body["privileges"] = self.privileges + body["{privileges}"] = self.privileges return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrivilegeAssignment: """Deserializes the PrivilegeAssignment from a dictionary.""" - return cls(principal=d.get("principal", None), privileges=_repeated_enum(d, "privileges", Privilege)) + return cls(principal=d.get("{principal}", None), privileges=_repeated_enum(d, "{privileges}", Privilege)) PropertiesKvPairs = Dict[str, str] @@ -6760,20 +6774,20 @@ def as_dict(self) -> dict: """Serializes the ProvisioningInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the ProvisioningInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProvisioningInfo: """Deserializes the ProvisioningInfo from a dictionary.""" - return cls(state=_enum(d, "state", ProvisioningInfoState)) + return cls(state=_enum(d, "{state}", ProvisioningInfoState)) class ProvisioningInfoState(Enum): @@ -6799,20 +6813,20 @@ def as_dict(self) -> dict: """Serializes the ProvisioningStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.initial_pipeline_sync_progress: - body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress.as_dict() + body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ProvisioningStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.initial_pipeline_sync_progress: - body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress + body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProvisioningStatus: """Deserializes the ProvisioningStatus from a dictionary.""" - return cls(initial_pipeline_sync_progress=_from_dict(d, "initial_pipeline_sync_progress", PipelineProgress)) + return cls(initial_pipeline_sync_progress=_from_dict(d, "{initial_pipeline_sync_progress}", PipelineProgress)) @dataclass @@ -6839,46 +6853,46 @@ def as_dict(self) -> dict: """Serializes the QuotaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_refreshed_at is not None: - body["last_refreshed_at"] = self.last_refreshed_at + body["{last_refreshed_at}"] = self.last_refreshed_at if self.parent_full_name is not None: - body["parent_full_name"] = self.parent_full_name + body["{parent_full_name}"] = self.parent_full_name if self.parent_securable_type is not None: - body["parent_securable_type"] = self.parent_securable_type.value + body["{parent_securable_type}"] = self.parent_securable_type.value if self.quota_count is not None: - body["quota_count"] = self.quota_count + body["{quota_count}"] = self.quota_count if self.quota_limit is not None: - body["quota_limit"] = self.quota_limit + body["{quota_limit}"] = self.quota_limit if self.quota_name is not None: - body["quota_name"] = self.quota_name + body["{quota_name}"] = self.quota_name return body def as_shallow_dict(self) -> dict: """Serializes the QuotaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.last_refreshed_at is not None: - body["last_refreshed_at"] = self.last_refreshed_at + body["{last_refreshed_at}"] = self.last_refreshed_at if self.parent_full_name is not None: - body["parent_full_name"] = self.parent_full_name + body["{parent_full_name}"] = self.parent_full_name if self.parent_securable_type is not None: - body["parent_securable_type"] = self.parent_securable_type + body["{parent_securable_type}"] = self.parent_securable_type if self.quota_count is not None: - body["quota_count"] = self.quota_count + body["{quota_count}"] = self.quota_count if self.quota_limit is not None: - body["quota_limit"] = self.quota_limit + body["{quota_limit}"] = self.quota_limit if self.quota_name is not None: - body["quota_name"] = self.quota_name + body["{quota_name}"] = self.quota_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QuotaInfo: """Deserializes the QuotaInfo from a dictionary.""" return cls( - last_refreshed_at=d.get("last_refreshed_at", None), - parent_full_name=d.get("parent_full_name", None), - parent_securable_type=_enum(d, "parent_securable_type", SecurableType), - quota_count=d.get("quota_count", None), - quota_limit=d.get("quota_limit", None), - quota_name=d.get("quota_name", None), + last_refreshed_at=d.get("{last_refreshed_at}", None), + parent_full_name=d.get("{parent_full_name}", None), + parent_securable_type=_enum(d, "{parent_securable_type}", SecurableType), + quota_count=d.get("{quota_count}", None), + quota_limit=d.get("{quota_limit}", None), + quota_name=d.get("{quota_name}", None), ) @@ -6900,31 +6914,31 @@ def as_dict(self) -> dict: """Serializes the R2Credentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_key_id is not None: - body["access_key_id"] = self.access_key_id + body["{access_key_id}"] = self.access_key_id if self.secret_access_key is not None: - body["secret_access_key"] = self.secret_access_key + body["{secret_access_key}"] = self.secret_access_key if self.session_token is not None: - body["session_token"] = self.session_token + body["{session_token}"] = self.session_token return body def as_shallow_dict(self) -> dict: """Serializes the R2Credentials into a shallow dictionary of its immediate attributes.""" body = {} if self.access_key_id is not None: - body["access_key_id"] = self.access_key_id + body["{access_key_id}"] = self.access_key_id if self.secret_access_key is not None: - body["secret_access_key"] = self.secret_access_key + body["{secret_access_key}"] = self.secret_access_key if self.session_token is not None: - body["session_token"] = self.session_token + body["{session_token}"] = self.session_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> R2Credentials: """Deserializes the R2Credentials from a dictionary.""" return cls( - access_key_id=d.get("access_key_id", None), - secret_access_key=d.get("secret_access_key", None), - session_token=d.get("session_token", None), + access_key_id=d.get("{access_key_id}", None), + secret_access_key=d.get("{secret_access_key}", None), + session_token=d.get("{session_token}", None), ) @@ -6941,24 +6955,24 @@ def as_dict(self) -> dict: """Serializes the RegenerateDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the RegenerateDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegenerateDashboardRequest: """Deserializes the RegenerateDashboardRequest from a dictionary.""" - return cls(table_name=d.get("table_name", None), warehouse_id=d.get("warehouse_id", None)) + return cls(table_name=d.get("{table_name}", None), warehouse_id=d.get("{warehouse_id}", None)) @dataclass @@ -6973,24 +6987,24 @@ def as_dict(self) -> dict: """Serializes the RegenerateDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.parent_folder is not None: - body["parent_folder"] = self.parent_folder + body["{parent_folder}"] = self.parent_folder return body def as_shallow_dict(self) -> dict: """Serializes the RegenerateDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.parent_folder is not None: - body["parent_folder"] = self.parent_folder + body["{parent_folder}"] = self.parent_folder return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegenerateDashboardResponse: """Deserializes the RegenerateDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("dashboard_id", None), parent_folder=d.get("parent_folder", None)) + return cls(dashboard_id=d.get("{dashboard_id}", None), parent_folder=d.get("{parent_folder}", None)) @dataclass @@ -7007,24 +7021,24 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAlias into a dictionary suitable for use as a JSON request body.""" body = {} if self.alias_name is not None: - body["alias_name"] = self.alias_name + body["{alias_name}"] = self.alias_name if self.version_num is not None: - body["version_num"] = self.version_num + body["{version_num}"] = self.version_num return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAlias into a shallow dictionary of its immediate attributes.""" body = {} if self.alias_name is not None: - body["alias_name"] = self.alias_name + body["{alias_name}"] = self.alias_name if self.version_num is not None: - body["version_num"] = self.version_num + body["{version_num}"] = self.version_num return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAlias: """Deserializes the RegisteredModelAlias from a dictionary.""" - return cls(alias_name=d.get("alias_name", None), version_num=d.get("version_num", None)) + return cls(alias_name=d.get("{alias_name}", None), version_num=d.get("{version_num}", None)) @dataclass @@ -7076,86 +7090,86 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aliases: - body["aliases"] = [v.as_dict() for v in self.aliases] + body["{aliases}"] = [v.as_dict() for v in self.aliases] if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aliases: - body["aliases"] = self.aliases + body["{aliases}"] = self.aliases if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelInfo: """Deserializes the RegisteredModelInfo from a dictionary.""" return cls( - aliases=_repeated_dict(d, "aliases", RegisteredModelAlias), - browse_only=d.get("browse_only", None), - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - full_name=d.get("full_name", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - schema_name=d.get("schema_name", None), - storage_location=d.get("storage_location", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + aliases=_repeated_dict(d, "{aliases}", RegisteredModelAlias), + browse_only=d.get("{browse_only}", None), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + full_name=d.get("{full_name}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + schema_name=d.get("{schema_name}", None), + storage_location=d.get("{storage_location}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -7219,108 +7233,108 @@ def as_dict(self) -> dict: """Serializes the SchemaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.catalog_type is not None: - body["catalog_type"] = self.catalog_type + body["{catalog_type}"] = self.catalog_type if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.effective_predictive_optimization_flag: - body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag.as_dict() + body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag.as_dict() if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization.value + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.schema_id is not None: - body["schema_id"] = self.schema_id + body["{schema_id}"] = self.schema_id if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the SchemaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.catalog_type is not None: - body["catalog_type"] = self.catalog_type + body["{catalog_type}"] = self.catalog_type if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.effective_predictive_optimization_flag: - body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag + body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.schema_id is not None: - body["schema_id"] = self.schema_id + body["{schema_id}"] = self.schema_id if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SchemaInfo: """Deserializes the SchemaInfo from a dictionary.""" return cls( - browse_only=d.get("browse_only", None), - catalog_name=d.get("catalog_name", None), - catalog_type=d.get("catalog_type", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), + browse_only=d.get("{browse_only}", None), + catalog_name=d.get("{catalog_name}", None), + catalog_type=d.get("{catalog_type}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), effective_predictive_optimization_flag=_from_dict( - d, "effective_predictive_optimization_flag", EffectivePredictiveOptimizationFlag + d, "{effective_predictive_optimization_flag}", EffectivePredictiveOptimizationFlag ), - enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), - full_name=d.get("full_name", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - properties=d.get("properties", None), - schema_id=d.get("schema_id", None), - storage_location=d.get("storage_location", None), - storage_root=d.get("storage_root", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), + full_name=d.get("{full_name}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + properties=d.get("{properties}", None), + schema_id=d.get("{schema_id}", None), + storage_location=d.get("{storage_location}", None), + storage_root=d.get("{storage_root}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -7362,26 +7376,26 @@ def as_dict(self) -> dict: """Serializes the SetArtifactAllowlist into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_matchers: - body["artifact_matchers"] = [v.as_dict() for v in self.artifact_matchers] + body["{artifact_matchers}"] = [v.as_dict() for v in self.artifact_matchers] if self.artifact_type is not None: - body["artifact_type"] = self.artifact_type.value + body["{artifact_type}"] = self.artifact_type.value return body def as_shallow_dict(self) -> dict: """Serializes the SetArtifactAllowlist into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_matchers: - body["artifact_matchers"] = self.artifact_matchers + body["{artifact_matchers}"] = self.artifact_matchers if self.artifact_type is not None: - body["artifact_type"] = self.artifact_type + body["{artifact_type}"] = self.artifact_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetArtifactAllowlist: """Deserializes the SetArtifactAllowlist from a dictionary.""" return cls( - artifact_matchers=_repeated_dict(d, "artifact_matchers", ArtifactMatcher), - artifact_type=_enum(d, "artifact_type", ArtifactType), + artifact_matchers=_repeated_dict(d, "{artifact_matchers}", ArtifactMatcher), + artifact_type=_enum(d, "{artifact_type}", ArtifactType), ) @@ -7400,29 +7414,29 @@ def as_dict(self) -> dict: """Serializes the SetRegisteredModelAliasRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.alias is not None: - body["alias"] = self.alias + body["{alias}"] = self.alias if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.version_num is not None: - body["version_num"] = self.version_num + body["{version_num}"] = self.version_num return body def as_shallow_dict(self) -> dict: """Serializes the SetRegisteredModelAliasRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.alias is not None: - body["alias"] = self.alias + body["{alias}"] = self.alias if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.version_num is not None: - body["version_num"] = self.version_num + body["{version_num}"] = self.version_num return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetRegisteredModelAliasRequest: """Deserializes the SetRegisteredModelAliasRequest from a dictionary.""" return cls( - alias=d.get("alias", None), full_name=d.get("full_name", None), version_num=d.get("version_num", None) + alias=d.get("{alias}", None), full_name=d.get("{full_name}", None), version_num=d.get("{version_num}", None) ) @@ -7440,26 +7454,26 @@ def as_dict(self) -> dict: """Serializes the SseEncryptionDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.algorithm is not None: - body["algorithm"] = self.algorithm.value + body["{algorithm}"] = self.algorithm.value if self.aws_kms_key_arn is not None: - body["aws_kms_key_arn"] = self.aws_kms_key_arn + body["{aws_kms_key_arn}"] = self.aws_kms_key_arn return body def as_shallow_dict(self) -> dict: """Serializes the SseEncryptionDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.algorithm is not None: - body["algorithm"] = self.algorithm + body["{algorithm}"] = self.algorithm if self.aws_kms_key_arn is not None: - body["aws_kms_key_arn"] = self.aws_kms_key_arn + body["{aws_kms_key_arn}"] = self.aws_kms_key_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SseEncryptionDetails: """Deserializes the SseEncryptionDetails from a dictionary.""" return cls( - algorithm=_enum(d, "algorithm", SseEncryptionDetailsAlgorithm), - aws_kms_key_arn=d.get("aws_kms_key_arn", None), + algorithm=_enum(d, "{algorithm}", SseEncryptionDetailsAlgorithm), + aws_kms_key_arn=d.get("{aws_kms_key_arn}", None), ) @@ -7529,108 +7543,108 @@ def as_dict(self) -> dict: """Serializes the StorageCredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal.as_dict() + body["{azure_service_principal}"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() + body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.used_for_managed_storage is not None: - body["used_for_managed_storage"] = self.used_for_managed_storage + body["{used_for_managed_storage}"] = self.used_for_managed_storage return body def as_shallow_dict(self) -> dict: """Serializes the StorageCredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal + body["{azure_service_principal}"] = self.azure_service_principal if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token + body["{cloudflare_api_token}"] = self.cloudflare_api_token if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.used_for_managed_storage is not None: - body["used_for_managed_storage"] = self.used_for_managed_storage + body["{used_for_managed_storage}"] = self.used_for_managed_storage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StorageCredentialInfo: """Deserializes the StorageCredentialInfo from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleResponse), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityResponse), - azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleResponse), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityResponse), + azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), databricks_gcp_service_account=_from_dict( - d, "databricks_gcp_service_account", DatabricksGcpServiceAccountResponse + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountResponse ), - full_name=d.get("full_name", None), - id=d.get("id", None), - isolation_mode=_enum(d, "isolation_mode", IsolationMode), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - read_only=d.get("read_only", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - used_for_managed_storage=d.get("used_for_managed_storage", None), + full_name=d.get("{full_name}", None), + id=d.get("{id}", None), + isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + read_only=d.get("{read_only}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + used_for_managed_storage=d.get("{used_for_managed_storage}", None), ) @@ -7647,24 +7661,24 @@ def as_dict(self) -> dict: """Serializes the SystemSchemaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the SystemSchemaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SystemSchemaInfo: """Deserializes the SystemSchemaInfo from a dictionary.""" - return cls(schema=d.get("schema", None), state=_enum(d, "state", SystemSchemaInfoState)) + return cls(schema=d.get("{schema}", None), state=_enum(d, "{state}", SystemSchemaInfoState)) class SystemSchemaInfoState(Enum): @@ -7693,31 +7707,31 @@ def as_dict(self) -> dict: """Serializes the TableConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.foreign_key_constraint: - body["foreign_key_constraint"] = self.foreign_key_constraint.as_dict() + body["{foreign_key_constraint}"] = self.foreign_key_constraint.as_dict() if self.named_table_constraint: - body["named_table_constraint"] = self.named_table_constraint.as_dict() + body["{named_table_constraint}"] = self.named_table_constraint.as_dict() if self.primary_key_constraint: - body["primary_key_constraint"] = self.primary_key_constraint.as_dict() + body["{primary_key_constraint}"] = self.primary_key_constraint.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TableConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.foreign_key_constraint: - body["foreign_key_constraint"] = self.foreign_key_constraint + body["{foreign_key_constraint}"] = self.foreign_key_constraint if self.named_table_constraint: - body["named_table_constraint"] = self.named_table_constraint + body["{named_table_constraint}"] = self.named_table_constraint if self.primary_key_constraint: - body["primary_key_constraint"] = self.primary_key_constraint + body["{primary_key_constraint}"] = self.primary_key_constraint return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableConstraint: """Deserializes the TableConstraint from a dictionary.""" return cls( - foreign_key_constraint=_from_dict(d, "foreign_key_constraint", ForeignKeyConstraint), - named_table_constraint=_from_dict(d, "named_table_constraint", NamedTableConstraint), - primary_key_constraint=_from_dict(d, "primary_key_constraint", PrimaryKeyConstraint), + foreign_key_constraint=_from_dict(d, "{foreign_key_constraint}", ForeignKeyConstraint), + named_table_constraint=_from_dict(d, "{named_table_constraint}", NamedTableConstraint), + primary_key_constraint=_from_dict(d, "{primary_key_constraint}", PrimaryKeyConstraint), ) @@ -7733,20 +7747,20 @@ def as_dict(self) -> dict: """Serializes the TableDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.table_full_name is not None: - body["table_full_name"] = self.table_full_name + body["{table_full_name}"] = self.table_full_name return body def as_shallow_dict(self) -> dict: """Serializes the TableDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.table_full_name is not None: - body["table_full_name"] = self.table_full_name + body["{table_full_name}"] = self.table_full_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableDependency: """Deserializes the TableDependency from a dictionary.""" - return cls(table_full_name=d.get("table_full_name", None)) + return cls(table_full_name=d.get("{table_full_name}", None)) @dataclass @@ -7758,20 +7772,20 @@ def as_dict(self) -> dict: """Serializes the TableExistsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.table_exists is not None: - body["table_exists"] = self.table_exists + body["{table_exists}"] = self.table_exists return body def as_shallow_dict(self) -> dict: """Serializes the TableExistsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.table_exists is not None: - body["table_exists"] = self.table_exists + body["{table_exists}"] = self.table_exists return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableExistsResponse: """Deserializes the TableExistsResponse from a dictionary.""" - return cls(table_exists=d.get("table_exists", None)) + return cls(table_exists=d.get("{table_exists}", None)) @dataclass @@ -7880,180 +7894,180 @@ def as_dict(self) -> dict: """Serializes the TableInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.columns: - body["columns"] = [v.as_dict() for v in self.columns] + body["{columns}"] = [v.as_dict() for v in self.columns] if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_access_configuration_id is not None: - body["data_access_configuration_id"] = self.data_access_configuration_id + body["{data_access_configuration_id}"] = self.data_access_configuration_id if self.data_source_format is not None: - body["data_source_format"] = self.data_source_format.value + body["{data_source_format}"] = self.data_source_format.value if self.deleted_at is not None: - body["deleted_at"] = self.deleted_at + body["{deleted_at}"] = self.deleted_at if self.delta_runtime_properties_kvpairs: - body["delta_runtime_properties_kvpairs"] = self.delta_runtime_properties_kvpairs.as_dict() + body["{delta_runtime_properties_kvpairs}"] = self.delta_runtime_properties_kvpairs.as_dict() if self.effective_predictive_optimization_flag: - body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag.as_dict() + body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag.as_dict() if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization.value + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value if self.encryption_details: - body["encryption_details"] = self.encryption_details.as_dict() + body["{encryption_details}"] = self.encryption_details.as_dict() if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.row_filter: - body["row_filter"] = self.row_filter.as_dict() + body["{row_filter}"] = self.row_filter.as_dict() if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.sql_path is not None: - body["sql_path"] = self.sql_path + body["{sql_path}"] = self.sql_path if self.storage_credential_name is not None: - body["storage_credential_name"] = self.storage_credential_name + body["{storage_credential_name}"] = self.storage_credential_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.table_constraints: - body["table_constraints"] = [v.as_dict() for v in self.table_constraints] + body["{table_constraints}"] = [v.as_dict() for v in self.table_constraints] if self.table_id is not None: - body["table_id"] = self.table_id + body["{table_id}"] = self.table_id if self.table_type is not None: - body["table_type"] = self.table_type.value + body["{table_type}"] = self.table_type.value if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.view_definition is not None: - body["view_definition"] = self.view_definition + body["{view_definition}"] = self.view_definition if self.view_dependencies: - body["view_dependencies"] = self.view_dependencies.as_dict() + body["{view_dependencies}"] = self.view_dependencies.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TableInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_access_configuration_id is not None: - body["data_access_configuration_id"] = self.data_access_configuration_id + body["{data_access_configuration_id}"] = self.data_access_configuration_id if self.data_source_format is not None: - body["data_source_format"] = self.data_source_format + body["{data_source_format}"] = self.data_source_format if self.deleted_at is not None: - body["deleted_at"] = self.deleted_at + body["{deleted_at}"] = self.deleted_at if self.delta_runtime_properties_kvpairs: - body["delta_runtime_properties_kvpairs"] = self.delta_runtime_properties_kvpairs + body["{delta_runtime_properties_kvpairs}"] = self.delta_runtime_properties_kvpairs if self.effective_predictive_optimization_flag: - body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag + body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization if self.encryption_details: - body["encryption_details"] = self.encryption_details + body["{encryption_details}"] = self.encryption_details if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.row_filter: - body["row_filter"] = self.row_filter + body["{row_filter}"] = self.row_filter if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.sql_path is not None: - body["sql_path"] = self.sql_path + body["{sql_path}"] = self.sql_path if self.storage_credential_name is not None: - body["storage_credential_name"] = self.storage_credential_name + body["{storage_credential_name}"] = self.storage_credential_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.table_constraints: - body["table_constraints"] = self.table_constraints + body["{table_constraints}"] = self.table_constraints if self.table_id is not None: - body["table_id"] = self.table_id + body["{table_id}"] = self.table_id if self.table_type is not None: - body["table_type"] = self.table_type + body["{table_type}"] = self.table_type if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.view_definition is not None: - body["view_definition"] = self.view_definition + body["{view_definition}"] = self.view_definition if self.view_dependencies: - body["view_dependencies"] = self.view_dependencies + body["{view_dependencies}"] = self.view_dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableInfo: """Deserializes the TableInfo from a dictionary.""" return cls( - access_point=d.get("access_point", None), - browse_only=d.get("browse_only", None), - catalog_name=d.get("catalog_name", None), - columns=_repeated_dict(d, "columns", ColumnInfo), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - data_access_configuration_id=d.get("data_access_configuration_id", None), - data_source_format=_enum(d, "data_source_format", DataSourceFormat), - deleted_at=d.get("deleted_at", None), + access_point=d.get("{access_point}", None), + browse_only=d.get("{browse_only}", None), + catalog_name=d.get("{catalog_name}", None), + columns=_repeated_dict(d, "{columns}", ColumnInfo), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + data_access_configuration_id=d.get("{data_access_configuration_id}", None), + data_source_format=_enum(d, "{data_source_format}", DataSourceFormat), + deleted_at=d.get("{deleted_at}", None), delta_runtime_properties_kvpairs=_from_dict( - d, "delta_runtime_properties_kvpairs", DeltaRuntimePropertiesKvPairs + d, "{delta_runtime_properties_kvpairs}", DeltaRuntimePropertiesKvPairs ), effective_predictive_optimization_flag=_from_dict( - d, "effective_predictive_optimization_flag", EffectivePredictiveOptimizationFlag + d, "{effective_predictive_optimization_flag}", EffectivePredictiveOptimizationFlag ), - enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), - encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), - full_name=d.get("full_name", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - pipeline_id=d.get("pipeline_id", None), - properties=d.get("properties", None), - row_filter=_from_dict(d, "row_filter", TableRowFilter), - schema_name=d.get("schema_name", None), - sql_path=d.get("sql_path", None), - storage_credential_name=d.get("storage_credential_name", None), - storage_location=d.get("storage_location", None), - table_constraints=_repeated_dict(d, "table_constraints", TableConstraint), - table_id=d.get("table_id", None), - table_type=_enum(d, "table_type", TableType), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - view_definition=d.get("view_definition", None), - view_dependencies=_from_dict(d, "view_dependencies", DependencyList), + enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), + encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), + full_name=d.get("{full_name}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + pipeline_id=d.get("{pipeline_id}", None), + properties=d.get("{properties}", None), + row_filter=_from_dict(d, "{row_filter}", TableRowFilter), + schema_name=d.get("{schema_name}", None), + sql_path=d.get("{sql_path}", None), + storage_credential_name=d.get("{storage_credential_name}", None), + storage_location=d.get("{storage_location}", None), + table_constraints=_repeated_dict(d, "{table_constraints}", TableConstraint), + table_id=d.get("{table_id}", None), + table_type=_enum(d, "{table_type}", TableType), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + view_definition=d.get("{view_definition}", None), + view_dependencies=_from_dict(d, "{view_dependencies}", DependencyList), ) @@ -8076,24 +8090,24 @@ def as_dict(self) -> dict: """Serializes the TableRowFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.input_column_names: - body["input_column_names"] = [v for v in self.input_column_names] + body["{input_column_names}"] = [v for v in self.input_column_names] return body def as_shallow_dict(self) -> dict: """Serializes the TableRowFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.input_column_names: - body["input_column_names"] = self.input_column_names + body["{input_column_names}"] = self.input_column_names return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableRowFilter: """Deserializes the TableRowFilter from a dictionary.""" - return cls(function_name=d.get("function_name", None), input_column_names=d.get("input_column_names", None)) + return cls(function_name=d.get("{function_name}", None), input_column_names=d.get("{input_column_names}", None)) @dataclass @@ -8107,24 +8121,24 @@ def as_dict(self) -> dict: """Serializes the TableSummary into a dictionary suitable for use as a JSON request body.""" body = {} if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.table_type is not None: - body["table_type"] = self.table_type.value + body["{table_type}"] = self.table_type.value return body def as_shallow_dict(self) -> dict: """Serializes the TableSummary into a shallow dictionary of its immediate attributes.""" body = {} if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.table_type is not None: - body["table_type"] = self.table_type + body["{table_type}"] = self.table_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableSummary: """Deserializes the TableSummary from a dictionary.""" - return cls(full_name=d.get("full_name", None), table_type=_enum(d, "table_type", TableType)) + return cls(full_name=d.get("{full_name}", None), table_type=_enum(d, "{table_type}", TableType)) class TableType(Enum): @@ -8162,36 +8176,36 @@ def as_dict(self) -> dict: """Serializes the TemporaryCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_temp_credentials: - body["aws_temp_credentials"] = self.aws_temp_credentials.as_dict() + body["{aws_temp_credentials}"] = self.aws_temp_credentials.as_dict() if self.azure_aad: - body["azure_aad"] = self.azure_aad.as_dict() + body["{azure_aad}"] = self.azure_aad.as_dict() if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.gcp_oauth_token: - body["gcp_oauth_token"] = self.gcp_oauth_token.as_dict() + body["{gcp_oauth_token}"] = self.gcp_oauth_token.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TemporaryCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_temp_credentials: - body["aws_temp_credentials"] = self.aws_temp_credentials + body["{aws_temp_credentials}"] = self.aws_temp_credentials if self.azure_aad: - body["azure_aad"] = self.azure_aad + body["{azure_aad}"] = self.azure_aad if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.gcp_oauth_token: - body["gcp_oauth_token"] = self.gcp_oauth_token + body["{gcp_oauth_token}"] = self.gcp_oauth_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TemporaryCredentials: """Deserializes the TemporaryCredentials from a dictionary.""" return cls( - aws_temp_credentials=_from_dict(d, "aws_temp_credentials", AwsCredentials), - azure_aad=_from_dict(d, "azure_aad", AzureActiveDirectoryToken), - expiration_time=d.get("expiration_time", None), - gcp_oauth_token=_from_dict(d, "gcp_oauth_token", GcpOauthToken), + aws_temp_credentials=_from_dict(d, "{aws_temp_credentials}", AwsCredentials), + azure_aad=_from_dict(d, "{azure_aad}", AzureActiveDirectoryToken), + expiration_time=d.get("{expiration_time}", None), + gcp_oauth_token=_from_dict(d, "{gcp_oauth_token}", GcpOauthToken), ) @@ -8215,31 +8229,31 @@ def as_dict(self) -> dict: """Serializes the TriggeredUpdateStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_processed_commit_version is not None: - body["last_processed_commit_version"] = self.last_processed_commit_version + body["{last_processed_commit_version}"] = self.last_processed_commit_version if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.triggered_update_progress: - body["triggered_update_progress"] = self.triggered_update_progress.as_dict() + body["{triggered_update_progress}"] = self.triggered_update_progress.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TriggeredUpdateStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_processed_commit_version is not None: - body["last_processed_commit_version"] = self.last_processed_commit_version + body["{last_processed_commit_version}"] = self.last_processed_commit_version if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.triggered_update_progress: - body["triggered_update_progress"] = self.triggered_update_progress + body["{triggered_update_progress}"] = self.triggered_update_progress return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TriggeredUpdateStatus: """Deserializes the TriggeredUpdateStatus from a dictionary.""" return cls( - last_processed_commit_version=d.get("last_processed_commit_version", None), - timestamp=d.get("timestamp", None), - triggered_update_progress=_from_dict(d, "triggered_update_progress", PipelineProgress), + last_processed_commit_version=d.get("{last_processed_commit_version}", None), + timestamp=d.get("{timestamp}", None), + triggered_update_progress=_from_dict(d, "{triggered_update_progress}", PipelineProgress), ) @@ -8317,56 +8331,56 @@ def as_dict(self) -> dict: """Serializes the UpdateCatalog into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization.value + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCatalog into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCatalog: """Deserializes the UpdateCatalog from a dictionary.""" return cls( - comment=d.get("comment", None), - enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), - isolation_mode=_enum(d, "isolation_mode", CatalogIsolationMode), - name=d.get("name", None), - new_name=d.get("new_name", None), - options=d.get("options", None), - owner=d.get("owner", None), - properties=d.get("properties", None), + comment=d.get("{comment}", None), + enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), + isolation_mode=_enum(d, "{isolation_mode}", CatalogIsolationMode), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + options=d.get("{options}", None), + owner=d.get("{owner}", None), + properties=d.get("{properties}", None), ) @@ -8388,36 +8402,36 @@ def as_dict(self) -> dict: """Serializes the UpdateConnection into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body def as_shallow_dict(self) -> dict: """Serializes the UpdateConnection into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateConnection: """Deserializes the UpdateConnection from a dictionary.""" return cls( - name=d.get("name", None), - new_name=d.get("new_name", None), - options=d.get("options", None), - owner=d.get("owner", None), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + options=d.get("{options}", None), + owner=d.get("{owner}", None), ) @@ -8465,76 +8479,78 @@ def as_dict(self) -> dict: """Serializes the UpdateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal.as_dict() + body["{azure_service_principal}"] = self.azure_service_principal.as_dict() if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.force is not None: - body["force"] = self.force + body["{force}"] = self.force if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.name_arg is not None: - body["name_arg"] = self.name_arg + body["{name_arg}"] = self.name_arg if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal + body["{azure_service_principal}"] = self.azure_service_principal if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.force is not None: - body["force"] = self.force + body["{force}"] = self.force if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.name_arg is not None: - body["name_arg"] = self.name_arg + body["{name_arg}"] = self.name_arg if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCredentialRequest: """Deserializes the UpdateCredentialRequest from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), - azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), - comment=d.get("comment", None), - databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), - force=d.get("force", None), - isolation_mode=_enum(d, "isolation_mode", IsolationMode), - name_arg=d.get("name_arg", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - read_only=d.get("read_only", None), - skip_validation=d.get("skip_validation", None), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), + azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), + comment=d.get("{comment}", None), + databricks_gcp_service_account=_from_dict( + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount + ), + force=d.get("{force}", None), + isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), + name_arg=d.get("{name_arg}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + read_only=d.get("{read_only}", None), + skip_validation=d.get("{skip_validation}", None), ) @@ -8584,81 +8600,81 @@ def as_dict(self) -> dict: """Serializes the UpdateExternalLocation into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.encryption_details: - body["encryption_details"] = self.encryption_details.as_dict() + body["{encryption_details}"] = self.encryption_details.as_dict() if self.fallback is not None: - body["fallback"] = self.fallback + body["{fallback}"] = self.fallback if self.force is not None: - body["force"] = self.force + body["{force}"] = self.force if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the UpdateExternalLocation into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.encryption_details: - body["encryption_details"] = self.encryption_details + body["{encryption_details}"] = self.encryption_details if self.fallback is not None: - body["fallback"] = self.fallback + body["{fallback}"] = self.fallback if self.force is not None: - body["force"] = self.force + body["{force}"] = self.force if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExternalLocation: """Deserializes the UpdateExternalLocation from a dictionary.""" return cls( - access_point=d.get("access_point", None), - comment=d.get("comment", None), - credential_name=d.get("credential_name", None), - encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), - fallback=d.get("fallback", None), - force=d.get("force", None), - isolation_mode=_enum(d, "isolation_mode", IsolationMode), - name=d.get("name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - read_only=d.get("read_only", None), - skip_validation=d.get("skip_validation", None), - url=d.get("url", None), + access_point=d.get("{access_point}", None), + comment=d.get("{comment}", None), + credential_name=d.get("{credential_name}", None), + encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), + fallback=d.get("{fallback}", None), + force=d.get("{force}", None), + isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + read_only=d.get("{read_only}", None), + skip_validation=d.get("{skip_validation}", None), + url=d.get("{url}", None), ) @@ -8675,24 +8691,24 @@ def as_dict(self) -> dict: """Serializes the UpdateFunction into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body def as_shallow_dict(self) -> dict: """Serializes the UpdateFunction into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateFunction: """Deserializes the UpdateFunction from a dictionary.""" - return cls(name=d.get("name", None), owner=d.get("owner", None)) + return cls(name=d.get("{name}", None), owner=d.get("{owner}", None)) @dataclass @@ -8726,62 +8742,62 @@ def as_dict(self) -> dict: """Serializes the UpdateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.delta_sharing_organization_name is not None: - body["delta_sharing_organization_name"] = self.delta_sharing_organization_name + body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( + body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["delta_sharing_scope"] = self.delta_sharing_scope.value + body["{delta_sharing_scope}"] = self.delta_sharing_scope.value if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.privilege_model_version is not None: - body["privilege_model_version"] = self.privilege_model_version + body["{privilege_model_version}"] = self.privilege_model_version if self.storage_root_credential_id is not None: - body["storage_root_credential_id"] = self.storage_root_credential_id + body["{storage_root_credential_id}"] = self.storage_root_credential_id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.delta_sharing_organization_name is not None: - body["delta_sharing_organization_name"] = self.delta_sharing_organization_name + body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( + body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["delta_sharing_scope"] = self.delta_sharing_scope + body["{delta_sharing_scope}"] = self.delta_sharing_scope if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.privilege_model_version is not None: - body["privilege_model_version"] = self.privilege_model_version + body["{privilege_model_version}"] = self.privilege_model_version if self.storage_root_credential_id is not None: - body["storage_root_credential_id"] = self.storage_root_credential_id + body["{storage_root_credential_id}"] = self.storage_root_credential_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateMetastore: """Deserializes the UpdateMetastore from a dictionary.""" return cls( - delta_sharing_organization_name=d.get("delta_sharing_organization_name", None), + delta_sharing_organization_name=d.get("{delta_sharing_organization_name}", None), delta_sharing_recipient_token_lifetime_in_seconds=d.get( - "delta_sharing_recipient_token_lifetime_in_seconds", None + "{delta_sharing_recipient_token_lifetime_in_seconds}", None ), - delta_sharing_scope=_enum(d, "delta_sharing_scope", UpdateMetastoreDeltaSharingScope), - id=d.get("id", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - privilege_model_version=d.get("privilege_model_version", None), - storage_root_credential_id=d.get("storage_root_credential_id", None), + delta_sharing_scope=_enum(d, "{delta_sharing_scope}", UpdateMetastoreDeltaSharingScope), + id=d.get("{id}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + privilege_model_version=d.get("{privilege_model_version}", None), + storage_root_credential_id=d.get("{storage_root_credential_id}", None), ) @@ -8801,31 +8817,31 @@ def as_dict(self) -> dict: """Serializes the UpdateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_catalog_name is not None: - body["default_catalog_name"] = self.default_catalog_name + body["{default_catalog_name}"] = self.default_catalog_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.default_catalog_name is not None: - body["default_catalog_name"] = self.default_catalog_name + body["{default_catalog_name}"] = self.default_catalog_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateMetastoreAssignment: """Deserializes the UpdateMetastoreAssignment from a dictionary.""" return cls( - default_catalog_name=d.get("default_catalog_name", None), - metastore_id=d.get("metastore_id", None), - workspace_id=d.get("workspace_id", None), + default_catalog_name=d.get("{default_catalog_name}", None), + metastore_id=d.get("{metastore_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -8851,28 +8867,30 @@ def as_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionRequest: """Deserializes the UpdateModelVersionRequest from a dictionary.""" - return cls(comment=d.get("comment", None), full_name=d.get("full_name", None), version=d.get("version", None)) + return cls( + comment=d.get("{comment}", None), full_name=d.get("{full_name}", None), version=d.get("{version}", None) + ) @dataclass @@ -8923,76 +8941,76 @@ def as_dict(self) -> dict: """Serializes the UpdateMonitor into a dictionary suitable for use as a JSON request body.""" body = {} if self.baseline_table_name is not None: - body["baseline_table_name"] = self.baseline_table_name + body["{baseline_table_name}"] = self.baseline_table_name if self.custom_metrics: - body["custom_metrics"] = [v.as_dict() for v in self.custom_metrics] + body["{custom_metrics}"] = [v.as_dict() for v in self.custom_metrics] if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.data_classification_config: - body["data_classification_config"] = self.data_classification_config.as_dict() + body["{data_classification_config}"] = self.data_classification_config.as_dict() if self.inference_log: - body["inference_log"] = self.inference_log.as_dict() + body["{inference_log}"] = self.inference_log.as_dict() if self.notifications: - body["notifications"] = self.notifications.as_dict() + body["{notifications}"] = self.notifications.as_dict() if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.schedule: - body["schedule"] = self.schedule.as_dict() + body["{schedule}"] = self.schedule.as_dict() if self.slicing_exprs: - body["slicing_exprs"] = [v for v in self.slicing_exprs] + body["{slicing_exprs}"] = [v for v in self.slicing_exprs] if self.snapshot: - body["snapshot"] = self.snapshot.as_dict() + body["{snapshot}"] = self.snapshot.as_dict() if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.time_series: - body["time_series"] = self.time_series.as_dict() + body["{time_series}"] = self.time_series.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateMonitor into a shallow dictionary of its immediate attributes.""" body = {} if self.baseline_table_name is not None: - body["baseline_table_name"] = self.baseline_table_name + body["{baseline_table_name}"] = self.baseline_table_name if self.custom_metrics: - body["custom_metrics"] = self.custom_metrics + body["{custom_metrics}"] = self.custom_metrics if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.data_classification_config: - body["data_classification_config"] = self.data_classification_config + body["{data_classification_config}"] = self.data_classification_config if self.inference_log: - body["inference_log"] = self.inference_log + body["{inference_log}"] = self.inference_log if self.notifications: - body["notifications"] = self.notifications + body["{notifications}"] = self.notifications if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.schedule: - body["schedule"] = self.schedule + body["{schedule}"] = self.schedule if self.slicing_exprs: - body["slicing_exprs"] = self.slicing_exprs + body["{slicing_exprs}"] = self.slicing_exprs if self.snapshot: - body["snapshot"] = self.snapshot + body["{snapshot}"] = self.snapshot if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name if self.time_series: - body["time_series"] = self.time_series + body["{time_series}"] = self.time_series return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateMonitor: """Deserializes the UpdateMonitor from a dictionary.""" return cls( - baseline_table_name=d.get("baseline_table_name", None), - custom_metrics=_repeated_dict(d, "custom_metrics", MonitorMetric), - dashboard_id=d.get("dashboard_id", None), - data_classification_config=_from_dict(d, "data_classification_config", MonitorDataClassificationConfig), - inference_log=_from_dict(d, "inference_log", MonitorInferenceLog), - notifications=_from_dict(d, "notifications", MonitorNotifications), - output_schema_name=d.get("output_schema_name", None), - schedule=_from_dict(d, "schedule", MonitorCronSchedule), - slicing_exprs=d.get("slicing_exprs", None), - snapshot=_from_dict(d, "snapshot", MonitorSnapshot), - table_name=d.get("table_name", None), - time_series=_from_dict(d, "time_series", MonitorTimeSeries), + baseline_table_name=d.get("{baseline_table_name}", None), + custom_metrics=_repeated_dict(d, "{custom_metrics}", MonitorMetric), + dashboard_id=d.get("{dashboard_id}", None), + data_classification_config=_from_dict(d, "{data_classification_config}", MonitorDataClassificationConfig), + inference_log=_from_dict(d, "{inference_log}", MonitorInferenceLog), + notifications=_from_dict(d, "{notifications}", MonitorNotifications), + output_schema_name=d.get("{output_schema_name}", None), + schedule=_from_dict(d, "{schedule}", MonitorCronSchedule), + slicing_exprs=d.get("{slicing_exprs}", None), + snapshot=_from_dict(d, "{snapshot}", MonitorSnapshot), + table_name=d.get("{table_name}", None), + time_series=_from_dict(d, "{time_series}", MonitorTimeSeries), ) @@ -9011,31 +9029,31 @@ def as_dict(self) -> dict: """Serializes the UpdatePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.changes: - body["changes"] = [v.as_dict() for v in self.changes] + body["{changes}"] = [v.as_dict() for v in self.changes] if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.securable_type is not None: - body["securable_type"] = self.securable_type.value + body["{securable_type}"] = self.securable_type.value return body def as_shallow_dict(self) -> dict: """Serializes the UpdatePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.changes: - body["changes"] = self.changes + body["{changes}"] = self.changes if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.securable_type is not None: - body["securable_type"] = self.securable_type + body["{securable_type}"] = self.securable_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePermissions: """Deserializes the UpdatePermissions from a dictionary.""" return cls( - changes=_repeated_dict(d, "changes", PermissionsChange), - full_name=d.get("full_name", None), - securable_type=_enum(d, "securable_type", SecurableType), + changes=_repeated_dict(d, "{changes}", PermissionsChange), + full_name=d.get("{full_name}", None), + securable_type=_enum(d, "{securable_type}", SecurableType), ) @@ -9057,36 +9075,36 @@ def as_dict(self) -> dict: """Serializes the UpdateRegisteredModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRegisteredModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRegisteredModelRequest: """Deserializes the UpdateRegisteredModelRequest from a dictionary.""" return cls( - comment=d.get("comment", None), - full_name=d.get("full_name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), + comment=d.get("{comment}", None), + full_name=d.get("{full_name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), ) @@ -9132,46 +9150,46 @@ def as_dict(self) -> dict: """Serializes the UpdateSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization.value + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties return body def as_shallow_dict(self) -> dict: """Serializes the UpdateSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = self.enable_predictive_optimization + body["{enable_predictive_optimization}"] = self.enable_predictive_optimization if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateSchema: """Deserializes the UpdateSchema from a dictionary.""" return cls( - comment=d.get("comment", None), - enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), - full_name=d.get("full_name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - properties=d.get("properties", None), + comment=d.get("{comment}", None), + enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), + full_name=d.get("{full_name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + properties=d.get("{properties}", None), ) @@ -9219,83 +9237,83 @@ def as_dict(self) -> dict: """Serializes the UpdateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal.as_dict() + body["{azure_service_principal}"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() + body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.force is not None: - body["force"] = self.force + body["{force}"] = self.force if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode.value + body["{isolation_mode}"] = self.isolation_mode.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body def as_shallow_dict(self) -> dict: """Serializes the UpdateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal + body["{azure_service_principal}"] = self.azure_service_principal if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token + body["{cloudflare_api_token}"] = self.cloudflare_api_token if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.force is not None: - body["force"] = self.force + body["{force}"] = self.force if self.isolation_mode is not None: - body["isolation_mode"] = self.isolation_mode + body["{isolation_mode}"] = self.isolation_mode if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateStorageCredential: """Deserializes the UpdateStorageCredential from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleRequest), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityResponse), - azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), - comment=d.get("comment", None), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleRequest), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityResponse), + azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), + comment=d.get("{comment}", None), databricks_gcp_service_account=_from_dict( - d, "databricks_gcp_service_account", DatabricksGcpServiceAccountRequest + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountRequest ), - force=d.get("force", None), - isolation_mode=_enum(d, "isolation_mode", IsolationMode), - name=d.get("name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - read_only=d.get("read_only", None), - skip_validation=d.get("skip_validation", None), + force=d.get("{force}", None), + isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + read_only=d.get("{read_only}", None), + skip_validation=d.get("{skip_validation}", None), ) @@ -9317,36 +9335,36 @@ def as_dict(self) -> dict: """Serializes the UpdateVolumeRequestContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body def as_shallow_dict(self) -> dict: """Serializes the UpdateVolumeRequestContent into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateVolumeRequestContent: """Deserializes the UpdateVolumeRequestContent from a dictionary.""" return cls( - comment=d.get("comment", None), - name=d.get("name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), ) @@ -9365,31 +9383,31 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceBindings into a dictionary suitable for use as a JSON request body.""" body = {} if self.assign_workspaces: - body["assign_workspaces"] = [v for v in self.assign_workspaces] + body["{assign_workspaces}"] = [v for v in self.assign_workspaces] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.unassign_workspaces: - body["unassign_workspaces"] = [v for v in self.unassign_workspaces] + body["{unassign_workspaces}"] = [v for v in self.unassign_workspaces] return body def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceBindings into a shallow dictionary of its immediate attributes.""" body = {} if self.assign_workspaces: - body["assign_workspaces"] = self.assign_workspaces + body["{assign_workspaces}"] = self.assign_workspaces if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.unassign_workspaces: - body["unassign_workspaces"] = self.unassign_workspaces + body["{unassign_workspaces}"] = self.unassign_workspaces return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceBindings: """Deserializes the UpdateWorkspaceBindings from a dictionary.""" return cls( - assign_workspaces=d.get("assign_workspaces", None), - name=d.get("name", None), - unassign_workspaces=d.get("unassign_workspaces", None), + assign_workspaces=d.get("{assign_workspaces}", None), + name=d.get("{name}", None), + unassign_workspaces=d.get("{unassign_workspaces}", None), ) @@ -9411,36 +9429,36 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceBindingsParameters into a dictionary suitable for use as a JSON request body.""" body = {} if self.add: - body["add"] = [v.as_dict() for v in self.add] + body["{add}"] = [v.as_dict() for v in self.add] if self.remove: - body["remove"] = [v.as_dict() for v in self.remove] + body["{remove}"] = [v.as_dict() for v in self.remove] if self.securable_name is not None: - body["securable_name"] = self.securable_name + body["{securable_name}"] = self.securable_name if self.securable_type is not None: - body["securable_type"] = self.securable_type.value + body["{securable_type}"] = self.securable_type.value return body def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceBindingsParameters into a shallow dictionary of its immediate attributes.""" body = {} if self.add: - body["add"] = self.add + body["{add}"] = self.add if self.remove: - body["remove"] = self.remove + body["{remove}"] = self.remove if self.securable_name is not None: - body["securable_name"] = self.securable_name + body["{securable_name}"] = self.securable_name if self.securable_type is not None: - body["securable_type"] = self.securable_type + body["{securable_type}"] = self.securable_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceBindingsParameters: """Deserializes the UpdateWorkspaceBindingsParameters from a dictionary.""" return cls( - add=_repeated_dict(d, "add", WorkspaceBinding), - remove=_repeated_dict(d, "remove", WorkspaceBinding), - securable_name=d.get("securable_name", None), - securable_type=_enum(d, "securable_type", UpdateBindingsSecurableType), + add=_repeated_dict(d, "{add}", WorkspaceBinding), + remove=_repeated_dict(d, "{remove}", WorkspaceBinding), + securable_name=d.get("{securable_name}", None), + securable_type=_enum(d, "{securable_type}", UpdateBindingsSecurableType), ) @@ -9478,56 +9496,58 @@ def as_dict(self) -> dict: """Serializes the ValidateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.external_location_name is not None: - body["external_location_name"] = self.external_location_name + body["{external_location_name}"] = self.external_location_name if self.purpose is not None: - body["purpose"] = self.purpose.value + body["{purpose}"] = self.purpose.value if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the ValidateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.credential_name is not None: - body["credential_name"] = self.credential_name + body["{credential_name}"] = self.credential_name if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.external_location_name is not None: - body["external_location_name"] = self.external_location_name + body["{external_location_name}"] = self.external_location_name if self.purpose is not None: - body["purpose"] = self.purpose + body["{purpose}"] = self.purpose if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateCredentialRequest: """Deserializes the ValidateCredentialRequest from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), - credential_name=d.get("credential_name", None), - databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), - external_location_name=d.get("external_location_name", None), - purpose=_enum(d, "purpose", CredentialPurpose), - read_only=d.get("read_only", None), - url=d.get("url", None), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), + credential_name=d.get("{credential_name}", None), + databricks_gcp_service_account=_from_dict( + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount + ), + external_location_name=d.get("{external_location_name}", None), + purpose=_enum(d, "{purpose}", CredentialPurpose), + read_only=d.get("{read_only}", None), + url=d.get("{url}", None), ) @@ -9544,24 +9564,24 @@ def as_dict(self) -> dict: """Serializes the ValidateCredentialResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_dir is not None: - body["isDir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the ValidateCredentialResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_dir is not None: - body["isDir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateCredentialResponse: """Deserializes the ValidateCredentialResponse from a dictionary.""" - return cls(is_dir=d.get("isDir", None), results=_repeated_dict(d, "results", CredentialValidationResult)) + return cls(is_dir=d.get("{is_dir}", None), results=_repeated_dict(d, "{results}", CredentialValidationResult)) class ValidateCredentialResult(Enum): @@ -9605,63 +9625,63 @@ def as_dict(self) -> dict: """Serializes the ValidateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role.as_dict() + body["{aws_iam_role}"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal.as_dict() + body["{azure_service_principal}"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() + body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() if self.external_location_name is not None: - body["external_location_name"] = self.external_location_name + body["{external_location_name}"] = self.external_location_name if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.storage_credential_name is not None: - body["storage_credential_name"] = self.storage_credential_name + body["{storage_credential_name}"] = self.storage_credential_name if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the ValidateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["aws_iam_role"] = self.aws_iam_role + body["{aws_iam_role}"] = self.aws_iam_role if self.azure_managed_identity: - body["azure_managed_identity"] = self.azure_managed_identity + body["{azure_managed_identity}"] = self.azure_managed_identity if self.azure_service_principal: - body["azure_service_principal"] = self.azure_service_principal + body["{azure_service_principal}"] = self.azure_service_principal if self.cloudflare_api_token: - body["cloudflare_api_token"] = self.cloudflare_api_token + body["{cloudflare_api_token}"] = self.cloudflare_api_token if self.databricks_gcp_service_account: - body["databricks_gcp_service_account"] = self.databricks_gcp_service_account + body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account if self.external_location_name is not None: - body["external_location_name"] = self.external_location_name + body["{external_location_name}"] = self.external_location_name if self.read_only is not None: - body["read_only"] = self.read_only + body["{read_only}"] = self.read_only if self.storage_credential_name is not None: - body["storage_credential_name"] = self.storage_credential_name + body["{storage_credential_name}"] = self.storage_credential_name if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateStorageCredential: """Deserializes the ValidateStorageCredential from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleRequest), - azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityRequest), - azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), + aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleRequest), + azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityRequest), + azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), databricks_gcp_service_account=_from_dict( - d, "databricks_gcp_service_account", DatabricksGcpServiceAccountRequest + d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountRequest ), - external_location_name=d.get("external_location_name", None), - read_only=d.get("read_only", None), - storage_credential_name=d.get("storage_credential_name", None), - url=d.get("url", None), + external_location_name=d.get("{external_location_name}", None), + read_only=d.get("{read_only}", None), + storage_credential_name=d.get("{storage_credential_name}", None), + url=d.get("{url}", None), ) @@ -9677,24 +9697,24 @@ def as_dict(self) -> dict: """Serializes the ValidateStorageCredentialResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_dir is not None: - body["isDir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the ValidateStorageCredentialResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_dir is not None: - body["isDir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateStorageCredentialResponse: """Deserializes the ValidateStorageCredentialResponse from a dictionary.""" - return cls(is_dir=d.get("isDir", None), results=_repeated_dict(d, "results", ValidationResult)) + return cls(is_dir=d.get("{is_dir}", None), results=_repeated_dict(d, "{results}", ValidationResult)) @dataclass @@ -9712,31 +9732,31 @@ def as_dict(self) -> dict: """Serializes the ValidationResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.operation is not None: - body["operation"] = self.operation.value + body["{operation}"] = self.operation.value if self.result is not None: - body["result"] = self.result.value + body["{result}"] = self.result.value return body def as_shallow_dict(self) -> dict: """Serializes the ValidationResult into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.operation is not None: - body["operation"] = self.operation + body["{operation}"] = self.operation if self.result is not None: - body["result"] = self.result + body["{result}"] = self.result return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidationResult: """Deserializes the ValidationResult from a dictionary.""" return cls( - message=d.get("message", None), - operation=_enum(d, "operation", ValidationResultOperation), - result=_enum(d, "result", ValidationResultResult), + message=d.get("{message}", None), + operation=_enum(d, "{operation}", ValidationResultOperation), + result=_enum(d, "{result}", ValidationResultResult), ) @@ -9818,101 +9838,101 @@ def as_dict(self) -> dict: """Serializes the VolumeInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.encryption_details: - body["encryption_details"] = self.encryption_details.as_dict() + body["{encryption_details}"] = self.encryption_details.as_dict() if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.volume_id is not None: - body["volume_id"] = self.volume_id + body["{volume_id}"] = self.volume_id if self.volume_type is not None: - body["volume_type"] = self.volume_type.value + body["{volume_type}"] = self.volume_type.value return body def as_shallow_dict(self) -> dict: """Serializes the VolumeInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["access_point"] = self.access_point + body["{access_point}"] = self.access_point if self.browse_only is not None: - body["browse_only"] = self.browse_only + body["{browse_only}"] = self.browse_only if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.encryption_details: - body["encryption_details"] = self.encryption_details + body["{encryption_details}"] = self.encryption_details if self.full_name is not None: - body["full_name"] = self.full_name + body["{full_name}"] = self.full_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.volume_id is not None: - body["volume_id"] = self.volume_id + body["{volume_id}"] = self.volume_id if self.volume_type is not None: - body["volume_type"] = self.volume_type + body["{volume_type}"] = self.volume_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumeInfo: """Deserializes the VolumeInfo from a dictionary.""" return cls( - access_point=d.get("access_point", None), - browse_only=d.get("browse_only", None), - catalog_name=d.get("catalog_name", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), - full_name=d.get("full_name", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - schema_name=d.get("schema_name", None), - storage_location=d.get("storage_location", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - volume_id=d.get("volume_id", None), - volume_type=_enum(d, "volume_type", VolumeType), + access_point=d.get("{access_point}", None), + browse_only=d.get("{browse_only}", None), + catalog_name=d.get("{catalog_name}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), + full_name=d.get("{full_name}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + schema_name=d.get("{schema_name}", None), + storage_location=d.get("{storage_location}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + volume_id=d.get("{volume_id}", None), + volume_type=_enum(d, "{volume_type}", VolumeType), ) @@ -9937,25 +9957,26 @@ def as_dict(self) -> dict: """Serializes the WorkspaceBinding into a dictionary suitable for use as a JSON request body.""" body = {} if self.binding_type is not None: - body["binding_type"] = self.binding_type.value + body["{binding_type}"] = self.binding_type.value if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceBinding into a shallow dictionary of its immediate attributes.""" body = {} if self.binding_type is not None: - body["binding_type"] = self.binding_type + body["{binding_type}"] = self.binding_type if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceBinding: """Deserializes the WorkspaceBinding from a dictionary.""" return cls( - binding_type=_enum(d, "binding_type", WorkspaceBindingBindingType), workspace_id=d.get("workspace_id", None) + binding_type=_enum(d, "{binding_type}", WorkspaceBindingBindingType), + workspace_id=d.get("{workspace_id}", None), ) @@ -9980,25 +10001,25 @@ def as_dict(self) -> dict: """Serializes the WorkspaceBindingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.bindings: - body["bindings"] = [v.as_dict() for v in self.bindings] + body["{bindings}"] = [v.as_dict() for v in self.bindings] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceBindingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.bindings: - body["bindings"] = self.bindings + body["{bindings}"] = self.bindings if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceBindingsResponse: """Deserializes the WorkspaceBindingsResponse from a dictionary.""" return cls( - bindings=_repeated_dict(d, "bindings", WorkspaceBinding), next_page_token=d.get("next_page_token", None) + bindings=_repeated_dict(d, "{bindings}", WorkspaceBinding), next_page_token=d.get("{next_page_token}", None) ) @@ -10025,10 +10046,10 @@ def create( """ body = {} if metastore_assignment is not None: - body["metastore_assignment"] = metastore_assignment.as_dict() + body["{metastore_assignment}"] = metastore_assignment.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do( @@ -10052,7 +10073,7 @@ def delete(self, workspace_id: int, metastore_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -10075,7 +10096,7 @@ def get(self, workspace_id: int) -> AccountsMetastoreAssignment: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -10095,7 +10116,7 @@ def list(self, metastore_id: str) -> Iterator[int]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do( @@ -10122,10 +10143,10 @@ def update( """ body = {} if metastore_assignment is not None: - body["metastore_assignment"] = metastore_assignment.as_dict() + body["{metastore_assignment}"] = metastore_assignment.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do( @@ -10154,10 +10175,10 @@ def create(self, *, metastore_info: Optional[CreateMetastore] = None) -> Account """ body = {} if metastore_info is not None: - body["metastore_info"] = metastore_info.as_dict() + body["{metastore_info}"] = metastore_info.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/metastores", body=body, headers=headers) @@ -10178,9 +10199,9 @@ def delete(self, metastore_id: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -10202,7 +10223,7 @@ def get(self, metastore_id: str) -> AccountsMetastoreInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -10219,7 +10240,7 @@ def list(self) -> Iterator[MetastoreInfo]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/metastores", headers=headers) @@ -10239,10 +10260,10 @@ def update(self, metastore_id: str, *, metastore_info: Optional[UpdateMetastore] """ body = {} if metastore_info is not None: - body["metastore_info"] = metastore_info.as_dict() + body["{metastore_info}"] = metastore_info.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -10278,10 +10299,10 @@ def create( """ body = {} if credential_info is not None: - body["credential_info"] = credential_info.as_dict() + body["{credential_info}"] = credential_info.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -10310,9 +10331,9 @@ def delete(self, metastore_id: str, storage_credential_name: str, *, force: Opti query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -10337,7 +10358,7 @@ def get(self, metastore_id: str, storage_credential_name: str) -> AccountsStorag """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -10359,7 +10380,7 @@ def list(self, metastore_id: str) -> Iterator[StorageCredentialInfo]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do( @@ -10392,10 +10413,10 @@ def update( """ body = {} if credential_info is not None: - body["credential_info"] = credential_info.as_dict() + body["{credential_info}"] = credential_info.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -10427,7 +10448,7 @@ def get(self, artifact_type: ArtifactType) -> ArtifactAllowlistInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}", headers=headers) @@ -10449,10 +10470,10 @@ def update(self, artifact_type: ArtifactType, artifact_matchers: List[ArtifactMa """ body = {} if artifact_matchers is not None: - body["artifact_matchers"] = [v.as_dict() for v in artifact_matchers] + body["{artifact_matchers}"] = [v.as_dict() for v in artifact_matchers] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -10512,24 +10533,24 @@ def create( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if connection_name is not None: - body["connection_name"] = connection_name + body["{connection_name}"] = connection_name if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options + body["{options}"] = options if properties is not None: - body["properties"] = properties + body["{properties}"] = properties if provider_name is not None: - body["provider_name"] = provider_name + body["{provider_name}"] = provider_name if share_name is not None: - body["share_name"] = share_name + body["{share_name}"] = share_name if storage_root is not None: - body["storage_root"] = storage_root + body["{storage_root}"] = storage_root headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/catalogs", body=body, headers=headers) @@ -10551,9 +10572,9 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/catalogs/{name}", query=query, headers=headers) @@ -10575,9 +10596,9 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> CatalogInf query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/catalogs/{name}", query=query, headers=headers) @@ -10616,25 +10637,25 @@ def list( query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/catalogs", query=query, headers=headers) - if "catalogs" in json: - for v in json["catalogs"]: + if "{catalogs}" in json: + for v in json["{catalogs}"]: yield CatalogInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -10674,22 +10695,22 @@ def update( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = enable_predictive_optimization.value + body["{enable_predictive_optimization}"] = enable_predictive_optimization.value if isolation_mode is not None: - body["isolation_mode"] = isolation_mode.value + body["{isolation_mode}"] = isolation_mode.value if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if options is not None: - body["options"] = options + body["{options}"] = options if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if properties is not None: - body["properties"] = properties + body["{properties}"] = properties headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/catalogs/{name}", body=body, headers=headers) @@ -10743,20 +10764,20 @@ def create( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if connection_type is not None: - body["connection_type"] = connection_type.value + body["{connection_type}"] = connection_type.value if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options + body["{options}"] = options if properties is not None: - body["properties"] = properties + body["{properties}"] = properties if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/connections", body=body, headers=headers) @@ -10774,7 +10795,7 @@ def delete(self, name: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/connections/{name}", headers=headers) @@ -10791,7 +10812,7 @@ def get(self, name: str) -> ConnectionInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/connections/{name}", headers=headers) @@ -10815,23 +10836,23 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/connections", query=query, headers=headers) - if "connections" in json: - for v in json["connections"]: + if "{connections}" in json: + for v in json["{connections}"]: yield ConnectionInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, name: str, options: Dict[str, str], *, new_name: Optional[str] = None, owner: Optional[str] = None @@ -10853,14 +10874,14 @@ def update( """ body = {} if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if options is not None: - body["options"] = options + body["{options}"] = options if owner is not None: - body["owner"] = owner + body["{owner}"] = owner headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/connections/{name}", body=body, headers=headers) @@ -10925,26 +10946,26 @@ def create_credential( """ body = {} if aws_iam_role is not None: - body["aws_iam_role"] = aws_iam_role.as_dict() + body["{aws_iam_role}"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["azure_managed_identity"] = azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["azure_service_principal"] = azure_service_principal.as_dict() + body["{azure_service_principal}"] = azure_service_principal.as_dict() if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if databricks_gcp_service_account is not None: - body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() if name is not None: - body["name"] = name + body["{name}"] = name if purpose is not None: - body["purpose"] = purpose.value + body["{purpose}"] = purpose.value if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if skip_validation is not None: - body["skip_validation"] = skip_validation + body["{skip_validation}"] = skip_validation headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/credentials", body=body, headers=headers) @@ -10967,9 +10988,9 @@ def delete_credential(self, name_arg: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/credentials/{name_arg}", query=query, headers=headers) @@ -10997,14 +11018,14 @@ def generate_temporary_service_credential( """ body = {} if azure_options is not None: - body["azure_options"] = azure_options.as_dict() + body["{azure_options}"] = azure_options.as_dict() if credential_name is not None: - body["credential_name"] = credential_name + body["{credential_name}"] = credential_name if gcp_options is not None: - body["gcp_options"] = gcp_options.as_dict() + body["{gcp_options}"] = gcp_options.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/temporary-service-credentials", body=body, headers=headers) @@ -11023,7 +11044,7 @@ def get_credential(self, name_arg: str) -> CredentialInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/credentials/{name_arg}", headers=headers) @@ -11059,23 +11080,23 @@ def list_credentials( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if purpose is not None: - query["purpose"] = purpose.value + query["{purpose}"] = purpose.value headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/credentials", query=query, headers=headers) - if "credentials" in json: - for v in json["credentials"]: + if "{credentials}" in json: + for v in json["{credentials}"]: yield CredentialInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update_credential( self, @@ -11131,30 +11152,30 @@ def update_credential( """ body = {} if aws_iam_role is not None: - body["aws_iam_role"] = aws_iam_role.as_dict() + body["{aws_iam_role}"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["azure_managed_identity"] = azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["azure_service_principal"] = azure_service_principal.as_dict() + body["{azure_service_principal}"] = azure_service_principal.as_dict() if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if databricks_gcp_service_account is not None: - body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() if force is not None: - body["force"] = force + body["{force}"] = force if isolation_mode is not None: - body["isolation_mode"] = isolation_mode.value + body["{isolation_mode}"] = isolation_mode.value if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if skip_validation is not None: - body["skip_validation"] = skip_validation + body["{skip_validation}"] = skip_validation headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/credentials/{name_arg}", body=body, headers=headers) @@ -11211,24 +11232,24 @@ def validate_credential( """ body = {} if aws_iam_role is not None: - body["aws_iam_role"] = aws_iam_role.as_dict() + body["{aws_iam_role}"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["azure_managed_identity"] = azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = azure_managed_identity.as_dict() if credential_name is not None: - body["credential_name"] = credential_name + body["{credential_name}"] = credential_name if databricks_gcp_service_account is not None: - body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() if external_location_name is not None: - body["external_location_name"] = external_location_name + body["{external_location_name}"] = external_location_name if purpose is not None: - body["purpose"] = purpose.value + body["{purpose}"] = purpose.value if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if url is not None: - body["url"] = url + body["{url}"] = url headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/validate-credentials", body=body, headers=headers) @@ -11294,26 +11315,26 @@ def create( """ body = {} if access_point is not None: - body["access_point"] = access_point + body["{access_point}"] = access_point if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if credential_name is not None: - body["credential_name"] = credential_name + body["{credential_name}"] = credential_name if encryption_details is not None: - body["encryption_details"] = encryption_details.as_dict() + body["{encryption_details}"] = encryption_details.as_dict() if fallback is not None: - body["fallback"] = fallback + body["{fallback}"] = fallback if name is not None: - body["name"] = name + body["{name}"] = name if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if skip_validation is not None: - body["skip_validation"] = skip_validation + body["{skip_validation}"] = skip_validation if url is not None: - body["url"] = url + body["{url}"] = url headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/external-locations", body=body, headers=headers) @@ -11335,9 +11356,9 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/external-locations/{name}", query=query, headers=headers) @@ -11359,9 +11380,9 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> ExternalLo query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/external-locations/{name}", query=query, headers=headers) @@ -11396,25 +11417,25 @@ def list( query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/external-locations", query=query, headers=headers) - if "external_locations" in json: - for v in json["external_locations"]: + if "{external_locations}" in json: + for v in json["{external_locations}"]: yield ExternalLocationInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -11471,32 +11492,32 @@ def update( """ body = {} if access_point is not None: - body["access_point"] = access_point + body["{access_point}"] = access_point if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if credential_name is not None: - body["credential_name"] = credential_name + body["{credential_name}"] = credential_name if encryption_details is not None: - body["encryption_details"] = encryption_details.as_dict() + body["{encryption_details}"] = encryption_details.as_dict() if fallback is not None: - body["fallback"] = fallback + body["{fallback}"] = fallback if force is not None: - body["force"] = force + body["{force}"] = force if isolation_mode is not None: - body["isolation_mode"] = isolation_mode.value + body["{isolation_mode}"] = isolation_mode.value if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if skip_validation is not None: - body["skip_validation"] = skip_validation + body["{skip_validation}"] = skip_validation if url is not None: - body["url"] = url + body["{url}"] = url headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/external-locations/{name}", body=body, headers=headers) @@ -11531,10 +11552,10 @@ def create(self, function_info: CreateFunction) -> FunctionInfo: """ body = {} if function_info is not None: - body["function_info"] = function_info.as_dict() + body["{function_info}"] = function_info.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/functions", body=body, headers=headers) @@ -11560,9 +11581,9 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/functions/{name}", query=query, headers=headers) @@ -11589,9 +11610,9 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> FunctionIn query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/functions/{name}", query=query, headers=headers) @@ -11634,27 +11655,27 @@ def list( query = {} if catalog_name is not None: - query["catalog_name"] = catalog_name + query["{catalog_name}"] = catalog_name if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if schema_name is not None: - query["schema_name"] = schema_name + query["{schema_name}"] = schema_name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/functions", query=query, headers=headers) - if "functions" in json: - for v in json["functions"]: + if "{functions}" in json: + for v in json["{functions}"]: yield FunctionInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: """Update a function. @@ -11676,10 +11697,10 @@ def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: """ body = {} if owner is not None: - body["owner"] = owner + body["{owner}"] = owner headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/functions/{name}", body=body, headers=headers) @@ -11717,9 +11738,9 @@ def get(self, securable_type: SecurableType, full_name: str, *, principal: Optio query = {} if principal is not None: - query["principal"] = principal + query["{principal}"] = principal headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -11750,9 +11771,9 @@ def get_effective( query = {} if principal is not None: - query["principal"] = principal + query["{principal}"] = principal headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -11781,10 +11802,10 @@ def update( """ body = {} if changes is not None: - body["changes"] = [v.as_dict() for v in changes] + body["{changes}"] = [v.as_dict() for v in changes] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -11831,12 +11852,12 @@ def assign(self, workspace_id: int, metastore_id: str, default_catalog_name: str """ body = {} if default_catalog_name is not None: - body["default_catalog_name"] = default_catalog_name + body["{default_catalog_name}"] = default_catalog_name if metastore_id is not None: - body["metastore_id"] = metastore_id + body["{metastore_id}"] = metastore_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore", body=body, headers=headers) @@ -11862,14 +11883,14 @@ def create(self, name: str, *, region: Optional[str] = None, storage_root: Optio """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if region is not None: - body["region"] = region + body["{region}"] = region if storage_root is not None: - body["storage_root"] = storage_root + body["{storage_root}"] = storage_root headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/metastores", body=body, headers=headers) @@ -11884,7 +11905,7 @@ def current(self) -> MetastoreAssignment: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/unity-catalog/current-metastore-assignment", headers=headers) @@ -11905,9 +11926,9 @@ def delete(self, id: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/metastores/{id}", query=query, headers=headers) @@ -11925,7 +11946,7 @@ def get(self, id: str) -> MetastoreInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/metastores/{id}", headers=headers) @@ -11941,7 +11962,7 @@ def list(self) -> Iterator[MetastoreInfo]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.1/unity-catalog/metastores", headers=headers) @@ -11958,7 +11979,7 @@ def summary(self) -> GetMetastoreSummaryResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/unity-catalog/metastore_summary", headers=headers) @@ -11979,9 +12000,9 @@ def unassign(self, workspace_id: int, metastore_id: str): query = {} if metastore_id is not None: - query["metastore_id"] = metastore_id + query["{metastore_id}"] = metastore_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -12027,24 +12048,24 @@ def update( """ body = {} if delta_sharing_organization_name is not None: - body["delta_sharing_organization_name"] = delta_sharing_organization_name + body["{delta_sharing_organization_name}"] = delta_sharing_organization_name if delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( + body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( delta_sharing_recipient_token_lifetime_in_seconds ) if delta_sharing_scope is not None: - body["delta_sharing_scope"] = delta_sharing_scope.value + body["{delta_sharing_scope}"] = delta_sharing_scope.value if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if privilege_model_version is not None: - body["privilege_model_version"] = privilege_model_version + body["{privilege_model_version}"] = privilege_model_version if storage_root_credential_id is not None: - body["storage_root_credential_id"] = storage_root_credential_id + body["{storage_root_credential_id}"] = storage_root_credential_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/metastores/{id}", body=body, headers=headers) @@ -12072,12 +12093,12 @@ def update_assignment( """ body = {} if default_catalog_name is not None: - body["default_catalog_name"] = default_catalog_name + body["{default_catalog_name}"] = default_catalog_name if metastore_id is not None: - body["metastore_id"] = metastore_id + body["{metastore_id}"] = metastore_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore", body=body, headers=headers) @@ -12147,11 +12168,11 @@ def get( query = {} if include_aliases is not None: - query["include_aliases"] = include_aliases + query["{include_aliases}"] = include_aliases if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -12180,9 +12201,9 @@ def get_by_alias(self, full_name: str, alias: str, *, include_aliases: Optional[ query = {} if include_aliases is not None: - query["include_aliases"] = include_aliases + query["{include_aliases}"] = include_aliases headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -12231,25 +12252,25 @@ def list( query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.1/unity-catalog/models/{full_name}/versions", query=query, headers=headers ) - if "model_versions" in json: - for v in json["model_versions"]: + if "{model_versions}" in json: + for v in json["{model_versions}"]: yield ModelVersionInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, full_name: str, version: int, *, comment: Optional[str] = None) -> ModelVersionInfo: """Update a Model Version. @@ -12273,10 +12294,10 @@ def update(self, full_name: str, version: int, *, comment: Optional[str] = None) """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -12291,35 +12312,6 @@ class OnlineTablesAPI: def __init__(self, api_client): self._api = api_client - def wait_get_online_table_active( - self, name: str, timeout=timedelta(minutes=20), callback: Optional[Callable[[OnlineTable], None]] = None - ) -> OnlineTable: - deadline = time.time() + timeout.total_seconds() - target_states = (ProvisioningInfoState.ACTIVE,) - failure_states = (ProvisioningInfoState.FAILED,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(name=name) - status = poll.unity_catalog_provisioning_state - status_message = f"current status: {status}" - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach ACTIVE, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"name={name}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create(self, *, table: Optional[OnlineTable] = None) -> Wait[OnlineTable]: """Create an Online Table. @@ -12330,17 +12322,17 @@ def create(self, *, table: Optional[OnlineTable] = None) -> Wait[OnlineTable]: :returns: Long-running operation waiter for :class:`OnlineTable`. - See :method:wait_get_online_table_active for more details. + See :method:WaitGetOnlineTableActive for more details. """ body = table.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.0/online-tables", body=body, headers=headers) return Wait( - self.wait_get_online_table_active, response=OnlineTable.from_dict(op_response), name=op_response["name"] + self.WaitGetOnlineTableActive, response=OnlineTable.from_dict(op_response), name=op_response["{name}"] ) def create_and_wait(self, *, table: Optional[OnlineTable] = None, timeout=timedelta(minutes=20)) -> OnlineTable: @@ -12360,7 +12352,7 @@ def delete(self, name: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/online-tables/{name}", headers=headers) @@ -12377,7 +12369,7 @@ def get(self, name: str) -> OnlineTable: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/online-tables/{name}", headers=headers) @@ -12489,34 +12481,34 @@ def create( """ body = {} if assets_dir is not None: - body["assets_dir"] = assets_dir + body["{assets_dir}"] = assets_dir if baseline_table_name is not None: - body["baseline_table_name"] = baseline_table_name + body["{baseline_table_name}"] = baseline_table_name if custom_metrics is not None: - body["custom_metrics"] = [v.as_dict() for v in custom_metrics] + body["{custom_metrics}"] = [v.as_dict() for v in custom_metrics] if data_classification_config is not None: - body["data_classification_config"] = data_classification_config.as_dict() + body["{data_classification_config}"] = data_classification_config.as_dict() if inference_log is not None: - body["inference_log"] = inference_log.as_dict() + body["{inference_log}"] = inference_log.as_dict() if notifications is not None: - body["notifications"] = notifications.as_dict() + body["{notifications}"] = notifications.as_dict() if output_schema_name is not None: - body["output_schema_name"] = output_schema_name + body["{output_schema_name}"] = output_schema_name if schedule is not None: - body["schedule"] = schedule.as_dict() + body["{schedule}"] = schedule.as_dict() if skip_builtin_dashboard is not None: - body["skip_builtin_dashboard"] = skip_builtin_dashboard + body["{skip_builtin_dashboard}"] = skip_builtin_dashboard if slicing_exprs is not None: - body["slicing_exprs"] = [v for v in slicing_exprs] + body["{slicing_exprs}"] = [v for v in slicing_exprs] if snapshot is not None: - body["snapshot"] = snapshot.as_dict() + body["{snapshot}"] = snapshot.as_dict() if time_series is not None: - body["time_series"] = time_series.as_dict() + body["{time_series}"] = time_series.as_dict() if warehouse_id is not None: - body["warehouse_id"] = warehouse_id + body["{warehouse_id}"] = warehouse_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", body=body, headers=headers) @@ -12568,7 +12560,7 @@ def get(self, table_name: str) -> MonitorInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", headers=headers) @@ -12595,7 +12587,7 @@ def get_refresh(self, table_name: str, refresh_id: str) -> MonitorRefreshInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -12622,7 +12614,7 @@ def list_refreshes(self, table_name: str) -> MonitorRefreshListResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", headers=headers) @@ -12653,10 +12645,10 @@ def regenerate_dashboard( """ body = {} if warehouse_id is not None: - body["warehouse_id"] = warehouse_id + body["{warehouse_id}"] = warehouse_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -12684,7 +12676,7 @@ def run_refresh(self, table_name: str) -> MonitorRefreshInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", headers=headers) @@ -12754,30 +12746,30 @@ def update( """ body = {} if baseline_table_name is not None: - body["baseline_table_name"] = baseline_table_name + body["{baseline_table_name}"] = baseline_table_name if custom_metrics is not None: - body["custom_metrics"] = [v.as_dict() for v in custom_metrics] + body["{custom_metrics}"] = [v.as_dict() for v in custom_metrics] if dashboard_id is not None: - body["dashboard_id"] = dashboard_id + body["{dashboard_id}"] = dashboard_id if data_classification_config is not None: - body["data_classification_config"] = data_classification_config.as_dict() + body["{data_classification_config}"] = data_classification_config.as_dict() if inference_log is not None: - body["inference_log"] = inference_log.as_dict() + body["{inference_log}"] = inference_log.as_dict() if notifications is not None: - body["notifications"] = notifications.as_dict() + body["{notifications}"] = notifications.as_dict() if output_schema_name is not None: - body["output_schema_name"] = output_schema_name + body["{output_schema_name}"] = output_schema_name if schedule is not None: - body["schedule"] = schedule.as_dict() + body["{schedule}"] = schedule.as_dict() if slicing_exprs is not None: - body["slicing_exprs"] = [v for v in slicing_exprs] + body["{slicing_exprs}"] = [v for v in slicing_exprs] if snapshot is not None: - body["snapshot"] = snapshot.as_dict() + body["{snapshot}"] = snapshot.as_dict() if time_series is not None: - body["time_series"] = time_series.as_dict() + body["{time_series}"] = time_series.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", body=body, headers=headers) @@ -12849,18 +12841,18 @@ def create( """ body = {} if catalog_name is not None: - body["catalog_name"] = catalog_name + body["{catalog_name}"] = catalog_name if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if schema_name is not None: - body["schema_name"] = schema_name + body["{schema_name}"] = schema_name if storage_location is not None: - body["storage_location"] = storage_location + body["{storage_location}"] = storage_location headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/models", body=body, headers=headers) @@ -12930,11 +12922,11 @@ def get( query = {} if include_aliases is not None: - query["include_aliases"] = include_aliases + query["{include_aliases}"] = include_aliases if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/models/{full_name}", query=query, headers=headers) @@ -12993,27 +12985,27 @@ def list( query = {} if catalog_name is not None: - query["catalog_name"] = catalog_name + query["{catalog_name}"] = catalog_name if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if schema_name is not None: - query["schema_name"] = schema_name + query["{schema_name}"] = schema_name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/models", query=query, headers=headers) - if "registered_models" in json: - for v in json["registered_models"]: + if "{registered_models}" in json: + for v in json["{registered_models}"]: yield RegisteredModelInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredModelAlias: """Set a Registered Model Alias. @@ -13035,10 +13027,10 @@ def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredM """ body = {} if version_num is not None: - body["version_num"] = version_num + body["{version_num}"] = version_num headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -13077,14 +13069,14 @@ def update( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/models/{full_name}", body=body, headers=headers) @@ -13121,7 +13113,7 @@ def get_quota(self, parent_securable_type: str, parent_full_name: str, quota_nam """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -13149,23 +13141,23 @@ def list_quotas( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", "/api/2.1/unity-catalog/resource-quotas/all-resource-quotas", query=query, headers=headers ) - if "quotas" in json: - for v in json["quotas"]: + if "{quotas}" in json: + for v in json["{quotas}"]: yield QuotaInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class SchemasAPI: @@ -13206,18 +13198,18 @@ def create( """ body = {} if catalog_name is not None: - body["catalog_name"] = catalog_name + body["{catalog_name}"] = catalog_name if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if properties is not None: - body["properties"] = properties + body["{properties}"] = properties if storage_root is not None: - body["storage_root"] = storage_root + body["{storage_root}"] = storage_root headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/schemas", body=body, headers=headers) @@ -13239,9 +13231,9 @@ def delete(self, full_name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/schemas/{full_name}", query=query, headers=headers) @@ -13263,9 +13255,9 @@ def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> Schem query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/schemas/{full_name}", query=query, headers=headers) @@ -13304,27 +13296,27 @@ def list( query = {} if catalog_name is not None: - query["catalog_name"] = catalog_name + query["{catalog_name}"] = catalog_name if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/schemas", query=query, headers=headers) - if "schemas" in json: - for v in json["schemas"]: + if "{schemas}" in json: + for v in json["{schemas}"]: yield SchemaInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -13360,18 +13352,18 @@ def update( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if enable_predictive_optimization is not None: - body["enable_predictive_optimization"] = enable_predictive_optimization.value + body["{enable_predictive_optimization}"] = enable_predictive_optimization.value if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if properties is not None: - body["properties"] = properties + body["{properties}"] = properties headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/schemas/{full_name}", body=body, headers=headers) @@ -13433,26 +13425,26 @@ def create( """ body = {} if aws_iam_role is not None: - body["aws_iam_role"] = aws_iam_role.as_dict() + body["{aws_iam_role}"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["azure_managed_identity"] = azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["azure_service_principal"] = azure_service_principal.as_dict() + body["{azure_service_principal}"] = azure_service_principal.as_dict() if cloudflare_api_token is not None: - body["cloudflare_api_token"] = cloudflare_api_token.as_dict() + body["{cloudflare_api_token}"] = cloudflare_api_token.as_dict() if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if databricks_gcp_service_account is not None: - body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() if name is not None: - body["name"] = name + body["{name}"] = name if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if skip_validation is not None: - body["skip_validation"] = skip_validation + body["{skip_validation}"] = skip_validation headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/storage-credentials", body=body, headers=headers) @@ -13474,9 +13466,9 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["force"] = force + query["{force}"] = force headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/storage-credentials/{name}", query=query, headers=headers) @@ -13494,7 +13486,7 @@ def get(self, name: str) -> StorageCredentialInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/storage-credentials/{name}", headers=headers) @@ -13524,23 +13516,23 @@ def list( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/storage-credentials", query=query, headers=headers) - if "storage_credentials" in json: - for v in json["storage_credentials"]: + if "{storage_credentials}" in json: + for v in json["{storage_credentials}"]: yield StorageCredentialInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -13593,32 +13585,32 @@ def update( """ body = {} if aws_iam_role is not None: - body["aws_iam_role"] = aws_iam_role.as_dict() + body["{aws_iam_role}"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["azure_managed_identity"] = azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["azure_service_principal"] = azure_service_principal.as_dict() + body["{azure_service_principal}"] = azure_service_principal.as_dict() if cloudflare_api_token is not None: - body["cloudflare_api_token"] = cloudflare_api_token.as_dict() + body["{cloudflare_api_token}"] = cloudflare_api_token.as_dict() if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if databricks_gcp_service_account is not None: - body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() if force is not None: - body["force"] = force + body["{force}"] = force if isolation_mode is not None: - body["isolation_mode"] = isolation_mode.value + body["{isolation_mode}"] = isolation_mode.value if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if skip_validation is not None: - body["skip_validation"] = skip_validation + body["{skip_validation}"] = skip_validation headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/storage-credentials/{name}", body=body, headers=headers) @@ -13672,26 +13664,26 @@ def validate( """ body = {} if aws_iam_role is not None: - body["aws_iam_role"] = aws_iam_role.as_dict() + body["{aws_iam_role}"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["azure_managed_identity"] = azure_managed_identity.as_dict() + body["{azure_managed_identity}"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["azure_service_principal"] = azure_service_principal.as_dict() + body["{azure_service_principal}"] = azure_service_principal.as_dict() if cloudflare_api_token is not None: - body["cloudflare_api_token"] = cloudflare_api_token.as_dict() + body["{cloudflare_api_token}"] = cloudflare_api_token.as_dict() if databricks_gcp_service_account is not None: - body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() + body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() if external_location_name is not None: - body["external_location_name"] = external_location_name + body["{external_location_name}"] = external_location_name if read_only is not None: - body["read_only"] = read_only + body["{read_only}"] = read_only if storage_credential_name is not None: - body["storage_credential_name"] = storage_credential_name + body["{storage_credential_name}"] = storage_credential_name if url is not None: - body["url"] = url + body["{url}"] = url headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/validate-storage-credentials", body=body, headers=headers) @@ -13720,7 +13712,7 @@ def disable(self, metastore_id: str, schema_name: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -13742,7 +13734,7 @@ def enable(self, metastore_id: str, schema_name: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -13772,25 +13764,25 @@ def list( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do( "GET", f"/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas", query=query, headers=headers ) - if "schemas" in json: - for v in json["schemas"]: + if "{schemas}" in json: + for v in json["{schemas}"]: yield SystemSchemaInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class TableConstraintsAPI: @@ -13830,12 +13822,12 @@ def create(self, full_name_arg: str, constraint: TableConstraint) -> TableConstr """ body = {} if constraint is not None: - body["constraint"] = constraint.as_dict() + body["{constraint}"] = constraint.as_dict() if full_name_arg is not None: - body["full_name_arg"] = full_name_arg + body["{full_name_arg}"] = full_name_arg headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/constraints", body=body, headers=headers) @@ -13866,11 +13858,11 @@ def delete(self, full_name: str, constraint_name: str, cascade: bool): query = {} if cascade is not None: - query["cascade"] = cascade + query["{cascade}"] = cascade if constraint_name is not None: - query["constraint_name"] = constraint_name + query["{constraint_name}"] = constraint_name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/constraints/{full_name}", query=query, headers=headers) @@ -13904,7 +13896,7 @@ def delete(self, full_name: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.1/unity-catalog/tables/{full_name}", headers=headers) @@ -13926,7 +13918,7 @@ def exists(self, full_name: str) -> TableExistsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{full_name}/exists", headers=headers) @@ -13963,13 +13955,13 @@ def get( query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if include_delta_metadata is not None: - query["include_delta_metadata"] = include_delta_metadata + query["{include_delta_metadata}"] = include_delta_metadata if include_manifest_capabilities is not None: - query["include_manifest_capabilities"] = include_manifest_capabilities + query["{include_manifest_capabilities}"] = include_manifest_capabilities headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{full_name}", query=query, headers=headers) @@ -14028,39 +14020,39 @@ def list( query = {} if catalog_name is not None: - query["catalog_name"] = catalog_name + query["{catalog_name}"] = catalog_name if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if include_delta_metadata is not None: - query["include_delta_metadata"] = include_delta_metadata + query["{include_delta_metadata}"] = include_delta_metadata if include_manifest_capabilities is not None: - query["include_manifest_capabilities"] = include_manifest_capabilities + query["{include_manifest_capabilities}"] = include_manifest_capabilities if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if omit_columns is not None: - query["omit_columns"] = omit_columns + query["{omit_columns}"] = omit_columns if omit_properties is not None: - query["omit_properties"] = omit_properties + query["{omit_properties}"] = omit_properties if omit_username is not None: - query["omit_username"] = omit_username + query["{omit_username}"] = omit_username if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if schema_name is not None: - query["schema_name"] = schema_name + query["{schema_name}"] = schema_name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/tables", query=query, headers=headers) - if "tables" in json: - for v in json["tables"]: + if "{tables}" in json: + for v in json["{tables}"]: yield TableInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_summaries( self, @@ -14107,31 +14099,31 @@ def list_summaries( query = {} if catalog_name is not None: - query["catalog_name"] = catalog_name + query["{catalog_name}"] = catalog_name if include_manifest_capabilities is not None: - query["include_manifest_capabilities"] = include_manifest_capabilities + query["{include_manifest_capabilities}"] = include_manifest_capabilities if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if schema_name_pattern is not None: - query["schema_name_pattern"] = schema_name_pattern + query["{schema_name_pattern}"] = schema_name_pattern if table_name_pattern is not None: - query["table_name_pattern"] = table_name_pattern + query["{table_name_pattern}"] = table_name_pattern headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/table-summaries", query=query, headers=headers) - if "tables" in json: - for v in json["tables"]: + if "{tables}" in json: + for v in json["{tables}"]: yield TableSummary.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, full_name: str, *, owner: Optional[str] = None): """Update a table owner. @@ -14149,10 +14141,10 @@ def update(self, full_name: str, *, owner: Optional[str] = None): """ body = {} if owner is not None: - body["owner"] = owner + body["{owner}"] = owner headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.1/unity-catalog/tables/{full_name}", body=body, headers=headers) @@ -14195,12 +14187,12 @@ def generate_temporary_table_credentials( """ body = {} if operation is not None: - body["operation"] = operation.value + body["{operation}"] = operation.value if table_id is not None: - body["table_id"] = table_id + body["{table_id}"] = table_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/unity-catalog/temporary-table-credentials", body=body, headers=headers) @@ -14267,20 +14259,20 @@ def create( """ body = {} if catalog_name is not None: - body["catalog_name"] = catalog_name + body["{catalog_name}"] = catalog_name if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if schema_name is not None: - body["schema_name"] = schema_name + body["{schema_name}"] = schema_name if storage_location is not None: - body["storage_location"] = storage_location + body["{storage_location}"] = storage_location if volume_type is not None: - body["volume_type"] = volume_type.value + body["{volume_type}"] = volume_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/volumes", body=body, headers=headers) @@ -14354,27 +14346,27 @@ def list( query = {} if catalog_name is not None: - query["catalog_name"] = catalog_name + query["{catalog_name}"] = catalog_name if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if schema_name is not None: - query["schema_name"] = schema_name + query["{schema_name}"] = schema_name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/volumes", query=query, headers=headers) - if "volumes" in json: - for v in json["volumes"]: + if "{volumes}" in json: + for v in json["{volumes}"]: yield VolumeInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInfo: """Get a Volume. @@ -14396,9 +14388,9 @@ def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInf query = {} if include_browse is not None: - query["include_browse"] = include_browse + query["{include_browse}"] = include_browse headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/volumes/{name}", query=query, headers=headers) @@ -14430,14 +14422,14 @@ def update( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/volumes/{name}", body=body, headers=headers) @@ -14476,7 +14468,7 @@ def get(self, name: str) -> CurrentWorkspaceBindings: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}", headers=headers) @@ -14512,11 +14504,11 @@ def get_bindings( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -14526,12 +14518,12 @@ def get_bindings( query=query, headers=headers, ) - if "bindings" in json: - for v in json["bindings"]: + if "{bindings}" in json: + for v in json["{bindings}"]: yield WorkspaceBinding.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -14556,12 +14548,12 @@ def update( """ body = {} if assign_workspaces is not None: - body["assign_workspaces"] = [v for v in assign_workspaces] + body["{assign_workspaces}"] = [v for v in assign_workspaces] if unassign_workspaces is not None: - body["unassign_workspaces"] = [v for v in unassign_workspaces] + body["{unassign_workspaces}"] = [v for v in unassign_workspaces] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -14595,12 +14587,12 @@ def update_bindings( """ body = {} if add is not None: - body["add"] = [v.as_dict() for v in add] + body["{add}"] = [v.as_dict() for v in add] if remove is not None: - body["remove"] = [v.as_dict() for v in remove] + body["{remove}"] = [v.as_dict() for v in remove] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( diff --git a/databricks/sdk/service/cleanrooms.py b/databricks/sdk/cleanrooms/v2/impl.py similarity index 73% rename from databricks/sdk/service/cleanrooms.py rename to databricks/sdk/cleanrooms/v2/impl.py index 10df23745..1794005e2 100755 --- a/databricks/sdk/service/cleanrooms.py +++ b/databricks/sdk/cleanrooms/v2/impl.py @@ -7,11 +7,11 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (_enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -57,66 +57,66 @@ def as_dict(self) -> dict: """Serializes the CleanRoom into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_restricted is not None: - body["access_restricted"] = self.access_restricted.value + body["{access_restricted}"] = self.access_restricted.value if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.local_collaborator_alias is not None: - body["local_collaborator_alias"] = self.local_collaborator_alias + body["{local_collaborator_alias}"] = self.local_collaborator_alias if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.output_catalog: - body["output_catalog"] = self.output_catalog.as_dict() + body["{output_catalog}"] = self.output_catalog.as_dict() if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.remote_detailed_info: - body["remote_detailed_info"] = self.remote_detailed_info.as_dict() + body["{remote_detailed_info}"] = self.remote_detailed_info.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoom into a shallow dictionary of its immediate attributes.""" body = {} if self.access_restricted is not None: - body["access_restricted"] = self.access_restricted + body["{access_restricted}"] = self.access_restricted if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.local_collaborator_alias is not None: - body["local_collaborator_alias"] = self.local_collaborator_alias + body["{local_collaborator_alias}"] = self.local_collaborator_alias if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.output_catalog: - body["output_catalog"] = self.output_catalog + body["{output_catalog}"] = self.output_catalog if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.remote_detailed_info: - body["remote_detailed_info"] = self.remote_detailed_info + body["{remote_detailed_info}"] = self.remote_detailed_info if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoom: """Deserializes the CleanRoom from a dictionary.""" return cls( - access_restricted=_enum(d, "access_restricted", CleanRoomAccessRestricted), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - local_collaborator_alias=d.get("local_collaborator_alias", None), - name=d.get("name", None), - output_catalog=_from_dict(d, "output_catalog", CleanRoomOutputCatalog), - owner=d.get("owner", None), - remote_detailed_info=_from_dict(d, "remote_detailed_info", CleanRoomRemoteDetail), - status=_enum(d, "status", CleanRoomStatusEnum), - updated_at=d.get("updated_at", None), + access_restricted=_enum(d, "{access_restricted}", CleanRoomAccessRestricted), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + local_collaborator_alias=d.get("{local_collaborator_alias}", None), + name=d.get("{name}", None), + output_catalog=_from_dict(d, "{output_catalog}", CleanRoomOutputCatalog), + owner=d.get("{owner}", None), + remote_detailed_info=_from_dict(d, "{remote_detailed_info}", CleanRoomRemoteDetail), + status=_enum(d, "{status}", CleanRoomStatusEnum), + updated_at=d.get("{updated_at}", None), ) @@ -187,83 +187,83 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAsset into a dictionary suitable for use as a JSON request body.""" body = {} if self.added_at is not None: - body["added_at"] = self.added_at + body["{added_at}"] = self.added_at if self.asset_type is not None: - body["asset_type"] = self.asset_type.value + body["{asset_type}"] = self.asset_type.value if self.foreign_table: - body["foreign_table"] = self.foreign_table.as_dict() + body["{foreign_table}"] = self.foreign_table.as_dict() if self.foreign_table_local_details: - body["foreign_table_local_details"] = self.foreign_table_local_details.as_dict() + body["{foreign_table_local_details}"] = self.foreign_table_local_details.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notebook: - body["notebook"] = self.notebook.as_dict() + body["{notebook}"] = self.notebook.as_dict() if self.owner_collaborator_alias is not None: - body["owner_collaborator_alias"] = self.owner_collaborator_alias + body["{owner_collaborator_alias}"] = self.owner_collaborator_alias if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.table: - body["table"] = self.table.as_dict() + body["{table}"] = self.table.as_dict() if self.table_local_details: - body["table_local_details"] = self.table_local_details.as_dict() + body["{table_local_details}"] = self.table_local_details.as_dict() if self.view: - body["view"] = self.view.as_dict() + body["{view}"] = self.view.as_dict() if self.view_local_details: - body["view_local_details"] = self.view_local_details.as_dict() + body["{view_local_details}"] = self.view_local_details.as_dict() if self.volume_local_details: - body["volume_local_details"] = self.volume_local_details.as_dict() + body["{volume_local_details}"] = self.volume_local_details.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAsset into a shallow dictionary of its immediate attributes.""" body = {} if self.added_at is not None: - body["added_at"] = self.added_at + body["{added_at}"] = self.added_at if self.asset_type is not None: - body["asset_type"] = self.asset_type + body["{asset_type}"] = self.asset_type if self.foreign_table: - body["foreign_table"] = self.foreign_table + body["{foreign_table}"] = self.foreign_table if self.foreign_table_local_details: - body["foreign_table_local_details"] = self.foreign_table_local_details + body["{foreign_table_local_details}"] = self.foreign_table_local_details if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notebook: - body["notebook"] = self.notebook + body["{notebook}"] = self.notebook if self.owner_collaborator_alias is not None: - body["owner_collaborator_alias"] = self.owner_collaborator_alias + body["{owner_collaborator_alias}"] = self.owner_collaborator_alias if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.table: - body["table"] = self.table + body["{table}"] = self.table if self.table_local_details: - body["table_local_details"] = self.table_local_details + body["{table_local_details}"] = self.table_local_details if self.view: - body["view"] = self.view + body["{view}"] = self.view if self.view_local_details: - body["view_local_details"] = self.view_local_details + body["{view_local_details}"] = self.view_local_details if self.volume_local_details: - body["volume_local_details"] = self.volume_local_details + body["{volume_local_details}"] = self.volume_local_details return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAsset: """Deserializes the CleanRoomAsset from a dictionary.""" return cls( - added_at=d.get("added_at", None), - asset_type=_enum(d, "asset_type", CleanRoomAssetAssetType), - foreign_table=_from_dict(d, "foreign_table", CleanRoomAssetForeignTable), + added_at=d.get("{added_at}", None), + asset_type=_enum(d, "{asset_type}", CleanRoomAssetAssetType), + foreign_table=_from_dict(d, "{foreign_table}", CleanRoomAssetForeignTable), foreign_table_local_details=_from_dict( - d, "foreign_table_local_details", CleanRoomAssetForeignTableLocalDetails + d, "{foreign_table_local_details}", CleanRoomAssetForeignTableLocalDetails ), - name=d.get("name", None), - notebook=_from_dict(d, "notebook", CleanRoomAssetNotebook), - owner_collaborator_alias=d.get("owner_collaborator_alias", None), - status=_enum(d, "status", CleanRoomAssetStatusEnum), - table=_from_dict(d, "table", CleanRoomAssetTable), - table_local_details=_from_dict(d, "table_local_details", CleanRoomAssetTableLocalDetails), - view=_from_dict(d, "view", CleanRoomAssetView), - view_local_details=_from_dict(d, "view_local_details", CleanRoomAssetViewLocalDetails), - volume_local_details=_from_dict(d, "volume_local_details", CleanRoomAssetVolumeLocalDetails), + name=d.get("{name}", None), + notebook=_from_dict(d, "{notebook}", CleanRoomAssetNotebook), + owner_collaborator_alias=d.get("{owner_collaborator_alias}", None), + status=_enum(d, "{status}", CleanRoomAssetStatusEnum), + table=_from_dict(d, "{table}", CleanRoomAssetTable), + table_local_details=_from_dict(d, "{table_local_details}", CleanRoomAssetTableLocalDetails), + view=_from_dict(d, "{view}", CleanRoomAssetView), + view_local_details=_from_dict(d, "{view_local_details}", CleanRoomAssetViewLocalDetails), + volume_local_details=_from_dict(d, "{volume_local_details}", CleanRoomAssetVolumeLocalDetails), ) @@ -285,20 +285,20 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["columns"] = [v.as_dict() for v in self.columns] + body["{columns}"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTable into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetForeignTable: """Deserializes the CleanRoomAssetForeignTable from a dictionary.""" - return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) + return cls(columns=_repeated_dict(d, "{columns}", ColumnInfo)) @dataclass @@ -311,20 +311,20 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTableLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTableLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetForeignTableLocalDetails: """Deserializes the CleanRoomAssetForeignTableLocalDetails from a dictionary.""" - return cls(local_name=d.get("local_name", None)) + return cls(local_name=d.get("{local_name}", None)) @dataclass @@ -340,24 +340,24 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetNotebook into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.notebook_content is not None: - body["notebook_content"] = self.notebook_content + body["{notebook_content}"] = self.notebook_content return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetNotebook into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.notebook_content is not None: - body["notebook_content"] = self.notebook_content + body["{notebook_content}"] = self.notebook_content return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetNotebook: """Deserializes the CleanRoomAssetNotebook from a dictionary.""" - return cls(etag=d.get("etag", None), notebook_content=d.get("notebook_content", None)) + return cls(etag=d.get("{etag}", None), notebook_content=d.get("{notebook_content}", None)) class CleanRoomAssetStatusEnum(Enum): @@ -376,20 +376,20 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["columns"] = [v.as_dict() for v in self.columns] + body["{columns}"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetTable into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetTable: """Deserializes the CleanRoomAssetTable from a dictionary.""" - return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) + return cls(columns=_repeated_dict(d, "{columns}", ColumnInfo)) @dataclass @@ -405,24 +405,24 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetTableLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name if self.partitions: - body["partitions"] = [v.as_dict() for v in self.partitions] + body["{partitions}"] = [v.as_dict() for v in self.partitions] return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetTableLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name if self.partitions: - body["partitions"] = self.partitions + body["{partitions}"] = self.partitions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetTableLocalDetails: """Deserializes the CleanRoomAssetTableLocalDetails from a dictionary.""" - return cls(local_name=d.get("local_name", None), partitions=_repeated_dict(d, "partitions", Partition)) + return cls(local_name=d.get("{local_name}", None), partitions=_repeated_dict(d, "{partitions}", Partition)) @dataclass @@ -434,20 +434,20 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetView into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["columns"] = [v.as_dict() for v in self.columns] + body["{columns}"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetView into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetView: """Deserializes the CleanRoomAssetView from a dictionary.""" - return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) + return cls(columns=_repeated_dict(d, "{columns}", ColumnInfo)) @dataclass @@ -460,20 +460,20 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetViewLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetViewLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetViewLocalDetails: """Deserializes the CleanRoomAssetViewLocalDetails from a dictionary.""" - return cls(local_name=d.get("local_name", None)) + return cls(local_name=d.get("{local_name}", None)) @dataclass @@ -486,20 +486,20 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetVolumeLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetVolumeLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["local_name"] = self.local_name + body["{local_name}"] = self.local_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetVolumeLocalDetails: """Deserializes the CleanRoomAssetVolumeLocalDetails from a dictionary.""" - return cls(local_name=d.get("local_name", None)) + return cls(local_name=d.get("{local_name}", None)) @dataclass @@ -540,46 +540,46 @@ def as_dict(self) -> dict: """Serializes the CleanRoomCollaborator into a dictionary suitable for use as a JSON request body.""" body = {} if self.collaborator_alias is not None: - body["collaborator_alias"] = self.collaborator_alias + body["{collaborator_alias}"] = self.collaborator_alias if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.global_metastore_id is not None: - body["global_metastore_id"] = self.global_metastore_id + body["{global_metastore_id}"] = self.global_metastore_id if self.invite_recipient_email is not None: - body["invite_recipient_email"] = self.invite_recipient_email + body["{invite_recipient_email}"] = self.invite_recipient_email if self.invite_recipient_workspace_id is not None: - body["invite_recipient_workspace_id"] = self.invite_recipient_workspace_id + body["{invite_recipient_workspace_id}"] = self.invite_recipient_workspace_id if self.organization_name is not None: - body["organization_name"] = self.organization_name + body["{organization_name}"] = self.organization_name return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomCollaborator into a shallow dictionary of its immediate attributes.""" body = {} if self.collaborator_alias is not None: - body["collaborator_alias"] = self.collaborator_alias + body["{collaborator_alias}"] = self.collaborator_alias if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.global_metastore_id is not None: - body["global_metastore_id"] = self.global_metastore_id + body["{global_metastore_id}"] = self.global_metastore_id if self.invite_recipient_email is not None: - body["invite_recipient_email"] = self.invite_recipient_email + body["{invite_recipient_email}"] = self.invite_recipient_email if self.invite_recipient_workspace_id is not None: - body["invite_recipient_workspace_id"] = self.invite_recipient_workspace_id + body["{invite_recipient_workspace_id}"] = self.invite_recipient_workspace_id if self.organization_name is not None: - body["organization_name"] = self.organization_name + body["{organization_name}"] = self.organization_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomCollaborator: """Deserializes the CleanRoomCollaborator from a dictionary.""" return cls( - collaborator_alias=d.get("collaborator_alias", None), - display_name=d.get("display_name", None), - global_metastore_id=d.get("global_metastore_id", None), - invite_recipient_email=d.get("invite_recipient_email", None), - invite_recipient_workspace_id=d.get("invite_recipient_workspace_id", None), - organization_name=d.get("organization_name", None), + collaborator_alias=d.get("{collaborator_alias}", None), + display_name=d.get("{display_name}", None), + global_metastore_id=d.get("{global_metastore_id}", None), + invite_recipient_email=d.get("{invite_recipient_email}", None), + invite_recipient_workspace_id=d.get("{invite_recipient_workspace_id}", None), + organization_name=d.get("{organization_name}", None), ) @@ -614,51 +614,51 @@ def as_dict(self) -> dict: """Serializes the CleanRoomNotebookTaskRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.collaborator_job_run_info: - body["collaborator_job_run_info"] = self.collaborator_job_run_info.as_dict() + body["{collaborator_job_run_info}"] = self.collaborator_job_run_info.as_dict() if self.notebook_job_run_state: - body["notebook_job_run_state"] = self.notebook_job_run_state.as_dict() + body["{notebook_job_run_state}"] = self.notebook_job_run_state.as_dict() if self.notebook_name is not None: - body["notebook_name"] = self.notebook_name + body["{notebook_name}"] = self.notebook_name if self.output_schema_expiration_time is not None: - body["output_schema_expiration_time"] = self.output_schema_expiration_time + body["{output_schema_expiration_time}"] = self.output_schema_expiration_time if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomNotebookTaskRun into a shallow dictionary of its immediate attributes.""" body = {} if self.collaborator_job_run_info: - body["collaborator_job_run_info"] = self.collaborator_job_run_info + body["{collaborator_job_run_info}"] = self.collaborator_job_run_info if self.notebook_job_run_state: - body["notebook_job_run_state"] = self.notebook_job_run_state + body["{notebook_job_run_state}"] = self.notebook_job_run_state if self.notebook_name is not None: - body["notebook_name"] = self.notebook_name + body["{notebook_name}"] = self.notebook_name if self.output_schema_expiration_time is not None: - body["output_schema_expiration_time"] = self.output_schema_expiration_time + body["{output_schema_expiration_time}"] = self.output_schema_expiration_time if self.output_schema_name is not None: - body["output_schema_name"] = self.output_schema_name + body["{output_schema_name}"] = self.output_schema_name if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomNotebookTaskRun: """Deserializes the CleanRoomNotebookTaskRun from a dictionary.""" return cls( - collaborator_job_run_info=_from_dict(d, "collaborator_job_run_info", CollaboratorJobRunInfo), - notebook_job_run_state=_from_dict(d, "notebook_job_run_state", CleanRoomTaskRunState), - notebook_name=d.get("notebook_name", None), - output_schema_expiration_time=d.get("output_schema_expiration_time", None), - output_schema_name=d.get("output_schema_name", None), - run_duration=d.get("run_duration", None), - start_time=d.get("start_time", None), + collaborator_job_run_info=_from_dict(d, "{collaborator_job_run_info}", CollaboratorJobRunInfo), + notebook_job_run_state=_from_dict(d, "{notebook_job_run_state}", CleanRoomTaskRunState), + notebook_name=d.get("{notebook_name}", None), + output_schema_expiration_time=d.get("{output_schema_expiration_time}", None), + output_schema_name=d.get("{output_schema_name}", None), + run_duration=d.get("{run_duration}", None), + start_time=d.get("{start_time}", None), ) @@ -676,26 +676,26 @@ def as_dict(self) -> dict: """Serializes the CleanRoomOutputCatalog into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomOutputCatalog into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomOutputCatalog: """Deserializes the CleanRoomOutputCatalog from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - status=_enum(d, "status", CleanRoomOutputCatalogOutputCatalogStatus), + catalog_name=d.get("{catalog_name}", None), + status=_enum(d, "{status}", CleanRoomOutputCatalogOutputCatalogStatus), ) @@ -740,51 +740,51 @@ def as_dict(self) -> dict: """Serializes the CleanRoomRemoteDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.central_clean_room_id is not None: - body["central_clean_room_id"] = self.central_clean_room_id + body["{central_clean_room_id}"] = self.central_clean_room_id if self.cloud_vendor is not None: - body["cloud_vendor"] = self.cloud_vendor + body["{cloud_vendor}"] = self.cloud_vendor if self.collaborators: - body["collaborators"] = [v.as_dict() for v in self.collaborators] + body["{collaborators}"] = [v.as_dict() for v in self.collaborators] if self.compliance_security_profile: - body["compliance_security_profile"] = self.compliance_security_profile.as_dict() + body["{compliance_security_profile}"] = self.compliance_security_profile.as_dict() if self.creator: - body["creator"] = self.creator.as_dict() + body["{creator}"] = self.creator.as_dict() if self.egress_network_policy: - body["egress_network_policy"] = self.egress_network_policy.as_dict() + body["{egress_network_policy}"] = self.egress_network_policy.as_dict() if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomRemoteDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.central_clean_room_id is not None: - body["central_clean_room_id"] = self.central_clean_room_id + body["{central_clean_room_id}"] = self.central_clean_room_id if self.cloud_vendor is not None: - body["cloud_vendor"] = self.cloud_vendor + body["{cloud_vendor}"] = self.cloud_vendor if self.collaborators: - body["collaborators"] = self.collaborators + body["{collaborators}"] = self.collaborators if self.compliance_security_profile: - body["compliance_security_profile"] = self.compliance_security_profile + body["{compliance_security_profile}"] = self.compliance_security_profile if self.creator: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.egress_network_policy: - body["egress_network_policy"] = self.egress_network_policy + body["{egress_network_policy}"] = self.egress_network_policy if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomRemoteDetail: """Deserializes the CleanRoomRemoteDetail from a dictionary.""" return cls( - central_clean_room_id=d.get("central_clean_room_id", None), - cloud_vendor=d.get("cloud_vendor", None), - collaborators=_repeated_dict(d, "collaborators", CleanRoomCollaborator), - compliance_security_profile=_from_dict(d, "compliance_security_profile", ComplianceSecurityProfile), - creator=_from_dict(d, "creator", CleanRoomCollaborator), - egress_network_policy=_from_dict(d, "egress_network_policy", EgressNetworkPolicy), - region=d.get("region", None), + central_clean_room_id=d.get("{central_clean_room_id}", None), + cloud_vendor=d.get("{cloud_vendor}", None), + collaborators=_repeated_dict(d, "{collaborators}", CleanRoomCollaborator), + compliance_security_profile=_from_dict(d, "{compliance_security_profile}", ComplianceSecurityProfile), + creator=_from_dict(d, "{creator}", CleanRoomCollaborator), + egress_network_policy=_from_dict(d, "{egress_network_policy}", EgressNetworkPolicy), + region=d.get("{region}", None), ) @@ -846,26 +846,26 @@ def as_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a dictionary suitable for use as a JSON request body.""" body = {} if self.life_cycle_state is not None: - body["life_cycle_state"] = self.life_cycle_state.value + body["{life_cycle_state}"] = self.life_cycle_state.value if self.result_state is not None: - body["result_state"] = self.result_state.value + body["{result_state}"] = self.result_state.value return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a shallow dictionary of its immediate attributes.""" body = {} if self.life_cycle_state is not None: - body["life_cycle_state"] = self.life_cycle_state + body["{life_cycle_state}"] = self.life_cycle_state if self.result_state is not None: - body["result_state"] = self.result_state + body["{result_state}"] = self.result_state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomTaskRunState: """Deserializes the CleanRoomTaskRunState from a dictionary.""" return cls( - life_cycle_state=_enum(d, "life_cycle_state", CleanRoomTaskRunLifeCycleState), - result_state=_enum(d, "result_state", CleanRoomTaskRunResultState), + life_cycle_state=_enum(d, "{life_cycle_state}", CleanRoomTaskRunLifeCycleState), + result_state=_enum(d, "{result_state}", CleanRoomTaskRunResultState), ) @@ -890,41 +890,41 @@ def as_dict(self) -> dict: """Serializes the CollaboratorJobRunInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.collaborator_alias is not None: - body["collaborator_alias"] = self.collaborator_alias + body["{collaborator_alias}"] = self.collaborator_alias if self.collaborator_job_id is not None: - body["collaborator_job_id"] = self.collaborator_job_id + body["{collaborator_job_id}"] = self.collaborator_job_id if self.collaborator_job_run_id is not None: - body["collaborator_job_run_id"] = self.collaborator_job_run_id + body["{collaborator_job_run_id}"] = self.collaborator_job_run_id if self.collaborator_task_run_id is not None: - body["collaborator_task_run_id"] = self.collaborator_task_run_id + body["{collaborator_task_run_id}"] = self.collaborator_task_run_id if self.collaborator_workspace_id is not None: - body["collaborator_workspace_id"] = self.collaborator_workspace_id + body["{collaborator_workspace_id}"] = self.collaborator_workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the CollaboratorJobRunInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.collaborator_alias is not None: - body["collaborator_alias"] = self.collaborator_alias + body["{collaborator_alias}"] = self.collaborator_alias if self.collaborator_job_id is not None: - body["collaborator_job_id"] = self.collaborator_job_id + body["{collaborator_job_id}"] = self.collaborator_job_id if self.collaborator_job_run_id is not None: - body["collaborator_job_run_id"] = self.collaborator_job_run_id + body["{collaborator_job_run_id}"] = self.collaborator_job_run_id if self.collaborator_task_run_id is not None: - body["collaborator_task_run_id"] = self.collaborator_task_run_id + body["{collaborator_task_run_id}"] = self.collaborator_task_run_id if self.collaborator_workspace_id is not None: - body["collaborator_workspace_id"] = self.collaborator_workspace_id + body["{collaborator_workspace_id}"] = self.collaborator_workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CollaboratorJobRunInfo: """Deserializes the CollaboratorJobRunInfo from a dictionary.""" return cls( - collaborator_alias=d.get("collaborator_alias", None), - collaborator_job_id=d.get("collaborator_job_id", None), - collaborator_job_run_id=d.get("collaborator_job_run_id", None), - collaborator_task_run_id=d.get("collaborator_task_run_id", None), - collaborator_workspace_id=d.get("collaborator_workspace_id", None), + collaborator_alias=d.get("{collaborator_alias}", None), + collaborator_job_id=d.get("{collaborator_job_id}", None), + collaborator_job_run_id=d.get("{collaborator_job_run_id}", None), + collaborator_task_run_id=d.get("{collaborator_task_run_id}", None), + collaborator_workspace_id=d.get("{collaborator_workspace_id}", None), ) @@ -968,76 +968,76 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.mask: - body["mask"] = self.mask.as_dict() + body["{mask}"] = self.mask.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.nullable is not None: - body["nullable"] = self.nullable + body["{nullable}"] = self.nullable if self.partition_index is not None: - body["partition_index"] = self.partition_index + body["{partition_index}"] = self.partition_index if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name.value + body["{type_name}"] = self.type_name.value if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.mask: - body["mask"] = self.mask + body["{mask}"] = self.mask if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.nullable is not None: - body["nullable"] = self.nullable + body["{nullable}"] = self.nullable if self.partition_index is not None: - body["partition_index"] = self.partition_index + body["{partition_index}"] = self.partition_index if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name + body["{type_name}"] = self.type_name if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - mask=_from_dict(d, "mask", ColumnMask), - name=d.get("name", None), - nullable=d.get("nullable", None), - partition_index=d.get("partition_index", None), - position=d.get("position", None), - type_interval_type=d.get("type_interval_type", None), - type_json=d.get("type_json", None), - type_name=_enum(d, "type_name", ColumnTypeName), - type_precision=d.get("type_precision", None), - type_scale=d.get("type_scale", None), - type_text=d.get("type_text", None), + comment=d.get("{comment}", None), + mask=_from_dict(d, "{mask}", ColumnMask), + name=d.get("{name}", None), + nullable=d.get("{nullable}", None), + partition_index=d.get("{partition_index}", None), + position=d.get("{position}", None), + type_interval_type=d.get("{type_interval_type}", None), + type_json=d.get("{type_json}", None), + type_name=_enum(d, "{type_name}", ColumnTypeName), + type_precision=d.get("{type_precision}", None), + type_scale=d.get("{type_scale}", None), + type_text=d.get("{type_text}", None), ) @@ -1055,24 +1055,24 @@ def as_dict(self) -> dict: """Serializes the ColumnMask into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.using_column_names: - body["using_column_names"] = [v for v in self.using_column_names] + body["{using_column_names}"] = [v for v in self.using_column_names] return body def as_shallow_dict(self) -> dict: """Serializes the ColumnMask into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.using_column_names: - body["using_column_names"] = self.using_column_names + body["{using_column_names}"] = self.using_column_names return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnMask: """Deserializes the ColumnMask from a dictionary.""" - return cls(function_name=d.get("function_name", None), using_column_names=d.get("using_column_names", None)) + return cls(function_name=d.get("{function_name}", None), using_column_names=d.get("{using_column_names}", None)) class ColumnTypeName(Enum): @@ -1115,26 +1115,26 @@ def as_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_standards: - body["compliance_standards"] = [v.value for v in self.compliance_standards] + body["{compliance_standards}"] = [v.value for v in self.compliance_standards] if self.is_enabled is not None: - body["is_enabled"] = self.is_enabled + body["{is_enabled}"] = self.is_enabled return body def as_shallow_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_standards: - body["compliance_standards"] = self.compliance_standards + body["{compliance_standards}"] = self.compliance_standards if self.is_enabled is not None: - body["is_enabled"] = self.is_enabled + body["{is_enabled}"] = self.is_enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComplianceSecurityProfile: """Deserializes the ComplianceSecurityProfile from a dictionary.""" return cls( - compliance_standards=_repeated_enum(d, "compliance_standards", ComplianceStandard), - is_enabled=d.get("is_enabled", None), + compliance_standards=_repeated_enum(d, "{compliance_standards}", ComplianceStandard), + is_enabled=d.get("{is_enabled}", None), ) @@ -1163,20 +1163,20 @@ def as_dict(self) -> dict: """Serializes the CreateCleanRoomOutputCatalogResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.output_catalog: - body["output_catalog"] = self.output_catalog.as_dict() + body["{output_catalog}"] = self.output_catalog.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateCleanRoomOutputCatalogResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.output_catalog: - body["output_catalog"] = self.output_catalog + body["{output_catalog}"] = self.output_catalog return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCleanRoomOutputCatalogResponse: """Deserializes the CreateCleanRoomOutputCatalogResponse from a dictionary.""" - return cls(output_catalog=_from_dict(d, "output_catalog", CleanRoomOutputCatalog)) + return cls(output_catalog=_from_dict(d, "{output_catalog}", CleanRoomOutputCatalog)) @dataclass @@ -1231,20 +1231,20 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.internet_access: - body["internet_access"] = self.internet_access.as_dict() + body["{internet_access}"] = self.internet_access.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.internet_access: - body["internet_access"] = self.internet_access + body["{internet_access}"] = self.internet_access return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicy: """Deserializes the EgressNetworkPolicy from a dictionary.""" - return cls(internet_access=_from_dict(d, "internet_access", EgressNetworkPolicyInternetAccessPolicy)) + return cls(internet_access=_from_dict(d, "{internet_access}", EgressNetworkPolicyInternetAccessPolicy)) @dataclass @@ -1267,26 +1267,26 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_internet_destinations: - body["allowed_internet_destinations"] = [v.as_dict() for v in self.allowed_internet_destinations] + body["{allowed_internet_destinations}"] = [v.as_dict() for v in self.allowed_internet_destinations] if self.allowed_storage_destinations: - body["allowed_storage_destinations"] = [v.as_dict() for v in self.allowed_storage_destinations] + body["{allowed_storage_destinations}"] = [v.as_dict() for v in self.allowed_storage_destinations] if self.log_only_mode: - body["log_only_mode"] = self.log_only_mode.as_dict() + body["{log_only_mode}"] = self.log_only_mode.as_dict() if self.restriction_mode is not None: - body["restriction_mode"] = self.restriction_mode.value + body["{restriction_mode}"] = self.restriction_mode.value return body def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_internet_destinations: - body["allowed_internet_destinations"] = self.allowed_internet_destinations + body["{allowed_internet_destinations}"] = self.allowed_internet_destinations if self.allowed_storage_destinations: - body["allowed_storage_destinations"] = self.allowed_storage_destinations + body["{allowed_storage_destinations}"] = self.allowed_storage_destinations if self.log_only_mode: - body["log_only_mode"] = self.log_only_mode + body["{log_only_mode}"] = self.log_only_mode if self.restriction_mode is not None: - body["restriction_mode"] = self.restriction_mode + body["{restriction_mode}"] = self.restriction_mode return body @classmethod @@ -1294,13 +1294,13 @@ def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicy """Deserializes the EgressNetworkPolicyInternetAccessPolicy from a dictionary.""" return cls( allowed_internet_destinations=_repeated_dict( - d, "allowed_internet_destinations", EgressNetworkPolicyInternetAccessPolicyInternetDestination + d, "{allowed_internet_destinations}", EgressNetworkPolicyInternetAccessPolicyInternetDestination ), allowed_storage_destinations=_repeated_dict( - d, "allowed_storage_destinations", EgressNetworkPolicyInternetAccessPolicyStorageDestination + d, "{allowed_storage_destinations}", EgressNetworkPolicyInternetAccessPolicyStorageDestination ), - log_only_mode=_from_dict(d, "log_only_mode", EgressNetworkPolicyInternetAccessPolicyLogOnlyMode), - restriction_mode=_enum(d, "restriction_mode", EgressNetworkPolicyInternetAccessPolicyRestrictionMode), + log_only_mode=_from_dict(d, "{log_only_mode}", EgressNetworkPolicyInternetAccessPolicyLogOnlyMode), + restriction_mode=_enum(d, "{restriction_mode}", EgressNetworkPolicyInternetAccessPolicyRestrictionMode), ) @@ -1326,35 +1326,35 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.protocol is not None: - body["protocol"] = self.protocol.value + body["{protocol}"] = self.protocol.value if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.protocol is not None: - body["protocol"] = self.protocol + body["{protocol}"] = self.protocol if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyInternetDestination: """Deserializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination from a dictionary.""" return cls( - destination=d.get("destination", None), + destination=d.get("{destination}", None), protocol=_enum( d, - "protocol", + "{protocol}", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol, ), - type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType), + type=_enum(d, "{type}", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType), ) @@ -1382,18 +1382,18 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_only_mode_type is not None: - body["log_only_mode_type"] = self.log_only_mode_type.value + body["{log_only_mode_type}"] = self.log_only_mode_type.value if self.workloads: - body["workloads"] = [v.value for v in self.workloads] + body["{workloads}"] = [v.value for v in self.workloads] return body def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a shallow dictionary of its immediate attributes.""" body = {} if self.log_only_mode_type is not None: - body["log_only_mode_type"] = self.log_only_mode_type + body["{log_only_mode_type}"] = self.log_only_mode_type if self.workloads: - body["workloads"] = self.workloads + body["{workloads}"] = self.workloads return body @classmethod @@ -1401,9 +1401,9 @@ def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicy """Deserializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode from a dictionary.""" return cls( log_only_mode_type=_enum( - d, "log_only_mode_type", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType + d, "{log_only_mode_type}", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType ), - workloads=_repeated_enum(d, "workloads", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType), + workloads=_repeated_enum(d, "{workloads}", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType), ) @@ -1456,56 +1456,56 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_paths: - body["allowed_paths"] = [v for v in self.allowed_paths] + body["{allowed_paths}"] = [v for v in self.allowed_paths] if self.azure_container is not None: - body["azure_container"] = self.azure_container + body["{azure_container}"] = self.azure_container if self.azure_dns_zone is not None: - body["azure_dns_zone"] = self.azure_dns_zone + body["{azure_dns_zone}"] = self.azure_dns_zone if self.azure_storage_account is not None: - body["azure_storage_account"] = self.azure_storage_account + body["{azure_storage_account}"] = self.azure_storage_account if self.azure_storage_service is not None: - body["azure_storage_service"] = self.azure_storage_service + body["{azure_storage_service}"] = self.azure_storage_service if self.bucket_name is not None: - body["bucket_name"] = self.bucket_name + body["{bucket_name}"] = self.bucket_name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_paths: - body["allowed_paths"] = self.allowed_paths + body["{allowed_paths}"] = self.allowed_paths if self.azure_container is not None: - body["azure_container"] = self.azure_container + body["{azure_container}"] = self.azure_container if self.azure_dns_zone is not None: - body["azure_dns_zone"] = self.azure_dns_zone + body["{azure_dns_zone}"] = self.azure_dns_zone if self.azure_storage_account is not None: - body["azure_storage_account"] = self.azure_storage_account + body["{azure_storage_account}"] = self.azure_storage_account if self.azure_storage_service is not None: - body["azure_storage_service"] = self.azure_storage_service + body["{azure_storage_service}"] = self.azure_storage_service if self.bucket_name is not None: - body["bucket_name"] = self.bucket_name + body["{bucket_name}"] = self.bucket_name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyStorageDestination: """Deserializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination from a dictionary.""" return cls( - allowed_paths=d.get("allowed_paths", None), - azure_container=d.get("azure_container", None), - azure_dns_zone=d.get("azure_dns_zone", None), - azure_storage_account=d.get("azure_storage_account", None), - azure_storage_service=d.get("azure_storage_service", None), - bucket_name=d.get("bucket_name", None), - region=d.get("region", None), - type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType), + allowed_paths=d.get("{allowed_paths}", None), + azure_container=d.get("{azure_container}", None), + azure_dns_zone=d.get("{azure_dns_zone}", None), + azure_storage_account=d.get("{azure_storage_account}", None), + azure_storage_service=d.get("{azure_storage_service}", None), + bucket_name=d.get("{bucket_name}", None), + region=d.get("{region}", None), + type=_enum(d, "{type}", EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType), ) @@ -1530,24 +1530,26 @@ def as_dict(self) -> dict: """Serializes the ListCleanRoomAssetsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets: - body["assets"] = [v.as_dict() for v in self.assets] + body["{assets}"] = [v.as_dict() for v in self.assets] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListCleanRoomAssetsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.assets: - body["assets"] = self.assets + body["{assets}"] = self.assets if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCleanRoomAssetsResponse: """Deserializes the ListCleanRoomAssetsResponse from a dictionary.""" - return cls(assets=_repeated_dict(d, "assets", CleanRoomAsset), next_page_token=d.get("next_page_token", None)) + return cls( + assets=_repeated_dict(d, "{assets}", CleanRoomAsset), next_page_token=d.get("{next_page_token}", None) + ) @dataclass @@ -1563,25 +1565,25 @@ def as_dict(self) -> dict: """Serializes the ListCleanRoomNotebookTaskRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.runs: - body["runs"] = [v.as_dict() for v in self.runs] + body["{runs}"] = [v.as_dict() for v in self.runs] return body def as_shallow_dict(self) -> dict: """Serializes the ListCleanRoomNotebookTaskRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.runs: - body["runs"] = self.runs + body["{runs}"] = self.runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCleanRoomNotebookTaskRunsResponse: """Deserializes the ListCleanRoomNotebookTaskRunsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), runs=_repeated_dict(d, "runs", CleanRoomNotebookTaskRun) + next_page_token=d.get("{next_page_token}", None), runs=_repeated_dict(d, "{runs}", CleanRoomNotebookTaskRun) ) @@ -1597,25 +1599,25 @@ def as_dict(self) -> dict: """Serializes the ListCleanRoomsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms: - body["clean_rooms"] = [v.as_dict() for v in self.clean_rooms] + body["{clean_rooms}"] = [v.as_dict() for v in self.clean_rooms] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListCleanRoomsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms: - body["clean_rooms"] = self.clean_rooms + body["{clean_rooms}"] = self.clean_rooms if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCleanRoomsResponse: """Deserializes the ListCleanRoomsResponse from a dictionary.""" return cls( - clean_rooms=_repeated_dict(d, "clean_rooms", CleanRoom), next_page_token=d.get("next_page_token", None) + clean_rooms=_repeated_dict(d, "{clean_rooms}", CleanRoom), next_page_token=d.get("{next_page_token}", None) ) @@ -1628,20 +1630,20 @@ def as_dict(self) -> dict: """Serializes the Partition into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["values"] = [v.as_dict() for v in self.values] + body["{values}"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the Partition into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Partition: """Deserializes the Partition from a dictionary.""" - return cls(values=_repeated_dict(d, "values", PartitionValue)) + return cls(values=_repeated_dict(d, "{values}", PartitionValue)) @dataclass @@ -1664,36 +1666,36 @@ def as_dict(self) -> dict: """Serializes the PartitionValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.op is not None: - body["op"] = self.op.value + body["{op}"] = self.op.value if self.recipient_property_key is not None: - body["recipient_property_key"] = self.recipient_property_key + body["{recipient_property_key}"] = self.recipient_property_key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the PartitionValue into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.recipient_property_key is not None: - body["recipient_property_key"] = self.recipient_property_key + body["{recipient_property_key}"] = self.recipient_property_key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartitionValue: """Deserializes the PartitionValue from a dictionary.""" return cls( - name=d.get("name", None), - op=_enum(d, "op", PartitionValueOp), - recipient_property_key=d.get("recipient_property_key", None), - value=d.get("value", None), + name=d.get("{name}", None), + op=_enum(d, "{op}", PartitionValueOp), + recipient_property_key=d.get("{recipient_property_key}", None), + value=d.get("{value}", None), ) @@ -1714,24 +1716,24 @@ def as_dict(self) -> dict: """Serializes the UpdateCleanRoomRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_room: - body["clean_room"] = self.clean_room.as_dict() + body["{clean_room}"] = self.clean_room.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCleanRoomRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_room: - body["clean_room"] = self.clean_room + body["{clean_room}"] = self.clean_room if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCleanRoomRequest: """Deserializes the UpdateCleanRoomRequest from a dictionary.""" - return cls(clean_room=_from_dict(d, "clean_room", CleanRoom), name=d.get("name", None)) + return cls(clean_room=_from_dict(d, "{clean_room}", CleanRoom), name=d.get("{name}", None)) class CleanRoomAssetsAPI: @@ -1758,8 +1760,8 @@ def create(self, clean_room_name: str, *, asset: Optional[CleanRoomAsset] = None """ body = asset.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/clean-rooms/{clean_room_name}/assets", body=body, headers=headers) @@ -1781,7 +1783,7 @@ def delete(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, asse """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -1806,7 +1808,7 @@ def get(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, asset_f """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -1829,19 +1831,19 @@ def list(self, clean_room_name: str, *, page_token: Optional[str] = None) -> Ite query = {} if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/clean-rooms/{clean_room_name}/assets", query=query, headers=headers) - if "assets" in json: - for v in json["assets"]: + if "{assets}" in json: + for v in json["{assets}"]: yield CleanRoomAsset.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -1875,8 +1877,8 @@ def update( """ body = asset.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1920,23 +1922,23 @@ def list( query = {} if notebook_name is not None: - query["notebook_name"] = notebook_name + query["{notebook_name}"] = notebook_name if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/clean-rooms/{clean_room_name}/runs", query=query, headers=headers) - if "runs" in json: - for v in json["runs"]: + if "{runs}" in json: + for v in json["{runs}"]: yield CleanRoomNotebookTaskRun.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class CleanRoomsAPI: @@ -1964,8 +1966,8 @@ def create(self, *, clean_room: Optional[CleanRoom] = None) -> CleanRoom: """ body = clean_room.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/clean-rooms", body=body, headers=headers) @@ -1986,8 +1988,8 @@ def create_output_catalog( """ body = output_catalog.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2009,7 +2011,7 @@ def delete(self, name: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/clean-rooms/{name}", headers=headers) @@ -2025,7 +2027,7 @@ def get(self, name: str) -> CleanRoom: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/clean-rooms/{name}", headers=headers) @@ -2047,21 +2049,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/clean-rooms", query=query, headers=headers) - if "clean_rooms" in json: - for v in json["clean_rooms"]: + if "{clean_rooms}" in json: + for v in json["{clean_rooms}"]: yield CleanRoom.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanRoom: """Update a clean room. @@ -2079,10 +2081,10 @@ def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanR """ body = {} if clean_room is not None: - body["clean_room"] = clean_room.as_dict() + body["{clean_room}"] = clean_room.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/clean-rooms/{name}", body=body, headers=headers) diff --git a/databricks/sdk/service/compute.py b/databricks/sdk/compute/v2/impl.py similarity index 75% rename from databricks/sdk/service/compute.py rename to databricks/sdk/compute/v2/impl.py index ec740e5b5..813033c32 100755 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/compute/v2/impl.py @@ -3,19 +3,16 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -50,36 +47,36 @@ def as_dict(self) -> dict: """Serializes the AddInstanceProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.iam_role_arn is not None: - body["iam_role_arn"] = self.iam_role_arn + body["{iam_role_arn}"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["is_meta_instance_profile"] = self.is_meta_instance_profile + body["{is_meta_instance_profile}"] = self.is_meta_instance_profile if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body def as_shallow_dict(self) -> dict: """Serializes the AddInstanceProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.iam_role_arn is not None: - body["iam_role_arn"] = self.iam_role_arn + body["{iam_role_arn}"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["is_meta_instance_profile"] = self.is_meta_instance_profile + body["{is_meta_instance_profile}"] = self.is_meta_instance_profile if self.skip_validation is not None: - body["skip_validation"] = self.skip_validation + body["{skip_validation}"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddInstanceProfile: """Deserializes the AddInstanceProfile from a dictionary.""" return cls( - iam_role_arn=d.get("iam_role_arn", None), - instance_profile_arn=d.get("instance_profile_arn", None), - is_meta_instance_profile=d.get("is_meta_instance_profile", None), - skip_validation=d.get("skip_validation", None), + iam_role_arn=d.get("{iam_role_arn}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + is_meta_instance_profile=d.get("{is_meta_instance_profile}", None), + skip_validation=d.get("{skip_validation}", None), ) @@ -113,20 +110,20 @@ def as_dict(self) -> dict: """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: """Deserializes the Adlsgen2Info from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -143,24 +140,24 @@ def as_dict(self) -> dict: """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" body = {} if self.max_workers is not None: - body["max_workers"] = self.max_workers + body["{max_workers}"] = self.max_workers if self.min_workers is not None: - body["min_workers"] = self.min_workers + body["{min_workers}"] = self.min_workers return body def as_shallow_dict(self) -> dict: """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" body = {} if self.max_workers is not None: - body["max_workers"] = self.max_workers + body["{max_workers}"] = self.max_workers if self.min_workers is not None: - body["min_workers"] = self.min_workers + body["{min_workers}"] = self.min_workers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoScale: """Deserializes the AutoScale from a dictionary.""" - return cls(max_workers=d.get("max_workers", None), min_workers=d.get("min_workers", None)) + return cls(max_workers=d.get("{max_workers}", None), min_workers=d.get("{min_workers}", None)) @dataclass @@ -247,66 +244,66 @@ def as_dict(self) -> dict: """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count + body["{ebs_volume_count}"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops + body["{ebs_volume_iops}"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size + body["{ebs_volume_size}"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput + body["{ebs_volume_throughput}"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type.value + body["{ebs_volume_type}"] = self.ebs_volume_type.value if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count + body["{ebs_volume_count}"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops + body["{ebs_volume_iops}"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size + body["{ebs_volume_size}"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput + body["{ebs_volume_throughput}"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type + body["{ebs_volume_type}"] = self.ebs_volume_type if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: """Deserializes the AwsAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", AwsAvailability), - ebs_volume_count=d.get("ebs_volume_count", None), - ebs_volume_iops=d.get("ebs_volume_iops", None), - ebs_volume_size=d.get("ebs_volume_size", None), - ebs_volume_throughput=d.get("ebs_volume_throughput", None), - ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), - first_on_demand=d.get("first_on_demand", None), - instance_profile_arn=d.get("instance_profile_arn", None), - spot_bid_price_percent=d.get("spot_bid_price_percent", None), - zone_id=d.get("zone_id", None), + availability=_enum(d, "{availability}", AwsAvailability), + ebs_volume_count=d.get("{ebs_volume_count}", None), + ebs_volume_iops=d.get("{ebs_volume_iops}", None), + ebs_volume_size=d.get("{ebs_volume_size}", None), + ebs_volume_throughput=d.get("{ebs_volume_throughput}", None), + ebs_volume_type=_enum(d, "{ebs_volume_type}", EbsVolumeType), + first_on_demand=d.get("{first_on_demand}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), + zone_id=d.get("{zone_id}", None), ) @@ -350,36 +347,36 @@ def as_dict(self) -> dict: """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info.as_dict() + body["{log_analytics_info}"] = self.log_analytics_info.as_dict() if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body def as_shallow_dict(self) -> dict: """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info + body["{log_analytics_info}"] = self.log_analytics_info if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: """Deserializes the AzureAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", AzureAvailability), - first_on_demand=d.get("first_on_demand", None), - log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), - spot_bid_max_price=d.get("spot_bid_max_price", None), + availability=_enum(d, "{availability}", AzureAvailability), + first_on_demand=d.get("{first_on_demand}", None), + log_analytics_info=_from_dict(d, "{log_analytics_info}", LogAnalyticsInfo), + spot_bid_max_price=d.get("{spot_bid_max_price}", None), ) @@ -404,31 +401,31 @@ def as_dict(self) -> dict: """Serializes the CancelCommand into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.command_id is not None: - body["commandId"] = self.command_id + body["{command_id}"] = self.command_id if self.context_id is not None: - body["contextId"] = self.context_id + body["{context_id}"] = self.context_id return body def as_shallow_dict(self) -> dict: """Serializes the CancelCommand into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.command_id is not None: - body["commandId"] = self.command_id + body["{command_id}"] = self.command_id if self.context_id is not None: - body["contextId"] = self.context_id + body["{context_id}"] = self.context_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelCommand: """Deserializes the CancelCommand from a dictionary.""" return cls( - cluster_id=d.get("clusterId", None), - command_id=d.get("commandId", None), - context_id=d.get("contextId", None), + cluster_id=d.get("{cluster_id}", None), + command_id=d.get("{command_id}", None), + context_id=d.get("{context_id}", None), ) @@ -461,24 +458,24 @@ def as_dict(self) -> dict: """Serializes the ChangeClusterOwner into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.owner_username is not None: - body["owner_username"] = self.owner_username + body["{owner_username}"] = self.owner_username return body def as_shallow_dict(self) -> dict: """Serializes the ChangeClusterOwner into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.owner_username is not None: - body["owner_username"] = self.owner_username + body["{owner_username}"] = self.owner_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ChangeClusterOwner: """Deserializes the ChangeClusterOwner from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None), owner_username=d.get("owner_username", None)) + return cls(cluster_id=d.get("{cluster_id}", None), owner_username=d.get("{owner_username}", None)) @dataclass @@ -511,24 +508,24 @@ def as_dict(self) -> dict: """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" body = {} if self.jobs is not None: - body["jobs"] = self.jobs + body["{jobs}"] = self.jobs if self.notebooks is not None: - body["notebooks"] = self.notebooks + body["{notebooks}"] = self.notebooks return body def as_shallow_dict(self) -> dict: """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" body = {} if self.jobs is not None: - body["jobs"] = self.jobs + body["{jobs}"] = self.jobs if self.notebooks is not None: - body["notebooks"] = self.notebooks + body["{notebooks}"] = self.notebooks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: """Deserializes the ClientsTypes from a dictionary.""" - return cls(jobs=d.get("jobs", None), notebooks=d.get("notebooks", None)) + return cls(jobs=d.get("{jobs}", None), notebooks=d.get("{notebooks}", None)) @dataclass @@ -540,20 +537,20 @@ def as_dict(self) -> dict: """Serializes the CloneCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.source_cluster_id is not None: - body["source_cluster_id"] = self.source_cluster_id + body["{source_cluster_id}"] = self.source_cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the CloneCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.source_cluster_id is not None: - body["source_cluster_id"] = self.source_cluster_id + body["{source_cluster_id}"] = self.source_cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloneCluster: """Deserializes the CloneCluster from a dictionary.""" - return cls(source_cluster_id=d.get("source_cluster_id", None)) + return cls(source_cluster_id=d.get("{source_cluster_id}", None)) @dataclass @@ -565,20 +562,20 @@ def as_dict(self) -> dict: """Serializes the CloudProviderNodeInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.status: - body["status"] = [v.value for v in self.status] + body["{status}"] = [v.value for v in self.status] return body def as_shallow_dict(self) -> dict: """Serializes the CloudProviderNodeInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloudProviderNodeInfo: """Deserializes the CloudProviderNodeInfo from a dictionary.""" - return cls(status=_repeated_enum(d, "status", CloudProviderNodeStatus)) + return cls(status=_repeated_enum(d, "{status}", CloudProviderNodeStatus)) class CloudProviderNodeStatus(Enum): @@ -605,36 +602,36 @@ def as_dict(self) -> dict: """Serializes the ClusterAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAccessControlRequest: """Deserializes the ClusterAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ClusterPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", ClusterPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -659,41 +656,41 @@ def as_dict(self) -> dict: """Serializes the ClusterAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAccessControlResponse: """Deserializes the ClusterAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", ClusterPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", ClusterPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -879,151 +876,151 @@ def as_dict(self) -> dict: """Serializes the ClusterAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value + body["{data_security_mode}"] = self.data_security_mode.value if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() + body["{docker_image}"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value + body["{runtime_engine}"] = self.runtime_engine.value if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() + body["{workload_type}"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode + body["{data_security_mode}"] = self.data_security_mode if self.docker_image: - body["docker_image"] = self.docker_image + body["{docker_image}"] = self.docker_image if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine + body["{runtime_engine}"] = self.runtime_engine if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAttributes: """Deserializes the ClusterAttributes from a dictionary.""" return cls( - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_name=d.get("cluster_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - kind=_enum(d, "kind", Kind), - node_type_id=d.get("node_type_id", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - ssh_public_keys=d.get("ssh_public_keys", None), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), + autotermination_minutes=d.get("{autotermination_minutes}", None), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + cluster_name=d.get("{cluster_name}", None), + custom_tags=d.get("{custom_tags}", None), + data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), + docker_image=_from_dict(d, "{docker_image}", DockerImage), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + is_single_node=d.get("{is_single_node}", None), + kind=_enum(d, "{kind}", Kind), + node_type_id=d.get("{node_type_id}", None), + policy_id=d.get("{policy_id}", None), + runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), + single_user_name=d.get("{single_user_name}", None), + spark_conf=d.get("{spark_conf}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + spark_version=d.get("{spark_version}", None), + ssh_public_keys=d.get("{ssh_public_keys}", None), + use_ml_runtime=d.get("{use_ml_runtime}", None), + workload_type=_from_dict(d, "{workload_type}", WorkloadType), ) @@ -1044,31 +1041,31 @@ def as_dict(self) -> dict: """Serializes the ClusterCompliance into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body def as_shallow_dict(self) -> dict: """Serializes the ClusterCompliance into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterCompliance: """Deserializes the ClusterCompliance from a dictionary.""" return cls( - cluster_id=d.get("cluster_id", None), - is_compliant=d.get("is_compliant", None), - violations=d.get("violations", None), + cluster_id=d.get("{cluster_id}", None), + is_compliant=d.get("{is_compliant}", None), + violations=d.get("{violations}", None), ) @@ -1347,256 +1344,256 @@ def as_dict(self) -> dict: """Serializes the ClusterDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.cluster_cores is not None: - body["cluster_cores"] = self.cluster_cores + body["{cluster_cores}"] = self.cluster_cores if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.cluster_log_status: - body["cluster_log_status"] = self.cluster_log_status.as_dict() + body["{cluster_log_status}"] = self.cluster_log_status.as_dict() if self.cluster_memory_mb is not None: - body["cluster_memory_mb"] = self.cluster_memory_mb + body["{cluster_memory_mb}"] = self.cluster_memory_mb if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.cluster_source is not None: - body["cluster_source"] = self.cluster_source.value + body["{cluster_source}"] = self.cluster_source.value if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value + body["{data_security_mode}"] = self.data_security_mode.value if self.default_tags: - body["default_tags"] = self.default_tags + body["{default_tags}"] = self.default_tags if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() + body["{docker_image}"] = self.docker_image.as_dict() if self.driver: - body["driver"] = self.driver.as_dict() + body["{driver}"] = self.driver.as_dict() if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.executors: - body["executors"] = [v.as_dict() for v in self.executors] + body["{executors}"] = [v.as_dict() for v in self.executors] if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.jdbc_port is not None: - body["jdbc_port"] = self.jdbc_port + body["{jdbc_port}"] = self.jdbc_port if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.last_restarted_time is not None: - body["last_restarted_time"] = self.last_restarted_time + body["{last_restarted_time}"] = self.last_restarted_time if self.last_state_loss_time is not None: - body["last_state_loss_time"] = self.last_state_loss_time + body["{last_state_loss_time}"] = self.last_state_loss_time if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value + body["{runtime_engine}"] = self.runtime_engine.value if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_context_id is not None: - body["spark_context_id"] = self.spark_context_id + body["{spark_context_id}"] = self.spark_context_id if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.spec: - body["spec"] = self.spec.as_dict() + body["{spec}"] = self.spec.as_dict() if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.state_message is not None: - body["state_message"] = self.state_message + body["{state_message}"] = self.state_message if self.terminated_time is not None: - body["terminated_time"] = self.terminated_time + body["{terminated_time}"] = self.terminated_time if self.termination_reason: - body["termination_reason"] = self.termination_reason.as_dict() + body["{termination_reason}"] = self.termination_reason.as_dict() if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() + body["{workload_type}"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.cluster_cores is not None: - body["cluster_cores"] = self.cluster_cores + body["{cluster_cores}"] = self.cluster_cores if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.cluster_log_status: - body["cluster_log_status"] = self.cluster_log_status + body["{cluster_log_status}"] = self.cluster_log_status if self.cluster_memory_mb is not None: - body["cluster_memory_mb"] = self.cluster_memory_mb + body["{cluster_memory_mb}"] = self.cluster_memory_mb if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.cluster_source is not None: - body["cluster_source"] = self.cluster_source + body["{cluster_source}"] = self.cluster_source if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode + body["{data_security_mode}"] = self.data_security_mode if self.default_tags: - body["default_tags"] = self.default_tags + body["{default_tags}"] = self.default_tags if self.docker_image: - body["docker_image"] = self.docker_image + body["{docker_image}"] = self.docker_image if self.driver: - body["driver"] = self.driver + body["{driver}"] = self.driver if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.executors: - body["executors"] = self.executors + body["{executors}"] = self.executors if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.jdbc_port is not None: - body["jdbc_port"] = self.jdbc_port + body["{jdbc_port}"] = self.jdbc_port if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.last_restarted_time is not None: - body["last_restarted_time"] = self.last_restarted_time + body["{last_restarted_time}"] = self.last_restarted_time if self.last_state_loss_time is not None: - body["last_state_loss_time"] = self.last_state_loss_time + body["{last_state_loss_time}"] = self.last_state_loss_time if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine + body["{runtime_engine}"] = self.runtime_engine if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_context_id is not None: - body["spark_context_id"] = self.spark_context_id + body["{spark_context_id}"] = self.spark_context_id if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.spec: - body["spec"] = self.spec + body["{spec}"] = self.spec if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.state_message is not None: - body["state_message"] = self.state_message + body["{state_message}"] = self.state_message if self.terminated_time is not None: - body["terminated_time"] = self.terminated_time + body["{terminated_time}"] = self.terminated_time if self.termination_reason: - body["termination_reason"] = self.termination_reason + body["{termination_reason}"] = self.termination_reason if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterDetails: """Deserializes the ClusterDetails from a dictionary.""" return cls( - autoscale=_from_dict(d, "autoscale", AutoScale), - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_cores=d.get("cluster_cores", None), - cluster_id=d.get("cluster_id", None), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_log_status=_from_dict(d, "cluster_log_status", LogSyncStatus), - cluster_memory_mb=d.get("cluster_memory_mb", None), - cluster_name=d.get("cluster_name", None), - cluster_source=_enum(d, "cluster_source", ClusterSource), - creator_user_name=d.get("creator_user_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - default_tags=d.get("default_tags", None), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver=_from_dict(d, "driver", SparkNode), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - executors=_repeated_dict(d, "executors", SparkNode), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - jdbc_port=d.get("jdbc_port", None), - kind=_enum(d, "kind", Kind), - last_restarted_time=d.get("last_restarted_time", None), - last_state_loss_time=d.get("last_state_loss_time", None), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_context_id=d.get("spark_context_id", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - spec=_from_dict(d, "spec", ClusterSpec), - ssh_public_keys=d.get("ssh_public_keys", None), - start_time=d.get("start_time", None), - state=_enum(d, "state", State), - state_message=d.get("state_message", None), - terminated_time=d.get("terminated_time", None), - termination_reason=_from_dict(d, "termination_reason", TerminationReason), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), + autoscale=_from_dict(d, "{autoscale}", AutoScale), + autotermination_minutes=d.get("{autotermination_minutes}", None), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + cluster_cores=d.get("{cluster_cores}", None), + cluster_id=d.get("{cluster_id}", None), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + cluster_log_status=_from_dict(d, "{cluster_log_status}", LogSyncStatus), + cluster_memory_mb=d.get("{cluster_memory_mb}", None), + cluster_name=d.get("{cluster_name}", None), + cluster_source=_enum(d, "{cluster_source}", ClusterSource), + creator_user_name=d.get("{creator_user_name}", None), + custom_tags=d.get("{custom_tags}", None), + data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), + default_tags=d.get("{default_tags}", None), + docker_image=_from_dict(d, "{docker_image}", DockerImage), + driver=_from_dict(d, "{driver}", SparkNode), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + executors=_repeated_dict(d, "{executors}", SparkNode), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + is_single_node=d.get("{is_single_node}", None), + jdbc_port=d.get("{jdbc_port}", None), + kind=_enum(d, "{kind}", Kind), + last_restarted_time=d.get("{last_restarted_time}", None), + last_state_loss_time=d.get("{last_state_loss_time}", None), + node_type_id=d.get("{node_type_id}", None), + num_workers=d.get("{num_workers}", None), + policy_id=d.get("{policy_id}", None), + runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), + single_user_name=d.get("{single_user_name}", None), + spark_conf=d.get("{spark_conf}", None), + spark_context_id=d.get("{spark_context_id}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + spark_version=d.get("{spark_version}", None), + spec=_from_dict(d, "{spec}", ClusterSpec), + ssh_public_keys=d.get("{ssh_public_keys}", None), + start_time=d.get("{start_time}", None), + state=_enum(d, "{state}", State), + state_message=d.get("{state_message}", None), + terminated_time=d.get("{terminated_time}", None), + termination_reason=_from_dict(d, "{termination_reason}", TerminationReason), + use_ml_runtime=d.get("{use_ml_runtime}", None), + workload_type=_from_dict(d, "{workload_type}", WorkloadType), ) @@ -1618,41 +1615,41 @@ def as_dict(self) -> dict: """Serializes the ClusterEvent into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.data_plane_event_details: - body["data_plane_event_details"] = self.data_plane_event_details.as_dict() + body["{data_plane_event_details}"] = self.data_plane_event_details.as_dict() if self.details: - body["details"] = self.details.as_dict() + body["{details}"] = self.details.as_dict() if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the ClusterEvent into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.data_plane_event_details: - body["data_plane_event_details"] = self.data_plane_event_details + body["{data_plane_event_details}"] = self.data_plane_event_details if self.details: - body["details"] = self.details + body["{details}"] = self.details if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterEvent: """Deserializes the ClusterEvent from a dictionary.""" return cls( - cluster_id=d.get("cluster_id", None), - data_plane_event_details=_from_dict(d, "data_plane_event_details", DataPlaneEventDetails), - details=_from_dict(d, "details", EventDetails), - timestamp=d.get("timestamp", None), - type=_enum(d, "type", EventType), + cluster_id=d.get("{cluster_id}", None), + data_plane_event_details=_from_dict(d, "{data_plane_event_details}", DataPlaneEventDetails), + details=_from_dict(d, "{details}", EventDetails), + timestamp=d.get("{timestamp}", None), + type=_enum(d, "{type}", EventType), ) @@ -1668,26 +1665,26 @@ def as_dict(self) -> dict: """Serializes the ClusterLibraryStatuses into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.library_statuses: - body["library_statuses"] = [v.as_dict() for v in self.library_statuses] + body["{library_statuses}"] = [v.as_dict() for v in self.library_statuses] return body def as_shallow_dict(self) -> dict: """Serializes the ClusterLibraryStatuses into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.library_statuses: - body["library_statuses"] = self.library_statuses + body["{library_statuses}"] = self.library_statuses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterLibraryStatuses: """Deserializes the ClusterLibraryStatuses from a dictionary.""" return cls( - cluster_id=d.get("cluster_id", None), - library_statuses=_repeated_dict(d, "library_statuses", LibraryFullStatus), + cluster_id=d.get("{cluster_id}", None), + library_statuses=_repeated_dict(d, "{library_statuses}", LibraryFullStatus), ) @@ -1713,31 +1710,31 @@ def as_dict(self) -> dict: """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() + body["{dbfs}"] = self.dbfs.as_dict() if self.s3: - body["s3"] = self.s3.as_dict() + body["{s3}"] = self.s3.as_dict() if self.volumes: - body["volumes"] = self.volumes.as_dict() + body["{volumes}"] = self.volumes.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" body = {} if self.dbfs: - body["dbfs"] = self.dbfs + body["{dbfs}"] = self.dbfs if self.s3: - body["s3"] = self.s3 + body["{s3}"] = self.s3 if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: """Deserializes the ClusterLogConf from a dictionary.""" return cls( - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), + dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), + s3=_from_dict(d, "{s3}", S3StorageInfo), + volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), ) @@ -1754,31 +1751,31 @@ def as_dict(self) -> dict: """Serializes the ClusterPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermission: """Deserializes the ClusterPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ClusterPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", ClusterPermissionLevel), ) @@ -1802,31 +1799,31 @@ def as_dict(self) -> dict: """Serializes the ClusterPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissions: """Deserializes the ClusterPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ClusterAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ClusterAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -1841,26 +1838,26 @@ def as_dict(self) -> dict: """Serializes the ClusterPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissionsDescription: """Deserializes the ClusterPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ClusterPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", ClusterPermissionLevel), ) @@ -1875,26 +1872,26 @@ def as_dict(self) -> dict: """Serializes the ClusterPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissionsRequest: """Deserializes the ClusterPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ClusterAccessControlRequest), - cluster_id=d.get("cluster_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ClusterAccessControlRequest), + cluster_id=d.get("{cluster_id}", None), ) @@ -1916,36 +1913,36 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyAccessControlRequest: """Deserializes the ClusterPolicyAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", ClusterPolicyPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -1970,41 +1967,41 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyAccessControlResponse: """Deserializes the ClusterPolicyAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", ClusterPolicyPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", ClusterPolicyPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -2021,31 +2018,31 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermission: """Deserializes the ClusterPolicyPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", ClusterPolicyPermissionLevel), ) @@ -2067,31 +2064,31 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissions: """Deserializes the ClusterPolicyPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ClusterPolicyAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ClusterPolicyAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -2106,26 +2103,26 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissionsDescription: """Deserializes the ClusterPolicyPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", ClusterPolicyPermissionLevel), ) @@ -2140,26 +2137,26 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.cluster_policy_id is not None: - body["cluster_policy_id"] = self.cluster_policy_id + body["{cluster_policy_id}"] = self.cluster_policy_id return body def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.cluster_policy_id is not None: - body["cluster_policy_id"] = self.cluster_policy_id + body["{cluster_policy_id}"] = self.cluster_policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissionsRequest: """Deserializes the ClusterPolicyPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ClusterPolicyAccessControlRequest), - cluster_policy_id=d.get("cluster_policy_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ClusterPolicyAccessControlRequest), + cluster_policy_id=d.get("{cluster_policy_id}", None), ) @@ -2185,29 +2182,31 @@ def as_dict(self) -> dict: """Serializes the ClusterSettingsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.field is not None: - body["field"] = self.field + body["{field}"] = self.field if self.new_value is not None: - body["new_value"] = self.new_value + body["{new_value}"] = self.new_value if self.previous_value is not None: - body["previous_value"] = self.previous_value + body["{previous_value}"] = self.previous_value return body def as_shallow_dict(self) -> dict: """Serializes the ClusterSettingsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.field is not None: - body["field"] = self.field + body["{field}"] = self.field if self.new_value is not None: - body["new_value"] = self.new_value + body["{new_value}"] = self.new_value if self.previous_value is not None: - body["previous_value"] = self.previous_value + body["{previous_value}"] = self.previous_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSettingsChange: """Deserializes the ClusterSettingsChange from a dictionary.""" return cls( - field=d.get("field", None), new_value=d.get("new_value", None), previous_value=d.get("previous_value", None) + field=d.get("{field}", None), + new_value=d.get("{new_value}", None), + previous_value=d.get("{previous_value}", None), ) @@ -2231,24 +2230,24 @@ def as_dict(self) -> dict: """Serializes the ClusterSize into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers return body def as_shallow_dict(self) -> dict: """Serializes the ClusterSize into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSize: """Deserializes the ClusterSize from a dictionary.""" - return cls(autoscale=_from_dict(d, "autoscale", AutoScale), num_workers=d.get("num_workers", None)) + return cls(autoscale=_from_dict(d, "{autoscale}", AutoScale), num_workers=d.get("{num_workers}", None)) class ClusterSource(Enum): @@ -2464,166 +2463,166 @@ def as_dict(self) -> dict: """Serializes the ClusterSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value + body["{data_security_mode}"] = self.data_security_mode.value if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() + body["{docker_image}"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value + body["{runtime_engine}"] = self.runtime_engine.value if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() + body["{workload_type}"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode + body["{data_security_mode}"] = self.data_security_mode if self.docker_image: - body["docker_image"] = self.docker_image + body["{docker_image}"] = self.docker_image if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine + body["{runtime_engine}"] = self.runtime_engine if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSpec: """Deserializes the ClusterSpec from a dictionary.""" return cls( - apply_policy_default_values=d.get("apply_policy_default_values", None), - autoscale=_from_dict(d, "autoscale", AutoScale), - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_name=d.get("cluster_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - kind=_enum(d, "kind", Kind), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - ssh_public_keys=d.get("ssh_public_keys", None), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), + apply_policy_default_values=d.get("{apply_policy_default_values}", None), + autoscale=_from_dict(d, "{autoscale}", AutoScale), + autotermination_minutes=d.get("{autotermination_minutes}", None), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + cluster_name=d.get("{cluster_name}", None), + custom_tags=d.get("{custom_tags}", None), + data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), + docker_image=_from_dict(d, "{docker_image}", DockerImage), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + is_single_node=d.get("{is_single_node}", None), + kind=_enum(d, "{kind}", Kind), + node_type_id=d.get("{node_type_id}", None), + num_workers=d.get("{num_workers}", None), + policy_id=d.get("{policy_id}", None), + runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), + single_user_name=d.get("{single_user_name}", None), + spark_conf=d.get("{spark_conf}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + spark_version=d.get("{spark_version}", None), + ssh_public_keys=d.get("{ssh_public_keys}", None), + use_ml_runtime=d.get("{use_ml_runtime}", None), + workload_type=_from_dict(d, "{workload_type}", WorkloadType), ) @@ -2644,36 +2643,36 @@ def as_dict(self) -> dict: """Serializes the Command into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.command is not None: - body["command"] = self.command + body["{command}"] = self.command if self.context_id is not None: - body["contextId"] = self.context_id + body["{context_id}"] = self.context_id if self.language is not None: - body["language"] = self.language.value + body["{language}"] = self.language.value return body def as_shallow_dict(self) -> dict: """Serializes the Command into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.command is not None: - body["command"] = self.command + body["{command}"] = self.command if self.context_id is not None: - body["contextId"] = self.context_id + body["{context_id}"] = self.context_id if self.language is not None: - body["language"] = self.language + body["{language}"] = self.language return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Command: """Deserializes the Command from a dictionary.""" return cls( - cluster_id=d.get("clusterId", None), - command=d.get("command", None), - context_id=d.get("contextId", None), - language=_enum(d, "language", Language), + cluster_id=d.get("{cluster_id}", None), + command=d.get("{command}", None), + context_id=d.get("{context_id}", None), + language=_enum(d, "{language}", Language), ) @@ -2699,29 +2698,31 @@ def as_dict(self) -> dict: """Serializes the CommandStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.results: - body["results"] = self.results.as_dict() + body["{results}"] = self.results.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the CommandStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.results: - body["results"] = self.results + body["{results}"] = self.results if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CommandStatusResponse: """Deserializes the CommandStatusResponse from a dictionary.""" return cls( - id=d.get("id", None), results=_from_dict(d, "results", Results), status=_enum(d, "status", CommandStatus) + id=d.get("{id}", None), + results=_from_dict(d, "{results}", Results), + status=_enum(d, "{status}", CommandStatus), ) @@ -2742,24 +2743,24 @@ def as_dict(self) -> dict: """Serializes the ContextStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the ContextStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ContextStatusResponse: """Deserializes the ContextStatusResponse from a dictionary.""" - return cls(id=d.get("id", None), status=_enum(d, "status", ContextStatus)) + return cls(id=d.get("{id}", None), status=_enum(d, "{status}", ContextStatus)) @dataclass @@ -2963,171 +2964,171 @@ def as_dict(self) -> dict: """Serializes the CreateCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.clone_from: - body["clone_from"] = self.clone_from.as_dict() + body["{clone_from}"] = self.clone_from.as_dict() if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value + body["{data_security_mode}"] = self.data_security_mode.value if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() + body["{docker_image}"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value + body["{runtime_engine}"] = self.runtime_engine.value if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() + body["{workload_type}"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.clone_from: - body["clone_from"] = self.clone_from + body["{clone_from}"] = self.clone_from if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode + body["{data_security_mode}"] = self.data_security_mode if self.docker_image: - body["docker_image"] = self.docker_image + body["{docker_image}"] = self.docker_image if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine + body["{runtime_engine}"] = self.runtime_engine if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCluster: """Deserializes the CreateCluster from a dictionary.""" return cls( - apply_policy_default_values=d.get("apply_policy_default_values", None), - autoscale=_from_dict(d, "autoscale", AutoScale), - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - clone_from=_from_dict(d, "clone_from", CloneCluster), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_name=d.get("cluster_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - kind=_enum(d, "kind", Kind), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - ssh_public_keys=d.get("ssh_public_keys", None), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), + apply_policy_default_values=d.get("{apply_policy_default_values}", None), + autoscale=_from_dict(d, "{autoscale}", AutoScale), + autotermination_minutes=d.get("{autotermination_minutes}", None), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + clone_from=_from_dict(d, "{clone_from}", CloneCluster), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + cluster_name=d.get("{cluster_name}", None), + custom_tags=d.get("{custom_tags}", None), + data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), + docker_image=_from_dict(d, "{docker_image}", DockerImage), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + is_single_node=d.get("{is_single_node}", None), + kind=_enum(d, "{kind}", Kind), + node_type_id=d.get("{node_type_id}", None), + num_workers=d.get("{num_workers}", None), + policy_id=d.get("{policy_id}", None), + runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), + single_user_name=d.get("{single_user_name}", None), + spark_conf=d.get("{spark_conf}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + spark_version=d.get("{spark_version}", None), + ssh_public_keys=d.get("{ssh_public_keys}", None), + use_ml_runtime=d.get("{use_ml_runtime}", None), + workload_type=_from_dict(d, "{workload_type}", WorkloadType), ) @@ -3139,20 +3140,20 @@ def as_dict(self) -> dict: """Serializes the CreateClusterResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateClusterResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateClusterResponse: """Deserializes the CreateClusterResponse from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None)) + return cls(cluster_id=d.get("{cluster_id}", None)) @dataclass @@ -3166,24 +3167,24 @@ def as_dict(self) -> dict: """Serializes the CreateContext into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.language is not None: - body["language"] = self.language.value + body["{language}"] = self.language.value return body def as_shallow_dict(self) -> dict: """Serializes the CreateContext into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.language is not None: - body["language"] = self.language + body["{language}"] = self.language return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateContext: """Deserializes the CreateContext from a dictionary.""" - return cls(cluster_id=d.get("clusterId", None), language=_enum(d, "language", Language)) + return cls(cluster_id=d.get("{cluster_id}", None), language=_enum(d, "{language}", Language)) @dataclass @@ -3252,81 +3253,81 @@ def as_dict(self) -> dict: """Serializes the CreateInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.disk_spec: - body["disk_spec"] = self.disk_spec.as_dict() + body["{disk_spec}"] = self.disk_spec.as_dict() if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.preloaded_docker_images: - body["preloaded_docker_images"] = [v.as_dict() for v in self.preloaded_docker_images] + body["{preloaded_docker_images}"] = [v.as_dict() for v in self.preloaded_docker_images] if self.preloaded_spark_versions: - body["preloaded_spark_versions"] = [v for v in self.preloaded_spark_versions] + body["{preloaded_spark_versions}"] = [v for v in self.preloaded_spark_versions] return body def as_shallow_dict(self) -> dict: """Serializes the CreateInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.disk_spec: - body["disk_spec"] = self.disk_spec + body["{disk_spec}"] = self.disk_spec if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.preloaded_docker_images: - body["preloaded_docker_images"] = self.preloaded_docker_images + body["{preloaded_docker_images}"] = self.preloaded_docker_images if self.preloaded_spark_versions: - body["preloaded_spark_versions"] = self.preloaded_spark_versions + body["{preloaded_spark_versions}"] = self.preloaded_spark_versions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateInstancePool: """Deserializes the CreateInstancePool from a dictionary.""" return cls( - aws_attributes=_from_dict(d, "aws_attributes", InstancePoolAwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", InstancePoolAzureAttributes), - custom_tags=d.get("custom_tags", None), - disk_spec=_from_dict(d, "disk_spec", DiskSpec), - enable_elastic_disk=d.get("enable_elastic_disk", None), - gcp_attributes=_from_dict(d, "gcp_attributes", InstancePoolGcpAttributes), - idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), - instance_pool_name=d.get("instance_pool_name", None), - max_capacity=d.get("max_capacity", None), - min_idle_instances=d.get("min_idle_instances", None), - node_type_id=d.get("node_type_id", None), - preloaded_docker_images=_repeated_dict(d, "preloaded_docker_images", DockerImage), - preloaded_spark_versions=d.get("preloaded_spark_versions", None), + aws_attributes=_from_dict(d, "{aws_attributes}", InstancePoolAwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", InstancePoolAzureAttributes), + custom_tags=d.get("{custom_tags}", None), + disk_spec=_from_dict(d, "{disk_spec}", DiskSpec), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", InstancePoolGcpAttributes), + idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), + instance_pool_name=d.get("{instance_pool_name}", None), + max_capacity=d.get("{max_capacity}", None), + min_idle_instances=d.get("{min_idle_instances}", None), + node_type_id=d.get("{node_type_id}", None), + preloaded_docker_images=_repeated_dict(d, "{preloaded_docker_images}", DockerImage), + preloaded_spark_versions=d.get("{preloaded_spark_versions}", None), ) @@ -3339,20 +3340,20 @@ def as_dict(self) -> dict: """Serializes the CreateInstancePoolResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateInstancePoolResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateInstancePoolResponse: """Deserializes the CreateInstancePoolResponse from a dictionary.""" - return cls(instance_pool_id=d.get("instance_pool_id", None)) + return cls(instance_pool_id=d.get("{instance_pool_id}", None)) @dataclass @@ -3397,51 +3398,51 @@ def as_dict(self) -> dict: """Serializes the CreatePolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.max_clusters_per_user is not None: - body["max_clusters_per_user"] = self.max_clusters_per_user + body["{max_clusters_per_user}"] = self.max_clusters_per_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = self.policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id return body def as_shallow_dict(self) -> dict: """Serializes the CreatePolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.max_clusters_per_user is not None: - body["max_clusters_per_user"] = self.max_clusters_per_user + body["{max_clusters_per_user}"] = self.max_clusters_per_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = self.policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePolicy: """Deserializes the CreatePolicy from a dictionary.""" return cls( - definition=d.get("definition", None), - description=d.get("description", None), - libraries=_repeated_dict(d, "libraries", Library), - max_clusters_per_user=d.get("max_clusters_per_user", None), - name=d.get("name", None), - policy_family_definition_overrides=d.get("policy_family_definition_overrides", None), - policy_family_id=d.get("policy_family_id", None), + definition=d.get("{definition}", None), + description=d.get("{description}", None), + libraries=_repeated_dict(d, "{libraries}", Library), + max_clusters_per_user=d.get("{max_clusters_per_user}", None), + name=d.get("{name}", None), + policy_family_definition_overrides=d.get("{policy_family_definition_overrides}", None), + policy_family_id=d.get("{policy_family_id}", None), ) @@ -3454,20 +3455,20 @@ def as_dict(self) -> dict: """Serializes the CreatePolicyResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body def as_shallow_dict(self) -> dict: """Serializes the CreatePolicyResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePolicyResponse: """Deserializes the CreatePolicyResponse from a dictionary.""" - return cls(policy_id=d.get("policy_id", None)) + return cls(policy_id=d.get("{policy_id}", None)) @dataclass @@ -3479,20 +3480,20 @@ def as_dict(self) -> dict: """Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" - return cls(script_id=d.get("script_id", None)) + return cls(script_id=d.get("{script_id}", None)) @dataclass @@ -3503,20 +3504,20 @@ def as_dict(self) -> dict: """Serializes the Created into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the Created into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Created: """Deserializes the Created from a dictionary.""" - return cls(id=d.get("id", None)) + return cls(id=d.get("{id}", None)) @dataclass @@ -3533,36 +3534,36 @@ def as_dict(self) -> dict: """Serializes the DataPlaneEventDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.event_type is not None: - body["event_type"] = self.event_type.value + body["{event_type}"] = self.event_type.value if self.executor_failures is not None: - body["executor_failures"] = self.executor_failures + body["{executor_failures}"] = self.executor_failures if self.host_id is not None: - body["host_id"] = self.host_id + body["{host_id}"] = self.host_id if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body def as_shallow_dict(self) -> dict: """Serializes the DataPlaneEventDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.event_type is not None: - body["event_type"] = self.event_type + body["{event_type}"] = self.event_type if self.executor_failures is not None: - body["executor_failures"] = self.executor_failures + body["{executor_failures}"] = self.executor_failures if self.host_id is not None: - body["host_id"] = self.host_id + body["{host_id}"] = self.host_id if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataPlaneEventDetails: """Deserializes the DataPlaneEventDetails from a dictionary.""" return cls( - event_type=_enum(d, "event_type", DataPlaneEventDetailsEventType), - executor_failures=d.get("executor_failures", None), - host_id=d.get("host_id", None), - timestamp=d.get("timestamp", None), + event_type=_enum(d, "{event_type}", DataPlaneEventDetailsEventType), + executor_failures=d.get("{executor_failures}", None), + host_id=d.get("{host_id}", None), + timestamp=d.get("{timestamp}", None), ) @@ -3621,20 +3622,20 @@ def as_dict(self) -> dict: """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: """Deserializes the DbfsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -3646,20 +3647,20 @@ def as_dict(self) -> dict: """Serializes the DeleteCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the DeleteCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteCluster: """Deserializes the DeleteCluster from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None)) + return cls(cluster_id=d.get("{cluster_id}", None)) @dataclass @@ -3689,20 +3690,20 @@ def as_dict(self) -> dict: """Serializes the DeleteInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id return body def as_shallow_dict(self) -> dict: """Serializes the DeleteInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteInstancePool: """Deserializes the DeleteInstancePool from a dictionary.""" - return cls(instance_pool_id=d.get("instance_pool_id", None)) + return cls(instance_pool_id=d.get("{instance_pool_id}", None)) @dataclass @@ -3732,20 +3733,20 @@ def as_dict(self) -> dict: """Serializes the DeletePolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body def as_shallow_dict(self) -> dict: """Serializes the DeletePolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeletePolicy: """Deserializes the DeletePolicy from a dictionary.""" - return cls(policy_id=d.get("policy_id", None)) + return cls(policy_id=d.get("{policy_id}", None)) @dataclass @@ -3794,24 +3795,24 @@ def as_dict(self) -> dict: """Serializes the DestroyContext into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.context_id is not None: - body["contextId"] = self.context_id + body["{context_id}"] = self.context_id return body def as_shallow_dict(self) -> dict: """Serializes the DestroyContext into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["clusterId"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.context_id is not None: - body["contextId"] = self.context_id + body["{context_id}"] = self.context_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DestroyContext: """Deserializes the DestroyContext from a dictionary.""" - return cls(cluster_id=d.get("clusterId", None), context_id=d.get("contextId", None)) + return cls(cluster_id=d.get("{cluster_id}", None), context_id=d.get("{context_id}", None)) @dataclass @@ -3872,41 +3873,41 @@ def as_dict(self) -> dict: """Serializes the DiskSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.disk_count is not None: - body["disk_count"] = self.disk_count + body["{disk_count}"] = self.disk_count if self.disk_iops is not None: - body["disk_iops"] = self.disk_iops + body["{disk_iops}"] = self.disk_iops if self.disk_size is not None: - body["disk_size"] = self.disk_size + body["{disk_size}"] = self.disk_size if self.disk_throughput is not None: - body["disk_throughput"] = self.disk_throughput + body["{disk_throughput}"] = self.disk_throughput if self.disk_type: - body["disk_type"] = self.disk_type.as_dict() + body["{disk_type}"] = self.disk_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the DiskSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.disk_count is not None: - body["disk_count"] = self.disk_count + body["{disk_count}"] = self.disk_count if self.disk_iops is not None: - body["disk_iops"] = self.disk_iops + body["{disk_iops}"] = self.disk_iops if self.disk_size is not None: - body["disk_size"] = self.disk_size + body["{disk_size}"] = self.disk_size if self.disk_throughput is not None: - body["disk_throughput"] = self.disk_throughput + body["{disk_throughput}"] = self.disk_throughput if self.disk_type: - body["disk_type"] = self.disk_type + body["{disk_type}"] = self.disk_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DiskSpec: """Deserializes the DiskSpec from a dictionary.""" return cls( - disk_count=d.get("disk_count", None), - disk_iops=d.get("disk_iops", None), - disk_size=d.get("disk_size", None), - disk_throughput=d.get("disk_throughput", None), - disk_type=_from_dict(d, "disk_type", DiskType), + disk_count=d.get("{disk_count}", None), + disk_iops=d.get("{disk_iops}", None), + disk_size=d.get("{disk_size}", None), + disk_throughput=d.get("{disk_throughput}", None), + disk_type=_from_dict(d, "{disk_type}", DiskType), ) @@ -3926,26 +3927,26 @@ def as_dict(self) -> dict: """Serializes the DiskType into a dictionary suitable for use as a JSON request body.""" body = {} if self.azure_disk_volume_type is not None: - body["azure_disk_volume_type"] = self.azure_disk_volume_type.value + body["{azure_disk_volume_type}"] = self.azure_disk_volume_type.value if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type.value + body["{ebs_volume_type}"] = self.ebs_volume_type.value return body def as_shallow_dict(self) -> dict: """Serializes the DiskType into a shallow dictionary of its immediate attributes.""" body = {} if self.azure_disk_volume_type is not None: - body["azure_disk_volume_type"] = self.azure_disk_volume_type + body["{azure_disk_volume_type}"] = self.azure_disk_volume_type if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type + body["{ebs_volume_type}"] = self.ebs_volume_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DiskType: """Deserializes the DiskType from a dictionary.""" return cls( - azure_disk_volume_type=_enum(d, "azure_disk_volume_type", DiskTypeAzureDiskVolumeType), - ebs_volume_type=_enum(d, "ebs_volume_type", DiskTypeEbsVolumeType), + azure_disk_volume_type=_enum(d, "{azure_disk_volume_type}", DiskTypeAzureDiskVolumeType), + ebs_volume_type=_enum(d, "{ebs_volume_type}", DiskTypeEbsVolumeType), ) @@ -3977,24 +3978,24 @@ def as_dict(self) -> dict: """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" body = {} if self.password is not None: - body["password"] = self.password + body["{password}"] = self.password if self.username is not None: - body["username"] = self.username + body["{username}"] = self.username return body def as_shallow_dict(self) -> dict: """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" body = {} if self.password is not None: - body["password"] = self.password + body["{password}"] = self.password if self.username is not None: - body["username"] = self.username + body["{username}"] = self.username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: """Deserializes the DockerBasicAuth from a dictionary.""" - return cls(password=d.get("password", None), username=d.get("username", None)) + return cls(password=d.get("{password}", None), username=d.get("{username}", None)) @dataclass @@ -4009,24 +4010,24 @@ def as_dict(self) -> dict: """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" body = {} if self.basic_auth: - body["basic_auth"] = self.basic_auth.as_dict() + body["{basic_auth}"] = self.basic_auth.as_dict() if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" body = {} if self.basic_auth: - body["basic_auth"] = self.basic_auth + body["{basic_auth}"] = self.basic_auth if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DockerImage: """Deserializes the DockerImage from a dictionary.""" - return cls(basic_auth=_from_dict(d, "basic_auth", DockerBasicAuth), url=d.get("url", None)) + return cls(basic_auth=_from_dict(d, "{basic_auth}", DockerBasicAuth), url=d.get("{url}", None)) class EbsVolumeType(Enum): @@ -4237,171 +4238,171 @@ def as_dict(self) -> dict: """Serializes the EditCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value + body["{data_security_mode}"] = self.data_security_mode.value if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() + body["{docker_image}"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value + body["{runtime_engine}"] = self.runtime_engine.value if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() + body["{workload_type}"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EditCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode + body["{data_security_mode}"] = self.data_security_mode if self.docker_image: - body["docker_image"] = self.docker_image + body["{docker_image}"] = self.docker_image if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine + body["{runtime_engine}"] = self.runtime_engine if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditCluster: """Deserializes the EditCluster from a dictionary.""" return cls( - apply_policy_default_values=d.get("apply_policy_default_values", None), - autoscale=_from_dict(d, "autoscale", AutoScale), - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_id=d.get("cluster_id", None), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_name=d.get("cluster_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - kind=_enum(d, "kind", Kind), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - ssh_public_keys=d.get("ssh_public_keys", None), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), + apply_policy_default_values=d.get("{apply_policy_default_values}", None), + autoscale=_from_dict(d, "{autoscale}", AutoScale), + autotermination_minutes=d.get("{autotermination_minutes}", None), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + cluster_id=d.get("{cluster_id}", None), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + cluster_name=d.get("{cluster_name}", None), + custom_tags=d.get("{custom_tags}", None), + data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), + docker_image=_from_dict(d, "{docker_image}", DockerImage), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + is_single_node=d.get("{is_single_node}", None), + kind=_enum(d, "{kind}", Kind), + node_type_id=d.get("{node_type_id}", None), + num_workers=d.get("{num_workers}", None), + policy_id=d.get("{policy_id}", None), + runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), + single_user_name=d.get("{single_user_name}", None), + spark_conf=d.get("{spark_conf}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + spark_version=d.get("{spark_version}", None), + ssh_public_keys=d.get("{ssh_public_keys}", None), + use_ml_runtime=d.get("{use_ml_runtime}", None), + workload_type=_from_dict(d, "{workload_type}", WorkloadType), ) @@ -4463,51 +4464,51 @@ def as_dict(self) -> dict: """Serializes the EditInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id return body def as_shallow_dict(self) -> dict: """Serializes the EditInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditInstancePool: """Deserializes the EditInstancePool from a dictionary.""" return cls( - custom_tags=d.get("custom_tags", None), - idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), - instance_pool_id=d.get("instance_pool_id", None), - instance_pool_name=d.get("instance_pool_name", None), - max_capacity=d.get("max_capacity", None), - min_idle_instances=d.get("min_idle_instances", None), - node_type_id=d.get("node_type_id", None), + custom_tags=d.get("{custom_tags}", None), + idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), + instance_pool_id=d.get("{instance_pool_id}", None), + instance_pool_name=d.get("{instance_pool_name}", None), + max_capacity=d.get("{max_capacity}", None), + min_idle_instances=d.get("{min_idle_instances}", None), + node_type_id=d.get("{node_type_id}", None), ) @@ -4574,56 +4575,56 @@ def as_dict(self) -> dict: """Serializes the EditPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.max_clusters_per_user is not None: - body["max_clusters_per_user"] = self.max_clusters_per_user + body["{max_clusters_per_user}"] = self.max_clusters_per_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = self.policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body def as_shallow_dict(self) -> dict: """Serializes the EditPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.max_clusters_per_user is not None: - body["max_clusters_per_user"] = self.max_clusters_per_user + body["{max_clusters_per_user}"] = self.max_clusters_per_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = self.policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditPolicy: """Deserializes the EditPolicy from a dictionary.""" return cls( - definition=d.get("definition", None), - description=d.get("description", None), - libraries=_repeated_dict(d, "libraries", Library), - max_clusters_per_user=d.get("max_clusters_per_user", None), - name=d.get("name", None), - policy_family_definition_overrides=d.get("policy_family_definition_overrides", None), - policy_family_id=d.get("policy_family_id", None), - policy_id=d.get("policy_id", None), + definition=d.get("{definition}", None), + description=d.get("{description}", None), + libraries=_repeated_dict(d, "{libraries}", Library), + max_clusters_per_user=d.get("{max_clusters_per_user}", None), + name=d.get("{name}", None), + policy_family_definition_overrides=d.get("{policy_family_definition_overrides}", None), + policy_family_id=d.get("{policy_family_id}", None), + policy_id=d.get("{policy_id}", None), ) @@ -4676,24 +4677,24 @@ def as_dict(self) -> dict: """Serializes the EnforceClusterComplianceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body def as_shallow_dict(self) -> dict: """Serializes the EnforceClusterComplianceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforceClusterComplianceRequest: """Deserializes the EnforceClusterComplianceRequest from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None), validate_only=d.get("validate_only", None)) + return cls(cluster_id=d.get("{cluster_id}", None), validate_only=d.get("{validate_only}", None)) @dataclass @@ -4710,24 +4711,26 @@ def as_dict(self) -> dict: """Serializes the EnforceClusterComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.changes: - body["changes"] = [v.as_dict() for v in self.changes] + body["{changes}"] = [v.as_dict() for v in self.changes] if self.has_changes is not None: - body["has_changes"] = self.has_changes + body["{has_changes}"] = self.has_changes return body def as_shallow_dict(self) -> dict: """Serializes the EnforceClusterComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.changes: - body["changes"] = self.changes + body["{changes}"] = self.changes if self.has_changes is not None: - body["has_changes"] = self.has_changes + body["{has_changes}"] = self.has_changes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforceClusterComplianceResponse: """Deserializes the EnforceClusterComplianceResponse from a dictionary.""" - return cls(changes=_repeated_dict(d, "changes", ClusterSettingsChange), has_changes=d.get("has_changes", None)) + return cls( + changes=_repeated_dict(d, "{changes}", ClusterSettingsChange), has_changes=d.get("{has_changes}", None) + ) @dataclass @@ -4797,116 +4800,116 @@ def as_dict(self) -> dict: """Serializes the EventDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.attributes: - body["attributes"] = self.attributes.as_dict() + body["{attributes}"] = self.attributes.as_dict() if self.cause is not None: - body["cause"] = self.cause.value + body["{cause}"] = self.cause.value if self.cluster_size: - body["cluster_size"] = self.cluster_size.as_dict() + body["{cluster_size}"] = self.cluster_size.as_dict() if self.current_num_vcpus is not None: - body["current_num_vcpus"] = self.current_num_vcpus + body["{current_num_vcpus}"] = self.current_num_vcpus if self.current_num_workers is not None: - body["current_num_workers"] = self.current_num_workers + body["{current_num_workers}"] = self.current_num_workers if self.did_not_expand_reason is not None: - body["did_not_expand_reason"] = self.did_not_expand_reason + body["{did_not_expand_reason}"] = self.did_not_expand_reason if self.disk_size is not None: - body["disk_size"] = self.disk_size + body["{disk_size}"] = self.disk_size if self.driver_state_message is not None: - body["driver_state_message"] = self.driver_state_message + body["{driver_state_message}"] = self.driver_state_message if self.enable_termination_for_node_blocklisted is not None: - body["enable_termination_for_node_blocklisted"] = self.enable_termination_for_node_blocklisted + body["{enable_termination_for_node_blocklisted}"] = self.enable_termination_for_node_blocklisted if self.free_space is not None: - body["free_space"] = self.free_space + body["{free_space}"] = self.free_space if self.init_scripts: - body["init_scripts"] = self.init_scripts.as_dict() + body["{init_scripts}"] = self.init_scripts.as_dict() if self.instance_id is not None: - body["instance_id"] = self.instance_id + body["{instance_id}"] = self.instance_id if self.job_run_name is not None: - body["job_run_name"] = self.job_run_name + body["{job_run_name}"] = self.job_run_name if self.previous_attributes: - body["previous_attributes"] = self.previous_attributes.as_dict() + body["{previous_attributes}"] = self.previous_attributes.as_dict() if self.previous_cluster_size: - body["previous_cluster_size"] = self.previous_cluster_size.as_dict() + body["{previous_cluster_size}"] = self.previous_cluster_size.as_dict() if self.previous_disk_size is not None: - body["previous_disk_size"] = self.previous_disk_size + body["{previous_disk_size}"] = self.previous_disk_size if self.reason: - body["reason"] = self.reason.as_dict() + body["{reason}"] = self.reason.as_dict() if self.target_num_vcpus is not None: - body["target_num_vcpus"] = self.target_num_vcpus + body["{target_num_vcpus}"] = self.target_num_vcpus if self.target_num_workers is not None: - body["target_num_workers"] = self.target_num_workers + body["{target_num_workers}"] = self.target_num_workers if self.user is not None: - body["user"] = self.user + body["{user}"] = self.user return body def as_shallow_dict(self) -> dict: """Serializes the EventDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.attributes: - body["attributes"] = self.attributes + body["{attributes}"] = self.attributes if self.cause is not None: - body["cause"] = self.cause + body["{cause}"] = self.cause if self.cluster_size: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.current_num_vcpus is not None: - body["current_num_vcpus"] = self.current_num_vcpus + body["{current_num_vcpus}"] = self.current_num_vcpus if self.current_num_workers is not None: - body["current_num_workers"] = self.current_num_workers + body["{current_num_workers}"] = self.current_num_workers if self.did_not_expand_reason is not None: - body["did_not_expand_reason"] = self.did_not_expand_reason + body["{did_not_expand_reason}"] = self.did_not_expand_reason if self.disk_size is not None: - body["disk_size"] = self.disk_size + body["{disk_size}"] = self.disk_size if self.driver_state_message is not None: - body["driver_state_message"] = self.driver_state_message + body["{driver_state_message}"] = self.driver_state_message if self.enable_termination_for_node_blocklisted is not None: - body["enable_termination_for_node_blocklisted"] = self.enable_termination_for_node_blocklisted + body["{enable_termination_for_node_blocklisted}"] = self.enable_termination_for_node_blocklisted if self.free_space is not None: - body["free_space"] = self.free_space + body["{free_space}"] = self.free_space if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_id is not None: - body["instance_id"] = self.instance_id + body["{instance_id}"] = self.instance_id if self.job_run_name is not None: - body["job_run_name"] = self.job_run_name + body["{job_run_name}"] = self.job_run_name if self.previous_attributes: - body["previous_attributes"] = self.previous_attributes + body["{previous_attributes}"] = self.previous_attributes if self.previous_cluster_size: - body["previous_cluster_size"] = self.previous_cluster_size + body["{previous_cluster_size}"] = self.previous_cluster_size if self.previous_disk_size is not None: - body["previous_disk_size"] = self.previous_disk_size + body["{previous_disk_size}"] = self.previous_disk_size if self.reason: - body["reason"] = self.reason + body["{reason}"] = self.reason if self.target_num_vcpus is not None: - body["target_num_vcpus"] = self.target_num_vcpus + body["{target_num_vcpus}"] = self.target_num_vcpus if self.target_num_workers is not None: - body["target_num_workers"] = self.target_num_workers + body["{target_num_workers}"] = self.target_num_workers if self.user is not None: - body["user"] = self.user + body["{user}"] = self.user return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EventDetails: """Deserializes the EventDetails from a dictionary.""" return cls( - attributes=_from_dict(d, "attributes", ClusterAttributes), - cause=_enum(d, "cause", EventDetailsCause), - cluster_size=_from_dict(d, "cluster_size", ClusterSize), - current_num_vcpus=d.get("current_num_vcpus", None), - current_num_workers=d.get("current_num_workers", None), - did_not_expand_reason=d.get("did_not_expand_reason", None), - disk_size=d.get("disk_size", None), - driver_state_message=d.get("driver_state_message", None), - enable_termination_for_node_blocklisted=d.get("enable_termination_for_node_blocklisted", None), - free_space=d.get("free_space", None), - init_scripts=_from_dict(d, "init_scripts", InitScriptEventDetails), - instance_id=d.get("instance_id", None), - job_run_name=d.get("job_run_name", None), - previous_attributes=_from_dict(d, "previous_attributes", ClusterAttributes), - previous_cluster_size=_from_dict(d, "previous_cluster_size", ClusterSize), - previous_disk_size=d.get("previous_disk_size", None), - reason=_from_dict(d, "reason", TerminationReason), - target_num_vcpus=d.get("target_num_vcpus", None), - target_num_workers=d.get("target_num_workers", None), - user=d.get("user", None), + attributes=_from_dict(d, "{attributes}", ClusterAttributes), + cause=_enum(d, "{cause}", EventDetailsCause), + cluster_size=_from_dict(d, "{cluster_size}", ClusterSize), + current_num_vcpus=d.get("{current_num_vcpus}", None), + current_num_workers=d.get("{current_num_workers}", None), + did_not_expand_reason=d.get("{did_not_expand_reason}", None), + disk_size=d.get("{disk_size}", None), + driver_state_message=d.get("{driver_state_message}", None), + enable_termination_for_node_blocklisted=d.get("{enable_termination_for_node_blocklisted}", None), + free_space=d.get("{free_space}", None), + init_scripts=_from_dict(d, "{init_scripts}", InitScriptEventDetails), + instance_id=d.get("{instance_id}", None), + job_run_name=d.get("{job_run_name}", None), + previous_attributes=_from_dict(d, "{previous_attributes}", ClusterAttributes), + previous_cluster_size=_from_dict(d, "{previous_cluster_size}", ClusterSize), + previous_disk_size=d.get("{previous_disk_size}", None), + reason=_from_dict(d, "{reason}", TerminationReason), + target_num_vcpus=d.get("{target_num_vcpus}", None), + target_num_workers=d.get("{target_num_workers}", None), + user=d.get("{user}", None), ) @@ -4991,46 +4994,46 @@ def as_dict(self) -> dict: """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size + body["{boot_disk_size}"] = self.boot_disk_size if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors + body["{use_preemptible_executors}"] = self.use_preemptible_executors if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size + body["{boot_disk_size}"] = self.boot_disk_size if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors + body["{use_preemptible_executors}"] = self.use_preemptible_executors if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: """Deserializes the GcpAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", GcpAvailability), - boot_disk_size=d.get("boot_disk_size", None), - google_service_account=d.get("google_service_account", None), - local_ssd_count=d.get("local_ssd_count", None), - use_preemptible_executors=d.get("use_preemptible_executors", None), - zone_id=d.get("zone_id", None), + availability=_enum(d, "{availability}", GcpAvailability), + boot_disk_size=d.get("{boot_disk_size}", None), + google_service_account=d.get("{google_service_account}", None), + local_ssd_count=d.get("{local_ssd_count}", None), + use_preemptible_executors=d.get("{use_preemptible_executors}", None), + zone_id=d.get("{zone_id}", None), ) @@ -5054,20 +5057,20 @@ def as_dict(self) -> dict: """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: """Deserializes the GcsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -5085,24 +5088,24 @@ def as_dict(self) -> dict: """Serializes the GetClusterComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body def as_shallow_dict(self) -> dict: """Serializes the GetClusterComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetClusterComplianceResponse: """Deserializes the GetClusterComplianceResponse from a dictionary.""" - return cls(is_compliant=d.get("is_compliant", None), violations=d.get("violations", None)) + return cls(is_compliant=d.get("{is_compliant}", None), violations=d.get("{violations}", None)) @dataclass @@ -5114,20 +5117,20 @@ def as_dict(self) -> dict: """Serializes the GetClusterPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetClusterPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetClusterPermissionLevelsResponse: """Deserializes the GetClusterPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ClusterPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ClusterPermissionsDescription)) @dataclass @@ -5139,20 +5142,20 @@ def as_dict(self) -> dict: """Serializes the GetClusterPolicyPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetClusterPolicyPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetClusterPolicyPermissionLevelsResponse: """Deserializes the GetClusterPolicyPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ClusterPolicyPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ClusterPolicyPermissionsDescription)) @dataclass @@ -5185,51 +5188,51 @@ def as_dict(self) -> dict: """Serializes the GetEvents into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.event_types: - body["event_types"] = [v.value for v in self.event_types] + body["{event_types}"] = [v.value for v in self.event_types] if self.limit is not None: - body["limit"] = self.limit + body["{limit}"] = self.limit if self.offset is not None: - body["offset"] = self.offset + body["{offset}"] = self.offset if self.order is not None: - body["order"] = self.order.value + body["{order}"] = self.order.value if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time return body def as_shallow_dict(self) -> dict: """Serializes the GetEvents into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.event_types: - body["event_types"] = self.event_types + body["{event_types}"] = self.event_types if self.limit is not None: - body["limit"] = self.limit + body["{limit}"] = self.limit if self.offset is not None: - body["offset"] = self.offset + body["{offset}"] = self.offset if self.order is not None: - body["order"] = self.order + body["{order}"] = self.order if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetEvents: """Deserializes the GetEvents from a dictionary.""" return cls( - cluster_id=d.get("cluster_id", None), - end_time=d.get("end_time", None), - event_types=_repeated_enum(d, "event_types", EventType), - limit=d.get("limit", None), - offset=d.get("offset", None), - order=_enum(d, "order", GetEventsOrder), - start_time=d.get("start_time", None), + cluster_id=d.get("{cluster_id}", None), + end_time=d.get("{end_time}", None), + event_types=_repeated_enum(d, "{event_types}", EventType), + limit=d.get("{limit}", None), + offset=d.get("{offset}", None), + order=_enum(d, "{order}", GetEventsOrder), + start_time=d.get("{start_time}", None), ) @@ -5254,31 +5257,31 @@ def as_dict(self) -> dict: """Serializes the GetEventsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.events: - body["events"] = [v.as_dict() for v in self.events] + body["{events}"] = [v.as_dict() for v in self.events] if self.next_page: - body["next_page"] = self.next_page.as_dict() + body["{next_page}"] = self.next_page.as_dict() if self.total_count is not None: - body["total_count"] = self.total_count + body["{total_count}"] = self.total_count return body def as_shallow_dict(self) -> dict: """Serializes the GetEventsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.events: - body["events"] = self.events + body["{events}"] = self.events if self.next_page: - body["next_page"] = self.next_page + body["{next_page}"] = self.next_page if self.total_count is not None: - body["total_count"] = self.total_count + body["{total_count}"] = self.total_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetEventsResponse: """Deserializes the GetEventsResponse from a dictionary.""" return cls( - events=_repeated_dict(d, "events", ClusterEvent), - next_page=_from_dict(d, "next_page", GetEvents), - total_count=d.get("total_count", None), + events=_repeated_dict(d, "{events}", ClusterEvent), + next_page=_from_dict(d, "{next_page}", GetEvents), + total_count=d.get("{total_count}", None), ) @@ -5371,106 +5374,106 @@ def as_dict(self) -> dict: """Serializes the GetInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.default_tags: - body["default_tags"] = self.default_tags + body["{default_tags}"] = self.default_tags if self.disk_spec: - body["disk_spec"] = self.disk_spec.as_dict() + body["{disk_spec}"] = self.disk_spec.as_dict() if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.preloaded_docker_images: - body["preloaded_docker_images"] = [v.as_dict() for v in self.preloaded_docker_images] + body["{preloaded_docker_images}"] = [v.as_dict() for v in self.preloaded_docker_images] if self.preloaded_spark_versions: - body["preloaded_spark_versions"] = [v for v in self.preloaded_spark_versions] + body["{preloaded_spark_versions}"] = [v for v in self.preloaded_spark_versions] if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.stats: - body["stats"] = self.stats.as_dict() + body["{stats}"] = self.stats.as_dict() if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.default_tags: - body["default_tags"] = self.default_tags + body["{default_tags}"] = self.default_tags if self.disk_spec: - body["disk_spec"] = self.disk_spec + body["{disk_spec}"] = self.disk_spec if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.preloaded_docker_images: - body["preloaded_docker_images"] = self.preloaded_docker_images + body["{preloaded_docker_images}"] = self.preloaded_docker_images if self.preloaded_spark_versions: - body["preloaded_spark_versions"] = self.preloaded_spark_versions + body["{preloaded_spark_versions}"] = self.preloaded_spark_versions if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.stats: - body["stats"] = self.stats + body["{stats}"] = self.stats if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetInstancePool: """Deserializes the GetInstancePool from a dictionary.""" return cls( - aws_attributes=_from_dict(d, "aws_attributes", InstancePoolAwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", InstancePoolAzureAttributes), - custom_tags=d.get("custom_tags", None), - default_tags=d.get("default_tags", None), - disk_spec=_from_dict(d, "disk_spec", DiskSpec), - enable_elastic_disk=d.get("enable_elastic_disk", None), - gcp_attributes=_from_dict(d, "gcp_attributes", InstancePoolGcpAttributes), - idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), - instance_pool_id=d.get("instance_pool_id", None), - instance_pool_name=d.get("instance_pool_name", None), - max_capacity=d.get("max_capacity", None), - min_idle_instances=d.get("min_idle_instances", None), - node_type_id=d.get("node_type_id", None), - preloaded_docker_images=_repeated_dict(d, "preloaded_docker_images", DockerImage), - preloaded_spark_versions=d.get("preloaded_spark_versions", None), - state=_enum(d, "state", InstancePoolState), - stats=_from_dict(d, "stats", InstancePoolStats), - status=_from_dict(d, "status", InstancePoolStatus), + aws_attributes=_from_dict(d, "{aws_attributes}", InstancePoolAwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", InstancePoolAzureAttributes), + custom_tags=d.get("{custom_tags}", None), + default_tags=d.get("{default_tags}", None), + disk_spec=_from_dict(d, "{disk_spec}", DiskSpec), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", InstancePoolGcpAttributes), + idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), + instance_pool_id=d.get("{instance_pool_id}", None), + instance_pool_name=d.get("{instance_pool_name}", None), + max_capacity=d.get("{max_capacity}", None), + min_idle_instances=d.get("{min_idle_instances}", None), + node_type_id=d.get("{node_type_id}", None), + preloaded_docker_images=_repeated_dict(d, "{preloaded_docker_images}", DockerImage), + preloaded_spark_versions=d.get("{preloaded_spark_versions}", None), + state=_enum(d, "{state}", InstancePoolState), + stats=_from_dict(d, "{stats}", InstancePoolStats), + status=_from_dict(d, "{status}", InstancePoolStatus), ) @@ -5483,20 +5486,20 @@ def as_dict(self) -> dict: """Serializes the GetInstancePoolPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetInstancePoolPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetInstancePoolPermissionLevelsResponse: """Deserializes the GetInstancePoolPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", InstancePoolPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", InstancePoolPermissionsDescription)) @dataclass @@ -5508,20 +5511,20 @@ def as_dict(self) -> dict: """Serializes the GetSparkVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.versions: - body["versions"] = [v.as_dict() for v in self.versions] + body["{versions}"] = [v.as_dict() for v in self.versions] return body def as_shallow_dict(self) -> dict: """Serializes the GetSparkVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.versions: - body["versions"] = self.versions + body["{versions}"] = self.versions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetSparkVersionsResponse: """Deserializes the GetSparkVersionsResponse from a dictionary.""" - return cls(versions=_repeated_dict(d, "versions", SparkVersion)) + return cls(versions=_repeated_dict(d, "{versions}", SparkVersion)) @dataclass @@ -5550,36 +5553,36 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptCreateRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script is not None: - body["script"] = self.script + body["{script}"] = self.script return body def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptCreateRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script is not None: - body["script"] = self.script + body["{script}"] = self.script return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptCreateRequest: """Deserializes the GlobalInitScriptCreateRequest from a dictionary.""" return cls( - enabled=d.get("enabled", None), - name=d.get("name", None), - position=d.get("position", None), - script=d.get("script", None), + enabled=d.get("{enabled}", None), + name=d.get("{name}", None), + position=d.get("{position}", None), + script=d.get("{script}", None), ) @@ -5614,56 +5617,56 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptDetails: """Deserializes the GlobalInitScriptDetails from a dictionary.""" return cls( - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - enabled=d.get("enabled", None), - name=d.get("name", None), - position=d.get("position", None), - script_id=d.get("script_id", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + enabled=d.get("{enabled}", None), + name=d.get("{name}", None), + position=d.get("{position}", None), + script_id=d.get("{script_id}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -5701,61 +5704,61 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptDetailsWithContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script is not None: - body["script"] = self.script + body["{script}"] = self.script if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptDetailsWithContent into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script is not None: - body["script"] = self.script + body["{script}"] = self.script if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptDetailsWithContent: """Deserializes the GlobalInitScriptDetailsWithContent from a dictionary.""" return cls( - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - enabled=d.get("enabled", None), - name=d.get("name", None), - position=d.get("position", None), - script=d.get("script", None), - script_id=d.get("script_id", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + enabled=d.get("{enabled}", None), + name=d.get("{name}", None), + position=d.get("{position}", None), + script=d.get("{script}", None), + script_id=d.get("{script_id}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -5788,41 +5791,41 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptUpdateRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script is not None: - body["script"] = self.script + body["{script}"] = self.script if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id return body def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptUpdateRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.script is not None: - body["script"] = self.script + body["{script}"] = self.script if self.script_id is not None: - body["script_id"] = self.script_id + body["{script_id}"] = self.script_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptUpdateRequest: """Deserializes the GlobalInitScriptUpdateRequest from a dictionary.""" return cls( - enabled=d.get("enabled", None), - name=d.get("name", None), - position=d.get("position", None), - script=d.get("script", None), - script_id=d.get("script_id", None), + enabled=d.get("{enabled}", None), + name=d.get("{name}", None), + position=d.get("{position}", None), + script=d.get("{script}", None), + script_id=d.get("{script_id}", None), ) @@ -5845,31 +5848,31 @@ def as_dict(self) -> dict: """Serializes the InitScriptEventDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster: - body["cluster"] = [v.as_dict() for v in self.cluster] + body["{cluster}"] = [v.as_dict() for v in self.cluster] if self.global_: - body["global"] = [v.as_dict() for v in self.global_] + body["{global}"] = [v.as_dict() for v in self.global_] if self.reported_for_node is not None: - body["reported_for_node"] = self.reported_for_node + body["{reported_for_node}"] = self.reported_for_node return body def as_shallow_dict(self) -> dict: """Serializes the InitScriptEventDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster: - body["cluster"] = self.cluster + body["{cluster}"] = self.cluster if self.global_: - body["global"] = self.global_ + body["{global}"] = self.global_ if self.reported_for_node is not None: - body["reported_for_node"] = self.reported_for_node + body["{reported_for_node}"] = self.reported_for_node return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptEventDetails: """Deserializes the InitScriptEventDetails from a dictionary.""" return cls( - cluster=_repeated_dict(d, "cluster", InitScriptInfoAndExecutionDetails), - global_=_repeated_dict(d, "global", InitScriptInfoAndExecutionDetails), - reported_for_node=d.get("reported_for_node", None), + cluster=_repeated_dict(d, "{cluster}", InitScriptInfoAndExecutionDetails), + global_=_repeated_dict(d, "{global}", InitScriptInfoAndExecutionDetails), + reported_for_node=d.get("{reported_for_node}", None), ) @@ -5921,51 +5924,51 @@ def as_dict(self) -> dict: """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.abfss: - body["abfss"] = self.abfss.as_dict() + body["{abfss}"] = self.abfss.as_dict() if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() + body["{dbfs}"] = self.dbfs.as_dict() if self.file: - body["file"] = self.file.as_dict() + body["{file}"] = self.file.as_dict() if self.gcs: - body["gcs"] = self.gcs.as_dict() + body["{gcs}"] = self.gcs.as_dict() if self.s3: - body["s3"] = self.s3.as_dict() + body["{s3}"] = self.s3.as_dict() if self.volumes: - body["volumes"] = self.volumes.as_dict() + body["{volumes}"] = self.volumes.as_dict() if self.workspace: - body["workspace"] = self.workspace.as_dict() + body["{workspace}"] = self.workspace.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.abfss: - body["abfss"] = self.abfss + body["{abfss}"] = self.abfss if self.dbfs: - body["dbfs"] = self.dbfs + body["{dbfs}"] = self.dbfs if self.file: - body["file"] = self.file + body["{file}"] = self.file if self.gcs: - body["gcs"] = self.gcs + body["{gcs}"] = self.gcs if self.s3: - body["s3"] = self.s3 + body["{s3}"] = self.s3 if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes if self.workspace: - body["workspace"] = self.workspace + body["{workspace}"] = self.workspace return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: """Deserializes the InitScriptInfo from a dictionary.""" return cls( - abfss=_from_dict(d, "abfss", Adlsgen2Info), - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - file=_from_dict(d, "file", LocalFileInfo), - gcs=_from_dict(d, "gcs", GcsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), - workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), + abfss=_from_dict(d, "{abfss}", Adlsgen2Info), + dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), + file=_from_dict(d, "{file}", LocalFileInfo), + gcs=_from_dict(d, "{gcs}", GcsStorageInfo), + s3=_from_dict(d, "{s3}", S3StorageInfo), + volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), + workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), ) @@ -6014,66 +6017,66 @@ def as_dict(self) -> dict: """Serializes the InitScriptInfoAndExecutionDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.abfss: - body["abfss"] = self.abfss.as_dict() + body["{abfss}"] = self.abfss.as_dict() if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() + body["{dbfs}"] = self.dbfs.as_dict() if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.execution_duration_seconds is not None: - body["execution_duration_seconds"] = self.execution_duration_seconds + body["{execution_duration_seconds}"] = self.execution_duration_seconds if self.file: - body["file"] = self.file.as_dict() + body["{file}"] = self.file.as_dict() if self.gcs: - body["gcs"] = self.gcs.as_dict() + body["{gcs}"] = self.gcs.as_dict() if self.s3: - body["s3"] = self.s3.as_dict() + body["{s3}"] = self.s3.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.volumes: - body["volumes"] = self.volumes.as_dict() + body["{volumes}"] = self.volumes.as_dict() if self.workspace: - body["workspace"] = self.workspace.as_dict() + body["{workspace}"] = self.workspace.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the InitScriptInfoAndExecutionDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.abfss: - body["abfss"] = self.abfss + body["{abfss}"] = self.abfss if self.dbfs: - body["dbfs"] = self.dbfs + body["{dbfs}"] = self.dbfs if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.execution_duration_seconds is not None: - body["execution_duration_seconds"] = self.execution_duration_seconds + body["{execution_duration_seconds}"] = self.execution_duration_seconds if self.file: - body["file"] = self.file + body["{file}"] = self.file if self.gcs: - body["gcs"] = self.gcs + body["{gcs}"] = self.gcs if self.s3: - body["s3"] = self.s3 + body["{s3}"] = self.s3 if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes if self.workspace: - body["workspace"] = self.workspace + body["{workspace}"] = self.workspace return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfoAndExecutionDetails: """Deserializes the InitScriptInfoAndExecutionDetails from a dictionary.""" return cls( - abfss=_from_dict(d, "abfss", Adlsgen2Info), - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - error_message=d.get("error_message", None), - execution_duration_seconds=d.get("execution_duration_seconds", None), - file=_from_dict(d, "file", LocalFileInfo), - gcs=_from_dict(d, "gcs", GcsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - status=_enum(d, "status", InitScriptExecutionDetailsInitScriptExecutionStatus), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), - workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), + abfss=_from_dict(d, "{abfss}", Adlsgen2Info), + dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), + error_message=d.get("{error_message}", None), + execution_duration_seconds=d.get("{execution_duration_seconds}", None), + file=_from_dict(d, "{file}", LocalFileInfo), + gcs=_from_dict(d, "{gcs}", GcsStorageInfo), + s3=_from_dict(d, "{s3}", S3StorageInfo), + status=_enum(d, "{status}", InitScriptExecutionDetailsInitScriptExecutionStatus), + volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), + workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), ) @@ -6089,24 +6092,24 @@ def as_dict(self) -> dict: """Serializes the InstallLibraries into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] return body def as_shallow_dict(self) -> dict: """Serializes the InstallLibraries into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstallLibraries: """Deserializes the InstallLibraries from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None), libraries=_repeated_dict(d, "libraries", Library)) + return cls(cluster_id=d.get("{cluster_id}", None), libraries=_repeated_dict(d, "{libraries}", Library)) @dataclass @@ -6145,36 +6148,36 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAccessControlRequest: """Deserializes the InstancePoolAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", InstancePoolPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -6199,41 +6202,41 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAccessControlResponse: """Deserializes the InstancePoolAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", InstancePoolPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", InstancePoolPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -6326,106 +6329,106 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAndStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.default_tags: - body["default_tags"] = self.default_tags + body["{default_tags}"] = self.default_tags if self.disk_spec: - body["disk_spec"] = self.disk_spec.as_dict() + body["{disk_spec}"] = self.disk_spec.as_dict() if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.preloaded_docker_images: - body["preloaded_docker_images"] = [v.as_dict() for v in self.preloaded_docker_images] + body["{preloaded_docker_images}"] = [v.as_dict() for v in self.preloaded_docker_images] if self.preloaded_spark_versions: - body["preloaded_spark_versions"] = [v for v in self.preloaded_spark_versions] + body["{preloaded_spark_versions}"] = [v for v in self.preloaded_spark_versions] if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.stats: - body["stats"] = self.stats.as_dict() + body["{stats}"] = self.stats.as_dict() if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAndStats into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.default_tags: - body["default_tags"] = self.default_tags + body["{default_tags}"] = self.default_tags if self.disk_spec: - body["disk_spec"] = self.disk_spec + body["{disk_spec}"] = self.disk_spec if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.instance_pool_name is not None: - body["instance_pool_name"] = self.instance_pool_name + body["{instance_pool_name}"] = self.instance_pool_name if self.max_capacity is not None: - body["max_capacity"] = self.max_capacity + body["{max_capacity}"] = self.max_capacity if self.min_idle_instances is not None: - body["min_idle_instances"] = self.min_idle_instances + body["{min_idle_instances}"] = self.min_idle_instances if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.preloaded_docker_images: - body["preloaded_docker_images"] = self.preloaded_docker_images + body["{preloaded_docker_images}"] = self.preloaded_docker_images if self.preloaded_spark_versions: - body["preloaded_spark_versions"] = self.preloaded_spark_versions + body["{preloaded_spark_versions}"] = self.preloaded_spark_versions if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.stats: - body["stats"] = self.stats + body["{stats}"] = self.stats if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAndStats: """Deserializes the InstancePoolAndStats from a dictionary.""" return cls( - aws_attributes=_from_dict(d, "aws_attributes", InstancePoolAwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", InstancePoolAzureAttributes), - custom_tags=d.get("custom_tags", None), - default_tags=d.get("default_tags", None), - disk_spec=_from_dict(d, "disk_spec", DiskSpec), - enable_elastic_disk=d.get("enable_elastic_disk", None), - gcp_attributes=_from_dict(d, "gcp_attributes", InstancePoolGcpAttributes), - idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), - instance_pool_id=d.get("instance_pool_id", None), - instance_pool_name=d.get("instance_pool_name", None), - max_capacity=d.get("max_capacity", None), - min_idle_instances=d.get("min_idle_instances", None), - node_type_id=d.get("node_type_id", None), - preloaded_docker_images=_repeated_dict(d, "preloaded_docker_images", DockerImage), - preloaded_spark_versions=d.get("preloaded_spark_versions", None), - state=_enum(d, "state", InstancePoolState), - stats=_from_dict(d, "stats", InstancePoolStats), - status=_from_dict(d, "status", InstancePoolStatus), + aws_attributes=_from_dict(d, "{aws_attributes}", InstancePoolAwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", InstancePoolAzureAttributes), + custom_tags=d.get("{custom_tags}", None), + default_tags=d.get("{default_tags}", None), + disk_spec=_from_dict(d, "{disk_spec}", DiskSpec), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", InstancePoolGcpAttributes), + idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), + instance_pool_id=d.get("{instance_pool_id}", None), + instance_pool_name=d.get("{instance_pool_name}", None), + max_capacity=d.get("{max_capacity}", None), + min_idle_instances=d.get("{min_idle_instances}", None), + node_type_id=d.get("{node_type_id}", None), + preloaded_docker_images=_repeated_dict(d, "{preloaded_docker_images}", DockerImage), + preloaded_spark_versions=d.get("{preloaded_spark_versions}", None), + state=_enum(d, "{state}", InstancePoolState), + stats=_from_dict(d, "{stats}", InstancePoolStats), + status=_from_dict(d, "{status}", InstancePoolStatus), ) @@ -6457,31 +6460,31 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAwsAttributes: """Deserializes the InstancePoolAwsAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", InstancePoolAwsAttributesAvailability), - spot_bid_price_percent=d.get("spot_bid_price_percent", None), - zone_id=d.get("zone_id", None), + availability=_enum(d, "{availability}", InstancePoolAwsAttributesAvailability), + spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), + zone_id=d.get("{zone_id}", None), ) @@ -6509,26 +6512,26 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAzureAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAzureAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAzureAttributes: """Deserializes the InstancePoolAzureAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", InstancePoolAzureAttributesAvailability), - spot_bid_max_price=d.get("spot_bid_max_price", None), + availability=_enum(d, "{availability}", InstancePoolAzureAttributesAvailability), + spot_bid_max_price=d.get("{spot_bid_max_price}", None), ) @@ -6572,31 +6575,31 @@ def as_dict(self) -> dict: """Serializes the InstancePoolGcpAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.gcp_availability is not None: - body["gcp_availability"] = self.gcp_availability.value + body["{gcp_availability}"] = self.gcp_availability.value if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolGcpAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.gcp_availability is not None: - body["gcp_availability"] = self.gcp_availability + body["{gcp_availability}"] = self.gcp_availability if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolGcpAttributes: """Deserializes the InstancePoolGcpAttributes from a dictionary.""" return cls( - gcp_availability=_enum(d, "gcp_availability", GcpAvailability), - local_ssd_count=d.get("local_ssd_count", None), - zone_id=d.get("zone_id", None), + gcp_availability=_enum(d, "{gcp_availability}", GcpAvailability), + local_ssd_count=d.get("{local_ssd_count}", None), + zone_id=d.get("{zone_id}", None), ) @@ -6613,31 +6616,31 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermission: """Deserializes the InstancePoolPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", InstancePoolPermissionLevel), ) @@ -6660,31 +6663,31 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissions: """Deserializes the InstancePoolPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", InstancePoolAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", InstancePoolAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -6699,26 +6702,26 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissionsDescription: """Deserializes the InstancePoolPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", InstancePoolPermissionLevel), ) @@ -6733,26 +6736,26 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissionsRequest: """Deserializes the InstancePoolPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", InstancePoolAccessControlRequest), - instance_pool_id=d.get("instance_pool_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", InstancePoolAccessControlRequest), + instance_pool_id=d.get("{instance_pool_id}", None), ) @@ -6785,36 +6788,36 @@ def as_dict(self) -> dict: """Serializes the InstancePoolStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.idle_count is not None: - body["idle_count"] = self.idle_count + body["{idle_count}"] = self.idle_count if self.pending_idle_count is not None: - body["pending_idle_count"] = self.pending_idle_count + body["{pending_idle_count}"] = self.pending_idle_count if self.pending_used_count is not None: - body["pending_used_count"] = self.pending_used_count + body["{pending_used_count}"] = self.pending_used_count if self.used_count is not None: - body["used_count"] = self.used_count + body["{used_count}"] = self.used_count return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolStats into a shallow dictionary of its immediate attributes.""" body = {} if self.idle_count is not None: - body["idle_count"] = self.idle_count + body["{idle_count}"] = self.idle_count if self.pending_idle_count is not None: - body["pending_idle_count"] = self.pending_idle_count + body["{pending_idle_count}"] = self.pending_idle_count if self.pending_used_count is not None: - body["pending_used_count"] = self.pending_used_count + body["{pending_used_count}"] = self.pending_used_count if self.used_count is not None: - body["used_count"] = self.used_count + body["{used_count}"] = self.used_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolStats: """Deserializes the InstancePoolStats from a dictionary.""" return cls( - idle_count=d.get("idle_count", None), - pending_idle_count=d.get("pending_idle_count", None), - pending_used_count=d.get("pending_used_count", None), - used_count=d.get("used_count", None), + idle_count=d.get("{idle_count}", None), + pending_idle_count=d.get("{pending_idle_count}", None), + pending_used_count=d.get("{pending_used_count}", None), + used_count=d.get("{used_count}", None), ) @@ -6829,20 +6832,20 @@ def as_dict(self) -> dict: """Serializes the InstancePoolStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.pending_instance_errors: - body["pending_instance_errors"] = [v.as_dict() for v in self.pending_instance_errors] + body["{pending_instance_errors}"] = [v.as_dict() for v in self.pending_instance_errors] return body def as_shallow_dict(self) -> dict: """Serializes the InstancePoolStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.pending_instance_errors: - body["pending_instance_errors"] = self.pending_instance_errors + body["{pending_instance_errors}"] = self.pending_instance_errors return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolStatus: """Deserializes the InstancePoolStatus from a dictionary.""" - return cls(pending_instance_errors=_repeated_dict(d, "pending_instance_errors", PendingInstanceError)) + return cls(pending_instance_errors=_repeated_dict(d, "{pending_instance_errors}", PendingInstanceError)) @dataclass @@ -6869,31 +6872,31 @@ def as_dict(self) -> dict: """Serializes the InstanceProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.iam_role_arn is not None: - body["iam_role_arn"] = self.iam_role_arn + body["{iam_role_arn}"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["is_meta_instance_profile"] = self.is_meta_instance_profile + body["{is_meta_instance_profile}"] = self.is_meta_instance_profile return body def as_shallow_dict(self) -> dict: """Serializes the InstanceProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.iam_role_arn is not None: - body["iam_role_arn"] = self.iam_role_arn + body["{iam_role_arn}"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["is_meta_instance_profile"] = self.is_meta_instance_profile + body["{is_meta_instance_profile}"] = self.is_meta_instance_profile return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstanceProfile: """Deserializes the InstanceProfile from a dictionary.""" return cls( - iam_role_arn=d.get("iam_role_arn", None), - instance_profile_arn=d.get("instance_profile_arn", None), - is_meta_instance_profile=d.get("is_meta_instance_profile", None), + iam_role_arn=d.get("{iam_role_arn}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + is_meta_instance_profile=d.get("{is_meta_instance_profile}", None), ) @@ -6961,51 +6964,51 @@ def as_dict(self) -> dict: """Serializes the Library into a dictionary suitable for use as a JSON request body.""" body = {} if self.cran: - body["cran"] = self.cran.as_dict() + body["{cran}"] = self.cran.as_dict() if self.egg is not None: - body["egg"] = self.egg + body["{egg}"] = self.egg if self.jar is not None: - body["jar"] = self.jar + body["{jar}"] = self.jar if self.maven: - body["maven"] = self.maven.as_dict() + body["{maven}"] = self.maven.as_dict() if self.pypi: - body["pypi"] = self.pypi.as_dict() + body["{pypi}"] = self.pypi.as_dict() if self.requirements is not None: - body["requirements"] = self.requirements + body["{requirements}"] = self.requirements if self.whl is not None: - body["whl"] = self.whl + body["{whl}"] = self.whl return body def as_shallow_dict(self) -> dict: """Serializes the Library into a shallow dictionary of its immediate attributes.""" body = {} if self.cran: - body["cran"] = self.cran + body["{cran}"] = self.cran if self.egg is not None: - body["egg"] = self.egg + body["{egg}"] = self.egg if self.jar is not None: - body["jar"] = self.jar + body["{jar}"] = self.jar if self.maven: - body["maven"] = self.maven + body["{maven}"] = self.maven if self.pypi: - body["pypi"] = self.pypi + body["{pypi}"] = self.pypi if self.requirements is not None: - body["requirements"] = self.requirements + body["{requirements}"] = self.requirements if self.whl is not None: - body["whl"] = self.whl + body["{whl}"] = self.whl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Library: """Deserializes the Library from a dictionary.""" return cls( - cran=_from_dict(d, "cran", RCranLibrary), - egg=d.get("egg", None), - jar=d.get("jar", None), - maven=_from_dict(d, "maven", MavenLibrary), - pypi=_from_dict(d, "pypi", PythonPyPiLibrary), - requirements=d.get("requirements", None), - whl=d.get("whl", None), + cran=_from_dict(d, "{cran}", RCranLibrary), + egg=d.get("{egg}", None), + jar=d.get("{jar}", None), + maven=_from_dict(d, "{maven}", MavenLibrary), + pypi=_from_dict(d, "{pypi}", PythonPyPiLibrary), + requirements=d.get("{requirements}", None), + whl=d.get("{whl}", None), ) @@ -7029,36 +7032,36 @@ def as_dict(self) -> dict: """Serializes the LibraryFullStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_library_for_all_clusters is not None: - body["is_library_for_all_clusters"] = self.is_library_for_all_clusters + body["{is_library_for_all_clusters}"] = self.is_library_for_all_clusters if self.library: - body["library"] = self.library.as_dict() + body["{library}"] = self.library.as_dict() if self.messages: - body["messages"] = [v for v in self.messages] + body["{messages}"] = [v for v in self.messages] if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the LibraryFullStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.is_library_for_all_clusters is not None: - body["is_library_for_all_clusters"] = self.is_library_for_all_clusters + body["{is_library_for_all_clusters}"] = self.is_library_for_all_clusters if self.library: - body["library"] = self.library + body["{library}"] = self.library if self.messages: - body["messages"] = self.messages + body["{messages}"] = self.messages if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LibraryFullStatus: """Deserializes the LibraryFullStatus from a dictionary.""" return cls( - is_library_for_all_clusters=d.get("is_library_for_all_clusters", None), - library=_from_dict(d, "library", Library), - messages=d.get("messages", None), - status=_enum(d, "status", LibraryInstallStatus), + is_library_for_all_clusters=d.get("{is_library_for_all_clusters}", None), + library=_from_dict(d, "{library}", Library), + messages=d.get("{messages}", None), + status=_enum(d, "{status}", LibraryInstallStatus), ) @@ -7084,20 +7087,20 @@ def as_dict(self) -> dict: """Serializes the ListAllClusterLibraryStatusesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.statuses: - body["statuses"] = [v.as_dict() for v in self.statuses] + body["{statuses}"] = [v.as_dict() for v in self.statuses] return body def as_shallow_dict(self) -> dict: """Serializes the ListAllClusterLibraryStatusesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.statuses: - body["statuses"] = self.statuses + body["{statuses}"] = self.statuses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAllClusterLibraryStatusesResponse: """Deserializes the ListAllClusterLibraryStatusesResponse from a dictionary.""" - return cls(statuses=_repeated_dict(d, "statuses", ClusterLibraryStatuses)) + return cls(statuses=_repeated_dict(d, "{statuses}", ClusterLibraryStatuses)) @dataclass @@ -7112,24 +7115,24 @@ def as_dict(self) -> dict: """Serializes the ListAvailableZonesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_zone is not None: - body["default_zone"] = self.default_zone + body["{default_zone}"] = self.default_zone if self.zones: - body["zones"] = [v for v in self.zones] + body["{zones}"] = [v for v in self.zones] return body def as_shallow_dict(self) -> dict: """Serializes the ListAvailableZonesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.default_zone is not None: - body["default_zone"] = self.default_zone + body["{default_zone}"] = self.default_zone if self.zones: - body["zones"] = self.zones + body["{zones}"] = self.zones return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAvailableZonesResponse: """Deserializes the ListAvailableZonesResponse from a dictionary.""" - return cls(default_zone=d.get("default_zone", None), zones=d.get("zones", None)) + return cls(default_zone=d.get("{default_zone}", None), zones=d.get("{zones}", None)) @dataclass @@ -7149,31 +7152,31 @@ def as_dict(self) -> dict: """Serializes the ListClusterCompliancesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.clusters: - body["clusters"] = [v.as_dict() for v in self.clusters] + body["{clusters}"] = [v.as_dict() for v in self.clusters] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListClusterCompliancesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.clusters: - body["clusters"] = self.clusters + body["{clusters}"] = self.clusters if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClusterCompliancesResponse: """Deserializes the ListClusterCompliancesResponse from a dictionary.""" return cls( - clusters=_repeated_dict(d, "clusters", ClusterCompliance), - next_page_token=d.get("next_page_token", None), - prev_page_token=d.get("prev_page_token", None), + clusters=_repeated_dict(d, "{clusters}", ClusterCompliance), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), ) @@ -7195,36 +7198,36 @@ def as_dict(self) -> dict: """Serializes the ListClustersFilterBy into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_sources: - body["cluster_sources"] = [v.value for v in self.cluster_sources] + body["{cluster_sources}"] = [v.value for v in self.cluster_sources] if self.cluster_states: - body["cluster_states"] = [v.value for v in self.cluster_states] + body["{cluster_states}"] = [v.value for v in self.cluster_states] if self.is_pinned is not None: - body["is_pinned"] = self.is_pinned + body["{is_pinned}"] = self.is_pinned if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body def as_shallow_dict(self) -> dict: """Serializes the ListClustersFilterBy into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_sources: - body["cluster_sources"] = self.cluster_sources + body["{cluster_sources}"] = self.cluster_sources if self.cluster_states: - body["cluster_states"] = self.cluster_states + body["{cluster_states}"] = self.cluster_states if self.is_pinned is not None: - body["is_pinned"] = self.is_pinned + body["{is_pinned}"] = self.is_pinned if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClustersFilterBy: """Deserializes the ListClustersFilterBy from a dictionary.""" return cls( - cluster_sources=_repeated_enum(d, "cluster_sources", ClusterSource), - cluster_states=_repeated_enum(d, "cluster_states", State), - is_pinned=d.get("is_pinned", None), - policy_id=d.get("policy_id", None), + cluster_sources=_repeated_enum(d, "{cluster_sources}", ClusterSource), + cluster_states=_repeated_enum(d, "{cluster_states}", State), + is_pinned=d.get("{is_pinned}", None), + policy_id=d.get("{policy_id}", None), ) @@ -7244,31 +7247,31 @@ def as_dict(self) -> dict: """Serializes the ListClustersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.clusters: - body["clusters"] = [v.as_dict() for v in self.clusters] + body["{clusters}"] = [v.as_dict() for v in self.clusters] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListClustersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.clusters: - body["clusters"] = self.clusters + body["{clusters}"] = self.clusters if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClustersResponse: """Deserializes the ListClustersResponse from a dictionary.""" return cls( - clusters=_repeated_dict(d, "clusters", ClusterDetails), - next_page_token=d.get("next_page_token", None), - prev_page_token=d.get("prev_page_token", None), + clusters=_repeated_dict(d, "{clusters}", ClusterDetails), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), ) @@ -7285,26 +7288,26 @@ def as_dict(self) -> dict: """Serializes the ListClustersSortBy into a dictionary suitable for use as a JSON request body.""" body = {} if self.direction is not None: - body["direction"] = self.direction.value + body["{direction}"] = self.direction.value if self.field is not None: - body["field"] = self.field.value + body["{field}"] = self.field.value return body def as_shallow_dict(self) -> dict: """Serializes the ListClustersSortBy into a shallow dictionary of its immediate attributes.""" body = {} if self.direction is not None: - body["direction"] = self.direction + body["{direction}"] = self.direction if self.field is not None: - body["field"] = self.field + body["{field}"] = self.field return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClustersSortBy: """Deserializes the ListClustersSortBy from a dictionary.""" return cls( - direction=_enum(d, "direction", ListClustersSortByDirection), - field=_enum(d, "field", ListClustersSortByField), + direction=_enum(d, "{direction}", ListClustersSortByDirection), + field=_enum(d, "{field}", ListClustersSortByField), ) @@ -7328,20 +7331,20 @@ def as_dict(self) -> dict: """Serializes the ListGlobalInitScriptsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.scripts: - body["scripts"] = [v.as_dict() for v in self.scripts] + body["{scripts}"] = [v.as_dict() for v in self.scripts] return body def as_shallow_dict(self) -> dict: """Serializes the ListGlobalInitScriptsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.scripts: - body["scripts"] = self.scripts + body["{scripts}"] = self.scripts return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListGlobalInitScriptsResponse: """Deserializes the ListGlobalInitScriptsResponse from a dictionary.""" - return cls(scripts=_repeated_dict(d, "scripts", GlobalInitScriptDetails)) + return cls(scripts=_repeated_dict(d, "{scripts}", GlobalInitScriptDetails)) @dataclass @@ -7352,20 +7355,20 @@ def as_dict(self) -> dict: """Serializes the ListInstancePools into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_pools: - body["instance_pools"] = [v.as_dict() for v in self.instance_pools] + body["{instance_pools}"] = [v.as_dict() for v in self.instance_pools] return body def as_shallow_dict(self) -> dict: """Serializes the ListInstancePools into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_pools: - body["instance_pools"] = self.instance_pools + body["{instance_pools}"] = self.instance_pools return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListInstancePools: """Deserializes the ListInstancePools from a dictionary.""" - return cls(instance_pools=_repeated_dict(d, "instance_pools", InstancePoolAndStats)) + return cls(instance_pools=_repeated_dict(d, "{instance_pools}", InstancePoolAndStats)) @dataclass @@ -7377,20 +7380,20 @@ def as_dict(self) -> dict: """Serializes the ListInstanceProfilesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_profiles: - body["instance_profiles"] = [v.as_dict() for v in self.instance_profiles] + body["{instance_profiles}"] = [v.as_dict() for v in self.instance_profiles] return body def as_shallow_dict(self) -> dict: """Serializes the ListInstanceProfilesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_profiles: - body["instance_profiles"] = self.instance_profiles + body["{instance_profiles}"] = self.instance_profiles return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListInstanceProfilesResponse: """Deserializes the ListInstanceProfilesResponse from a dictionary.""" - return cls(instance_profiles=_repeated_dict(d, "instance_profiles", InstanceProfile)) + return cls(instance_profiles=_repeated_dict(d, "{instance_profiles}", InstanceProfile)) @dataclass @@ -7402,20 +7405,20 @@ def as_dict(self) -> dict: """Serializes the ListNodeTypesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.node_types: - body["node_types"] = [v.as_dict() for v in self.node_types] + body["{node_types}"] = [v.as_dict() for v in self.node_types] return body def as_shallow_dict(self) -> dict: """Serializes the ListNodeTypesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.node_types: - body["node_types"] = self.node_types + body["{node_types}"] = self.node_types return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNodeTypesResponse: """Deserializes the ListNodeTypesResponse from a dictionary.""" - return cls(node_types=_repeated_dict(d, "node_types", NodeType)) + return cls(node_types=_repeated_dict(d, "{node_types}", NodeType)) @dataclass @@ -7427,20 +7430,20 @@ def as_dict(self) -> dict: """Serializes the ListPoliciesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.policies: - body["policies"] = [v.as_dict() for v in self.policies] + body["{policies}"] = [v.as_dict() for v in self.policies] return body def as_shallow_dict(self) -> dict: """Serializes the ListPoliciesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.policies: - body["policies"] = self.policies + body["{policies}"] = self.policies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPoliciesResponse: """Deserializes the ListPoliciesResponse from a dictionary.""" - return cls(policies=_repeated_dict(d, "policies", Policy)) + return cls(policies=_repeated_dict(d, "{policies}", Policy)) @dataclass @@ -7456,26 +7459,26 @@ def as_dict(self) -> dict: """Serializes the ListPolicyFamiliesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.policy_families: - body["policy_families"] = [v.as_dict() for v in self.policy_families] + body["{policy_families}"] = [v.as_dict() for v in self.policy_families] return body def as_shallow_dict(self) -> dict: """Serializes the ListPolicyFamiliesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.policy_families: - body["policy_families"] = self.policy_families + body["{policy_families}"] = self.policy_families return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPolicyFamiliesResponse: """Deserializes the ListPolicyFamiliesResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - policy_families=_repeated_dict(d, "policy_families", PolicyFamily), + next_page_token=d.get("{next_page_token}", None), + policy_families=_repeated_dict(d, "{policy_families}", PolicyFamily), ) @@ -7500,20 +7503,20 @@ def as_dict(self) -> dict: """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: """Deserializes the LocalFileInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -7526,26 +7529,26 @@ def as_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key + body["{log_analytics_primary_key}"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key + body["{log_analytics_primary_key}"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: """Deserializes the LogAnalyticsInfo from a dictionary.""" return cls( - log_analytics_primary_key=d.get("log_analytics_primary_key", None), - log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), + log_analytics_primary_key=d.get("{log_analytics_primary_key}", None), + log_analytics_workspace_id=d.get("{log_analytics_workspace_id}", None), ) @@ -7565,24 +7568,24 @@ def as_dict(self) -> dict: """Serializes the LogSyncStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_attempted is not None: - body["last_attempted"] = self.last_attempted + body["{last_attempted}"] = self.last_attempted if self.last_exception is not None: - body["last_exception"] = self.last_exception + body["{last_exception}"] = self.last_exception return body def as_shallow_dict(self) -> dict: """Serializes the LogSyncStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_attempted is not None: - body["last_attempted"] = self.last_attempted + body["{last_attempted}"] = self.last_attempted if self.last_exception is not None: - body["last_exception"] = self.last_exception + body["{last_exception}"] = self.last_exception return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogSyncStatus: """Deserializes the LogSyncStatus from a dictionary.""" - return cls(last_attempted=d.get("last_attempted", None), last_exception=d.get("last_exception", None)) + return cls(last_attempted=d.get("{last_attempted}", None), last_exception=d.get("{last_exception}", None)) @dataclass @@ -7604,29 +7607,29 @@ def as_dict(self) -> dict: """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.coordinates is not None: - body["coordinates"] = self.coordinates + body["{coordinates}"] = self.coordinates if self.exclusions: - body["exclusions"] = [v for v in self.exclusions] + body["{exclusions}"] = [v for v in self.exclusions] if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body def as_shallow_dict(self) -> dict: """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.coordinates is not None: - body["coordinates"] = self.coordinates + body["{coordinates}"] = self.coordinates if self.exclusions: - body["exclusions"] = self.exclusions + body["{exclusions}"] = self.exclusions if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: """Deserializes the MavenLibrary from a dictionary.""" return cls( - coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) + coordinates=d.get("{coordinates}", None), exclusions=d.get("{exclusions}", None), repo=d.get("{repo}", None) ) @@ -7655,41 +7658,41 @@ def as_dict(self) -> dict: """Serializes the NodeInstanceType into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_type_id is not None: - body["instance_type_id"] = self.instance_type_id + body["{instance_type_id}"] = self.instance_type_id if self.local_disk_size_gb is not None: - body["local_disk_size_gb"] = self.local_disk_size_gb + body["{local_disk_size_gb}"] = self.local_disk_size_gb if self.local_disks is not None: - body["local_disks"] = self.local_disks + body["{local_disks}"] = self.local_disks if self.local_nvme_disk_size_gb is not None: - body["local_nvme_disk_size_gb"] = self.local_nvme_disk_size_gb + body["{local_nvme_disk_size_gb}"] = self.local_nvme_disk_size_gb if self.local_nvme_disks is not None: - body["local_nvme_disks"] = self.local_nvme_disks + body["{local_nvme_disks}"] = self.local_nvme_disks return body def as_shallow_dict(self) -> dict: """Serializes the NodeInstanceType into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_type_id is not None: - body["instance_type_id"] = self.instance_type_id + body["{instance_type_id}"] = self.instance_type_id if self.local_disk_size_gb is not None: - body["local_disk_size_gb"] = self.local_disk_size_gb + body["{local_disk_size_gb}"] = self.local_disk_size_gb if self.local_disks is not None: - body["local_disks"] = self.local_disks + body["{local_disks}"] = self.local_disks if self.local_nvme_disk_size_gb is not None: - body["local_nvme_disk_size_gb"] = self.local_nvme_disk_size_gb + body["{local_nvme_disk_size_gb}"] = self.local_nvme_disk_size_gb if self.local_nvme_disks is not None: - body["local_nvme_disks"] = self.local_nvme_disks + body["{local_nvme_disks}"] = self.local_nvme_disks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NodeInstanceType: """Deserializes the NodeInstanceType from a dictionary.""" return cls( - instance_type_id=d.get("instance_type_id", None), - local_disk_size_gb=d.get("local_disk_size_gb", None), - local_disks=d.get("local_disks", None), - local_nvme_disk_size_gb=d.get("local_nvme_disk_size_gb", None), - local_nvme_disks=d.get("local_nvme_disks", None), + instance_type_id=d.get("{instance_type_id}", None), + local_disk_size_gb=d.get("{local_disk_size_gb}", None), + local_disks=d.get("{local_disks}", None), + local_nvme_disk_size_gb=d.get("{local_nvme_disk_size_gb}", None), + local_nvme_disks=d.get("{local_nvme_disks}", None), ) @@ -7766,116 +7769,116 @@ def as_dict(self) -> dict: """Serializes the NodeType into a dictionary suitable for use as a JSON request body.""" body = {} if self.category is not None: - body["category"] = self.category + body["{category}"] = self.category if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_order is not None: - body["display_order"] = self.display_order + body["{display_order}"] = self.display_order if self.instance_type_id is not None: - body["instance_type_id"] = self.instance_type_id + body["{instance_type_id}"] = self.instance_type_id if self.is_deprecated is not None: - body["is_deprecated"] = self.is_deprecated + body["{is_deprecated}"] = self.is_deprecated if self.is_encrypted_in_transit is not None: - body["is_encrypted_in_transit"] = self.is_encrypted_in_transit + body["{is_encrypted_in_transit}"] = self.is_encrypted_in_transit if self.is_graviton is not None: - body["is_graviton"] = self.is_graviton + body["{is_graviton}"] = self.is_graviton if self.is_hidden is not None: - body["is_hidden"] = self.is_hidden + body["{is_hidden}"] = self.is_hidden if self.is_io_cache_enabled is not None: - body["is_io_cache_enabled"] = self.is_io_cache_enabled + body["{is_io_cache_enabled}"] = self.is_io_cache_enabled if self.memory_mb is not None: - body["memory_mb"] = self.memory_mb + body["{memory_mb}"] = self.memory_mb if self.node_info: - body["node_info"] = self.node_info.as_dict() + body["{node_info}"] = self.node_info.as_dict() if self.node_instance_type: - body["node_instance_type"] = self.node_instance_type.as_dict() + body["{node_instance_type}"] = self.node_instance_type.as_dict() if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_cores is not None: - body["num_cores"] = self.num_cores + body["{num_cores}"] = self.num_cores if self.num_gpus is not None: - body["num_gpus"] = self.num_gpus + body["{num_gpus}"] = self.num_gpus if self.photon_driver_capable is not None: - body["photon_driver_capable"] = self.photon_driver_capable + body["{photon_driver_capable}"] = self.photon_driver_capable if self.photon_worker_capable is not None: - body["photon_worker_capable"] = self.photon_worker_capable + body["{photon_worker_capable}"] = self.photon_worker_capable if self.support_cluster_tags is not None: - body["support_cluster_tags"] = self.support_cluster_tags + body["{support_cluster_tags}"] = self.support_cluster_tags if self.support_ebs_volumes is not None: - body["support_ebs_volumes"] = self.support_ebs_volumes + body["{support_ebs_volumes}"] = self.support_ebs_volumes if self.support_port_forwarding is not None: - body["support_port_forwarding"] = self.support_port_forwarding + body["{support_port_forwarding}"] = self.support_port_forwarding return body def as_shallow_dict(self) -> dict: """Serializes the NodeType into a shallow dictionary of its immediate attributes.""" body = {} if self.category is not None: - body["category"] = self.category + body["{category}"] = self.category if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_order is not None: - body["display_order"] = self.display_order + body["{display_order}"] = self.display_order if self.instance_type_id is not None: - body["instance_type_id"] = self.instance_type_id + body["{instance_type_id}"] = self.instance_type_id if self.is_deprecated is not None: - body["is_deprecated"] = self.is_deprecated + body["{is_deprecated}"] = self.is_deprecated if self.is_encrypted_in_transit is not None: - body["is_encrypted_in_transit"] = self.is_encrypted_in_transit + body["{is_encrypted_in_transit}"] = self.is_encrypted_in_transit if self.is_graviton is not None: - body["is_graviton"] = self.is_graviton + body["{is_graviton}"] = self.is_graviton if self.is_hidden is not None: - body["is_hidden"] = self.is_hidden + body["{is_hidden}"] = self.is_hidden if self.is_io_cache_enabled is not None: - body["is_io_cache_enabled"] = self.is_io_cache_enabled + body["{is_io_cache_enabled}"] = self.is_io_cache_enabled if self.memory_mb is not None: - body["memory_mb"] = self.memory_mb + body["{memory_mb}"] = self.memory_mb if self.node_info: - body["node_info"] = self.node_info + body["{node_info}"] = self.node_info if self.node_instance_type: - body["node_instance_type"] = self.node_instance_type + body["{node_instance_type}"] = self.node_instance_type if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_cores is not None: - body["num_cores"] = self.num_cores + body["{num_cores}"] = self.num_cores if self.num_gpus is not None: - body["num_gpus"] = self.num_gpus + body["{num_gpus}"] = self.num_gpus if self.photon_driver_capable is not None: - body["photon_driver_capable"] = self.photon_driver_capable + body["{photon_driver_capable}"] = self.photon_driver_capable if self.photon_worker_capable is not None: - body["photon_worker_capable"] = self.photon_worker_capable + body["{photon_worker_capable}"] = self.photon_worker_capable if self.support_cluster_tags is not None: - body["support_cluster_tags"] = self.support_cluster_tags + body["{support_cluster_tags}"] = self.support_cluster_tags if self.support_ebs_volumes is not None: - body["support_ebs_volumes"] = self.support_ebs_volumes + body["{support_ebs_volumes}"] = self.support_ebs_volumes if self.support_port_forwarding is not None: - body["support_port_forwarding"] = self.support_port_forwarding + body["{support_port_forwarding}"] = self.support_port_forwarding return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NodeType: """Deserializes the NodeType from a dictionary.""" return cls( - category=d.get("category", None), - description=d.get("description", None), - display_order=d.get("display_order", None), - instance_type_id=d.get("instance_type_id", None), - is_deprecated=d.get("is_deprecated", None), - is_encrypted_in_transit=d.get("is_encrypted_in_transit", None), - is_graviton=d.get("is_graviton", None), - is_hidden=d.get("is_hidden", None), - is_io_cache_enabled=d.get("is_io_cache_enabled", None), - memory_mb=d.get("memory_mb", None), - node_info=_from_dict(d, "node_info", CloudProviderNodeInfo), - node_instance_type=_from_dict(d, "node_instance_type", NodeInstanceType), - node_type_id=d.get("node_type_id", None), - num_cores=d.get("num_cores", None), - num_gpus=d.get("num_gpus", None), - photon_driver_capable=d.get("photon_driver_capable", None), - photon_worker_capable=d.get("photon_worker_capable", None), - support_cluster_tags=d.get("support_cluster_tags", None), - support_ebs_volumes=d.get("support_ebs_volumes", None), - support_port_forwarding=d.get("support_port_forwarding", None), + category=d.get("{category}", None), + description=d.get("{description}", None), + display_order=d.get("{display_order}", None), + instance_type_id=d.get("{instance_type_id}", None), + is_deprecated=d.get("{is_deprecated}", None), + is_encrypted_in_transit=d.get("{is_encrypted_in_transit}", None), + is_graviton=d.get("{is_graviton}", None), + is_hidden=d.get("{is_hidden}", None), + is_io_cache_enabled=d.get("{is_io_cache_enabled}", None), + memory_mb=d.get("{memory_mb}", None), + node_info=_from_dict(d, "{node_info}", CloudProviderNodeInfo), + node_instance_type=_from_dict(d, "{node_instance_type}", NodeInstanceType), + node_type_id=d.get("{node_type_id}", None), + num_cores=d.get("{num_cores}", None), + num_gpus=d.get("{num_gpus}", None), + photon_driver_capable=d.get("{photon_driver_capable}", None), + photon_worker_capable=d.get("{photon_worker_capable}", None), + support_cluster_tags=d.get("{support_cluster_tags}", None), + support_ebs_volumes=d.get("{support_ebs_volumes}", None), + support_port_forwarding=d.get("{support_port_forwarding}", None), ) @@ -7891,24 +7894,24 @@ def as_dict(self) -> dict: """Serializes the PendingInstanceError into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_id is not None: - body["instance_id"] = self.instance_id + body["{instance_id}"] = self.instance_id if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body def as_shallow_dict(self) -> dict: """Serializes the PendingInstanceError into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_id is not None: - body["instance_id"] = self.instance_id + body["{instance_id}"] = self.instance_id if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PendingInstanceError: """Deserializes the PendingInstanceError from a dictionary.""" - return cls(instance_id=d.get("instance_id", None), message=d.get("message", None)) + return cls(instance_id=d.get("{instance_id}", None), message=d.get("{message}", None)) @dataclass @@ -7920,20 +7923,20 @@ def as_dict(self) -> dict: """Serializes the PermanentDeleteCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the PermanentDeleteCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermanentDeleteCluster: """Deserializes the PermanentDeleteCluster from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None)) + return cls(cluster_id=d.get("{cluster_id}", None)) @dataclass @@ -7962,20 +7965,20 @@ def as_dict(self) -> dict: """Serializes the PinCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the PinCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PinCluster: """Deserializes the PinCluster from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None)) + return cls(cluster_id=d.get("{cluster_id}", None)) @dataclass @@ -8054,71 +8057,71 @@ def as_dict(self) -> dict: """Serializes the Policy into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at_timestamp is not None: - body["created_at_timestamp"] = self.created_at_timestamp + body["{created_at_timestamp}"] = self.created_at_timestamp if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.is_default is not None: - body["is_default"] = self.is_default + body["{is_default}"] = self.is_default if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.max_clusters_per_user is not None: - body["max_clusters_per_user"] = self.max_clusters_per_user + body["{max_clusters_per_user}"] = self.max_clusters_per_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = self.policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body def as_shallow_dict(self) -> dict: """Serializes the Policy into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at_timestamp is not None: - body["created_at_timestamp"] = self.created_at_timestamp + body["{created_at_timestamp}"] = self.created_at_timestamp if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.is_default is not None: - body["is_default"] = self.is_default + body["{is_default}"] = self.is_default if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.max_clusters_per_user is not None: - body["max_clusters_per_user"] = self.max_clusters_per_user + body["{max_clusters_per_user}"] = self.max_clusters_per_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = self.policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Policy: """Deserializes the Policy from a dictionary.""" return cls( - created_at_timestamp=d.get("created_at_timestamp", None), - creator_user_name=d.get("creator_user_name", None), - definition=d.get("definition", None), - description=d.get("description", None), - is_default=d.get("is_default", None), - libraries=_repeated_dict(d, "libraries", Library), - max_clusters_per_user=d.get("max_clusters_per_user", None), - name=d.get("name", None), - policy_family_definition_overrides=d.get("policy_family_definition_overrides", None), - policy_family_id=d.get("policy_family_id", None), - policy_id=d.get("policy_id", None), + created_at_timestamp=d.get("{created_at_timestamp}", None), + creator_user_name=d.get("{creator_user_name}", None), + definition=d.get("{definition}", None), + description=d.get("{description}", None), + is_default=d.get("{is_default}", None), + libraries=_repeated_dict(d, "{libraries}", Library), + max_clusters_per_user=d.get("{max_clusters_per_user}", None), + name=d.get("{name}", None), + policy_family_definition_overrides=d.get("{policy_family_definition_overrides}", None), + policy_family_id=d.get("{policy_family_id}", None), + policy_id=d.get("{policy_id}", None), ) @@ -8142,36 +8145,36 @@ def as_dict(self) -> dict: """Serializes the PolicyFamily into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id return body def as_shallow_dict(self) -> dict: """Serializes the PolicyFamily into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["definition"] = self.definition + body["{definition}"] = self.definition if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.policy_family_id is not None: - body["policy_family_id"] = self.policy_family_id + body["{policy_family_id}"] = self.policy_family_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PolicyFamily: """Deserializes the PolicyFamily from a dictionary.""" return cls( - definition=d.get("definition", None), - description=d.get("description", None), - name=d.get("name", None), - policy_family_id=d.get("policy_family_id", None), + definition=d.get("{definition}", None), + description=d.get("{description}", None), + name=d.get("{name}", None), + policy_family_id=d.get("{policy_family_id}", None), ) @@ -8188,24 +8191,24 @@ def as_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body def as_shallow_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PythonPyPiLibrary: """Deserializes the PythonPyPiLibrary from a dictionary.""" - return cls(package=d.get("package", None), repo=d.get("repo", None)) + return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) @dataclass @@ -8220,24 +8223,24 @@ def as_dict(self) -> dict: """Serializes the RCranLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body def as_shallow_dict(self) -> dict: """Serializes the RCranLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RCranLibrary: """Deserializes the RCranLibrary from a dictionary.""" - return cls(package=d.get("package", None), repo=d.get("repo", None)) + return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) @dataclass @@ -8249,20 +8252,20 @@ def as_dict(self) -> dict: """Serializes the RemoveInstanceProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn return body def as_shallow_dict(self) -> dict: """Serializes the RemoveInstanceProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RemoveInstanceProfile: """Deserializes the RemoveInstanceProfile from a dictionary.""" - return cls(instance_profile_arn=d.get("instance_profile_arn", None)) + return cls(instance_profile_arn=d.get("{instance_profile_arn}", None)) @dataclass @@ -8306,31 +8309,31 @@ def as_dict(self) -> dict: """Serializes the ResizeCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers return body def as_shallow_dict(self) -> dict: """Serializes the ResizeCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResizeCluster: """Deserializes the ResizeCluster from a dictionary.""" return cls( - autoscale=_from_dict(d, "autoscale", AutoScale), - cluster_id=d.get("cluster_id", None), - num_workers=d.get("num_workers", None), + autoscale=_from_dict(d, "{autoscale}", AutoScale), + cluster_id=d.get("{cluster_id}", None), + num_workers=d.get("{num_workers}", None), ) @@ -8363,24 +8366,24 @@ def as_dict(self) -> dict: """Serializes the RestartCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.restart_user is not None: - body["restart_user"] = self.restart_user + body["{restart_user}"] = self.restart_user return body def as_shallow_dict(self) -> dict: """Serializes the RestartCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.restart_user is not None: - body["restart_user"] = self.restart_user + body["{restart_user}"] = self.restart_user return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestartCluster: """Deserializes the RestartCluster from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None), restart_user=d.get("restart_user", None)) + return cls(cluster_id=d.get("{cluster_id}", None), restart_user=d.get("{restart_user}", None)) @dataclass @@ -8443,66 +8446,66 @@ def as_dict(self) -> dict: """Serializes the Results into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["cause"] = self.cause + body["{cause}"] = self.cause if self.data: - body["data"] = self.data + body["{data}"] = self.data if self.file_name is not None: - body["fileName"] = self.file_name + body["{file_name}"] = self.file_name if self.file_names: - body["fileNames"] = [v for v in self.file_names] + body["{file_names}"] = [v for v in self.file_names] if self.is_json_schema is not None: - body["isJsonSchema"] = self.is_json_schema + body["{is_json_schema}"] = self.is_json_schema if self.pos is not None: - body["pos"] = self.pos + body["{pos}"] = self.pos if self.result_type is not None: - body["resultType"] = self.result_type.value + body["{result_type}"] = self.result_type.value if self.schema: - body["schema"] = [v for v in self.schema] + body["{schema}"] = [v for v in self.schema] if self.summary is not None: - body["summary"] = self.summary + body["{summary}"] = self.summary if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body def as_shallow_dict(self) -> dict: """Serializes the Results into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["cause"] = self.cause + body["{cause}"] = self.cause if self.data: - body["data"] = self.data + body["{data}"] = self.data if self.file_name is not None: - body["fileName"] = self.file_name + body["{file_name}"] = self.file_name if self.file_names: - body["fileNames"] = self.file_names + body["{file_names}"] = self.file_names if self.is_json_schema is not None: - body["isJsonSchema"] = self.is_json_schema + body["{is_json_schema}"] = self.is_json_schema if self.pos is not None: - body["pos"] = self.pos + body["{pos}"] = self.pos if self.result_type is not None: - body["resultType"] = self.result_type + body["{result_type}"] = self.result_type if self.schema: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.summary is not None: - body["summary"] = self.summary + body["{summary}"] = self.summary if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Results: """Deserializes the Results from a dictionary.""" return cls( - cause=d.get("cause", None), - data=d.get("data", None), - file_name=d.get("fileName", None), - file_names=d.get("fileNames", None), - is_json_schema=d.get("isJsonSchema", None), - pos=d.get("pos", None), - result_type=_enum(d, "resultType", ResultType), - schema=d.get("schema", None), - summary=d.get("summary", None), - truncated=d.get("truncated", None), + cause=d.get("{cause}", None), + data=d.get("{data}", None), + file_name=d.get("{file_name}", None), + file_names=d.get("{file_names}", None), + is_json_schema=d.get("{is_json_schema}", None), + pos=d.get("{pos}", None), + result_type=_enum(d, "{result_type}", ResultType), + schema=d.get("{schema}", None), + summary=d.get("{summary}", None), + truncated=d.get("{truncated}", None), ) @@ -8554,51 +8557,51 @@ def as_dict(self) -> dict: """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl + body["{canned_acl}"] = self.canned_acl if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption + body["{enable_encryption}"] = self.enable_encryption if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type + body["{encryption_type}"] = self.encryption_type if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.kms_key is not None: - body["kms_key"] = self.kms_key + body["{kms_key}"] = self.kms_key if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl + body["{canned_acl}"] = self.canned_acl if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption + body["{enable_encryption}"] = self.enable_encryption if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type + body["{encryption_type}"] = self.encryption_type if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.kms_key is not None: - body["kms_key"] = self.kms_key + body["{kms_key}"] = self.kms_key if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: """Deserializes the S3StorageInfo from a dictionary.""" return cls( - canned_acl=d.get("canned_acl", None), - destination=d.get("destination", None), - enable_encryption=d.get("enable_encryption", None), - encryption_type=d.get("encryption_type", None), - endpoint=d.get("endpoint", None), - kms_key=d.get("kms_key", None), - region=d.get("region", None), + canned_acl=d.get("{canned_acl}", None), + destination=d.get("{destination}", None), + enable_encryption=d.get("{enable_encryption}", None), + encryption_type=d.get("{encryption_type}", None), + endpoint=d.get("{endpoint}", None), + kms_key=d.get("{kms_key}", None), + region=d.get("{region}", None), ) @@ -8634,51 +8637,51 @@ def as_dict(self) -> dict: """Serializes the SparkNode into a dictionary suitable for use as a JSON request body.""" body = {} if self.host_private_ip is not None: - body["host_private_ip"] = self.host_private_ip + body["{host_private_ip}"] = self.host_private_ip if self.instance_id is not None: - body["instance_id"] = self.instance_id + body["{instance_id}"] = self.instance_id if self.node_aws_attributes: - body["node_aws_attributes"] = self.node_aws_attributes.as_dict() + body["{node_aws_attributes}"] = self.node_aws_attributes.as_dict() if self.node_id is not None: - body["node_id"] = self.node_id + body["{node_id}"] = self.node_id if self.private_ip is not None: - body["private_ip"] = self.private_ip + body["{private_ip}"] = self.private_ip if self.public_dns is not None: - body["public_dns"] = self.public_dns + body["{public_dns}"] = self.public_dns if self.start_timestamp is not None: - body["start_timestamp"] = self.start_timestamp + body["{start_timestamp}"] = self.start_timestamp return body def as_shallow_dict(self) -> dict: """Serializes the SparkNode into a shallow dictionary of its immediate attributes.""" body = {} if self.host_private_ip is not None: - body["host_private_ip"] = self.host_private_ip + body["{host_private_ip}"] = self.host_private_ip if self.instance_id is not None: - body["instance_id"] = self.instance_id + body["{instance_id}"] = self.instance_id if self.node_aws_attributes: - body["node_aws_attributes"] = self.node_aws_attributes + body["{node_aws_attributes}"] = self.node_aws_attributes if self.node_id is not None: - body["node_id"] = self.node_id + body["{node_id}"] = self.node_id if self.private_ip is not None: - body["private_ip"] = self.private_ip + body["{private_ip}"] = self.private_ip if self.public_dns is not None: - body["public_dns"] = self.public_dns + body["{public_dns}"] = self.public_dns if self.start_timestamp is not None: - body["start_timestamp"] = self.start_timestamp + body["{start_timestamp}"] = self.start_timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkNode: """Deserializes the SparkNode from a dictionary.""" return cls( - host_private_ip=d.get("host_private_ip", None), - instance_id=d.get("instance_id", None), - node_aws_attributes=_from_dict(d, "node_aws_attributes", SparkNodeAwsAttributes), - node_id=d.get("node_id", None), - private_ip=d.get("private_ip", None), - public_dns=d.get("public_dns", None), - start_timestamp=d.get("start_timestamp", None), + host_private_ip=d.get("{host_private_ip}", None), + instance_id=d.get("{instance_id}", None), + node_aws_attributes=_from_dict(d, "{node_aws_attributes}", SparkNodeAwsAttributes), + node_id=d.get("{node_id}", None), + private_ip=d.get("{private_ip}", None), + public_dns=d.get("{public_dns}", None), + start_timestamp=d.get("{start_timestamp}", None), ) @@ -8693,20 +8696,20 @@ def as_dict(self) -> dict: """Serializes the SparkNodeAwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_spot is not None: - body["is_spot"] = self.is_spot + body["{is_spot}"] = self.is_spot return body def as_shallow_dict(self) -> dict: """Serializes the SparkNodeAwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.is_spot is not None: - body["is_spot"] = self.is_spot + body["{is_spot}"] = self.is_spot return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkNodeAwsAttributes: """Deserializes the SparkNodeAwsAttributes from a dictionary.""" - return cls(is_spot=d.get("is_spot", None)) + return cls(is_spot=d.get("{is_spot}", None)) @dataclass @@ -8724,24 +8727,24 @@ def as_dict(self) -> dict: """Serializes the SparkVersion into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the SparkVersion into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkVersion: """Deserializes the SparkVersion from a dictionary.""" - return cls(key=d.get("key", None), name=d.get("name", None)) + return cls(key=d.get("{key}", None), name=d.get("{name}", None)) @dataclass @@ -8753,20 +8756,20 @@ def as_dict(self) -> dict: """Serializes the StartCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the StartCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StartCluster: """Deserializes the StartCluster from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None)) + return cls(cluster_id=d.get("{cluster_id}", None)) @dataclass @@ -8820,31 +8823,31 @@ def as_dict(self) -> dict: """Serializes the TerminationReason into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["code"] = self.code.value + body["{code}"] = self.code.value if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the TerminationReason into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["code"] = self.code + body["{code}"] = self.code if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TerminationReason: """Deserializes the TerminationReason from a dictionary.""" return cls( - code=_enum(d, "code", TerminationReasonCode), - parameters=d.get("parameters", None), - type=_enum(d, "type", TerminationReasonType), + code=_enum(d, "{code}", TerminationReasonCode), + parameters=d.get("{parameters}", None), + type=_enum(d, "{type}", TerminationReasonType), ) @@ -9032,24 +9035,24 @@ def as_dict(self) -> dict: """Serializes the UninstallLibraries into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] return body def as_shallow_dict(self) -> dict: """Serializes the UninstallLibraries into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UninstallLibraries: """Deserializes the UninstallLibraries from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None), libraries=_repeated_dict(d, "libraries", Library)) + return cls(cluster_id=d.get("{cluster_id}", None), libraries=_repeated_dict(d, "{libraries}", Library)) @dataclass @@ -9078,20 +9081,20 @@ def as_dict(self) -> dict: """Serializes the UnpinCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body def as_shallow_dict(self) -> dict: """Serializes the UnpinCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UnpinCluster: """Deserializes the UnpinCluster from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None)) + return cls(cluster_id=d.get("{cluster_id}", None)) @dataclass @@ -9138,31 +9141,31 @@ def as_dict(self) -> dict: """Serializes the UpdateCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster: - body["cluster"] = self.cluster.as_dict() + body["{cluster}"] = self.cluster.as_dict() if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster: - body["cluster"] = self.cluster + body["{cluster}"] = self.cluster if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCluster: """Deserializes the UpdateCluster from a dictionary.""" return cls( - cluster=_from_dict(d, "cluster", UpdateClusterResource), - cluster_id=d.get("cluster_id", None), - update_mask=d.get("update_mask", None), + cluster=_from_dict(d, "{cluster}", UpdateClusterResource), + cluster_id=d.get("{cluster_id}", None), + update_mask=d.get("{update_mask}", None), ) @@ -9359,161 +9362,161 @@ def as_dict(self) -> dict: """Serializes the UpdateClusterResource into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value + body["{data_security_mode}"] = self.data_security_mode.value if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() + body["{docker_image}"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value + body["{runtime_engine}"] = self.runtime_engine.value if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() + body["{workload_type}"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateClusterResource into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode + body["{data_security_mode}"] = self.data_security_mode if self.docker_image: - body["docker_image"] = self.docker_image + body["{docker_image}"] = self.docker_image if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine + body["{runtime_engine}"] = self.runtime_engine if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateClusterResource: """Deserializes the UpdateClusterResource from a dictionary.""" return cls( - autoscale=_from_dict(d, "autoscale", AutoScale), - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_name=d.get("cluster_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - kind=_enum(d, "kind", Kind), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - ssh_public_keys=d.get("ssh_public_keys", None), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), + autoscale=_from_dict(d, "{autoscale}", AutoScale), + autotermination_minutes=d.get("{autotermination_minutes}", None), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + cluster_name=d.get("{cluster_name}", None), + custom_tags=d.get("{custom_tags}", None), + data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), + docker_image=_from_dict(d, "{docker_image}", DockerImage), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + is_single_node=d.get("{is_single_node}", None), + kind=_enum(d, "{kind}", Kind), + node_type_id=d.get("{node_type_id}", None), + num_workers=d.get("{num_workers}", None), + policy_id=d.get("{policy_id}", None), + runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), + single_user_name=d.get("{single_user_name}", None), + spark_conf=d.get("{spark_conf}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + spark_version=d.get("{spark_version}", None), + ssh_public_keys=d.get("{ssh_public_keys}", None), + use_ml_runtime=d.get("{use_ml_runtime}", None), + workload_type=_from_dict(d, "{workload_type}", WorkloadType), ) @@ -9565,20 +9568,20 @@ def as_dict(self) -> dict: """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: """Deserializes the VolumesStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -9592,20 +9595,20 @@ def as_dict(self) -> dict: """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" body = {} if self.clients: - body["clients"] = self.clients.as_dict() + body["{clients}"] = self.clients.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" body = {} if self.clients: - body["clients"] = self.clients + body["{clients}"] = self.clients return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: """Deserializes the WorkloadType from a dictionary.""" - return cls(clients=_from_dict(d, "clients", ClientsTypes)) + return cls(clients=_from_dict(d, "{clients}", ClientsTypes)) @dataclass @@ -9619,20 +9622,20 @@ def as_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: """Deserializes the WorkspaceStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) class ClusterPoliciesAPI: @@ -9706,22 +9709,22 @@ def create( """ body = {} if definition is not None: - body["definition"] = definition + body["{definition}"] = definition if description is not None: - body["description"] = description + body["{description}"] = description if libraries is not None: - body["libraries"] = [v.as_dict() for v in libraries] + body["{libraries}"] = [v.as_dict() for v in libraries] if max_clusters_per_user is not None: - body["max_clusters_per_user"] = max_clusters_per_user + body["{max_clusters_per_user}"] = max_clusters_per_user if name is not None: - body["name"] = name + body["{name}"] = name if policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = policy_family_definition_overrides if policy_family_id is not None: - body["policy_family_id"] = policy_family_id + body["{policy_family_id}"] = policy_family_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/policies/clusters/create", body=body, headers=headers) @@ -9739,10 +9742,10 @@ def delete(self, policy_id: str): """ body = {} if policy_id is not None: - body["policy_id"] = policy_id + body["{policy_id}"] = policy_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/policies/clusters/delete", body=body, headers=headers) @@ -9800,24 +9803,24 @@ def edit( """ body = {} if definition is not None: - body["definition"] = definition + body["{definition}"] = definition if description is not None: - body["description"] = description + body["{description}"] = description if libraries is not None: - body["libraries"] = [v.as_dict() for v in libraries] + body["{libraries}"] = [v.as_dict() for v in libraries] if max_clusters_per_user is not None: - body["max_clusters_per_user"] = max_clusters_per_user + body["{max_clusters_per_user}"] = max_clusters_per_user if name is not None: - body["name"] = name + body["{name}"] = name if policy_family_definition_overrides is not None: - body["policy_family_definition_overrides"] = policy_family_definition_overrides + body["{policy_family_definition_overrides}"] = policy_family_definition_overrides if policy_family_id is not None: - body["policy_family_id"] = policy_family_id + body["{policy_family_id}"] = policy_family_id if policy_id is not None: - body["policy_id"] = policy_id + body["{policy_id}"] = policy_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/policies/clusters/edit", body=body, headers=headers) @@ -9835,9 +9838,9 @@ def get(self, policy_id: str) -> Policy: query = {} if policy_id is not None: - query["policy_id"] = policy_id + query["{policy_id}"] = policy_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/policies/clusters/get", query=query, headers=headers) @@ -9855,7 +9858,7 @@ def get_permission_levels(self, cluster_policy_id: str) -> GetClusterPolicyPermi """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -9876,7 +9879,7 @@ def get_permissions(self, cluster_policy_id: str) -> ClusterPolicyPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/cluster-policies/{cluster_policy_id}", headers=headers) @@ -9901,11 +9904,11 @@ def list( query = {} if sort_column is not None: - query["sort_column"] = sort_column.value + query["{sort_column}"] = sort_column.value if sort_order is not None: - query["sort_order"] = sort_order.value + query["{sort_order}"] = sort_order.value headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/policies/clusters/list", query=query, headers=headers) @@ -9928,10 +9931,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -9955,10 +9958,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -9992,73 +9995,6 @@ class ClustersAPI: def __init__(self, api_client): self._api = api_client - def wait_get_cluster_running( - self, - cluster_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[ClusterDetails], None]] = None, - ) -> ClusterDetails: - deadline = time.time() + timeout.total_seconds() - target_states = (State.RUNNING,) - failure_states = ( - State.ERROR, - State.TERMINATED, - ) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(cluster_id=cluster_id) - status = poll.state - status_message = poll.state_message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach RUNNING, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"cluster_id={cluster_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - - def wait_get_cluster_terminated( - self, - cluster_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[ClusterDetails], None]] = None, - ) -> ClusterDetails: - deadline = time.time() + timeout.total_seconds() - target_states = (State.TERMINATED,) - failure_states = (State.ERROR,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(cluster_id=cluster_id) - status = poll.state - status_message = poll.state_message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach TERMINATED, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"cluster_id={cluster_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def change_owner(self, cluster_id: str, owner_username: str): """Change cluster owner. @@ -10074,12 +10010,12 @@ def change_owner(self, cluster_id: str, owner_username: str): """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if owner_username is not None: - body["owner_username"] = owner_username + body["{owner_username}"] = owner_username headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.1/clusters/change-owner", body=body, headers=headers) @@ -10300,81 +10236,81 @@ def create( :returns: Long-running operation waiter for :class:`ClusterDetails`. - See :method:wait_get_cluster_running for more details. + See :method:WaitGetClusterRunning for more details. """ body = {} if apply_policy_default_values is not None: - body["apply_policy_default_values"] = apply_policy_default_values + body["{apply_policy_default_values}"] = apply_policy_default_values if autoscale is not None: - body["autoscale"] = autoscale.as_dict() + body["{autoscale}"] = autoscale.as_dict() if autotermination_minutes is not None: - body["autotermination_minutes"] = autotermination_minutes + body["{autotermination_minutes}"] = autotermination_minutes if aws_attributes is not None: - body["aws_attributes"] = aws_attributes.as_dict() + body["{aws_attributes}"] = aws_attributes.as_dict() if azure_attributes is not None: - body["azure_attributes"] = azure_attributes.as_dict() + body["{azure_attributes}"] = azure_attributes.as_dict() if clone_from is not None: - body["clone_from"] = clone_from.as_dict() + body["{clone_from}"] = clone_from.as_dict() if cluster_log_conf is not None: - body["cluster_log_conf"] = cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = cluster_log_conf.as_dict() if cluster_name is not None: - body["cluster_name"] = cluster_name + body["{cluster_name}"] = cluster_name if custom_tags is not None: - body["custom_tags"] = custom_tags + body["{custom_tags}"] = custom_tags if data_security_mode is not None: - body["data_security_mode"] = data_security_mode.value + body["{data_security_mode}"] = data_security_mode.value if docker_image is not None: - body["docker_image"] = docker_image.as_dict() + body["{docker_image}"] = docker_image.as_dict() if driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = driver_instance_pool_id + body["{driver_instance_pool_id}"] = driver_instance_pool_id if driver_node_type_id is not None: - body["driver_node_type_id"] = driver_node_type_id + body["{driver_node_type_id}"] = driver_node_type_id if enable_elastic_disk is not None: - body["enable_elastic_disk"] = enable_elastic_disk + body["{enable_elastic_disk}"] = enable_elastic_disk if enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = enable_local_disk_encryption if gcp_attributes is not None: - body["gcp_attributes"] = gcp_attributes.as_dict() + body["{gcp_attributes}"] = gcp_attributes.as_dict() if init_scripts is not None: - body["init_scripts"] = [v.as_dict() for v in init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in init_scripts] if instance_pool_id is not None: - body["instance_pool_id"] = instance_pool_id + body["{instance_pool_id}"] = instance_pool_id if is_single_node is not None: - body["is_single_node"] = is_single_node + body["{is_single_node}"] = is_single_node if kind is not None: - body["kind"] = kind.value + body["{kind}"] = kind.value if node_type_id is not None: - body["node_type_id"] = node_type_id + body["{node_type_id}"] = node_type_id if num_workers is not None: - body["num_workers"] = num_workers + body["{num_workers}"] = num_workers if policy_id is not None: - body["policy_id"] = policy_id + body["{policy_id}"] = policy_id if runtime_engine is not None: - body["runtime_engine"] = runtime_engine.value + body["{runtime_engine}"] = runtime_engine.value if single_user_name is not None: - body["single_user_name"] = single_user_name + body["{single_user_name}"] = single_user_name if spark_conf is not None: - body["spark_conf"] = spark_conf + body["{spark_conf}"] = spark_conf if spark_env_vars is not None: - body["spark_env_vars"] = spark_env_vars + body["{spark_env_vars}"] = spark_env_vars if spark_version is not None: - body["spark_version"] = spark_version + body["{spark_version}"] = spark_version if ssh_public_keys is not None: - body["ssh_public_keys"] = [v for v in ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in ssh_public_keys] if use_ml_runtime is not None: - body["use_ml_runtime"] = use_ml_runtime + body["{use_ml_runtime}"] = use_ml_runtime if workload_type is not None: - body["workload_type"] = workload_type.as_dict() + body["{workload_type}"] = workload_type.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.1/clusters/create", body=body, headers=headers) return Wait( - self.wait_get_cluster_running, + self.WaitGetClusterRunning, response=CreateClusterResponse.from_dict(op_response), - cluster_id=op_response["cluster_id"], + cluster_id=op_response["{cluster_id}"], ) def create_and_wait( @@ -10459,21 +10395,19 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: :returns: Long-running operation waiter for :class:`ClusterDetails`. - See :method:wait_get_cluster_terminated for more details. + See :method:WaitGetClusterTerminated for more details. """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.1/clusters/delete", body=body, headers=headers) return Wait( - self.wait_get_cluster_terminated, - response=DeleteClusterResponse.from_dict(op_response), - cluster_id=cluster_id, + self.WaitGetClusterTerminated, response=DeleteClusterResponse.from_dict(op_response), cluster_id=cluster_id ) def delete_and_wait(self, cluster_id: str, timeout=timedelta(minutes=20)) -> ClusterDetails: @@ -10692,79 +10626,79 @@ def edit( :returns: Long-running operation waiter for :class:`ClusterDetails`. - See :method:wait_get_cluster_running for more details. + See :method:WaitGetClusterRunning for more details. """ body = {} if apply_policy_default_values is not None: - body["apply_policy_default_values"] = apply_policy_default_values + body["{apply_policy_default_values}"] = apply_policy_default_values if autoscale is not None: - body["autoscale"] = autoscale.as_dict() + body["{autoscale}"] = autoscale.as_dict() if autotermination_minutes is not None: - body["autotermination_minutes"] = autotermination_minutes + body["{autotermination_minutes}"] = autotermination_minutes if aws_attributes is not None: - body["aws_attributes"] = aws_attributes.as_dict() + body["{aws_attributes}"] = aws_attributes.as_dict() if azure_attributes is not None: - body["azure_attributes"] = azure_attributes.as_dict() + body["{azure_attributes}"] = azure_attributes.as_dict() if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if cluster_log_conf is not None: - body["cluster_log_conf"] = cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = cluster_log_conf.as_dict() if cluster_name is not None: - body["cluster_name"] = cluster_name + body["{cluster_name}"] = cluster_name if custom_tags is not None: - body["custom_tags"] = custom_tags + body["{custom_tags}"] = custom_tags if data_security_mode is not None: - body["data_security_mode"] = data_security_mode.value + body["{data_security_mode}"] = data_security_mode.value if docker_image is not None: - body["docker_image"] = docker_image.as_dict() + body["{docker_image}"] = docker_image.as_dict() if driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = driver_instance_pool_id + body["{driver_instance_pool_id}"] = driver_instance_pool_id if driver_node_type_id is not None: - body["driver_node_type_id"] = driver_node_type_id + body["{driver_node_type_id}"] = driver_node_type_id if enable_elastic_disk is not None: - body["enable_elastic_disk"] = enable_elastic_disk + body["{enable_elastic_disk}"] = enable_elastic_disk if enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = enable_local_disk_encryption if gcp_attributes is not None: - body["gcp_attributes"] = gcp_attributes.as_dict() + body["{gcp_attributes}"] = gcp_attributes.as_dict() if init_scripts is not None: - body["init_scripts"] = [v.as_dict() for v in init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in init_scripts] if instance_pool_id is not None: - body["instance_pool_id"] = instance_pool_id + body["{instance_pool_id}"] = instance_pool_id if is_single_node is not None: - body["is_single_node"] = is_single_node + body["{is_single_node}"] = is_single_node if kind is not None: - body["kind"] = kind.value + body["{kind}"] = kind.value if node_type_id is not None: - body["node_type_id"] = node_type_id + body["{node_type_id}"] = node_type_id if num_workers is not None: - body["num_workers"] = num_workers + body["{num_workers}"] = num_workers if policy_id is not None: - body["policy_id"] = policy_id + body["{policy_id}"] = policy_id if runtime_engine is not None: - body["runtime_engine"] = runtime_engine.value + body["{runtime_engine}"] = runtime_engine.value if single_user_name is not None: - body["single_user_name"] = single_user_name + body["{single_user_name}"] = single_user_name if spark_conf is not None: - body["spark_conf"] = spark_conf + body["{spark_conf}"] = spark_conf if spark_env_vars is not None: - body["spark_env_vars"] = spark_env_vars + body["{spark_env_vars}"] = spark_env_vars if spark_version is not None: - body["spark_version"] = spark_version + body["{spark_version}"] = spark_version if ssh_public_keys is not None: - body["ssh_public_keys"] = [v for v in ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in ssh_public_keys] if use_ml_runtime is not None: - body["use_ml_runtime"] = use_ml_runtime + body["{use_ml_runtime}"] = use_ml_runtime if workload_type is not None: - body["workload_type"] = workload_type.as_dict() + body["{workload_type}"] = workload_type.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.1/clusters/edit", body=body, headers=headers) return Wait( - self.wait_get_cluster_running, response=EditClusterResponse.from_dict(op_response), cluster_id=cluster_id + self.WaitGetClusterRunning, response=EditClusterResponse.from_dict(op_response), cluster_id=cluster_id ) def edit_and_wait( @@ -10874,28 +10808,28 @@ def events( """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if end_time is not None: - body["end_time"] = end_time + body["{end_time}"] = end_time if event_types is not None: - body["event_types"] = [v.value for v in event_types] + body["{event_types}"] = [v.value for v in event_types] if limit is not None: - body["limit"] = limit + body["{limit}"] = limit if offset is not None: - body["offset"] = offset + body["{offset}"] = offset if order is not None: - body["order"] = order.value + body["{order}"] = order.value if start_time is not None: - body["start_time"] = start_time + body["{start_time}"] = start_time headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } while True: json = self._api.do("POST", "/api/2.1/clusters/events", body=body, headers=headers) - if "events" in json: - for v in json["events"]: + if "{events}" in json: + for v in json["{events}"]: yield ClusterEvent.from_dict(v) if "next_page" not in json or not json["next_page"]: return @@ -10915,9 +10849,9 @@ def get(self, cluster_id: str) -> ClusterDetails: query = {} if cluster_id is not None: - query["cluster_id"] = cluster_id + query["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/clusters/get", query=query, headers=headers) @@ -10935,7 +10869,7 @@ def get_permission_levels(self, cluster_id: str) -> GetClusterPermissionLevelsRe """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/clusters/{cluster_id}/permissionLevels", headers=headers) @@ -10953,7 +10887,7 @@ def get_permissions(self, cluster_id: str) -> ClusterPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/clusters/{cluster_id}", headers=headers) @@ -10988,25 +10922,25 @@ def list( query = {} if filter_by is not None: - query["filter_by"] = filter_by.as_dict() + query["{filter_by}"] = filter_by.as_dict() if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if sort_by is not None: - query["sort_by"] = sort_by.as_dict() + query["{sort_by}"] = sort_by.as_dict() headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/clusters/list", query=query, headers=headers) - if "clusters" in json: - for v in json["clusters"]: + if "{clusters}" in json: + for v in json["{clusters}"]: yield ClusterDetails.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_node_types(self) -> ListNodeTypesResponse: """List node types. @@ -11017,7 +10951,7 @@ def list_node_types(self) -> ListNodeTypesResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/clusters/list-node-types", headers=headers) @@ -11033,7 +10967,7 @@ def list_zones(self) -> ListAvailableZonesResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/clusters/list-zones", headers=headers) @@ -11055,10 +10989,10 @@ def permanent_delete(self, cluster_id: str): """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.1/clusters/permanent-delete", body=body, headers=headers) @@ -11075,10 +11009,10 @@ def pin(self, cluster_id: str): """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.1/clusters/pin", body=body, headers=headers) @@ -11108,23 +11042,23 @@ def resize( :returns: Long-running operation waiter for :class:`ClusterDetails`. - See :method:wait_get_cluster_running for more details. + See :method:WaitGetClusterRunning for more details. """ body = {} if autoscale is not None: - body["autoscale"] = autoscale.as_dict() + body["{autoscale}"] = autoscale.as_dict() if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if num_workers is not None: - body["num_workers"] = num_workers + body["{num_workers}"] = num_workers headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.1/clusters/resize", body=body, headers=headers) return Wait( - self.wait_get_cluster_running, response=ResizeClusterResponse.from_dict(op_response), cluster_id=cluster_id + self.WaitGetClusterRunning, response=ResizeClusterResponse.from_dict(op_response), cluster_id=cluster_id ) def resize_and_wait( @@ -11149,21 +11083,21 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai :returns: Long-running operation waiter for :class:`ClusterDetails`. - See :method:wait_get_cluster_running for more details. + See :method:WaitGetClusterRunning for more details. """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if restart_user is not None: - body["restart_user"] = restart_user + body["{restart_user}"] = restart_user headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.1/clusters/restart", body=body, headers=headers) return Wait( - self.wait_get_cluster_running, response=RestartClusterResponse.from_dict(op_response), cluster_id=cluster_id + self.WaitGetClusterRunning, response=RestartClusterResponse.from_dict(op_response), cluster_id=cluster_id ) def restart_and_wait( @@ -11187,10 +11121,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/clusters/{cluster_id}", body=body, headers=headers) @@ -11205,7 +11139,7 @@ def spark_versions(self) -> GetSparkVersionsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/clusters/spark-versions", headers=headers) @@ -11225,19 +11159,19 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: :returns: Long-running operation waiter for :class:`ClusterDetails`. - See :method:wait_get_cluster_running for more details. + See :method:WaitGetClusterRunning for more details. """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.1/clusters/start", body=body, headers=headers) return Wait( - self.wait_get_cluster_running, response=StartClusterResponse.from_dict(op_response), cluster_id=cluster_id + self.WaitGetClusterRunning, response=StartClusterResponse.from_dict(op_response), cluster_id=cluster_id ) def start_and_wait(self, cluster_id: str, timeout=timedelta(minutes=20)) -> ClusterDetails: @@ -11256,10 +11190,10 @@ def unpin(self, cluster_id: str): """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.1/clusters/unpin", body=body, headers=headers) @@ -11298,23 +11232,23 @@ def update( :returns: Long-running operation waiter for :class:`ClusterDetails`. - See :method:wait_get_cluster_running for more details. + See :method:WaitGetClusterRunning for more details. """ body = {} if cluster is not None: - body["cluster"] = cluster.as_dict() + body["{cluster}"] = cluster.as_dict() if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if update_mask is not None: - body["update_mask"] = update_mask + body["{update_mask}"] = update_mask headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.1/clusters/update", body=body, headers=headers) return Wait( - self.wait_get_cluster_running, response=UpdateClusterResponse.from_dict(op_response), cluster_id=cluster_id + self.WaitGetClusterRunning, response=UpdateClusterResponse.from_dict(op_response), cluster_id=cluster_id ) def update_and_wait( @@ -11342,10 +11276,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/permissions/clusters/{cluster_id}", body=body, headers=headers) @@ -11359,115 +11293,6 @@ class CommandExecutionAPI: def __init__(self, api_client): self._api = api_client - def wait_command_status_command_execution_cancelled( - self, - cluster_id: str, - command_id: str, - context_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[CommandStatusResponse], None]] = None, - ) -> CommandStatusResponse: - deadline = time.time() + timeout.total_seconds() - target_states = (CommandStatus.CANCELLED,) - failure_states = (CommandStatus.ERROR,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.command_status(cluster_id=cluster_id, command_id=command_id, context_id=context_id) - status = poll.status - status_message = f"current status: {status}" - if poll.results: - status_message = poll.results.cause - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach Cancelled, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"cluster_id={cluster_id}, command_id={command_id}, context_id={context_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - - def wait_context_status_command_execution_running( - self, - cluster_id: str, - context_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[ContextStatusResponse], None]] = None, - ) -> ContextStatusResponse: - deadline = time.time() + timeout.total_seconds() - target_states = (ContextStatus.RUNNING,) - failure_states = (ContextStatus.ERROR,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.context_status(cluster_id=cluster_id, context_id=context_id) - status = poll.status - status_message = f"current status: {status}" - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach Running, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"cluster_id={cluster_id}, context_id={context_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - - def wait_command_status_command_execution_finished_or_error( - self, - cluster_id: str, - command_id: str, - context_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[CommandStatusResponse], None]] = None, - ) -> CommandStatusResponse: - deadline = time.time() + timeout.total_seconds() - target_states = ( - CommandStatus.FINISHED, - CommandStatus.ERROR, - ) - failure_states = ( - CommandStatus.CANCELLED, - CommandStatus.CANCELLING, - ) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.command_status(cluster_id=cluster_id, command_id=command_id, context_id=context_id) - status = poll.status - status_message = f"current status: {status}" - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach Finished or Error, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"cluster_id={cluster_id}, command_id={command_id}, context_id={context_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def cancel( self, *, cluster_id: Optional[str] = None, command_id: Optional[str] = None, context_id: Optional[str] = None ) -> Wait[CommandStatusResponse]: @@ -11483,23 +11308,23 @@ def cancel( :returns: Long-running operation waiter for :class:`CommandStatusResponse`. - See :method:wait_command_status_command_execution_cancelled for more details. + See :method:WaitCommandStatusCommandExecutionCancelled for more details. """ body = {} if cluster_id is not None: - body["clusterId"] = cluster_id + body["{cluster_id}"] = cluster_id if command_id is not None: - body["commandId"] = command_id + body["{command_id}"] = command_id if context_id is not None: - body["contextId"] = context_id + body["{context_id}"] = context_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/1.2/commands/cancel", body=body, headers=headers) return Wait( - self.wait_command_status_command_execution_cancelled, + self.WaitCommandStatusCommandExecutionCancelled, response=CancelResponse.from_dict(op_response), cluster_id=cluster_id, command_id=command_id, @@ -11532,13 +11357,13 @@ def command_status(self, cluster_id: str, context_id: str, command_id: str) -> C query = {} if cluster_id is not None: - query["clusterId"] = cluster_id + query["{cluster_id}"] = cluster_id if command_id is not None: - query["commandId"] = command_id + query["{command_id}"] = command_id if context_id is not None: - query["contextId"] = context_id + query["{context_id}"] = context_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/1.2/commands/status", query=query, headers=headers) @@ -11557,11 +11382,11 @@ def context_status(self, cluster_id: str, context_id: str) -> ContextStatusRespo query = {} if cluster_id is not None: - query["clusterId"] = cluster_id + query["{cluster_id}"] = cluster_id if context_id is not None: - query["contextId"] = context_id + query["{context_id}"] = context_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/1.2/contexts/status", query=query, headers=headers) @@ -11582,24 +11407,24 @@ def create( :returns: Long-running operation waiter for :class:`ContextStatusResponse`. - See :method:wait_context_status_command_execution_running for more details. + See :method:WaitContextStatusCommandExecutionRunning for more details. """ body = {} if cluster_id is not None: - body["clusterId"] = cluster_id + body["{cluster_id}"] = cluster_id if language is not None: - body["language"] = language.value + body["{language}"] = language.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/1.2/contexts/create", body=body, headers=headers) return Wait( - self.wait_context_status_command_execution_running, + self.WaitContextStatusCommandExecutionRunning, response=Created.from_dict(op_response), cluster_id=cluster_id, - context_id=op_response["id"], + context_id=op_response["{id}"], ) def create_and_wait( @@ -11619,12 +11444,12 @@ def destroy(self, cluster_id: str, context_id: str): """ body = {} if cluster_id is not None: - body["clusterId"] = cluster_id + body["{cluster_id}"] = cluster_id if context_id is not None: - body["contextId"] = context_id + body["{context_id}"] = context_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/1.2/contexts/destroy", body=body, headers=headers) @@ -11653,28 +11478,28 @@ def execute( :returns: Long-running operation waiter for :class:`CommandStatusResponse`. - See :method:wait_command_status_command_execution_finished_or_error for more details. + See :method:WaitCommandStatusCommandExecutionFinishedOrError for more details. """ body = {} if cluster_id is not None: - body["clusterId"] = cluster_id + body["{cluster_id}"] = cluster_id if command is not None: - body["command"] = command + body["{command}"] = command if context_id is not None: - body["contextId"] = context_id + body["{context_id}"] = context_id if language is not None: - body["language"] = language.value + body["{language}"] = language.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/1.2/commands/execute", body=body, headers=headers) return Wait( - self.wait_command_status_command_execution_finished_or_error, + self.WaitCommandStatusCommandExecutionFinishedOrError, response=Created.from_dict(op_response), cluster_id=cluster_id, - command_id=op_response["id"], + command_id=op_response["{id}"], context_id=context_id, ) @@ -11732,16 +11557,16 @@ def create( """ body = {} if enabled is not None: - body["enabled"] = enabled + body["{enabled}"] = enabled if name is not None: - body["name"] = name + body["{name}"] = name if position is not None: - body["position"] = position + body["{position}"] = position if script is not None: - body["script"] = script + body["{script}"] = script headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/global-init-scripts", body=body, headers=headers) @@ -11759,7 +11584,7 @@ def delete(self, script_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/global-init-scripts/{script_id}", headers=headers) @@ -11776,7 +11601,7 @@ def get(self, script_id: str) -> GlobalInitScriptDetailsWithContent: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/global-init-scripts/{script_id}", headers=headers) @@ -11793,7 +11618,7 @@ def list(self) -> Iterator[GlobalInitScriptDetails]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/global-init-scripts", headers=headers) @@ -11831,16 +11656,16 @@ def update( """ body = {} if enabled is not None: - body["enabled"] = enabled + body["{enabled}"] = enabled if name is not None: - body["name"] = name + body["{name}"] = name if position is not None: - body["position"] = position + body["{position}"] = position if script is not None: - body["script"] = script + body["{script}"] = script headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.0/global-init-scripts/{script_id}", body=body, headers=headers) @@ -11937,34 +11762,34 @@ def create( """ body = {} if aws_attributes is not None: - body["aws_attributes"] = aws_attributes.as_dict() + body["{aws_attributes}"] = aws_attributes.as_dict() if azure_attributes is not None: - body["azure_attributes"] = azure_attributes.as_dict() + body["{azure_attributes}"] = azure_attributes.as_dict() if custom_tags is not None: - body["custom_tags"] = custom_tags + body["{custom_tags}"] = custom_tags if disk_spec is not None: - body["disk_spec"] = disk_spec.as_dict() + body["{disk_spec}"] = disk_spec.as_dict() if enable_elastic_disk is not None: - body["enable_elastic_disk"] = enable_elastic_disk + body["{enable_elastic_disk}"] = enable_elastic_disk if gcp_attributes is not None: - body["gcp_attributes"] = gcp_attributes.as_dict() + body["{gcp_attributes}"] = gcp_attributes.as_dict() if idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = idle_instance_autotermination_minutes if instance_pool_name is not None: - body["instance_pool_name"] = instance_pool_name + body["{instance_pool_name}"] = instance_pool_name if max_capacity is not None: - body["max_capacity"] = max_capacity + body["{max_capacity}"] = max_capacity if min_idle_instances is not None: - body["min_idle_instances"] = min_idle_instances + body["{min_idle_instances}"] = min_idle_instances if node_type_id is not None: - body["node_type_id"] = node_type_id + body["{node_type_id}"] = node_type_id if preloaded_docker_images is not None: - body["preloaded_docker_images"] = [v.as_dict() for v in preloaded_docker_images] + body["{preloaded_docker_images}"] = [v.as_dict() for v in preloaded_docker_images] if preloaded_spark_versions is not None: - body["preloaded_spark_versions"] = [v for v in preloaded_spark_versions] + body["{preloaded_spark_versions}"] = [v for v in preloaded_spark_versions] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/instance-pools/create", body=body, headers=headers) @@ -11982,10 +11807,10 @@ def delete(self, instance_pool_id: str): """ body = {} if instance_pool_id is not None: - body["instance_pool_id"] = instance_pool_id + body["{instance_pool_id}"] = instance_pool_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/instance-pools/delete", body=body, headers=headers) @@ -12037,22 +11862,22 @@ def edit( """ body = {} if custom_tags is not None: - body["custom_tags"] = custom_tags + body["{custom_tags}"] = custom_tags if idle_instance_autotermination_minutes is not None: - body["idle_instance_autotermination_minutes"] = idle_instance_autotermination_minutes + body["{idle_instance_autotermination_minutes}"] = idle_instance_autotermination_minutes if instance_pool_id is not None: - body["instance_pool_id"] = instance_pool_id + body["{instance_pool_id}"] = instance_pool_id if instance_pool_name is not None: - body["instance_pool_name"] = instance_pool_name + body["{instance_pool_name}"] = instance_pool_name if max_capacity is not None: - body["max_capacity"] = max_capacity + body["{max_capacity}"] = max_capacity if min_idle_instances is not None: - body["min_idle_instances"] = min_idle_instances + body["{min_idle_instances}"] = min_idle_instances if node_type_id is not None: - body["node_type_id"] = node_type_id + body["{node_type_id}"] = node_type_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/instance-pools/edit", body=body, headers=headers) @@ -12070,9 +11895,9 @@ def get(self, instance_pool_id: str) -> GetInstancePool: query = {} if instance_pool_id is not None: - query["instance_pool_id"] = instance_pool_id + query["{instance_pool_id}"] = instance_pool_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/instance-pools/get", query=query, headers=headers) @@ -12090,7 +11915,7 @@ def get_permission_levels(self, instance_pool_id: str) -> GetInstancePoolPermiss """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -12111,7 +11936,7 @@ def get_permissions(self, instance_pool_id: str) -> InstancePoolPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", headers=headers) @@ -12126,7 +11951,7 @@ def list(self) -> Iterator[InstancePoolAndStats]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/instance-pools/list", headers=headers) @@ -12149,10 +11974,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", body=body, headers=headers) @@ -12174,10 +11999,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -12236,16 +12061,16 @@ def add( """ body = {} if iam_role_arn is not None: - body["iam_role_arn"] = iam_role_arn + body["{iam_role_arn}"] = iam_role_arn if instance_profile_arn is not None: - body["instance_profile_arn"] = instance_profile_arn + body["{instance_profile_arn}"] = instance_profile_arn if is_meta_instance_profile is not None: - body["is_meta_instance_profile"] = is_meta_instance_profile + body["{is_meta_instance_profile}"] = is_meta_instance_profile if skip_validation is not None: - body["skip_validation"] = skip_validation + body["{skip_validation}"] = skip_validation headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/instance-profiles/add", body=body, headers=headers) @@ -12292,14 +12117,14 @@ def edit( """ body = {} if iam_role_arn is not None: - body["iam_role_arn"] = iam_role_arn + body["{iam_role_arn}"] = iam_role_arn if instance_profile_arn is not None: - body["instance_profile_arn"] = instance_profile_arn + body["{instance_profile_arn}"] = instance_profile_arn if is_meta_instance_profile is not None: - body["is_meta_instance_profile"] = is_meta_instance_profile + body["{is_meta_instance_profile}"] = is_meta_instance_profile headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/instance-profiles/edit", body=body, headers=headers) @@ -12315,7 +12140,7 @@ def list(self) -> Iterator[InstanceProfile]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/instance-profiles/list", headers=headers) @@ -12337,10 +12162,10 @@ def remove(self, instance_profile_arn: str): """ body = {} if instance_profile_arn is not None: - body["instance_profile_arn"] = instance_profile_arn + body["{instance_profile_arn}"] = instance_profile_arn headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/instance-profiles/remove", body=body, headers=headers) @@ -12374,7 +12199,7 @@ def all_cluster_statuses(self) -> Iterator[ClusterLibraryStatuses]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/libraries/all-cluster-statuses", headers=headers) @@ -12398,9 +12223,9 @@ def cluster_status(self, cluster_id: str) -> Iterator[LibraryFullStatus]: query = {} if cluster_id is not None: - query["cluster_id"] = cluster_id + query["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/libraries/cluster-status", query=query, headers=headers) @@ -12422,12 +12247,12 @@ def install(self, cluster_id: str, libraries: List[Library]): """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if libraries is not None: - body["libraries"] = [v.as_dict() for v in libraries] + body["{libraries}"] = [v.as_dict() for v in libraries] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/libraries/install", body=body, headers=headers) @@ -12447,12 +12272,12 @@ def uninstall(self, cluster_id: str, libraries: List[Library]): """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if libraries is not None: - body["libraries"] = [v.as_dict() for v in libraries] + body["{libraries}"] = [v.as_dict() for v in libraries] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/libraries/uninstall", body=body, headers=headers) @@ -12498,12 +12323,12 @@ def enforce_compliance( """ body = {} if cluster_id is not None: - body["cluster_id"] = cluster_id + body["{cluster_id}"] = cluster_id if validate_only is not None: - body["validate_only"] = validate_only + body["{validate_only}"] = validate_only headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/policies/clusters/enforce-compliance", body=body, headers=headers) @@ -12523,9 +12348,9 @@ def get_compliance(self, cluster_id: str) -> GetClusterComplianceResponse: query = {} if cluster_id is not None: - query["cluster_id"] = cluster_id + query["{cluster_id}"] = cluster_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/policies/clusters/get-compliance", query=query, headers=headers) @@ -12553,23 +12378,23 @@ def list_compliance( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if policy_id is not None: - query["policy_id"] = policy_id + query["{policy_id}"] = policy_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/policies/clusters/list-compliance", query=query, headers=headers) - if "clusters" in json: - for v in json["clusters"]: + if "{clusters}" in json: + for v in json["{clusters}"]: yield ClusterCompliance.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class PolicyFamiliesAPI: @@ -12601,9 +12426,9 @@ def get(self, policy_family_id: str, *, version: Optional[int] = None) -> Policy query = {} if version is not None: - query["version"] = version + query["{version}"] = version headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/policy-families/{policy_family_id}", query=query, headers=headers) @@ -12625,18 +12450,18 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/policy-families", query=query, headers=headers) - if "policy_families" in json: - for v in json["policy_families"]: + if "{policy_families}" in json: + for v in json["{policy_families}"]: yield PolicyFamily.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/dashboards/v2/impl.py similarity index 75% rename from databricks/sdk/service/dashboards.py rename to databricks/sdk/dashboards/v2/impl.py index 98307a8bb..2e5720786 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/dashboards/v2/impl.py @@ -3,19 +3,15 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import Wait, _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -41,36 +37,36 @@ def as_dict(self) -> dict: """Serializes the BaseChunkInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body def as_shallow_dict(self) -> dict: """Serializes the BaseChunkInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseChunkInfo: """Deserializes the BaseChunkInfo from a dictionary.""" return cls( - byte_count=d.get("byte_count", None), - chunk_index=d.get("chunk_index", None), - row_count=d.get("row_count", None), - row_offset=d.get("row_offset", None), + byte_count=d.get("{byte_count}", None), + chunk_index=d.get("{chunk_index}", None), + row_count=d.get("{row_count}", None), + row_offset=d.get("{row_offset}", None), ) @@ -82,20 +78,20 @@ def as_dict(self) -> dict: """Serializes the CancelQueryExecutionResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.status: - body["status"] = [v.as_dict() for v in self.status] + body["{status}"] = [v.as_dict() for v in self.status] return body def as_shallow_dict(self) -> dict: """Serializes the CancelQueryExecutionResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelQueryExecutionResponse: """Deserializes the CancelQueryExecutionResponse from a dictionary.""" - return cls(status=_repeated_dict(d, "status", CancelQueryExecutionResponseStatus)) + return cls(status=_repeated_dict(d, "{status}", CancelQueryExecutionResponseStatus)) @dataclass @@ -116,31 +112,31 @@ def as_dict(self) -> dict: """Serializes the CancelQueryExecutionResponseStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_token is not None: - body["data_token"] = self.data_token + body["{data_token}"] = self.data_token if self.pending: - body["pending"] = self.pending.as_dict() + body["{pending}"] = self.pending.as_dict() if self.success: - body["success"] = self.success.as_dict() + body["{success}"] = self.success.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CancelQueryExecutionResponseStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.data_token is not None: - body["data_token"] = self.data_token + body["{data_token}"] = self.data_token if self.pending: - body["pending"] = self.pending + body["{pending}"] = self.pending if self.success: - body["success"] = self.success + body["{success}"] = self.success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelQueryExecutionResponseStatus: """Deserializes the CancelQueryExecutionResponseStatus from a dictionary.""" return cls( - data_token=d.get("data_token", None), - pending=_from_dict(d, "pending", Empty), - success=_from_dict(d, "success", Empty), + data_token=d.get("{data_token}", None), + pending=_from_dict(d, "{pending}", Empty), + success=_from_dict(d, "{success}", Empty), ) @@ -173,51 +169,51 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_name is not None: - body["type_name"] = self.type_name.value + body["{type_name}"] = self.type_name.value if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_name is not None: - body["type_name"] = self.type_name + body["{type_name}"] = self.type_name if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - name=d.get("name", None), - position=d.get("position", None), - type_interval_type=d.get("type_interval_type", None), - type_name=_enum(d, "type_name", ColumnInfoTypeName), - type_precision=d.get("type_precision", None), - type_scale=d.get("type_scale", None), - type_text=d.get("type_text", None), + name=d.get("{name}", None), + position=d.get("{position}", None), + type_interval_type=d.get("{type_interval_type}", None), + type_name=_enum(d, "{type_name}", ColumnInfoTypeName), + type_precision=d.get("{type_precision}", None), + type_scale=d.get("{type_scale}", None), + type_text=d.get("{type_text}", None), ) @@ -264,24 +260,26 @@ def as_dict(self) -> dict: """Serializes the CronSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.quartz_cron_expression is not None: - body["quartz_cron_expression"] = self.quartz_cron_expression + body["{quartz_cron_expression}"] = self.quartz_cron_expression if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body def as_shallow_dict(self) -> dict: """Serializes the CronSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.quartz_cron_expression is not None: - body["quartz_cron_expression"] = self.quartz_cron_expression + body["{quartz_cron_expression}"] = self.quartz_cron_expression if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: """Deserializes the CronSchedule from a dictionary.""" - return cls(quartz_cron_expression=d.get("quartz_cron_expression", None), timezone_id=d.get("timezone_id", None)) + return cls( + quartz_cron_expression=d.get("{quartz_cron_expression}", None), timezone_id=d.get("{timezone_id}", None) + ) @dataclass @@ -329,66 +327,66 @@ def as_dict(self) -> dict: """Serializes the Dashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state.value + body["{lifecycle_state}"] = self.lifecycle_state.value if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.serialized_dashboard is not None: - body["serialized_dashboard"] = self.serialized_dashboard + body["{serialized_dashboard}"] = self.serialized_dashboard if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the Dashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state + body["{lifecycle_state}"] = self.lifecycle_state if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.serialized_dashboard is not None: - body["serialized_dashboard"] = self.serialized_dashboard + body["{serialized_dashboard}"] = self.serialized_dashboard if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dashboard: """Deserializes the Dashboard from a dictionary.""" return cls( - create_time=d.get("create_time", None), - dashboard_id=d.get("dashboard_id", None), - display_name=d.get("display_name", None), - etag=d.get("etag", None), - lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), - parent_path=d.get("parent_path", None), - path=d.get("path", None), - serialized_dashboard=d.get("serialized_dashboard", None), - update_time=d.get("update_time", None), - warehouse_id=d.get("warehouse_id", None), + create_time=d.get("{create_time}", None), + dashboard_id=d.get("{dashboard_id}", None), + display_name=d.get("{display_name}", None), + etag=d.get("{etag}", None), + lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), + parent_path=d.get("{parent_path}", None), + path=d.get("{path}", None), + serialized_dashboard=d.get("{serialized_dashboard}", None), + update_time=d.get("{update_time}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -475,31 +473,31 @@ def as_dict(self) -> dict: """Serializes the ExecutePublishedDashboardQueryRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_name is not None: - body["dashboard_name"] = self.dashboard_name + body["{dashboard_name}"] = self.dashboard_name if self.dashboard_revision_id is not None: - body["dashboard_revision_id"] = self.dashboard_revision_id + body["{dashboard_revision_id}"] = self.dashboard_revision_id if self.override_warehouse_id is not None: - body["override_warehouse_id"] = self.override_warehouse_id + body["{override_warehouse_id}"] = self.override_warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the ExecutePublishedDashboardQueryRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_name is not None: - body["dashboard_name"] = self.dashboard_name + body["{dashboard_name}"] = self.dashboard_name if self.dashboard_revision_id is not None: - body["dashboard_revision_id"] = self.dashboard_revision_id + body["{dashboard_revision_id}"] = self.dashboard_revision_id if self.override_warehouse_id is not None: - body["override_warehouse_id"] = self.override_warehouse_id + body["{override_warehouse_id}"] = self.override_warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExecutePublishedDashboardQueryRequest: """Deserializes the ExecutePublishedDashboardQueryRequest from a dictionary.""" return cls( - dashboard_name=d.get("dashboard_name", None), - dashboard_revision_id=d.get("dashboard_revision_id", None), - override_warehouse_id=d.get("override_warehouse_id", None), + dashboard_name=d.get("{dashboard_name}", None), + dashboard_revision_id=d.get("{dashboard_revision_id}", None), + override_warehouse_id=d.get("{override_warehouse_id}", None), ) @@ -562,61 +560,61 @@ def as_dict(self) -> dict: """Serializes the ExternalLink into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.expiration is not None: - body["expiration"] = self.expiration + body["{expiration}"] = self.expiration if self.external_link is not None: - body["external_link"] = self.external_link + body["{external_link}"] = self.external_link if self.http_headers: - body["http_headers"] = self.http_headers + body["{http_headers}"] = self.http_headers if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body def as_shallow_dict(self) -> dict: """Serializes the ExternalLink into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.expiration is not None: - body["expiration"] = self.expiration + body["{expiration}"] = self.expiration if self.external_link is not None: - body["external_link"] = self.external_link + body["{external_link}"] = self.external_link if self.http_headers: - body["http_headers"] = self.http_headers + body["{http_headers}"] = self.http_headers if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalLink: """Deserializes the ExternalLink from a dictionary.""" return cls( - byte_count=d.get("byte_count", None), - chunk_index=d.get("chunk_index", None), - expiration=d.get("expiration", None), - external_link=d.get("external_link", None), - http_headers=d.get("http_headers", None), - next_chunk_index=d.get("next_chunk_index", None), - next_chunk_internal_link=d.get("next_chunk_internal_link", None), - row_count=d.get("row_count", None), - row_offset=d.get("row_offset", None), + byte_count=d.get("{byte_count}", None), + chunk_index=d.get("{chunk_index}", None), + expiration=d.get("{expiration}", None), + external_link=d.get("{external_link}", None), + http_headers=d.get("{http_headers}", None), + next_chunk_index=d.get("{next_chunk_index}", None), + next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), + row_count=d.get("{row_count}", None), + row_offset=d.get("{row_offset}", None), ) @@ -644,31 +642,31 @@ def as_dict(self) -> dict: """Serializes the GenieAttachment into a dictionary suitable for use as a JSON request body.""" body = {} if self.attachment_id is not None: - body["attachment_id"] = self.attachment_id + body["{attachment_id}"] = self.attachment_id if self.query: - body["query"] = self.query.as_dict() + body["{query}"] = self.query.as_dict() if self.text: - body["text"] = self.text.as_dict() + body["{text}"] = self.text.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GenieAttachment into a shallow dictionary of its immediate attributes.""" body = {} if self.attachment_id is not None: - body["attachment_id"] = self.attachment_id + body["{attachment_id}"] = self.attachment_id if self.query: - body["query"] = self.query + body["{query}"] = self.query if self.text: - body["text"] = self.text + body["{text}"] = self.text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieAttachment: """Deserializes the GenieAttachment from a dictionary.""" return cls( - attachment_id=d.get("attachment_id", None), - query=_from_dict(d, "query", GenieQueryAttachment), - text=_from_dict(d, "text", TextAttachment), + attachment_id=d.get("{attachment_id}", None), + query=_from_dict(d, "{query}", GenieQueryAttachment), + text=_from_dict(d, "{text}", TextAttachment), ) @@ -699,51 +697,51 @@ def as_dict(self) -> dict: """Serializes the GenieConversation into a dictionary suitable for use as a JSON request body.""" body = {} if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.created_timestamp is not None: - body["created_timestamp"] = self.created_timestamp + body["{created_timestamp}"] = self.created_timestamp if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the GenieConversation into a shallow dictionary of its immediate attributes.""" body = {} if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.created_timestamp is not None: - body["created_timestamp"] = self.created_timestamp + body["{created_timestamp}"] = self.created_timestamp if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieConversation: """Deserializes the GenieConversation from a dictionary.""" return cls( - conversation_id=d.get("conversation_id", None), - created_timestamp=d.get("created_timestamp", None), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - space_id=d.get("space_id", None), - title=d.get("title", None), - user_id=d.get("user_id", None), + conversation_id=d.get("{conversation_id}", None), + created_timestamp=d.get("{created_timestamp}", None), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + space_id=d.get("{space_id}", None), + title=d.get("{title}", None), + user_id=d.get("{user_id}", None), ) @@ -762,31 +760,31 @@ def as_dict(self) -> dict: """Serializes the GenieCreateConversationMessageRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id return body def as_shallow_dict(self) -> dict: """Serializes the GenieCreateConversationMessageRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieCreateConversationMessageRequest: """Deserializes the GenieCreateConversationMessageRequest from a dictionary.""" return cls( - content=d.get("content", None), - conversation_id=d.get("conversation_id", None), - space_id=d.get("space_id", None), + content=d.get("{content}", None), + conversation_id=d.get("{conversation_id}", None), + space_id=d.get("{space_id}", None), ) @@ -805,31 +803,31 @@ def as_dict(self) -> dict: """Serializes the GenieGenerateDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.transient_statement_id is not None: - body["transient_statement_id"] = self.transient_statement_id + body["{transient_statement_id}"] = self.transient_statement_id return body def as_shallow_dict(self) -> dict: """Serializes the GenieGenerateDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.transient_statement_id is not None: - body["transient_statement_id"] = self.transient_statement_id + body["{transient_statement_id}"] = self.transient_statement_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieGenerateDownloadFullQueryResultResponse: """Deserializes the GenieGenerateDownloadFullQueryResultResponse from a dictionary.""" return cls( - error=d.get("error", None), - status=_enum(d, "status", MessageStatus), - transient_statement_id=d.get("transient_statement_id", None), + error=d.get("{error}", None), + status=_enum(d, "{status}", MessageStatus), + transient_statement_id=d.get("{transient_statement_id}", None), ) @@ -846,26 +844,26 @@ def as_dict(self) -> dict: """Serializes the GenieGetDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.statement_response: - body["statement_response"] = self.statement_response.as_dict() + body["{statement_response}"] = self.statement_response.as_dict() if self.transient_statement_id is not None: - body["transient_statement_id"] = self.transient_statement_id + body["{transient_statement_id}"] = self.transient_statement_id return body def as_shallow_dict(self) -> dict: """Serializes the GenieGetDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.statement_response: - body["statement_response"] = self.statement_response + body["{statement_response}"] = self.statement_response if self.transient_statement_id is not None: - body["transient_statement_id"] = self.transient_statement_id + body["{transient_statement_id}"] = self.transient_statement_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieGetDownloadFullQueryResultResponse: """Deserializes the GenieGetDownloadFullQueryResultResponse from a dictionary.""" return cls( - statement_response=_from_dict(d, "statement_response", StatementResponse), - transient_statement_id=d.get("transient_statement_id", None), + statement_response=_from_dict(d, "{statement_response}", StatementResponse), + transient_statement_id=d.get("{transient_statement_id}", None), ) @@ -879,20 +877,20 @@ def as_dict(self) -> dict: """Serializes the GenieGetMessageQueryResultResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.statement_response: - body["statement_response"] = self.statement_response.as_dict() + body["{statement_response}"] = self.statement_response.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GenieGetMessageQueryResultResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.statement_response: - body["statement_response"] = self.statement_response + body["{statement_response}"] = self.statement_response return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieGetMessageQueryResultResponse: """Deserializes the GenieGetMessageQueryResultResponse from a dictionary.""" - return cls(statement_response=_from_dict(d, "statement_response", StatementResponse)) + return cls(statement_response=_from_dict(d, "{statement_response}", StatementResponse)) @dataclass @@ -951,76 +949,76 @@ def as_dict(self) -> dict: """Serializes the GenieMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.attachments: - body["attachments"] = [v.as_dict() for v in self.attachments] + body["{attachments}"] = [v.as_dict() for v in self.attachments] if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.created_timestamp is not None: - body["created_timestamp"] = self.created_timestamp + body["{created_timestamp}"] = self.created_timestamp if self.error: - body["error"] = self.error.as_dict() + body["{error}"] = self.error.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.message_id is not None: - body["message_id"] = self.message_id + body["{message_id}"] = self.message_id if self.query_result: - body["query_result"] = self.query_result.as_dict() + body["{query_result}"] = self.query_result.as_dict() if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the GenieMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.attachments: - body["attachments"] = self.attachments + body["{attachments}"] = self.attachments if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.created_timestamp is not None: - body["created_timestamp"] = self.created_timestamp + body["{created_timestamp}"] = self.created_timestamp if self.error: - body["error"] = self.error + body["{error}"] = self.error if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.message_id is not None: - body["message_id"] = self.message_id + body["{message_id}"] = self.message_id if self.query_result: - body["query_result"] = self.query_result + body["{query_result}"] = self.query_result if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieMessage: """Deserializes the GenieMessage from a dictionary.""" return cls( - attachments=_repeated_dict(d, "attachments", GenieAttachment), - content=d.get("content", None), - conversation_id=d.get("conversation_id", None), - created_timestamp=d.get("created_timestamp", None), - error=_from_dict(d, "error", MessageError), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - message_id=d.get("message_id", None), - query_result=_from_dict(d, "query_result", Result), - space_id=d.get("space_id", None), - status=_enum(d, "status", MessageStatus), - user_id=d.get("user_id", None), + attachments=_repeated_dict(d, "{attachments}", GenieAttachment), + content=d.get("{content}", None), + conversation_id=d.get("{conversation_id}", None), + created_timestamp=d.get("{created_timestamp}", None), + error=_from_dict(d, "{error}", MessageError), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + message_id=d.get("{message_id}", None), + query_result=_from_dict(d, "{query_result}", Result), + space_id=d.get("{space_id}", None), + status=_enum(d, "{status}", MessageStatus), + user_id=d.get("{user_id}", None), ) @@ -1051,51 +1049,51 @@ def as_dict(self) -> dict: """Serializes the GenieQueryAttachment into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.query_result_metadata: - body["query_result_metadata"] = self.query_result_metadata.as_dict() + body["{query_result_metadata}"] = self.query_result_metadata.as_dict() if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title return body def as_shallow_dict(self) -> dict: """Serializes the GenieQueryAttachment into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.query_result_metadata: - body["query_result_metadata"] = self.query_result_metadata + body["{query_result_metadata}"] = self.query_result_metadata if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieQueryAttachment: """Deserializes the GenieQueryAttachment from a dictionary.""" return cls( - description=d.get("description", None), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - query=d.get("query", None), - query_result_metadata=_from_dict(d, "query_result_metadata", GenieResultMetadata), - statement_id=d.get("statement_id", None), - title=d.get("title", None), + description=d.get("{description}", None), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + query=d.get("{query}", None), + query_result_metadata=_from_dict(d, "{query_result_metadata}", GenieResultMetadata), + statement_id=d.get("{statement_id}", None), + title=d.get("{title}", None), ) @@ -1111,24 +1109,24 @@ def as_dict(self) -> dict: """Serializes the GenieResultMetadata into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_truncated is not None: - body["is_truncated"] = self.is_truncated + body["{is_truncated}"] = self.is_truncated if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count return body def as_shallow_dict(self) -> dict: """Serializes the GenieResultMetadata into a shallow dictionary of its immediate attributes.""" body = {} if self.is_truncated is not None: - body["is_truncated"] = self.is_truncated + body["{is_truncated}"] = self.is_truncated if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieResultMetadata: """Deserializes the GenieResultMetadata from a dictionary.""" - return cls(is_truncated=d.get("is_truncated", None), row_count=d.get("row_count", None)) + return cls(is_truncated=d.get("{is_truncated}", None), row_count=d.get("{row_count}", None)) @dataclass @@ -1146,28 +1144,30 @@ def as_dict(self) -> dict: """Serializes the GenieSpace into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title return body def as_shallow_dict(self) -> dict: """Serializes the GenieSpace into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieSpace: """Deserializes the GenieSpace from a dictionary.""" - return cls(description=d.get("description", None), space_id=d.get("space_id", None), title=d.get("title", None)) + return cls( + description=d.get("{description}", None), space_id=d.get("{space_id}", None), title=d.get("{title}", None) + ) @dataclass @@ -1182,24 +1182,24 @@ def as_dict(self) -> dict: """Serializes the GenieStartConversationMessageRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id return body def as_shallow_dict(self) -> dict: """Serializes the GenieStartConversationMessageRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.space_id is not None: - body["space_id"] = self.space_id + body["{space_id}"] = self.space_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieStartConversationMessageRequest: """Deserializes the GenieStartConversationMessageRequest from a dictionary.""" - return cls(content=d.get("content", None), space_id=d.get("space_id", None)) + return cls(content=d.get("{content}", None), space_id=d.get("{space_id}", None)) @dataclass @@ -1218,36 +1218,36 @@ def as_dict(self) -> dict: """Serializes the GenieStartConversationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.conversation: - body["conversation"] = self.conversation.as_dict() + body["{conversation}"] = self.conversation.as_dict() if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.message: - body["message"] = self.message.as_dict() + body["{message}"] = self.message.as_dict() if self.message_id is not None: - body["message_id"] = self.message_id + body["{message_id}"] = self.message_id return body def as_shallow_dict(self) -> dict: """Serializes the GenieStartConversationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.conversation: - body["conversation"] = self.conversation + body["{conversation}"] = self.conversation if self.conversation_id is not None: - body["conversation_id"] = self.conversation_id + body["{conversation_id}"] = self.conversation_id if self.message: - body["message"] = self.message + body["{message}"] = self.message if self.message_id is not None: - body["message_id"] = self.message_id + body["{message_id}"] = self.message_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieStartConversationResponse: """Deserializes the GenieStartConversationResponse from a dictionary.""" return cls( - conversation=_from_dict(d, "conversation", GenieConversation), - conversation_id=d.get("conversation_id", None), - message=_from_dict(d, "message", GenieMessage), - message_id=d.get("message_id", None), + conversation=_from_dict(d, "{conversation}", GenieConversation), + conversation_id=d.get("{conversation_id}", None), + message=_from_dict(d, "{message}", GenieMessage), + message_id=d.get("{message_id}", None), ) @@ -1287,25 +1287,25 @@ def as_dict(self) -> dict: """Serializes the ListDashboardsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboards: - body["dashboards"] = [v.as_dict() for v in self.dashboards] + body["{dashboards}"] = [v.as_dict() for v in self.dashboards] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListDashboardsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboards: - body["dashboards"] = self.dashboards + body["{dashboards}"] = self.dashboards if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListDashboardsResponse: """Deserializes the ListDashboardsResponse from a dictionary.""" return cls( - dashboards=_repeated_dict(d, "dashboards", Dashboard), next_page_token=d.get("next_page_token", None) + dashboards=_repeated_dict(d, "{dashboards}", Dashboard), next_page_token=d.get("{next_page_token}", None) ) @@ -1321,24 +1321,26 @@ def as_dict(self) -> dict: """Serializes the ListSchedulesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.schedules: - body["schedules"] = [v.as_dict() for v in self.schedules] + body["{schedules}"] = [v.as_dict() for v in self.schedules] return body def as_shallow_dict(self) -> dict: """Serializes the ListSchedulesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.schedules: - body["schedules"] = self.schedules + body["{schedules}"] = self.schedules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSchedulesResponse: """Deserializes the ListSchedulesResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), schedules=_repeated_dict(d, "schedules", Schedule)) + return cls( + next_page_token=d.get("{next_page_token}", None), schedules=_repeated_dict(d, "{schedules}", Schedule) + ) @dataclass @@ -1353,26 +1355,26 @@ def as_dict(self) -> dict: """Serializes the ListSubscriptionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.subscriptions: - body["subscriptions"] = [v.as_dict() for v in self.subscriptions] + body["{subscriptions}"] = [v.as_dict() for v in self.subscriptions] return body def as_shallow_dict(self) -> dict: """Serializes the ListSubscriptionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.subscriptions: - body["subscriptions"] = self.subscriptions + body["{subscriptions}"] = self.subscriptions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSubscriptionsResponse: """Deserializes the ListSubscriptionsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - subscriptions=_repeated_dict(d, "subscriptions", Subscription), + next_page_token=d.get("{next_page_token}", None), + subscriptions=_repeated_dict(d, "{subscriptions}", Subscription), ) @@ -1386,24 +1388,24 @@ def as_dict(self) -> dict: """Serializes the MessageError into a dictionary suitable for use as a JSON request body.""" body = {} if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the MessageError into a shallow dictionary of its immediate attributes.""" body = {} if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MessageError: """Deserializes the MessageError from a dictionary.""" - return cls(error=d.get("error", None), type=_enum(d, "type", MessageErrorType)) + return cls(error=d.get("{error}", None), type=_enum(d, "{type}", MessageErrorType)) class MessageErrorType(Enum): @@ -1503,36 +1505,36 @@ def as_dict(self) -> dict: """Serializes the MigrateDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.source_dashboard_id is not None: - body["source_dashboard_id"] = self.source_dashboard_id + body["{source_dashboard_id}"] = self.source_dashboard_id if self.update_parameter_syntax is not None: - body["update_parameter_syntax"] = self.update_parameter_syntax + body["{update_parameter_syntax}"] = self.update_parameter_syntax return body def as_shallow_dict(self) -> dict: """Serializes the MigrateDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.source_dashboard_id is not None: - body["source_dashboard_id"] = self.source_dashboard_id + body["{source_dashboard_id}"] = self.source_dashboard_id if self.update_parameter_syntax is not None: - body["update_parameter_syntax"] = self.update_parameter_syntax + body["{update_parameter_syntax}"] = self.update_parameter_syntax return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MigrateDashboardRequest: """Deserializes the MigrateDashboardRequest from a dictionary.""" return cls( - display_name=d.get("display_name", None), - parent_path=d.get("parent_path", None), - source_dashboard_id=d.get("source_dashboard_id", None), - update_parameter_syntax=d.get("update_parameter_syntax", None), + display_name=d.get("{display_name}", None), + parent_path=d.get("{parent_path}", None), + source_dashboard_id=d.get("{source_dashboard_id}", None), + update_parameter_syntax=d.get("{update_parameter_syntax}", None), ) @@ -1546,20 +1548,20 @@ def as_dict(self) -> dict: """Serializes the PendingStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_token is not None: - body["data_token"] = self.data_token + body["{data_token}"] = self.data_token return body def as_shallow_dict(self) -> dict: """Serializes the PendingStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.data_token is not None: - body["data_token"] = self.data_token + body["{data_token}"] = self.data_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PendingStatus: """Deserializes the PendingStatus from a dictionary.""" - return cls(data_token=d.get("data_token", None)) + return cls(data_token=d.get("{data_token}", None)) @dataclass @@ -1570,20 +1572,20 @@ def as_dict(self) -> dict: """Serializes the PollQueryStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.data: - body["data"] = [v.as_dict() for v in self.data] + body["{data}"] = [v.as_dict() for v in self.data] return body def as_shallow_dict(self) -> dict: """Serializes the PollQueryStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.data: - body["data"] = self.data + body["{data}"] = self.data return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PollQueryStatusResponse: """Deserializes the PollQueryStatusResponse from a dictionary.""" - return cls(data=_repeated_dict(d, "data", PollQueryStatusResponseData)) + return cls(data=_repeated_dict(d, "{data}", PollQueryStatusResponseData)) @dataclass @@ -1594,20 +1596,20 @@ def as_dict(self) -> dict: """Serializes the PollQueryStatusResponseData into a dictionary suitable for use as a JSON request body.""" body = {} if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the PollQueryStatusResponseData into a shallow dictionary of its immediate attributes.""" body = {} if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PollQueryStatusResponseData: """Deserializes the PollQueryStatusResponseData from a dictionary.""" - return cls(status=_from_dict(d, "status", QueryResponseStatus)) + return cls(status=_from_dict(d, "{status}", QueryResponseStatus)) @dataclass @@ -1626,31 +1628,31 @@ def as_dict(self) -> dict: """Serializes the PublishRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.embed_credentials is not None: - body["embed_credentials"] = self.embed_credentials + body["{embed_credentials}"] = self.embed_credentials if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the PublishRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.embed_credentials is not None: - body["embed_credentials"] = self.embed_credentials + body["{embed_credentials}"] = self.embed_credentials if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublishRequest: """Deserializes the PublishRequest from a dictionary.""" return cls( - dashboard_id=d.get("dashboard_id", None), - embed_credentials=d.get("embed_credentials", None), - warehouse_id=d.get("warehouse_id", None), + dashboard_id=d.get("{dashboard_id}", None), + embed_credentials=d.get("{embed_credentials}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -1672,36 +1674,36 @@ def as_dict(self) -> dict: """Serializes the PublishedDashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.embed_credentials is not None: - body["embed_credentials"] = self.embed_credentials + body["{embed_credentials}"] = self.embed_credentials if self.revision_create_time is not None: - body["revision_create_time"] = self.revision_create_time + body["{revision_create_time}"] = self.revision_create_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the PublishedDashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.embed_credentials is not None: - body["embed_credentials"] = self.embed_credentials + body["{embed_credentials}"] = self.embed_credentials if self.revision_create_time is not None: - body["revision_create_time"] = self.revision_create_time + body["{revision_create_time}"] = self.revision_create_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublishedDashboard: """Deserializes the PublishedDashboard from a dictionary.""" return cls( - display_name=d.get("display_name", None), - embed_credentials=d.get("embed_credentials", None), - revision_create_time=d.get("revision_create_time", None), - warehouse_id=d.get("warehouse_id", None), + display_name=d.get("{display_name}", None), + embed_credentials=d.get("{embed_credentials}", None), + revision_create_time=d.get("{revision_create_time}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -1728,41 +1730,41 @@ def as_dict(self) -> dict: """Serializes the QueryResponseStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.canceled: - body["canceled"] = self.canceled.as_dict() + body["{canceled}"] = self.canceled.as_dict() if self.closed: - body["closed"] = self.closed.as_dict() + body["{closed}"] = self.closed.as_dict() if self.pending: - body["pending"] = self.pending.as_dict() + body["{pending}"] = self.pending.as_dict() if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.success: - body["success"] = self.success.as_dict() + body["{success}"] = self.success.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the QueryResponseStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.canceled: - body["canceled"] = self.canceled + body["{canceled}"] = self.canceled if self.closed: - body["closed"] = self.closed + body["{closed}"] = self.closed if self.pending: - body["pending"] = self.pending + body["{pending}"] = self.pending if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.success: - body["success"] = self.success + body["{success}"] = self.success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryResponseStatus: """Deserializes the QueryResponseStatus from a dictionary.""" return cls( - canceled=_from_dict(d, "canceled", Empty), - closed=_from_dict(d, "closed", Empty), - pending=_from_dict(d, "pending", PendingStatus), - statement_id=d.get("statement_id", None), - success=_from_dict(d, "success", SuccessStatus), + canceled=_from_dict(d, "{canceled}", Empty), + closed=_from_dict(d, "{closed}", Empty), + pending=_from_dict(d, "{pending}", PendingStatus), + statement_id=d.get("{statement_id}", None), + success=_from_dict(d, "{success}", SuccessStatus), ) @@ -1782,31 +1784,31 @@ def as_dict(self) -> dict: """Serializes the Result into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_truncated is not None: - body["is_truncated"] = self.is_truncated + body["{is_truncated}"] = self.is_truncated if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id return body def as_shallow_dict(self) -> dict: """Serializes the Result into a shallow dictionary of its immediate attributes.""" body = {} if self.is_truncated is not None: - body["is_truncated"] = self.is_truncated + body["{is_truncated}"] = self.is_truncated if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Result: """Deserializes the Result from a dictionary.""" return cls( - is_truncated=d.get("is_truncated", None), - row_count=d.get("row_count", None), - statement_id=d.get("statement_id", None), + is_truncated=d.get("{is_truncated}", None), + row_count=d.get("{row_count}", None), + statement_id=d.get("{statement_id}", None), ) @@ -1845,56 +1847,56 @@ def as_dict(self) -> dict: """Serializes the ResultData into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.data_array: - body["data_array"] = [v for v in self.data_array] + body["{data_array}"] = [v for v in self.data_array] if self.external_links: - body["external_links"] = [v.as_dict() for v in self.external_links] + body["{external_links}"] = [v.as_dict() for v in self.external_links] if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body def as_shallow_dict(self) -> dict: """Serializes the ResultData into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.data_array: - body["data_array"] = self.data_array + body["{data_array}"] = self.data_array if self.external_links: - body["external_links"] = self.external_links + body["{external_links}"] = self.external_links if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultData: """Deserializes the ResultData from a dictionary.""" return cls( - byte_count=d.get("byte_count", None), - chunk_index=d.get("chunk_index", None), - data_array=d.get("data_array", None), - external_links=_repeated_dict(d, "external_links", ExternalLink), - next_chunk_index=d.get("next_chunk_index", None), - next_chunk_internal_link=d.get("next_chunk_internal_link", None), - row_count=d.get("row_count", None), - row_offset=d.get("row_offset", None), + byte_count=d.get("{byte_count}", None), + chunk_index=d.get("{chunk_index}", None), + data_array=d.get("{data_array}", None), + external_links=_repeated_dict(d, "{external_links}", ExternalLink), + next_chunk_index=d.get("{next_chunk_index}", None), + next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), + row_count=d.get("{row_count}", None), + row_offset=d.get("{row_offset}", None), ) @@ -1927,51 +1929,51 @@ def as_dict(self) -> dict: """Serializes the ResultManifest into a dictionary suitable for use as a JSON request body.""" body = {} if self.chunks: - body["chunks"] = [v.as_dict() for v in self.chunks] + body["{chunks}"] = [v.as_dict() for v in self.chunks] if self.format is not None: - body["format"] = self.format.value + body["{format}"] = self.format.value if self.schema: - body["schema"] = self.schema.as_dict() + body["{schema}"] = self.schema.as_dict() if self.total_byte_count is not None: - body["total_byte_count"] = self.total_byte_count + body["{total_byte_count}"] = self.total_byte_count if self.total_chunk_count is not None: - body["total_chunk_count"] = self.total_chunk_count + body["{total_chunk_count}"] = self.total_chunk_count if self.total_row_count is not None: - body["total_row_count"] = self.total_row_count + body["{total_row_count}"] = self.total_row_count if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body def as_shallow_dict(self) -> dict: """Serializes the ResultManifest into a shallow dictionary of its immediate attributes.""" body = {} if self.chunks: - body["chunks"] = self.chunks + body["{chunks}"] = self.chunks if self.format is not None: - body["format"] = self.format + body["{format}"] = self.format if self.schema: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.total_byte_count is not None: - body["total_byte_count"] = self.total_byte_count + body["{total_byte_count}"] = self.total_byte_count if self.total_chunk_count is not None: - body["total_chunk_count"] = self.total_chunk_count + body["{total_chunk_count}"] = self.total_chunk_count if self.total_row_count is not None: - body["total_row_count"] = self.total_row_count + body["{total_row_count}"] = self.total_row_count if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultManifest: """Deserializes the ResultManifest from a dictionary.""" return cls( - chunks=_repeated_dict(d, "chunks", BaseChunkInfo), - format=_enum(d, "format", Format), - schema=_from_dict(d, "schema", ResultSchema), - total_byte_count=d.get("total_byte_count", None), - total_chunk_count=d.get("total_chunk_count", None), - total_row_count=d.get("total_row_count", None), - truncated=d.get("truncated", None), + chunks=_repeated_dict(d, "{chunks}", BaseChunkInfo), + format=_enum(d, "{format}", Format), + schema=_from_dict(d, "{schema}", ResultSchema), + total_byte_count=d.get("{total_byte_count}", None), + total_chunk_count=d.get("{total_chunk_count}", None), + total_row_count=d.get("{total_row_count}", None), + truncated=d.get("{truncated}", None), ) @@ -1987,24 +1989,24 @@ def as_dict(self) -> dict: """Serializes the ResultSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.column_count is not None: - body["column_count"] = self.column_count + body["{column_count}"] = self.column_count if self.columns: - body["columns"] = [v.as_dict() for v in self.columns] + body["{columns}"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: """Serializes the ResultSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.column_count is not None: - body["column_count"] = self.column_count + body["{column_count}"] = self.column_count if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultSchema: """Deserializes the ResultSchema from a dictionary.""" - return cls(column_count=d.get("column_count", None), columns=_repeated_dict(d, "columns", ColumnInfo)) + return cls(column_count=d.get("{column_count}", None), columns=_repeated_dict(d, "{columns}", ColumnInfo)) @dataclass @@ -2042,61 +2044,61 @@ def as_dict(self) -> dict: """Serializes the Schedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.cron_schedule: - body["cron_schedule"] = self.cron_schedule.as_dict() + body["{cron_schedule}"] = self.cron_schedule.as_dict() if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.pause_status is not None: - body["pause_status"] = self.pause_status.value + body["{pause_status}"] = self.pause_status.value if self.schedule_id is not None: - body["schedule_id"] = self.schedule_id + body["{schedule_id}"] = self.schedule_id if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the Schedule into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.cron_schedule: - body["cron_schedule"] = self.cron_schedule + body["{cron_schedule}"] = self.cron_schedule if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.pause_status is not None: - body["pause_status"] = self.pause_status + body["{pause_status}"] = self.pause_status if self.schedule_id is not None: - body["schedule_id"] = self.schedule_id + body["{schedule_id}"] = self.schedule_id if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Schedule: """Deserializes the Schedule from a dictionary.""" return cls( - create_time=d.get("create_time", None), - cron_schedule=_from_dict(d, "cron_schedule", CronSchedule), - dashboard_id=d.get("dashboard_id", None), - display_name=d.get("display_name", None), - etag=d.get("etag", None), - pause_status=_enum(d, "pause_status", SchedulePauseStatus), - schedule_id=d.get("schedule_id", None), - update_time=d.get("update_time", None), - warehouse_id=d.get("warehouse_id", None), + create_time=d.get("{create_time}", None), + cron_schedule=_from_dict(d, "{cron_schedule}", CronSchedule), + dashboard_id=d.get("{dashboard_id}", None), + display_name=d.get("{display_name}", None), + etag=d.get("{etag}", None), + pause_status=_enum(d, "{pause_status}", SchedulePauseStatus), + schedule_id=d.get("{schedule_id}", None), + update_time=d.get("{update_time}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -2117,24 +2119,24 @@ def as_dict(self) -> dict: """Serializes the ServiceError into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_code is not None: - body["error_code"] = self.error_code.value + body["{error_code}"] = self.error_code.value if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body def as_shallow_dict(self) -> dict: """Serializes the ServiceError into a shallow dictionary of its immediate attributes.""" body = {} if self.error_code is not None: - body["error_code"] = self.error_code + body["{error_code}"] = self.error_code if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServiceError: """Deserializes the ServiceError from a dictionary.""" - return cls(error_code=_enum(d, "error_code", ServiceErrorCode), message=d.get("message", None)) + return cls(error_code=_enum(d, "{error_code}", ServiceErrorCode), message=d.get("{message}", None)) class ServiceErrorCode(Enum): @@ -2173,36 +2175,36 @@ def as_dict(self) -> dict: """Serializes the StatementResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.manifest: - body["manifest"] = self.manifest.as_dict() + body["{manifest}"] = self.manifest.as_dict() if self.result: - body["result"] = self.result.as_dict() + body["{result}"] = self.result.as_dict() if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the StatementResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.manifest: - body["manifest"] = self.manifest + body["{manifest}"] = self.manifest if self.result: - body["result"] = self.result + body["{result}"] = self.result if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementResponse: """Deserializes the StatementResponse from a dictionary.""" return cls( - manifest=_from_dict(d, "manifest", ResultManifest), - result=_from_dict(d, "result", ResultData), - statement_id=d.get("statement_id", None), - status=_from_dict(d, "status", StatementStatus), + manifest=_from_dict(d, "{manifest}", ResultManifest), + result=_from_dict(d, "{result}", ResultData), + statement_id=d.get("{statement_id}", None), + status=_from_dict(d, "{status}", StatementStatus), ) @@ -2238,24 +2240,24 @@ def as_dict(self) -> dict: """Serializes the StatementStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.error: - body["error"] = self.error.as_dict() + body["{error}"] = self.error.as_dict() if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the StatementStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.error: - body["error"] = self.error + body["{error}"] = self.error if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementStatus: """Deserializes the StatementStatus from a dictionary.""" - return cls(error=_from_dict(d, "error", ServiceError), state=_enum(d, "state", StatementState)) + return cls(error=_from_dict(d, "{error}", ServiceError), state=_enum(d, "{state}", StatementState)) @dataclass @@ -2272,26 +2274,26 @@ def as_dict(self) -> dict: """Serializes the Subscriber into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_subscriber: - body["destination_subscriber"] = self.destination_subscriber.as_dict() + body["{destination_subscriber}"] = self.destination_subscriber.as_dict() if self.user_subscriber: - body["user_subscriber"] = self.user_subscriber.as_dict() + body["{user_subscriber}"] = self.user_subscriber.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Subscriber into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_subscriber: - body["destination_subscriber"] = self.destination_subscriber + body["{destination_subscriber}"] = self.destination_subscriber if self.user_subscriber: - body["user_subscriber"] = self.user_subscriber + body["{user_subscriber}"] = self.user_subscriber return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Subscriber: """Deserializes the Subscriber from a dictionary.""" return cls( - destination_subscriber=_from_dict(d, "destination_subscriber", SubscriptionSubscriberDestination), - user_subscriber=_from_dict(d, "user_subscriber", SubscriptionSubscriberUser), + destination_subscriber=_from_dict(d, "{destination_subscriber}", SubscriptionSubscriberDestination), + user_subscriber=_from_dict(d, "{user_subscriber}", SubscriptionSubscriberUser), ) @@ -2327,56 +2329,56 @@ def as_dict(self) -> dict: """Serializes the Subscription into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.created_by_user_id is not None: - body["created_by_user_id"] = self.created_by_user_id + body["{created_by_user_id}"] = self.created_by_user_id if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.schedule_id is not None: - body["schedule_id"] = self.schedule_id + body["{schedule_id}"] = self.schedule_id if self.subscriber: - body["subscriber"] = self.subscriber.as_dict() + body["{subscriber}"] = self.subscriber.as_dict() if self.subscription_id is not None: - body["subscription_id"] = self.subscription_id + body["{subscription_id}"] = self.subscription_id if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the Subscription into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.created_by_user_id is not None: - body["created_by_user_id"] = self.created_by_user_id + body["{created_by_user_id}"] = self.created_by_user_id if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.schedule_id is not None: - body["schedule_id"] = self.schedule_id + body["{schedule_id}"] = self.schedule_id if self.subscriber: - body["subscriber"] = self.subscriber + body["{subscriber}"] = self.subscriber if self.subscription_id is not None: - body["subscription_id"] = self.subscription_id + body["{subscription_id}"] = self.subscription_id if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Subscription: """Deserializes the Subscription from a dictionary.""" return cls( - create_time=d.get("create_time", None), - created_by_user_id=d.get("created_by_user_id", None), - dashboard_id=d.get("dashboard_id", None), - etag=d.get("etag", None), - schedule_id=d.get("schedule_id", None), - subscriber=_from_dict(d, "subscriber", Subscriber), - subscription_id=d.get("subscription_id", None), - update_time=d.get("update_time", None), + create_time=d.get("{create_time}", None), + created_by_user_id=d.get("{created_by_user_id}", None), + dashboard_id=d.get("{dashboard_id}", None), + etag=d.get("{etag}", None), + schedule_id=d.get("{schedule_id}", None), + subscriber=_from_dict(d, "{subscriber}", Subscriber), + subscription_id=d.get("{subscription_id}", None), + update_time=d.get("{update_time}", None), ) @@ -2389,20 +2391,20 @@ def as_dict(self) -> dict: """Serializes the SubscriptionSubscriberDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_id is not None: - body["destination_id"] = self.destination_id + body["{destination_id}"] = self.destination_id return body def as_shallow_dict(self) -> dict: """Serializes the SubscriptionSubscriberDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_id is not None: - body["destination_id"] = self.destination_id + body["{destination_id}"] = self.destination_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubscriptionSubscriberDestination: """Deserializes the SubscriptionSubscriberDestination from a dictionary.""" - return cls(destination_id=d.get("destination_id", None)) + return cls(destination_id=d.get("{destination_id}", None)) @dataclass @@ -2414,20 +2416,20 @@ def as_dict(self) -> dict: """Serializes the SubscriptionSubscriberUser into a dictionary suitable for use as a JSON request body.""" body = {} if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the SubscriptionSubscriberUser into a shallow dictionary of its immediate attributes.""" body = {} if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubscriptionSubscriberUser: """Deserializes the SubscriptionSubscriberUser from a dictionary.""" - return cls(user_id=d.get("user_id", None)) + return cls(user_id=d.get("{user_id}", None)) @dataclass @@ -2443,24 +2445,24 @@ def as_dict(self) -> dict: """Serializes the SuccessStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_token is not None: - body["data_token"] = self.data_token + body["{data_token}"] = self.data_token if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body def as_shallow_dict(self) -> dict: """Serializes the SuccessStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.data_token is not None: - body["data_token"] = self.data_token + body["{data_token}"] = self.data_token if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SuccessStatus: """Deserializes the SuccessStatus from a dictionary.""" - return cls(data_token=d.get("data_token", None), truncated=d.get("truncated", None)) + return cls(data_token=d.get("{data_token}", None), truncated=d.get("{truncated}", None)) @dataclass @@ -2474,24 +2476,24 @@ def as_dict(self) -> dict: """Serializes the TextAttachment into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the TextAttachment into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TextAttachment: """Deserializes the TextAttachment from a dictionary.""" - return cls(content=d.get("content", None), id=d.get("id", None)) + return cls(content=d.get("{content}", None), id=d.get("{id}", None)) @dataclass @@ -2539,40 +2541,6 @@ class GenieAPI: def __init__(self, api_client): self._api = api_client - def wait_get_message_genie_completed( - self, - conversation_id: str, - message_id: str, - space_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[GenieMessage], None]] = None, - ) -> GenieMessage: - deadline = time.time() + timeout.total_seconds() - target_states = (MessageStatus.COMPLETED,) - failure_states = (MessageStatus.FAILED,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get_message(conversation_id=conversation_id, message_id=message_id, space_id=space_id) - status = poll.status - status_message = f"current status: {status}" - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach COMPLETED, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"conversation_id={conversation_id}, message_id={message_id}, space_id={space_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create_message(self, space_id: str, conversation_id: str, content: str) -> Wait[GenieMessage]: """Create conversation message. @@ -2588,14 +2556,14 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W :returns: Long-running operation waiter for :class:`GenieMessage`. - See :method:wait_get_message_genie_completed for more details. + See :method:WaitGetMessageGenieCompleted for more details. """ body = {} if content is not None: - body["content"] = content + body["{content}"] = content headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do( @@ -2605,10 +2573,10 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W headers=headers, ) return Wait( - self.wait_get_message_genie_completed, + self.WaitGetMessageGenieCompleted, response=GenieMessage.from_dict(op_response), conversation_id=conversation_id, - message_id=op_response["id"], + message_id=op_response["{id}"], space_id=space_id, ) @@ -2640,7 +2608,7 @@ def execute_message_attachment_query( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2668,7 +2636,7 @@ def execute_message_query( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2703,7 +2671,7 @@ def generate_download_full_query_result( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2744,9 +2712,9 @@ def get_download_full_query_result( query = {} if transient_statement_id is not None: - query["transient_statement_id"] = transient_statement_id + query["{transient_statement_id}"] = transient_statement_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2773,7 +2741,7 @@ def get_message(self, space_id: str, conversation_id: str, message_id: str) -> G """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2804,7 +2772,7 @@ def get_message_attachment_query_result( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2833,7 +2801,7 @@ def get_message_query_result( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2864,7 +2832,7 @@ def get_message_query_result_by_attachment( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2886,7 +2854,7 @@ def get_space(self, space_id: str) -> GenieSpace: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", headers=headers) @@ -2904,24 +2872,24 @@ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: :returns: Long-running operation waiter for :class:`GenieMessage`. - See :method:wait_get_message_genie_completed for more details. + See :method:WaitGetMessageGenieCompleted for more details. """ body = {} if content is not None: - body["content"] = content + body["{content}"] = content headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do( "POST", f"/api/2.0/genie/spaces/{space_id}/start-conversation", body=body, headers=headers ) return Wait( - self.wait_get_message_genie_completed, + self.WaitGetMessageGenieCompleted, response=GenieStartConversationResponse.from_dict(op_response), - conversation_id=op_response["conversation_id"], - message_id=op_response["message_id"], + conversation_id=op_response["{conversation_id}"], + message_id=op_response["{message_id}"], space_id=space_id, ) @@ -2947,8 +2915,8 @@ def create(self, *, dashboard: Optional[Dashboard] = None) -> Dashboard: """ body = dashboard.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/lakeview/dashboards", body=body, headers=headers) @@ -2965,8 +2933,8 @@ def create_schedule(self, dashboard_id: str, *, schedule: Optional[Schedule] = N """ body = schedule.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/lakeview/dashboards/{dashboard_id}/schedules", body=body, headers=headers) @@ -2987,8 +2955,8 @@ def create_subscription( """ body = subscription.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3015,9 +2983,9 @@ def delete_schedule(self, dashboard_id: str, schedule_id: str, *, etag: Optional query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -3047,9 +3015,9 @@ def delete_subscription( query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -3071,7 +3039,7 @@ def get(self, dashboard_id: str) -> Dashboard: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers) @@ -3089,7 +3057,7 @@ def get_published(self, dashboard_id: str) -> PublishedDashboard: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers) @@ -3107,7 +3075,7 @@ def get_schedule(self, dashboard_id: str, schedule_id: str) -> Schedule: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3129,7 +3097,7 @@ def get_subscription(self, dashboard_id: str, schedule_id: str, subscription_id: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3165,25 +3133,25 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if show_trashed is not None: - query["show_trashed"] = show_trashed + query["{show_trashed}"] = show_trashed if view is not None: - query["view"] = view.value + query["{view}"] = view.value headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/lakeview/dashboards", query=query, headers=headers) - if "dashboards" in json: - for v in json["dashboards"]: + if "{dashboards}" in json: + for v in json["{dashboards}"]: yield Dashboard.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_schedules( self, dashboard_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3203,23 +3171,23 @@ def list_schedules( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/schedules", query=query, headers=headers ) - if "schedules" in json: - for v in json["schedules"]: + if "{schedules}" in json: + for v in json["{schedules}"]: yield Schedule.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_subscriptions( self, dashboard_id: str, schedule_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3241,11 +3209,11 @@ def list_subscriptions( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -3255,12 +3223,12 @@ def list_subscriptions( query=query, headers=headers, ) - if "subscriptions" in json: - for v in json["subscriptions"]: + if "{subscriptions}" in json: + for v in json["{subscriptions}"]: yield Subscription.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def migrate( self, @@ -3288,16 +3256,16 @@ def migrate( """ body = {} if display_name is not None: - body["display_name"] = display_name + body["{display_name}"] = display_name if parent_path is not None: - body["parent_path"] = parent_path + body["{parent_path}"] = parent_path if source_dashboard_id is not None: - body["source_dashboard_id"] = source_dashboard_id + body["{source_dashboard_id}"] = source_dashboard_id if update_parameter_syntax is not None: - body["update_parameter_syntax"] = update_parameter_syntax + body["{update_parameter_syntax}"] = update_parameter_syntax headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/lakeview/dashboards/migrate", body=body, headers=headers) @@ -3322,12 +3290,12 @@ def publish( """ body = {} if embed_credentials is not None: - body["embed_credentials"] = embed_credentials + body["{embed_credentials}"] = embed_credentials if warehouse_id is not None: - body["warehouse_id"] = warehouse_id + body["{warehouse_id}"] = warehouse_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", body=body, headers=headers) @@ -3345,7 +3313,7 @@ def trash(self, dashboard_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers) @@ -3362,7 +3330,7 @@ def unpublish(self, dashboard_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers) @@ -3380,8 +3348,8 @@ def update(self, dashboard_id: str, *, dashboard: Optional[Dashboard] = None) -> """ body = dashboard.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/lakeview/dashboards/{dashboard_id}", body=body, headers=headers) @@ -3400,8 +3368,8 @@ def update_schedule(self, dashboard_id: str, schedule_id: str, *, schedule: Opti """ body = schedule.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3428,7 +3396,7 @@ def get_published_dashboard_embedded(self, dashboard_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published/embedded", headers=headers) @@ -3455,13 +3423,13 @@ def cancel_published_query_execution( query = {} if dashboard_name is not None: - query["dashboard_name"] = dashboard_name + query["{dashboard_name}"] = dashboard_name if dashboard_revision_id is not None: - query["dashboard_revision_id"] = dashboard_revision_id + query["{dashboard_revision_id}"] = dashboard_revision_id if tokens is not None: - query["tokens"] = [v for v in tokens] + query["{tokens}"] = [v for v in tokens] headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("DELETE", "/api/2.0/lakeview-query/query/published", query=query, headers=headers) @@ -3484,14 +3452,14 @@ def execute_published_dashboard_query( """ body = {} if dashboard_name is not None: - body["dashboard_name"] = dashboard_name + body["{dashboard_name}"] = dashboard_name if dashboard_revision_id is not None: - body["dashboard_revision_id"] = dashboard_revision_id + body["{dashboard_revision_id}"] = dashboard_revision_id if override_warehouse_id is not None: - body["override_warehouse_id"] = override_warehouse_id + body["{override_warehouse_id}"] = override_warehouse_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/lakeview-query/query/published", body=body, headers=headers) @@ -3511,13 +3479,13 @@ def poll_published_query_status( query = {} if dashboard_name is not None: - query["dashboard_name"] = dashboard_name + query["{dashboard_name}"] = dashboard_name if dashboard_revision_id is not None: - query["dashboard_revision_id"] = dashboard_revision_id + query["{dashboard_revision_id}"] = dashboard_revision_id if tokens is not None: - query["tokens"] = [v for v in tokens] + query["{tokens}"] = [v for v in tokens] headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/lakeview-query/query/published", query=query, headers=headers) diff --git a/databricks/sdk/service/files.py b/databricks/sdk/files/v2/impl.py similarity index 83% rename from databricks/sdk/service/files.py rename to databricks/sdk/files/v2/impl.py index 8d60b842f..2b9c71317 100755 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/files/v2/impl.py @@ -6,11 +6,11 @@ from dataclasses import dataclass from typing import Any, BinaryIO, Dict, Iterator, List, Optional -from ._internal import _escape_multi_segment_path_parameter, _repeated_dict +from ...service._internal import (_escape_multi_segment_path_parameter, + _repeated_dict) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -26,24 +26,24 @@ def as_dict(self) -> dict: """Serializes the AddBlock into a dictionary suitable for use as a JSON request body.""" body = {} if self.data is not None: - body["data"] = self.data + body["{data}"] = self.data if self.handle is not None: - body["handle"] = self.handle + body["{handle}"] = self.handle return body def as_shallow_dict(self) -> dict: """Serializes the AddBlock into a shallow dictionary of its immediate attributes.""" body = {} if self.data is not None: - body["data"] = self.data + body["{data}"] = self.data if self.handle is not None: - body["handle"] = self.handle + body["{handle}"] = self.handle return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddBlock: """Deserializes the AddBlock from a dictionary.""" - return cls(data=d.get("data", None), handle=d.get("handle", None)) + return cls(data=d.get("{data}", None), handle=d.get("{handle}", None)) @dataclass @@ -73,20 +73,20 @@ def as_dict(self) -> dict: """Serializes the Close into a dictionary suitable for use as a JSON request body.""" body = {} if self.handle is not None: - body["handle"] = self.handle + body["{handle}"] = self.handle return body def as_shallow_dict(self) -> dict: """Serializes the Close into a shallow dictionary of its immediate attributes.""" body = {} if self.handle is not None: - body["handle"] = self.handle + body["{handle}"] = self.handle return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Close: """Deserializes the Close from a dictionary.""" - return cls(handle=d.get("handle", None)) + return cls(handle=d.get("{handle}", None)) @dataclass @@ -119,24 +119,24 @@ def as_dict(self) -> dict: """Serializes the Create into a dictionary suitable for use as a JSON request body.""" body = {} if self.overwrite is not None: - body["overwrite"] = self.overwrite + body["{overwrite}"] = self.overwrite if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the Create into a shallow dictionary of its immediate attributes.""" body = {} if self.overwrite is not None: - body["overwrite"] = self.overwrite + body["{overwrite}"] = self.overwrite if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Create: """Deserializes the Create from a dictionary.""" - return cls(overwrite=d.get("overwrite", None), path=d.get("path", None)) + return cls(overwrite=d.get("{overwrite}", None), path=d.get("{path}", None)) @dataclass @@ -167,20 +167,20 @@ def as_dict(self) -> dict: """Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.handle is not None: - body["handle"] = self.handle + body["{handle}"] = self.handle return body def as_shallow_dict(self) -> dict: """Serializes the CreateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.handle is not None: - body["handle"] = self.handle + body["{handle}"] = self.handle return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" - return cls(handle=d.get("handle", None)) + return cls(handle=d.get("{handle}", None)) @dataclass @@ -196,24 +196,24 @@ def as_dict(self) -> dict: """Serializes the Delete into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.recursive is not None: - body["recursive"] = self.recursive + body["{recursive}"] = self.recursive return body def as_shallow_dict(self) -> dict: """Serializes the Delete into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.recursive is not None: - body["recursive"] = self.recursive + body["{recursive}"] = self.recursive return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Delete: """Deserializes the Delete from a dictionary.""" - return cls(path=d.get("path", None), recursive=d.get("recursive", None)) + return cls(path=d.get("{path}", None), recursive=d.get("{recursive}", None)) @dataclass @@ -273,41 +273,41 @@ def as_dict(self) -> dict: """Serializes the DirectoryEntry into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_size is not None: - body["file_size"] = self.file_size + body["{file_size}"] = self.file_size if self.is_directory is not None: - body["is_directory"] = self.is_directory + body["{is_directory}"] = self.is_directory if self.last_modified is not None: - body["last_modified"] = self.last_modified + body["{last_modified}"] = self.last_modified if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the DirectoryEntry into a shallow dictionary of its immediate attributes.""" body = {} if self.file_size is not None: - body["file_size"] = self.file_size + body["{file_size}"] = self.file_size if self.is_directory is not None: - body["is_directory"] = self.is_directory + body["{is_directory}"] = self.is_directory if self.last_modified is not None: - body["last_modified"] = self.last_modified + body["{last_modified}"] = self.last_modified if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DirectoryEntry: """Deserializes the DirectoryEntry from a dictionary.""" return cls( - file_size=d.get("file_size", None), - is_directory=d.get("is_directory", None), - last_modified=d.get("last_modified", None), - name=d.get("name", None), - path=d.get("path", None), + file_size=d.get("{file_size}", None), + is_directory=d.get("{is_directory}", None), + last_modified=d.get("{last_modified}", None), + name=d.get("{name}", None), + path=d.get("{path}", None), ) @@ -327,36 +327,36 @@ def as_dict(self) -> dict: """Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.content_length is not None: - body["content-length"] = self.content_length + body["{content_length}"] = self.content_length if self.content_type is not None: - body["content-type"] = self.content_type + body["{content_type}"] = self.content_type if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents if self.last_modified is not None: - body["last-modified"] = self.last_modified + body["{last_modified}"] = self.last_modified return body def as_shallow_dict(self) -> dict: """Serializes the DownloadResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.content_length is not None: - body["content-length"] = self.content_length + body["{content_length}"] = self.content_length if self.content_type is not None: - body["content-type"] = self.content_type + body["{content_type}"] = self.content_type if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents if self.last_modified is not None: - body["last-modified"] = self.last_modified + body["{last_modified}"] = self.last_modified return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DownloadResponse: """Deserializes the DownloadResponse from a dictionary.""" return cls( - content_length=int(d.get("content-length", None)), - content_type=d.get("content-type", None), - contents=d.get("contents", None), - last_modified=d.get("last-modified", None), + content_length=int(d.get("{content_length}", None)), + content_type=d.get("{content_type}", None), + contents=d.get("{contents}", None), + last_modified=d.get("{last_modified}", None), ) @@ -378,36 +378,36 @@ def as_dict(self) -> dict: """Serializes the FileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_size is not None: - body["file_size"] = self.file_size + body["{file_size}"] = self.file_size if self.is_dir is not None: - body["is_dir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.modification_time is not None: - body["modification_time"] = self.modification_time + body["{modification_time}"] = self.modification_time if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the FileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.file_size is not None: - body["file_size"] = self.file_size + body["{file_size}"] = self.file_size if self.is_dir is not None: - body["is_dir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.modification_time is not None: - body["modification_time"] = self.modification_time + body["{modification_time}"] = self.modification_time if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" return cls( - file_size=d.get("file_size", None), - is_dir=d.get("is_dir", None), - modification_time=d.get("modification_time", None), - path=d.get("path", None), + file_size=d.get("{file_size}", None), + is_dir=d.get("{is_dir}", None), + modification_time=d.get("{modification_time}", None), + path=d.get("{path}", None), ) @@ -443,31 +443,31 @@ def as_dict(self) -> dict: """Serializes the GetMetadataResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.content_length is not None: - body["content-length"] = self.content_length + body["{content_length}"] = self.content_length if self.content_type is not None: - body["content-type"] = self.content_type + body["{content_type}"] = self.content_type if self.last_modified is not None: - body["last-modified"] = self.last_modified + body["{last_modified}"] = self.last_modified return body def as_shallow_dict(self) -> dict: """Serializes the GetMetadataResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.content_length is not None: - body["content-length"] = self.content_length + body["{content_length}"] = self.content_length if self.content_type is not None: - body["content-type"] = self.content_type + body["{content_type}"] = self.content_type if self.last_modified is not None: - body["last-modified"] = self.last_modified + body["{last_modified}"] = self.last_modified return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetMetadataResponse: """Deserializes the GetMetadataResponse from a dictionary.""" return cls( - content_length=int(d.get("content-length", None)), - content_type=d.get("content-type", None), - last_modified=d.get("last-modified", None), + content_length=int(d.get("{content_length}", None)), + content_type=d.get("{content_type}", None), + last_modified=d.get("{last_modified}", None), ) @@ -483,25 +483,25 @@ def as_dict(self) -> dict: """Serializes the ListDirectoryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["contents"] = [v.as_dict() for v in self.contents] + body["{contents}"] = [v.as_dict() for v in self.contents] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListDirectoryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListDirectoryResponse: """Deserializes the ListDirectoryResponse from a dictionary.""" return cls( - contents=_repeated_dict(d, "contents", DirectoryEntry), next_page_token=d.get("next_page_token", None) + contents=_repeated_dict(d, "{contents}", DirectoryEntry), next_page_token=d.get("{next_page_token}", None) ) @@ -514,20 +514,20 @@ def as_dict(self) -> dict: """Serializes the ListStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.files: - body["files"] = [v.as_dict() for v in self.files] + body["{files}"] = [v.as_dict() for v in self.files] return body def as_shallow_dict(self) -> dict: """Serializes the ListStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.files: - body["files"] = self.files + body["{files}"] = self.files return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListStatusResponse: """Deserializes the ListStatusResponse from a dictionary.""" - return cls(files=_repeated_dict(d, "files", FileInfo)) + return cls(files=_repeated_dict(d, "{files}", FileInfo)) @dataclass @@ -539,20 +539,20 @@ def as_dict(self) -> dict: """Serializes the MkDirs into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the MkDirs into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MkDirs: """Deserializes the MkDirs from a dictionary.""" - return cls(path=d.get("path", None)) + return cls(path=d.get("{path}", None)) @dataclass @@ -585,24 +585,24 @@ def as_dict(self) -> dict: """Serializes the Move into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_path is not None: - body["destination_path"] = self.destination_path + body["{destination_path}"] = self.destination_path if self.source_path is not None: - body["source_path"] = self.source_path + body["{source_path}"] = self.source_path return body def as_shallow_dict(self) -> dict: """Serializes the Move into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_path is not None: - body["destination_path"] = self.destination_path + body["{destination_path}"] = self.destination_path if self.source_path is not None: - body["source_path"] = self.source_path + body["{source_path}"] = self.source_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Move: """Deserializes the Move from a dictionary.""" - return cls(destination_path=d.get("destination_path", None), source_path=d.get("source_path", None)) + return cls(destination_path=d.get("{destination_path}", None), source_path=d.get("{source_path}", None)) @dataclass @@ -638,28 +638,28 @@ def as_dict(self) -> dict: """Serializes the Put into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents is not None: - body["contents"] = self.contents + body["{contents}"] = self.contents if self.overwrite is not None: - body["overwrite"] = self.overwrite + body["{overwrite}"] = self.overwrite if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the Put into a shallow dictionary of its immediate attributes.""" body = {} if self.contents is not None: - body["contents"] = self.contents + body["{contents}"] = self.contents if self.overwrite is not None: - body["overwrite"] = self.overwrite + body["{overwrite}"] = self.overwrite if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Put: """Deserializes the Put from a dictionary.""" - return cls(contents=d.get("contents", None), overwrite=d.get("overwrite", None), path=d.get("path", None)) + return cls(contents=d.get("{contents}", None), overwrite=d.get("{overwrite}", None), path=d.get("{path}", None)) @dataclass @@ -693,24 +693,24 @@ def as_dict(self) -> dict: """Serializes the ReadResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.bytes_read is not None: - body["bytes_read"] = self.bytes_read + body["{bytes_read}"] = self.bytes_read if self.data is not None: - body["data"] = self.data + body["{data}"] = self.data return body def as_shallow_dict(self) -> dict: """Serializes the ReadResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.bytes_read is not None: - body["bytes_read"] = self.bytes_read + body["{bytes_read}"] = self.bytes_read if self.data is not None: - body["data"] = self.data + body["{data}"] = self.data return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ReadResponse: """Deserializes the ReadResponse from a dictionary.""" - return cls(bytes_read=d.get("bytes_read", None), data=d.get("data", None)) + return cls(bytes_read=d.get("{bytes_read}", None), data=d.get("{data}", None)) @dataclass @@ -755,12 +755,12 @@ def add_block(self, handle: int, data: str): """ body = {} if data is not None: - body["data"] = data + body["{data}"] = data if handle is not None: - body["handle"] = handle + body["{handle}"] = handle headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/dbfs/add-block", body=body, headers=headers) @@ -778,10 +778,10 @@ def close(self, handle: int): """ body = {} if handle is not None: - body["handle"] = handle + body["{handle}"] = handle headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/dbfs/close", body=body, headers=headers) @@ -807,12 +807,12 @@ def create(self, path: str, *, overwrite: Optional[bool] = None) -> CreateRespon """ body = {} if overwrite is not None: - body["overwrite"] = overwrite + body["{overwrite}"] = overwrite if path is not None: - body["path"] = path + body["{path}"] = path headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/dbfs/create", body=body, headers=headers) @@ -846,12 +846,12 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): """ body = {} if path is not None: - body["path"] = path + body["{path}"] = path if recursive is not None: - body["recursive"] = recursive + body["{recursive}"] = recursive headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/dbfs/delete", body=body, headers=headers) @@ -870,9 +870,9 @@ def get_status(self, path: str) -> FileInfo: query = {} if path is not None: - query["path"] = path + query["{path}"] = path headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/dbfs/get-status", query=query, headers=headers) @@ -899,9 +899,9 @@ def list(self, path: str) -> Iterator[FileInfo]: query = {} if path is not None: - query["path"] = path + query["{path}"] = path headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/dbfs/list", query=query, headers=headers) @@ -923,10 +923,10 @@ def mkdirs(self, path: str): """ body = {} if path is not None: - body["path"] = path + body["{path}"] = path headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/dbfs/mkdirs", body=body, headers=headers) @@ -948,12 +948,12 @@ def move(self, source_path: str, destination_path: str): """ body = {} if destination_path is not None: - body["destination_path"] = destination_path + body["{destination_path}"] = destination_path if source_path is not None: - body["source_path"] = source_path + body["{source_path}"] = source_path headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/dbfs/move", body=body, headers=headers) @@ -983,14 +983,14 @@ def put(self, path: str, *, contents: Optional[str] = None, overwrite: Optional[ """ body = {} if contents is not None: - body["contents"] = contents + body["{contents}"] = contents if overwrite is not None: - body["overwrite"] = overwrite + body["{overwrite}"] = overwrite if path is not None: - body["path"] = path + body["{path}"] = path headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/dbfs/put", body=body, headers=headers) @@ -1019,13 +1019,13 @@ def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] query = {} if length is not None: - query["length"] = length + query["{length}"] = length if offset is not None: - query["offset"] = offset + query["{offset}"] = offset if path is not None: - query["path"] = path + query["{path}"] = path headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/dbfs/read", query=query, headers=headers) @@ -1121,12 +1121,12 @@ def download(self, file_path: str) -> DownloadResponse: """ headers = { - "Accept": "application/octet-stream", + "0": "{Accept application/octet-stream}", } response_headers = [ - "content-length", - "content-type", - "last-modified", + "{content_length}", + "{content_type}", + "{last_modified}", ] res = self._api.do( "GET", @@ -1173,9 +1173,9 @@ def get_metadata(self, file_path: str) -> GetMetadataResponse: headers = {} response_headers = [ - "content-length", - "content-type", - "last-modified", + "{content_length}", + "{content_type}", + "{last_modified}", ] res = self._api.do( "HEAD", @@ -1218,11 +1218,11 @@ def list_directory_contents( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -1232,12 +1232,12 @@ def list_directory_contents( query=query, headers=headers, ) - if "contents" in json: - for v in json["contents"]: + if "{contents}" in json: + for v in json["{contents}"]: yield DirectoryEntry.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool] = None): """Upload a file. @@ -1258,9 +1258,9 @@ def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool query = {} if overwrite is not None: - query["overwrite"] = overwrite + query["{overwrite}"] = overwrite headers = { - "Content-Type": "application/octet-stream", + "0": "{Content-Type application/octet-stream}", } self._api.do( diff --git a/databricks/sdk/service/iam.py b/databricks/sdk/iam/v2/impl.py similarity index 77% rename from databricks/sdk/service/iam.py rename to databricks/sdk/iam/v2/impl.py index d5fe5645e..88dab201f 100755 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/iam/v2/impl.py @@ -7,11 +7,11 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (_enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -33,36 +33,36 @@ def as_dict(self) -> dict: """Serializes the AccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the AccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccessControlRequest: """Deserializes the AccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", PermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", PermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -87,41 +87,41 @@ def as_dict(self) -> dict: """Serializes the AccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the AccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccessControlResponse: """Deserializes the AccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", Permission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", Permission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -136,20 +136,20 @@ def as_dict(self) -> dict: """Serializes the Actor into a dictionary suitable for use as a JSON request body.""" body = {} if self.actor_id is not None: - body["actor_id"] = self.actor_id + body["{actor_id}"] = self.actor_id return body def as_shallow_dict(self) -> dict: """Serializes the Actor into a shallow dictionary of its immediate attributes.""" body = {} if self.actor_id is not None: - body["actor_id"] = self.actor_id + body["{actor_id}"] = self.actor_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Actor: """Deserializes the Actor from a dictionary.""" - return cls(actor_id=d.get("actor_id", None)) + return cls(actor_id=d.get("{actor_id}", None)) @dataclass @@ -162,26 +162,26 @@ def as_dict(self) -> dict: """Serializes the CheckPolicyResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.consistency_token: - body["consistency_token"] = self.consistency_token.as_dict() + body["{consistency_token}"] = self.consistency_token.as_dict() if self.is_permitted is not None: - body["is_permitted"] = self.is_permitted + body["{is_permitted}"] = self.is_permitted return body def as_shallow_dict(self) -> dict: """Serializes the CheckPolicyResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.consistency_token: - body["consistency_token"] = self.consistency_token + body["{consistency_token}"] = self.consistency_token if self.is_permitted is not None: - body["is_permitted"] = self.is_permitted + body["{is_permitted}"] = self.is_permitted return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CheckPolicyResponse: """Deserializes the CheckPolicyResponse from a dictionary.""" return cls( - consistency_token=_from_dict(d, "consistency_token", ConsistencyToken), - is_permitted=d.get("is_permitted", None), + consistency_token=_from_dict(d, "{consistency_token}", ConsistencyToken), + is_permitted=d.get("{is_permitted}", None), ) @@ -201,41 +201,41 @@ def as_dict(self) -> dict: """Serializes the ComplexValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.display is not None: - body["display"] = self.display + body["{display}"] = self.display if self.primary is not None: - body["primary"] = self.primary + body["{primary}"] = self.primary if self.ref is not None: - body["$ref"] = self.ref + body["{ref}"] = self.ref if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the ComplexValue into a shallow dictionary of its immediate attributes.""" body = {} if self.display is not None: - body["display"] = self.display + body["{display}"] = self.display if self.primary is not None: - body["primary"] = self.primary + body["{primary}"] = self.primary if self.ref is not None: - body["$ref"] = self.ref + body["{ref}"] = self.ref if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComplexValue: """Deserializes the ComplexValue from a dictionary.""" return cls( - display=d.get("display", None), - primary=d.get("primary", None), - ref=d.get("$ref", None), - type=d.get("type", None), - value=d.get("value", None), + display=d.get("{display}", None), + primary=d.get("{primary}", None), + ref=d.get("{ref}", None), + type=d.get("{type}", None), + value=d.get("{value}", None), ) @@ -247,20 +247,20 @@ def as_dict(self) -> dict: """Serializes the ConsistencyToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the ConsistencyToken into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConsistencyToken: """Deserializes the ConsistencyToken from a dictionary.""" - return cls(value=d.get("value", None)) + return cls(value=d.get("{value}", None)) @dataclass @@ -307,20 +307,20 @@ def as_dict(self) -> dict: """Serializes the GetAssignableRolesForResourceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.roles: - body["roles"] = [v.as_dict() for v in self.roles] + body["{roles}"] = [v.as_dict() for v in self.roles] return body def as_shallow_dict(self) -> dict: """Serializes the GetAssignableRolesForResourceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.roles: - body["roles"] = self.roles + body["{roles}"] = self.roles return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetAssignableRolesForResourceResponse: """Deserializes the GetAssignableRolesForResourceResponse from a dictionary.""" - return cls(roles=_repeated_dict(d, "roles", Role)) + return cls(roles=_repeated_dict(d, "{roles}", Role)) @dataclass @@ -332,20 +332,20 @@ def as_dict(self) -> dict: """Serializes the GetPasswordPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetPasswordPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPasswordPermissionLevelsResponse: """Deserializes the GetPasswordPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", PasswordPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", PasswordPermissionsDescription)) @dataclass @@ -357,20 +357,20 @@ def as_dict(self) -> dict: """Serializes the GetPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPermissionLevelsResponse: """Deserializes the GetPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", PermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", PermissionsDescription)) class GetSortOrder(Enum): @@ -391,24 +391,24 @@ def as_dict(self) -> dict: """Serializes the GrantRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.principals: - body["principals"] = [v for v in self.principals] + body["{principals}"] = [v for v in self.principals] if self.role is not None: - body["role"] = self.role + body["{role}"] = self.role return body def as_shallow_dict(self) -> dict: """Serializes the GrantRule into a shallow dictionary of its immediate attributes.""" body = {} if self.principals: - body["principals"] = self.principals + body["{principals}"] = self.principals if self.role is not None: - body["role"] = self.role + body["{role}"] = self.role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GrantRule: """Deserializes the GrantRule from a dictionary.""" - return cls(principals=d.get("principals", None), role=d.get("role", None)) + return cls(principals=d.get("{principals}", None), role=d.get("{role}", None)) @dataclass @@ -444,61 +444,61 @@ def as_dict(self) -> dict: """Serializes the Group into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["displayName"] = self.display_name + body["{display_name}"] = self.display_name if self.entitlements: - body["entitlements"] = [v.as_dict() for v in self.entitlements] + body["{entitlements}"] = [v.as_dict() for v in self.entitlements] if self.external_id is not None: - body["externalId"] = self.external_id + body["{external_id}"] = self.external_id if self.groups: - body["groups"] = [v.as_dict() for v in self.groups] + body["{groups}"] = [v.as_dict() for v in self.groups] if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.members: - body["members"] = [v.as_dict() for v in self.members] + body["{members}"] = [v.as_dict() for v in self.members] if self.meta: - body["meta"] = self.meta.as_dict() + body["{meta}"] = self.meta.as_dict() if self.roles: - body["roles"] = [v.as_dict() for v in self.roles] + body["{roles}"] = [v.as_dict() for v in self.roles] if self.schemas: - body["schemas"] = [v.value for v in self.schemas] + body["{schemas}"] = [v.value for v in self.schemas] return body def as_shallow_dict(self) -> dict: """Serializes the Group into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["displayName"] = self.display_name + body["{display_name}"] = self.display_name if self.entitlements: - body["entitlements"] = self.entitlements + body["{entitlements}"] = self.entitlements if self.external_id is not None: - body["externalId"] = self.external_id + body["{external_id}"] = self.external_id if self.groups: - body["groups"] = self.groups + body["{groups}"] = self.groups if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.members: - body["members"] = self.members + body["{members}"] = self.members if self.meta: - body["meta"] = self.meta + body["{meta}"] = self.meta if self.roles: - body["roles"] = self.roles + body["{roles}"] = self.roles if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Group: """Deserializes the Group from a dictionary.""" return cls( - display_name=d.get("displayName", None), - entitlements=_repeated_dict(d, "entitlements", ComplexValue), - external_id=d.get("externalId", None), - groups=_repeated_dict(d, "groups", ComplexValue), - id=d.get("id", None), - members=_repeated_dict(d, "members", ComplexValue), - meta=_from_dict(d, "meta", ResourceMeta), - roles=_repeated_dict(d, "roles", ComplexValue), - schemas=_repeated_enum(d, "schemas", GroupSchema), + display_name=d.get("{display_name}", None), + entitlements=_repeated_dict(d, "{entitlements}", ComplexValue), + external_id=d.get("{external_id}", None), + groups=_repeated_dict(d, "{groups}", ComplexValue), + id=d.get("{id}", None), + members=_repeated_dict(d, "{members}", ComplexValue), + meta=_from_dict(d, "{meta}", ResourceMeta), + roles=_repeated_dict(d, "{roles}", ComplexValue), + schemas=_repeated_enum(d, "{schemas}", GroupSchema), ) @@ -528,41 +528,41 @@ def as_dict(self) -> dict: """Serializes the ListGroupsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items_per_page is not None: - body["itemsPerPage"] = self.items_per_page + body["{items_per_page}"] = self.items_per_page if self.resources: - body["Resources"] = [v.as_dict() for v in self.resources] + body["{resources}"] = [v.as_dict() for v in self.resources] if self.schemas: - body["schemas"] = [v.value for v in self.schemas] + body["{schemas}"] = [v.value for v in self.schemas] if self.start_index is not None: - body["startIndex"] = self.start_index + body["{start_index}"] = self.start_index if self.total_results is not None: - body["totalResults"] = self.total_results + body["{total_results}"] = self.total_results return body def as_shallow_dict(self) -> dict: """Serializes the ListGroupsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items_per_page is not None: - body["itemsPerPage"] = self.items_per_page + body["{items_per_page}"] = self.items_per_page if self.resources: - body["Resources"] = self.resources + body["{resources}"] = self.resources if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas if self.start_index is not None: - body["startIndex"] = self.start_index + body["{start_index}"] = self.start_index if self.total_results is not None: - body["totalResults"] = self.total_results + body["{total_results}"] = self.total_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListGroupsResponse: """Deserializes the ListGroupsResponse from a dictionary.""" return cls( - items_per_page=d.get("itemsPerPage", None), - resources=_repeated_dict(d, "Resources", Group), - schemas=_repeated_enum(d, "schemas", ListResponseSchema), - start_index=d.get("startIndex", None), - total_results=d.get("totalResults", None), + items_per_page=d.get("{items_per_page}", None), + resources=_repeated_dict(d, "{resources}", Group), + schemas=_repeated_enum(d, "{schemas}", ListResponseSchema), + start_index=d.get("{start_index}", None), + total_results=d.get("{total_results}", None), ) @@ -592,41 +592,41 @@ def as_dict(self) -> dict: """Serializes the ListServicePrincipalResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items_per_page is not None: - body["itemsPerPage"] = self.items_per_page + body["{items_per_page}"] = self.items_per_page if self.resources: - body["Resources"] = [v.as_dict() for v in self.resources] + body["{resources}"] = [v.as_dict() for v in self.resources] if self.schemas: - body["schemas"] = [v.value for v in self.schemas] + body["{schemas}"] = [v.value for v in self.schemas] if self.start_index is not None: - body["startIndex"] = self.start_index + body["{start_index}"] = self.start_index if self.total_results is not None: - body["totalResults"] = self.total_results + body["{total_results}"] = self.total_results return body def as_shallow_dict(self) -> dict: """Serializes the ListServicePrincipalResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items_per_page is not None: - body["itemsPerPage"] = self.items_per_page + body["{items_per_page}"] = self.items_per_page if self.resources: - body["Resources"] = self.resources + body["{resources}"] = self.resources if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas if self.start_index is not None: - body["startIndex"] = self.start_index + body["{start_index}"] = self.start_index if self.total_results is not None: - body["totalResults"] = self.total_results + body["{total_results}"] = self.total_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListServicePrincipalResponse: """Deserializes the ListServicePrincipalResponse from a dictionary.""" return cls( - items_per_page=d.get("itemsPerPage", None), - resources=_repeated_dict(d, "Resources", ServicePrincipal), - schemas=_repeated_enum(d, "schemas", ListResponseSchema), - start_index=d.get("startIndex", None), - total_results=d.get("totalResults", None), + items_per_page=d.get("{items_per_page}", None), + resources=_repeated_dict(d, "{resources}", ServicePrincipal), + schemas=_repeated_enum(d, "{schemas}", ListResponseSchema), + start_index=d.get("{start_index}", None), + total_results=d.get("{total_results}", None), ) @@ -657,41 +657,41 @@ def as_dict(self) -> dict: """Serializes the ListUsersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items_per_page is not None: - body["itemsPerPage"] = self.items_per_page + body["{items_per_page}"] = self.items_per_page if self.resources: - body["Resources"] = [v.as_dict() for v in self.resources] + body["{resources}"] = [v.as_dict() for v in self.resources] if self.schemas: - body["schemas"] = [v.value for v in self.schemas] + body["{schemas}"] = [v.value for v in self.schemas] if self.start_index is not None: - body["startIndex"] = self.start_index + body["{start_index}"] = self.start_index if self.total_results is not None: - body["totalResults"] = self.total_results + body["{total_results}"] = self.total_results return body def as_shallow_dict(self) -> dict: """Serializes the ListUsersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items_per_page is not None: - body["itemsPerPage"] = self.items_per_page + body["{items_per_page}"] = self.items_per_page if self.resources: - body["Resources"] = self.resources + body["{resources}"] = self.resources if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas if self.start_index is not None: - body["startIndex"] = self.start_index + body["{start_index}"] = self.start_index if self.total_results is not None: - body["totalResults"] = self.total_results + body["{total_results}"] = self.total_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListUsersResponse: """Deserializes the ListUsersResponse from a dictionary.""" return cls( - items_per_page=d.get("itemsPerPage", None), - resources=_repeated_dict(d, "Resources", User), - schemas=_repeated_enum(d, "schemas", ListResponseSchema), - start_index=d.get("startIndex", None), - total_results=d.get("totalResults", None), + items_per_page=d.get("{items_per_page}", None), + resources=_repeated_dict(d, "{resources}", User), + schemas=_repeated_enum(d, "{schemas}", ListResponseSchema), + start_index=d.get("{start_index}", None), + total_results=d.get("{total_results}", None), ) @@ -713,36 +713,36 @@ def as_dict(self) -> dict: """Serializes the MigratePermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.from_workspace_group_name is not None: - body["from_workspace_group_name"] = self.from_workspace_group_name + body["{from_workspace_group_name}"] = self.from_workspace_group_name if self.size is not None: - body["size"] = self.size + body["{size}"] = self.size if self.to_account_group_name is not None: - body["to_account_group_name"] = self.to_account_group_name + body["{to_account_group_name}"] = self.to_account_group_name if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the MigratePermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.from_workspace_group_name is not None: - body["from_workspace_group_name"] = self.from_workspace_group_name + body["{from_workspace_group_name}"] = self.from_workspace_group_name if self.size is not None: - body["size"] = self.size + body["{size}"] = self.size if self.to_account_group_name is not None: - body["to_account_group_name"] = self.to_account_group_name + body["{to_account_group_name}"] = self.to_account_group_name if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MigratePermissionsRequest: """Deserializes the MigratePermissionsRequest from a dictionary.""" return cls( - from_workspace_group_name=d.get("from_workspace_group_name", None), - size=d.get("size", None), - to_account_group_name=d.get("to_account_group_name", None), - workspace_id=d.get("workspace_id", None), + from_workspace_group_name=d.get("{from_workspace_group_name}", None), + size=d.get("{size}", None), + to_account_group_name=d.get("{to_account_group_name}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -755,20 +755,20 @@ def as_dict(self) -> dict: """Serializes the MigratePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permissions_migrated is not None: - body["permissions_migrated"] = self.permissions_migrated + body["{permissions_migrated}"] = self.permissions_migrated return body def as_shallow_dict(self) -> dict: """Serializes the MigratePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permissions_migrated is not None: - body["permissions_migrated"] = self.permissions_migrated + body["{permissions_migrated}"] = self.permissions_migrated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MigratePermissionsResponse: """Deserializes the MigratePermissionsResponse from a dictionary.""" - return cls(permissions_migrated=d.get("permissions_migrated", None)) + return cls(permissions_migrated=d.get("{permissions_migrated}", None)) @dataclass @@ -783,24 +783,24 @@ def as_dict(self) -> dict: """Serializes the Name into a dictionary suitable for use as a JSON request body.""" body = {} if self.family_name is not None: - body["familyName"] = self.family_name + body["{family_name}"] = self.family_name if self.given_name is not None: - body["givenName"] = self.given_name + body["{given_name}"] = self.given_name return body def as_shallow_dict(self) -> dict: """Serializes the Name into a shallow dictionary of its immediate attributes.""" body = {} if self.family_name is not None: - body["familyName"] = self.family_name + body["{family_name}"] = self.family_name if self.given_name is not None: - body["givenName"] = self.given_name + body["{given_name}"] = self.given_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Name: """Deserializes the Name from a dictionary.""" - return cls(family_name=d.get("familyName", None), given_name=d.get("givenName", None)) + return cls(family_name=d.get("{family_name}", None), given_name=d.get("{given_name}", None)) @dataclass @@ -815,31 +815,31 @@ def as_dict(self) -> dict: """Serializes the ObjectPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the ObjectPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ObjectPermissions: """Deserializes the ObjectPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", AccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", AccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -857,31 +857,31 @@ def as_dict(self) -> dict: """Serializes the PartialUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.operations: - body["Operations"] = [v.as_dict() for v in self.operations] + body["{operations}"] = [v.as_dict() for v in self.operations] if self.schemas: - body["schemas"] = [v.value for v in self.schemas] + body["{schemas}"] = [v.value for v in self.schemas] return body def as_shallow_dict(self) -> dict: """Serializes the PartialUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.operations: - body["Operations"] = self.operations + body["{operations}"] = self.operations if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartialUpdate: """Deserializes the PartialUpdate from a dictionary.""" return cls( - id=d.get("id", None), - operations=_repeated_dict(d, "Operations", Patch), - schemas=_repeated_enum(d, "schemas", PatchSchema), + id=d.get("{id}", None), + operations=_repeated_dict(d, "{operations}", Patch), + schemas=_repeated_enum(d, "{schemas}", PatchSchema), ) @@ -903,36 +903,36 @@ def as_dict(self) -> dict: """Serializes the PasswordAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the PasswordAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordAccessControlRequest: """Deserializes the PasswordAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", PasswordPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", PasswordPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -957,41 +957,41 @@ def as_dict(self) -> dict: """Serializes the PasswordAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the PasswordAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordAccessControlResponse: """Deserializes the PasswordAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", PasswordPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", PasswordPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -1008,31 +1008,31 @@ def as_dict(self) -> dict: """Serializes the PasswordPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the PasswordPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermission: """Deserializes the PasswordPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", PasswordPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", PasswordPermissionLevel), ) @@ -1054,31 +1054,31 @@ def as_dict(self) -> dict: """Serializes the PasswordPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the PasswordPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermissions: """Deserializes the PasswordPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", PasswordAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", PasswordAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -1093,26 +1093,26 @@ def as_dict(self) -> dict: """Serializes the PasswordPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the PasswordPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermissionsDescription: """Deserializes the PasswordPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", PasswordPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", PasswordPermissionLevel), ) @@ -1124,20 +1124,20 @@ def as_dict(self) -> dict: """Serializes the PasswordPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] return body def as_shallow_dict(self) -> dict: """Serializes the PasswordPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermissionsRequest: """Deserializes the PasswordPermissionsRequest from a dictionary.""" - return cls(access_control_list=_repeated_dict(d, "access_control_list", PasswordAccessControlRequest)) + return cls(access_control_list=_repeated_dict(d, "{access_control_list}", PasswordAccessControlRequest)) @dataclass @@ -1155,28 +1155,28 @@ def as_dict(self) -> dict: """Serializes the Patch into a dictionary suitable for use as a JSON request body.""" body = {} if self.op is not None: - body["op"] = self.op.value + body["{op}"] = self.op.value if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.value: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the Patch into a shallow dictionary of its immediate attributes.""" body = {} if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.value: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Patch: """Deserializes the Patch from a dictionary.""" - return cls(op=_enum(d, "op", PatchOp), path=d.get("path", None), value=d.get("value", None)) + return cls(op=_enum(d, "{op}", PatchOp), path=d.get("{path}", None), value=d.get("{value}", None)) class PatchOp(Enum): @@ -1223,31 +1223,31 @@ def as_dict(self) -> dict: """Serializes the Permission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the Permission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Permission: """Deserializes the Permission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", PermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", PermissionLevel), ) @@ -1269,31 +1269,31 @@ def as_dict(self) -> dict: """Serializes the PermissionAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.permissions: - body["permissions"] = [v.value for v in self.permissions] + body["{permissions}"] = [v.value for v in self.permissions] if self.principal: - body["principal"] = self.principal.as_dict() + body["{principal}"] = self.principal.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the PermissionAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.permissions: - body["permissions"] = self.permissions + body["{permissions}"] = self.permissions if self.principal: - body["principal"] = self.principal + body["{principal}"] = self.principal return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionAssignment: """Deserializes the PermissionAssignment from a dictionary.""" return cls( - error=d.get("error", None), - permissions=_repeated_enum(d, "permissions", WorkspacePermission), - principal=_from_dict(d, "principal", PrincipalOutput), + error=d.get("{error}", None), + permissions=_repeated_enum(d, "{permissions}", WorkspacePermission), + principal=_from_dict(d, "{principal}", PrincipalOutput), ) @@ -1306,20 +1306,20 @@ def as_dict(self) -> dict: """Serializes the PermissionAssignments into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_assignments: - body["permission_assignments"] = [v.as_dict() for v in self.permission_assignments] + body["{permission_assignments}"] = [v.as_dict() for v in self.permission_assignments] return body def as_shallow_dict(self) -> dict: """Serializes the PermissionAssignments into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_assignments: - body["permission_assignments"] = self.permission_assignments + body["{permission_assignments}"] = self.permission_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionAssignments: """Deserializes the PermissionAssignments from a dictionary.""" - return cls(permission_assignments=_repeated_dict(d, "permission_assignments", PermissionAssignment)) + return cls(permission_assignments=_repeated_dict(d, "{permission_assignments}", PermissionAssignment)) class PermissionLevel(Enum): @@ -1355,25 +1355,26 @@ def as_dict(self) -> dict: """Serializes the PermissionOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the PermissionOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionOutput: """Deserializes the PermissionOutput from a dictionary.""" return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", WorkspacePermission) + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", WorkspacePermission), ) @@ -1388,25 +1389,25 @@ def as_dict(self) -> dict: """Serializes the PermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the PermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsDescription: """Deserializes the PermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", PermissionLevel) + description=d.get("{description}", None), permission_level=_enum(d, "{permission_level}", PermissionLevel) ) @@ -1426,31 +1427,31 @@ def as_dict(self) -> dict: """Serializes the PermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.request_object_id is not None: - body["request_object_id"] = self.request_object_id + body["{request_object_id}"] = self.request_object_id if self.request_object_type is not None: - body["request_object_type"] = self.request_object_type + body["{request_object_type}"] = self.request_object_type return body def as_shallow_dict(self) -> dict: """Serializes the PermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.request_object_id is not None: - body["request_object_id"] = self.request_object_id + body["{request_object_id}"] = self.request_object_id if self.request_object_type is not None: - body["request_object_type"] = self.request_object_type + body["{request_object_type}"] = self.request_object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsRequest: """Deserializes the PermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", AccessControlRequest), - request_object_id=d.get("request_object_id", None), - request_object_type=d.get("request_object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", AccessControlRequest), + request_object_id=d.get("{request_object_id}", None), + request_object_type=d.get("{request_object_type}", None), ) @@ -1477,41 +1478,41 @@ def as_dict(self) -> dict: """Serializes the PrincipalOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.principal_id is not None: - body["principal_id"] = self.principal_id + body["{principal_id}"] = self.principal_id if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the PrincipalOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.principal_id is not None: - body["principal_id"] = self.principal_id + body["{principal_id}"] = self.principal_id if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrincipalOutput: """Deserializes the PrincipalOutput from a dictionary.""" return cls( - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - principal_id=d.get("principal_id", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + principal_id=d.get("{principal_id}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -1538,31 +1539,31 @@ def as_dict(self) -> dict: """Serializes the ResourceInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.legacy_acl_path is not None: - body["legacy_acl_path"] = self.legacy_acl_path + body["{legacy_acl_path}"] = self.legacy_acl_path if self.parent_resource_info: - body["parent_resource_info"] = self.parent_resource_info.as_dict() + body["{parent_resource_info}"] = self.parent_resource_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ResourceInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.legacy_acl_path is not None: - body["legacy_acl_path"] = self.legacy_acl_path + body["{legacy_acl_path}"] = self.legacy_acl_path if self.parent_resource_info: - body["parent_resource_info"] = self.parent_resource_info + body["{parent_resource_info}"] = self.parent_resource_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResourceInfo: """Deserializes the ResourceInfo from a dictionary.""" return cls( - id=d.get("id", None), - legacy_acl_path=d.get("legacy_acl_path", None), - parent_resource_info=_from_dict(d, "parent_resource_info", ResourceInfo), + id=d.get("{id}", None), + legacy_acl_path=d.get("{legacy_acl_path}", None), + parent_resource_info=_from_dict(d, "{parent_resource_info}", ResourceInfo), ) @@ -1576,20 +1577,20 @@ def as_dict(self) -> dict: """Serializes the ResourceMeta into a dictionary suitable for use as a JSON request body.""" body = {} if self.resource_type is not None: - body["resourceType"] = self.resource_type + body["{resource_type}"] = self.resource_type return body def as_shallow_dict(self) -> dict: """Serializes the ResourceMeta into a shallow dictionary of its immediate attributes.""" body = {} if self.resource_type is not None: - body["resourceType"] = self.resource_type + body["{resource_type}"] = self.resource_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResourceMeta: """Deserializes the ResourceMeta from a dictionary.""" - return cls(resource_type=d.get("resourceType", None)) + return cls(resource_type=d.get("{resource_type}", None)) @dataclass @@ -1601,20 +1602,20 @@ def as_dict(self) -> dict: """Serializes the Role into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the Role into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Role: """Deserializes the Role from a dictionary.""" - return cls(name=d.get("name", None)) + return cls(name=d.get("{name}", None)) @dataclass @@ -1631,29 +1632,31 @@ def as_dict(self) -> dict: """Serializes the RuleSetResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.grant_rules: - body["grant_rules"] = [v.as_dict() for v in self.grant_rules] + body["{grant_rules}"] = [v.as_dict() for v in self.grant_rules] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the RuleSetResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.grant_rules: - body["grant_rules"] = self.grant_rules + body["{grant_rules}"] = self.grant_rules if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RuleSetResponse: """Deserializes the RuleSetResponse from a dictionary.""" return cls( - etag=d.get("etag", None), grant_rules=_repeated_dict(d, "grant_rules", GrantRule), name=d.get("name", None) + etag=d.get("{etag}", None), + grant_rules=_repeated_dict(d, "{grant_rules}", GrantRule), + name=d.get("{name}", None), ) @@ -1672,29 +1675,31 @@ def as_dict(self) -> dict: """Serializes the RuleSetUpdateRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.grant_rules: - body["grant_rules"] = [v.as_dict() for v in self.grant_rules] + body["{grant_rules}"] = [v.as_dict() for v in self.grant_rules] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the RuleSetUpdateRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.grant_rules: - body["grant_rules"] = self.grant_rules + body["{grant_rules}"] = self.grant_rules if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RuleSetUpdateRequest: """Deserializes the RuleSetUpdateRequest from a dictionary.""" return cls( - etag=d.get("etag", None), grant_rules=_repeated_dict(d, "grant_rules", GrantRule), name=d.get("name", None) + etag=d.get("{etag}", None), + grant_rules=_repeated_dict(d, "{grant_rules}", GrantRule), + name=d.get("{name}", None), ) @@ -1732,61 +1737,61 @@ def as_dict(self) -> dict: """Serializes the ServicePrincipal into a dictionary suitable for use as a JSON request body.""" body = {} if self.active is not None: - body["active"] = self.active + body["{active}"] = self.active if self.application_id is not None: - body["applicationId"] = self.application_id + body["{application_id}"] = self.application_id if self.display_name is not None: - body["displayName"] = self.display_name + body["{display_name}"] = self.display_name if self.entitlements: - body["entitlements"] = [v.as_dict() for v in self.entitlements] + body["{entitlements}"] = [v.as_dict() for v in self.entitlements] if self.external_id is not None: - body["externalId"] = self.external_id + body["{external_id}"] = self.external_id if self.groups: - body["groups"] = [v.as_dict() for v in self.groups] + body["{groups}"] = [v.as_dict() for v in self.groups] if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.roles: - body["roles"] = [v.as_dict() for v in self.roles] + body["{roles}"] = [v.as_dict() for v in self.roles] if self.schemas: - body["schemas"] = [v.value for v in self.schemas] + body["{schemas}"] = [v.value for v in self.schemas] return body def as_shallow_dict(self) -> dict: """Serializes the ServicePrincipal into a shallow dictionary of its immediate attributes.""" body = {} if self.active is not None: - body["active"] = self.active + body["{active}"] = self.active if self.application_id is not None: - body["applicationId"] = self.application_id + body["{application_id}"] = self.application_id if self.display_name is not None: - body["displayName"] = self.display_name + body["{display_name}"] = self.display_name if self.entitlements: - body["entitlements"] = self.entitlements + body["{entitlements}"] = self.entitlements if self.external_id is not None: - body["externalId"] = self.external_id + body["{external_id}"] = self.external_id if self.groups: - body["groups"] = self.groups + body["{groups}"] = self.groups if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.roles: - body["roles"] = self.roles + body["{roles}"] = self.roles if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServicePrincipal: """Deserializes the ServicePrincipal from a dictionary.""" return cls( - active=d.get("active", None), - application_id=d.get("applicationId", None), - display_name=d.get("displayName", None), - entitlements=_repeated_dict(d, "entitlements", ComplexValue), - external_id=d.get("externalId", None), - groups=_repeated_dict(d, "groups", ComplexValue), - id=d.get("id", None), - roles=_repeated_dict(d, "roles", ComplexValue), - schemas=_repeated_enum(d, "schemas", ServicePrincipalSchema), + active=d.get("{active}", None), + application_id=d.get("{application_id}", None), + display_name=d.get("{display_name}", None), + entitlements=_repeated_dict(d, "{entitlements}", ComplexValue), + external_id=d.get("{external_id}", None), + groups=_repeated_dict(d, "{groups}", ComplexValue), + id=d.get("{id}", None), + roles=_repeated_dict(d, "{roles}", ComplexValue), + schemas=_repeated_enum(d, "{schemas}", ServicePrincipalSchema), ) @@ -1824,24 +1829,24 @@ def as_dict(self) -> dict: """Serializes the UpdateRuleSetRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rule_set: - body["rule_set"] = self.rule_set.as_dict() + body["{rule_set}"] = self.rule_set.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRuleSetRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rule_set: - body["rule_set"] = self.rule_set + body["{rule_set}"] = self.rule_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRuleSetRequest: """Deserializes the UpdateRuleSetRequest from a dictionary.""" - return cls(name=d.get("name", None), rule_set=_from_dict(d, "rule_set", RuleSetUpdateRequest)) + return cls(name=d.get("{name}", None), rule_set=_from_dict(d, "{rule_set}", RuleSetUpdateRequest)) @dataclass @@ -1863,31 +1868,31 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceAssignments into a dictionary suitable for use as a JSON request body.""" body = {} if self.permissions: - body["permissions"] = [v.value for v in self.permissions] + body["{permissions}"] = [v.value for v in self.permissions] if self.principal_id is not None: - body["principal_id"] = self.principal_id + body["{principal_id}"] = self.principal_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceAssignments into a shallow dictionary of its immediate attributes.""" body = {} if self.permissions: - body["permissions"] = self.permissions + body["{permissions}"] = self.permissions if self.principal_id is not None: - body["principal_id"] = self.principal_id + body["{principal_id}"] = self.principal_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceAssignments: """Deserializes the UpdateWorkspaceAssignments from a dictionary.""" return cls( - permissions=_repeated_enum(d, "permissions", WorkspacePermission), - principal_id=d.get("principal_id", None), - workspace_id=d.get("workspace_id", None), + permissions=_repeated_enum(d, "{permissions}", WorkspacePermission), + principal_id=d.get("{principal_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -1935,71 +1940,71 @@ def as_dict(self) -> dict: """Serializes the User into a dictionary suitable for use as a JSON request body.""" body = {} if self.active is not None: - body["active"] = self.active + body["{active}"] = self.active if self.display_name is not None: - body["displayName"] = self.display_name + body["{display_name}"] = self.display_name if self.emails: - body["emails"] = [v.as_dict() for v in self.emails] + body["{emails}"] = [v.as_dict() for v in self.emails] if self.entitlements: - body["entitlements"] = [v.as_dict() for v in self.entitlements] + body["{entitlements}"] = [v.as_dict() for v in self.entitlements] if self.external_id is not None: - body["externalId"] = self.external_id + body["{external_id}"] = self.external_id if self.groups: - body["groups"] = [v.as_dict() for v in self.groups] + body["{groups}"] = [v.as_dict() for v in self.groups] if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name: - body["name"] = self.name.as_dict() + body["{name}"] = self.name.as_dict() if self.roles: - body["roles"] = [v.as_dict() for v in self.roles] + body["{roles}"] = [v.as_dict() for v in self.roles] if self.schemas: - body["schemas"] = [v.value for v in self.schemas] + body["{schemas}"] = [v.value for v in self.schemas] if self.user_name is not None: - body["userName"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the User into a shallow dictionary of its immediate attributes.""" body = {} if self.active is not None: - body["active"] = self.active + body["{active}"] = self.active if self.display_name is not None: - body["displayName"] = self.display_name + body["{display_name}"] = self.display_name if self.emails: - body["emails"] = self.emails + body["{emails}"] = self.emails if self.entitlements: - body["entitlements"] = self.entitlements + body["{entitlements}"] = self.entitlements if self.external_id is not None: - body["externalId"] = self.external_id + body["{external_id}"] = self.external_id if self.groups: - body["groups"] = self.groups + body["{groups}"] = self.groups if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name: - body["name"] = self.name + body["{name}"] = self.name if self.roles: - body["roles"] = self.roles + body["{roles}"] = self.roles if self.schemas: - body["schemas"] = self.schemas + body["{schemas}"] = self.schemas if self.user_name is not None: - body["userName"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> User: """Deserializes the User from a dictionary.""" return cls( - active=d.get("active", None), - display_name=d.get("displayName", None), - emails=_repeated_dict(d, "emails", ComplexValue), - entitlements=_repeated_dict(d, "entitlements", ComplexValue), - external_id=d.get("externalId", None), - groups=_repeated_dict(d, "groups", ComplexValue), - id=d.get("id", None), - name=_from_dict(d, "name", Name), - roles=_repeated_dict(d, "roles", ComplexValue), - schemas=_repeated_enum(d, "schemas", UserSchema), - user_name=d.get("userName", None), + active=d.get("{active}", None), + display_name=d.get("{display_name}", None), + emails=_repeated_dict(d, "{emails}", ComplexValue), + entitlements=_repeated_dict(d, "{entitlements}", ComplexValue), + external_id=d.get("{external_id}", None), + groups=_repeated_dict(d, "{groups}", ComplexValue), + id=d.get("{id}", None), + name=_from_dict(d, "{name}", Name), + roles=_repeated_dict(d, "{roles}", ComplexValue), + schemas=_repeated_enum(d, "{schemas}", UserSchema), + user_name=d.get("{user_name}", None), ) @@ -2027,20 +2032,20 @@ def as_dict(self) -> dict: """Serializes the WorkspacePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.permissions: - body["permissions"] = [v.as_dict() for v in self.permissions] + body["{permissions}"] = [v.as_dict() for v in self.permissions] return body def as_shallow_dict(self) -> dict: """Serializes the WorkspacePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.permissions: - body["permissions"] = self.permissions + body["{permissions}"] = self.permissions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspacePermissions: """Deserializes the WorkspacePermissions from a dictionary.""" - return cls(permissions=_repeated_dict(d, "permissions", PermissionOutput)) + return cls(permissions=_repeated_dict(d, "{permissions}", PermissionOutput)) class AccessControlAPI: @@ -2075,19 +2080,19 @@ def check_policy( query = {} if actor is not None: - query["actor"] = actor.as_dict() + query["{actor}"] = actor.as_dict() if authz_identity is not None: - query["authz_identity"] = authz_identity.value + query["{authz_identity}"] = authz_identity.value if consistency_token is not None: - query["consistency_token"] = consistency_token.as_dict() + query["{consistency_token}"] = consistency_token.as_dict() if permission is not None: - query["permission"] = permission + query["{permission}"] = permission if resource is not None: - query["resource"] = resource + query["{resource}"] = resource if resource_info is not None: - query["resource_info"] = resource_info.as_dict() + query["{resource_info}"] = resource_info.as_dict() headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/access-control/check-policy-v2", query=query, headers=headers) @@ -2116,9 +2121,9 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: - query["resource"] = resource + query["{resource}"] = resource headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2150,11 +2155,11 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag if name is not None: - query["name"] = name + query["{name}"] = name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2179,12 +2184,12 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if rule_set is not None: - body["rule_set"] = rule_set.as_dict() + body["{rule_set}"] = rule_set.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2218,9 +2223,9 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: - query["resource"] = resource + query["{resource}"] = resource headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2249,11 +2254,11 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag if name is not None: - query["name"] = name + query["{name}"] = name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/preview/accounts/access-control/rule-sets", query=query, headers=headers) @@ -2273,12 +2278,12 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if rule_set is not None: - body["rule_set"] = rule_set.as_dict() + body["{rule_set}"] = rule_set.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", "/api/2.0/preview/accounts/access-control/rule-sets", body=body, headers=headers) @@ -2336,26 +2341,26 @@ def create( """ body = {} if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if id is not None: - body["id"] = id + body["{id}"] = id if members is not None: - body["members"] = [v.as_dict() for v in members] + body["{members}"] = [v.as_dict() for v in members] if meta is not None: - body["meta"] = meta.as_dict() + body["{meta}"] = meta.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2390,7 +2395,7 @@ def get(self, id: str) -> Group: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", headers=headers) @@ -2436,42 +2441,42 @@ def list( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["startIndex"] = 1 - if "count" not in query: - query["count"] = 100 + query["{start_index}"] = 1 + if "{count}" not in query: + query["{count}"] = 100 while True: json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups", query=query, headers=headers ) - if "Resources" in json: - for v in json["Resources"]: - i = v["id"] + if "{resources}" in json: + for v in json["{resources}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield Group.from_dict(v) - if "Resources" not in json or not json["Resources"]: + if "{resources}" not in json or not json["{resources}"]: return - query["startIndex"] += len(json["Resources"]) + query["{start_index}"] += len(json["{resources}"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update group details. @@ -2488,11 +2493,11 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["Operations"] = [v.as_dict() for v in operations] + body["{operations}"] = [v.as_dict() for v in operations] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do( @@ -2539,23 +2544,23 @@ def update( """ body = {} if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if members is not None: - body["members"] = [v.as_dict() for v in members] + body["{members}"] = [v.as_dict() for v in members] if meta is not None: - body["meta"] = meta.as_dict() + body["{meta}"] = meta.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", body=body, headers=headers) @@ -2612,26 +2617,26 @@ def create( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if application_id is not None: - body["applicationId"] = application_id + body["{application_id}"] = application_id if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if id is not None: - body["id"] = id + body["{id}"] = id if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2668,7 +2673,7 @@ def get(self, id: str) -> ServicePrincipal: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2716,28 +2721,28 @@ def list( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["startIndex"] = 1 - if "count" not in query: - query["count"] = 100 + query["{start_index}"] = 1 + if "{count}" not in query: + query["{count}"] = 100 while True: json = self._api.do( "GET", @@ -2745,16 +2750,16 @@ def list( query=query, headers=headers, ) - if "Resources" in json: - for v in json["Resources"]: - i = v["id"] + if "{resources}" in json: + for v in json["{resources}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield ServicePrincipal.from_dict(v) - if "Resources" not in json or not json["Resources"]: + if "{resources}" not in json or not json["{resources}"]: return - query["startIndex"] += len(json["Resources"]) + query["{start_index}"] += len(json["{resources}"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update service principal details. @@ -2771,11 +2776,11 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["Operations"] = [v.as_dict() for v in operations] + body["{operations}"] = [v.as_dict() for v in operations] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do( @@ -2828,23 +2833,23 @@ def update( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if application_id is not None: - body["applicationId"] = application_id + body["{application_id}"] = application_id if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do( @@ -2920,30 +2925,30 @@ def create( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if emails is not None: - body["emails"] = [v.as_dict() for v in emails] + body["{emails}"] = [v.as_dict() for v in emails] if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if id is not None: - body["id"] = id + body["{id}"] = id if name is not None: - body["name"] = name.as_dict() + body["{name}"] = name.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] if user_name is not None: - body["userName"] = user_name + body["{user_name}"] = user_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3011,21 +3016,21 @@ def get( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3074,42 +3079,42 @@ def list( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["startIndex"] = 1 - if "count" not in query: - query["count"] = 100 + query["{start_index}"] = 1 + if "{count}" not in query: + query["{count}"] = 100 while True: json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users", query=query, headers=headers ) - if "Resources" in json: - for v in json["Resources"]: - i = v["id"] + if "{resources}" in json: + for v in json["{resources}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield User.from_dict(v) - if "Resources" not in json or not json["Resources"]: + if "{resources}" not in json or not json["{resources}"]: return - query["startIndex"] += len(json["Resources"]) + query["{start_index}"] += len(json["{resources}"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update user details. @@ -3126,11 +3131,11 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["Operations"] = [v.as_dict() for v in operations] + body["{operations}"] = [v.as_dict() for v in operations] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do( @@ -3187,27 +3192,27 @@ def update( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if emails is not None: - body["emails"] = [v.as_dict() for v in emails] + body["{emails}"] = [v.as_dict() for v in emails] if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if name is not None: - body["name"] = name.as_dict() + body["{name}"] = name.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] if user_name is not None: - body["userName"] = user_name + body["{user_name}"] = user_name headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}", body=body, headers=headers) @@ -3228,7 +3233,7 @@ def me(self) -> User: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/preview/scim/v2/Me", headers=headers) @@ -3286,26 +3291,26 @@ def create( """ body = {} if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if id is not None: - body["id"] = id + body["{id}"] = id if members is not None: - body["members"] = [v.as_dict() for v in members] + body["{members}"] = [v.as_dict() for v in members] if meta is not None: - body["meta"] = meta.as_dict() + body["{meta}"] = meta.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/scim/v2/Groups", body=body, headers=headers) @@ -3338,7 +3343,7 @@ def get(self, id: str) -> Group: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Groups/{id}", headers=headers) @@ -3384,40 +3389,40 @@ def list( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["startIndex"] = 1 - if "count" not in query: - query["count"] = 100 + query["{start_index}"] = 1 + if "{count}" not in query: + query["{count}"] = 100 while True: json = self._api.do("GET", "/api/2.0/preview/scim/v2/Groups", query=query, headers=headers) - if "Resources" in json: - for v in json["Resources"]: - i = v["id"] + if "{resources}" in json: + for v in json["{resources}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield Group.from_dict(v) - if "Resources" not in json or not json["Resources"]: + if "{resources}" not in json or not json["{resources}"]: return - query["startIndex"] += len(json["Resources"]) + query["{start_index}"] += len(json["{resources}"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update group details. @@ -3434,11 +3439,11 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["Operations"] = [v.as_dict() for v in operations] + body["{operations}"] = [v.as_dict() for v in operations] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -3483,23 +3488,23 @@ def update( """ body = {} if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if members is not None: - body["members"] = [v.as_dict() for v in members] + body["{members}"] = [v.as_dict() for v in members] if meta is not None: - body["meta"] = meta.as_dict() + body["{meta}"] = meta.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -3534,16 +3539,16 @@ def migrate_permissions( """ body = {} if from_workspace_group_name is not None: - body["from_workspace_group_name"] = from_workspace_group_name + body["{from_workspace_group_name}"] = from_workspace_group_name if size is not None: - body["size"] = size + body["{size}"] = size if to_account_group_name is not None: - body["to_account_group_name"] = to_account_group_name + body["{to_account_group_name}"] = to_account_group_name if workspace_id is not None: - body["workspace_id"] = workspace_id + body["{workspace_id}"] = workspace_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/permissionmigration", body=body, headers=headers) @@ -3621,7 +3626,7 @@ def get(self, request_object_type: str, request_object_id: str) -> ObjectPermiss """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/{request_object_type}/{request_object_id}", headers=headers) @@ -3641,7 +3646,7 @@ def get_permission_levels(self, request_object_type: str, request_object_id: str """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3674,10 +3679,10 @@ def set( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3709,10 +3714,10 @@ def update( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3772,26 +3777,26 @@ def create( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if application_id is not None: - body["applicationId"] = application_id + body["{application_id}"] = application_id if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if id is not None: - body["id"] = id + body["{id}"] = id if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/scim/v2/ServicePrincipals", body=body, headers=headers) @@ -3824,7 +3829,7 @@ def get(self, id: str) -> ServicePrincipal: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", headers=headers) @@ -3870,40 +3875,40 @@ def list( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["startIndex"] = 1 - if "count" not in query: - query["count"] = 100 + query["{start_index}"] = 1 + if "{count}" not in query: + query["{count}"] = 100 while True: json = self._api.do("GET", "/api/2.0/preview/scim/v2/ServicePrincipals", query=query, headers=headers) - if "Resources" in json: - for v in json["Resources"]: - i = v["id"] + if "{resources}" in json: + for v in json["{resources}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield ServicePrincipal.from_dict(v) - if "Resources" not in json or not json["Resources"]: + if "{resources}" not in json or not json["{resources}"]: return - query["startIndex"] += len(json["Resources"]) + query["{start_index}"] += len(json["{resources}"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update service principal details. @@ -3920,11 +3925,11 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["Operations"] = [v.as_dict() for v in operations] + body["{operations}"] = [v.as_dict() for v in operations] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -3972,23 +3977,23 @@ def update( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if application_id is not None: - body["applicationId"] = application_id + body["{application_id}"] = application_id if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -4059,30 +4064,30 @@ def create( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if emails is not None: - body["emails"] = [v.as_dict() for v in emails] + body["{emails}"] = [v.as_dict() for v in emails] if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if id is not None: - body["id"] = id + body["{id}"] = id if name is not None: - body["name"] = name.as_dict() + body["{name}"] = name.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] if user_name is not None: - body["userName"] = user_name + body["{user_name}"] = user_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/scim/v2/Users", body=body, headers=headers) @@ -4148,21 +4153,21 @@ def get( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Users/{id}", query=query, headers=headers) @@ -4177,7 +4182,7 @@ def get_permission_levels(self) -> GetPasswordPermissionLevelsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords/permissionLevels", headers=headers) @@ -4192,7 +4197,7 @@ def get_permissions(self) -> PasswordPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords", headers=headers) @@ -4239,40 +4244,40 @@ def list( query = {} if attributes is not None: - query["attributes"] = attributes + query["{attributes}"] = attributes if count is not None: - query["count"] = count + query["{count}"] = count if excluded_attributes is not None: - query["excludedAttributes"] = excluded_attributes + query["{excluded_attributes}"] = excluded_attributes if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if sort_by is not None: - query["sortBy"] = sort_by + query["{sort_by}"] = sort_by if sort_order is not None: - query["sortOrder"] = sort_order.value + query["{sort_order}"] = sort_order.value if start_index is not None: - query["startIndex"] = start_index + query["{start_index}"] = start_index headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["startIndex"] = 1 - if "count" not in query: - query["count"] = 100 + query["{start_index}"] = 1 + if "{count}" not in query: + query["{count}"] = 100 while True: json = self._api.do("GET", "/api/2.0/preview/scim/v2/Users", query=query, headers=headers) - if "Resources" in json: - for v in json["Resources"]: - i = v["id"] + if "{resources}" in json: + for v in json["{resources}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield User.from_dict(v) - if "Resources" not in json or not json["Resources"]: + if "{resources}" not in json or not json["{resources}"]: return - query["startIndex"] += len(json["Resources"]) + query["{start_index}"] += len(json["{resources}"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update user details. @@ -4289,11 +4294,11 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["Operations"] = [v.as_dict() for v in operations] + body["{operations}"] = [v.as_dict() for v in operations] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -4312,10 +4317,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) @@ -4371,27 +4376,27 @@ def update( """ body = {} if active is not None: - body["active"] = active + body["{active}"] = active if display_name is not None: - body["displayName"] = display_name + body["{display_name}"] = display_name if emails is not None: - body["emails"] = [v.as_dict() for v in emails] + body["{emails}"] = [v.as_dict() for v in emails] if entitlements is not None: - body["entitlements"] = [v.as_dict() for v in entitlements] + body["{entitlements}"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["externalId"] = external_id + body["{external_id}"] = external_id if groups is not None: - body["groups"] = [v.as_dict() for v in groups] + body["{groups}"] = [v.as_dict() for v in groups] if name is not None: - body["name"] = name.as_dict() + body["{name}"] = name.as_dict() if roles is not None: - body["roles"] = [v.as_dict() for v in roles] + body["{roles}"] = [v.as_dict() for v in roles] if schemas is not None: - body["schemas"] = [v.value for v in schemas] + body["{schemas}"] = [v.value for v in schemas] if user_name is not None: - body["userName"] = user_name + body["{user_name}"] = user_name headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -4409,10 +4414,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) @@ -4441,7 +4446,7 @@ def delete(self, workspace_id: int, principal_id: int): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -4462,7 +4467,7 @@ def get(self, workspace_id: int) -> WorkspacePermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -4484,7 +4489,7 @@ def list(self, workspace_id: int) -> Iterator[PermissionAssignment]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do( @@ -4518,10 +4523,10 @@ def update( """ body = {} if permissions is not None: - body["permissions"] = [v.value for v in permissions] + body["{permissions}"] = [v.value for v in permissions] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/jobs/v2/impl.py similarity index 74% rename from databricks/sdk/service/jobs.py rename to databricks/sdk/jobs/v2/impl.py index 5ecccf9fa..4c91e76c6 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/jobs/v2/impl.py @@ -3,19 +3,15 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import Wait, _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -31,20 +27,20 @@ def as_dict(self) -> dict: """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: """Deserializes the Adlsgen2Info from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -61,24 +57,24 @@ def as_dict(self) -> dict: """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" body = {} if self.max_workers is not None: - body["max_workers"] = self.max_workers + body["{max_workers}"] = self.max_workers if self.min_workers is not None: - body["min_workers"] = self.min_workers + body["{min_workers}"] = self.min_workers return body def as_shallow_dict(self) -> dict: """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" body = {} if self.max_workers is not None: - body["max_workers"] = self.max_workers + body["{max_workers}"] = self.max_workers if self.min_workers is not None: - body["min_workers"] = self.min_workers + body["{min_workers}"] = self.min_workers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoScale: """Deserializes the AutoScale from a dictionary.""" - return cls(max_workers=d.get("max_workers", None), min_workers=d.get("min_workers", None)) + return cls(max_workers=d.get("{max_workers}", None), min_workers=d.get("{min_workers}", None)) @dataclass @@ -165,66 +161,66 @@ def as_dict(self) -> dict: """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count + body["{ebs_volume_count}"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops + body["{ebs_volume_iops}"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size + body["{ebs_volume_size}"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput + body["{ebs_volume_throughput}"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type.value + body["{ebs_volume_type}"] = self.ebs_volume_type.value if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count + body["{ebs_volume_count}"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops + body["{ebs_volume_iops}"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size + body["{ebs_volume_size}"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput + body["{ebs_volume_throughput}"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type + body["{ebs_volume_type}"] = self.ebs_volume_type if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: """Deserializes the AwsAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", AwsAvailability), - ebs_volume_count=d.get("ebs_volume_count", None), - ebs_volume_iops=d.get("ebs_volume_iops", None), - ebs_volume_size=d.get("ebs_volume_size", None), - ebs_volume_throughput=d.get("ebs_volume_throughput", None), - ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), - first_on_demand=d.get("first_on_demand", None), - instance_profile_arn=d.get("instance_profile_arn", None), - spot_bid_price_percent=d.get("spot_bid_price_percent", None), - zone_id=d.get("zone_id", None), + availability=_enum(d, "{availability}", AwsAvailability), + ebs_volume_count=d.get("{ebs_volume_count}", None), + ebs_volume_iops=d.get("{ebs_volume_iops}", None), + ebs_volume_size=d.get("{ebs_volume_size}", None), + ebs_volume_throughput=d.get("{ebs_volume_throughput}", None), + ebs_volume_type=_enum(d, "{ebs_volume_type}", EbsVolumeType), + first_on_demand=d.get("{first_on_demand}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), + zone_id=d.get("{zone_id}", None), ) @@ -268,36 +264,36 @@ def as_dict(self) -> dict: """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info.as_dict() + body["{log_analytics_info}"] = self.log_analytics_info.as_dict() if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body def as_shallow_dict(self) -> dict: """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info + body["{log_analytics_info}"] = self.log_analytics_info if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: """Deserializes the AzureAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", AzureAvailability), - first_on_demand=d.get("first_on_demand", None), - log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), - spot_bid_max_price=d.get("spot_bid_max_price", None), + availability=_enum(d, "{availability}", AzureAvailability), + first_on_demand=d.get("{first_on_demand}", None), + log_analytics_info=_from_dict(d, "{log_analytics_info}", LogAnalyticsInfo), + spot_bid_max_price=d.get("{spot_bid_max_price}", None), ) @@ -341,46 +337,46 @@ def as_dict(self) -> dict: """Serializes the BaseJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_time is not None: - body["created_time"] = self.created_time + body["{created_time}"] = self.created_time if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.settings: - body["settings"] = self.settings.as_dict() + body["{settings}"] = self.settings.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the BaseJob into a shallow dictionary of its immediate attributes.""" body = {} if self.created_time is not None: - body["created_time"] = self.created_time + body["{created_time}"] = self.created_time if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.settings: - body["settings"] = self.settings + body["{settings}"] = self.settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseJob: """Deserializes the BaseJob from a dictionary.""" return cls( - created_time=d.get("created_time", None), - creator_user_name=d.get("creator_user_name", None), - effective_budget_policy_id=d.get("effective_budget_policy_id", None), - has_more=d.get("has_more", None), - job_id=d.get("job_id", None), - settings=_from_dict(d, "settings", JobSettings), + created_time=d.get("{created_time}", None), + creator_user_name=d.get("{creator_user_name}", None), + effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), + has_more=d.get("{has_more}", None), + job_id=d.get("{job_id}", None), + settings=_from_dict(d, "{settings}", JobSettings), ) @@ -542,181 +538,181 @@ def as_dict(self) -> dict: """Serializes the BaseRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.attempt_number is not None: - body["attempt_number"] = self.attempt_number + body["{attempt_number}"] = self.attempt_number if self.cleanup_duration is not None: - body["cleanup_duration"] = self.cleanup_duration + body["{cleanup_duration}"] = self.cleanup_duration if self.cluster_instance: - body["cluster_instance"] = self.cluster_instance.as_dict() + body["{cluster_instance}"] = self.cluster_instance.as_dict() if self.cluster_spec: - body["cluster_spec"] = self.cluster_spec.as_dict() + body["{cluster_spec}"] = self.cluster_spec.as_dict() if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.effective_performance_target is not None: - body["effective_performance_target"] = self.effective_performance_target.value + body["{effective_performance_target}"] = self.effective_performance_target.value if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.execution_duration is not None: - body["execution_duration"] = self.execution_duration + body["{execution_duration}"] = self.execution_duration if self.git_source: - body["git_source"] = self.git_source.as_dict() + body["{git_source}"] = self.git_source.as_dict() if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.job_clusters: - body["job_clusters"] = [v.as_dict() for v in self.job_clusters] + body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = [v.as_dict() for v in self.job_parameters] + body["{job_parameters}"] = [v.as_dict() for v in self.job_parameters] if self.job_run_id is not None: - body["job_run_id"] = self.job_run_id + body["{job_run_id}"] = self.job_run_id if self.number_in_job is not None: - body["number_in_job"] = self.number_in_job + body["{number_in_job}"] = self.number_in_job if self.original_attempt_run_id is not None: - body["original_attempt_run_id"] = self.original_attempt_run_id + body["{original_attempt_run_id}"] = self.original_attempt_run_id if self.overriding_parameters: - body["overriding_parameters"] = self.overriding_parameters.as_dict() + body["{overriding_parameters}"] = self.overriding_parameters.as_dict() if self.queue_duration is not None: - body["queue_duration"] = self.queue_duration + body["{queue_duration}"] = self.queue_duration if self.repair_history: - body["repair_history"] = [v.as_dict() for v in self.repair_history] + body["{repair_history}"] = [v.as_dict() for v in self.repair_history] if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_page_url is not None: - body["run_page_url"] = self.run_page_url + body["{run_page_url}"] = self.run_page_url if self.run_type is not None: - body["run_type"] = self.run_type.value + body["{run_type}"] = self.run_type.value if self.schedule: - body["schedule"] = self.schedule.as_dict() + body["{schedule}"] = self.schedule.as_dict() if self.setup_duration is not None: - body["setup_duration"] = self.setup_duration + body["{setup_duration}"] = self.setup_duration if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() if self.tasks: - body["tasks"] = [v.as_dict() for v in self.tasks] + body["{tasks}"] = [v.as_dict() for v in self.tasks] if self.trigger is not None: - body["trigger"] = self.trigger.value + body["{trigger}"] = self.trigger.value if self.trigger_info: - body["trigger_info"] = self.trigger_info.as_dict() + body["{trigger_info}"] = self.trigger_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the BaseRun into a shallow dictionary of its immediate attributes.""" body = {} if self.attempt_number is not None: - body["attempt_number"] = self.attempt_number + body["{attempt_number}"] = self.attempt_number if self.cleanup_duration is not None: - body["cleanup_duration"] = self.cleanup_duration + body["{cleanup_duration}"] = self.cleanup_duration if self.cluster_instance: - body["cluster_instance"] = self.cluster_instance + body["{cluster_instance}"] = self.cluster_instance if self.cluster_spec: - body["cluster_spec"] = self.cluster_spec + body["{cluster_spec}"] = self.cluster_spec if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.effective_performance_target is not None: - body["effective_performance_target"] = self.effective_performance_target + body["{effective_performance_target}"] = self.effective_performance_target if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.execution_duration is not None: - body["execution_duration"] = self.execution_duration + body["{execution_duration}"] = self.execution_duration if self.git_source: - body["git_source"] = self.git_source + body["{git_source}"] = self.git_source if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.job_clusters: - body["job_clusters"] = self.job_clusters + body["{job_clusters}"] = self.job_clusters if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.job_run_id is not None: - body["job_run_id"] = self.job_run_id + body["{job_run_id}"] = self.job_run_id if self.number_in_job is not None: - body["number_in_job"] = self.number_in_job + body["{number_in_job}"] = self.number_in_job if self.original_attempt_run_id is not None: - body["original_attempt_run_id"] = self.original_attempt_run_id + body["{original_attempt_run_id}"] = self.original_attempt_run_id if self.overriding_parameters: - body["overriding_parameters"] = self.overriding_parameters + body["{overriding_parameters}"] = self.overriding_parameters if self.queue_duration is not None: - body["queue_duration"] = self.queue_duration + body["{queue_duration}"] = self.queue_duration if self.repair_history: - body["repair_history"] = self.repair_history + body["{repair_history}"] = self.repair_history if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_page_url is not None: - body["run_page_url"] = self.run_page_url + body["{run_page_url}"] = self.run_page_url if self.run_type is not None: - body["run_type"] = self.run_type + body["{run_type}"] = self.run_type if self.schedule: - body["schedule"] = self.schedule + body["{schedule}"] = self.schedule if self.setup_duration is not None: - body["setup_duration"] = self.setup_duration + body["{setup_duration}"] = self.setup_duration if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.status: - body["status"] = self.status + body["{status}"] = self.status if self.tasks: - body["tasks"] = self.tasks + body["{tasks}"] = self.tasks if self.trigger is not None: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger if self.trigger_info: - body["trigger_info"] = self.trigger_info + body["{trigger_info}"] = self.trigger_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseRun: """Deserializes the BaseRun from a dictionary.""" return cls( - attempt_number=d.get("attempt_number", None), - cleanup_duration=d.get("cleanup_duration", None), - cluster_instance=_from_dict(d, "cluster_instance", ClusterInstance), - cluster_spec=_from_dict(d, "cluster_spec", ClusterSpec), - creator_user_name=d.get("creator_user_name", None), - description=d.get("description", None), - effective_performance_target=_enum(d, "effective_performance_target", PerformanceTarget), - end_time=d.get("end_time", None), - execution_duration=d.get("execution_duration", None), - git_source=_from_dict(d, "git_source", GitSource), - has_more=d.get("has_more", None), - job_clusters=_repeated_dict(d, "job_clusters", JobCluster), - job_id=d.get("job_id", None), - job_parameters=_repeated_dict(d, "job_parameters", JobParameter), - job_run_id=d.get("job_run_id", None), - number_in_job=d.get("number_in_job", None), - original_attempt_run_id=d.get("original_attempt_run_id", None), - overriding_parameters=_from_dict(d, "overriding_parameters", RunParameters), - queue_duration=d.get("queue_duration", None), - repair_history=_repeated_dict(d, "repair_history", RepairHistoryItem), - run_duration=d.get("run_duration", None), - run_id=d.get("run_id", None), - run_name=d.get("run_name", None), - run_page_url=d.get("run_page_url", None), - run_type=_enum(d, "run_type", RunType), - schedule=_from_dict(d, "schedule", CronSchedule), - setup_duration=d.get("setup_duration", None), - start_time=d.get("start_time", None), - state=_from_dict(d, "state", RunState), - status=_from_dict(d, "status", RunStatus), - tasks=_repeated_dict(d, "tasks", RunTask), - trigger=_enum(d, "trigger", TriggerType), - trigger_info=_from_dict(d, "trigger_info", TriggerInfo), + attempt_number=d.get("{attempt_number}", None), + cleanup_duration=d.get("{cleanup_duration}", None), + cluster_instance=_from_dict(d, "{cluster_instance}", ClusterInstance), + cluster_spec=_from_dict(d, "{cluster_spec}", ClusterSpec), + creator_user_name=d.get("{creator_user_name}", None), + description=d.get("{description}", None), + effective_performance_target=_enum(d, "{effective_performance_target}", PerformanceTarget), + end_time=d.get("{end_time}", None), + execution_duration=d.get("{execution_duration}", None), + git_source=_from_dict(d, "{git_source}", GitSource), + has_more=d.get("{has_more}", None), + job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), + job_id=d.get("{job_id}", None), + job_parameters=_repeated_dict(d, "{job_parameters}", JobParameter), + job_run_id=d.get("{job_run_id}", None), + number_in_job=d.get("{number_in_job}", None), + original_attempt_run_id=d.get("{original_attempt_run_id}", None), + overriding_parameters=_from_dict(d, "{overriding_parameters}", RunParameters), + queue_duration=d.get("{queue_duration}", None), + repair_history=_repeated_dict(d, "{repair_history}", RepairHistoryItem), + run_duration=d.get("{run_duration}", None), + run_id=d.get("{run_id}", None), + run_name=d.get("{run_name}", None), + run_page_url=d.get("{run_page_url}", None), + run_type=_enum(d, "{run_type}", RunType), + schedule=_from_dict(d, "{schedule}", CronSchedule), + setup_duration=d.get("{setup_duration}", None), + start_time=d.get("{start_time}", None), + state=_from_dict(d, "{state}", RunState), + status=_from_dict(d, "{status}", RunStatus), + tasks=_repeated_dict(d, "{tasks}", RunTask), + trigger=_enum(d, "{trigger}", TriggerType), + trigger_info=_from_dict(d, "{trigger_info}", TriggerInfo), ) @@ -733,24 +729,24 @@ def as_dict(self) -> dict: """Serializes the CancelAllRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_queued_runs is not None: - body["all_queued_runs"] = self.all_queued_runs + body["{all_queued_runs}"] = self.all_queued_runs if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body def as_shallow_dict(self) -> dict: """Serializes the CancelAllRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.all_queued_runs is not None: - body["all_queued_runs"] = self.all_queued_runs + body["{all_queued_runs}"] = self.all_queued_runs if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelAllRuns: """Deserializes the CancelAllRuns from a dictionary.""" - return cls(all_queued_runs=d.get("all_queued_runs", None), job_id=d.get("job_id", None)) + return cls(all_queued_runs=d.get("{all_queued_runs}", None), job_id=d.get("{job_id}", None)) @dataclass @@ -780,20 +776,20 @@ def as_dict(self) -> dict: """Serializes the CancelRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the CancelRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelRun: """Deserializes the CancelRun from a dictionary.""" - return cls(run_id=d.get("run_id", None)) + return cls(run_id=d.get("{run_id}", None)) @dataclass @@ -864,26 +860,26 @@ def as_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a dictionary suitable for use as a JSON request body.""" body = {} if self.life_cycle_state is not None: - body["life_cycle_state"] = self.life_cycle_state.value + body["{life_cycle_state}"] = self.life_cycle_state.value if self.result_state is not None: - body["result_state"] = self.result_state.value + body["{result_state}"] = self.result_state.value return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a shallow dictionary of its immediate attributes.""" body = {} if self.life_cycle_state is not None: - body["life_cycle_state"] = self.life_cycle_state + body["{life_cycle_state}"] = self.life_cycle_state if self.result_state is not None: - body["result_state"] = self.result_state + body["{result_state}"] = self.result_state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomTaskRunState: """Deserializes the CleanRoomTaskRunState from a dictionary.""" return cls( - life_cycle_state=_enum(d, "life_cycle_state", CleanRoomTaskRunLifeCycleState), - result_state=_enum(d, "result_state", CleanRoomTaskRunResultState), + life_cycle_state=_enum(d, "{life_cycle_state}", CleanRoomTaskRunLifeCycleState), + result_state=_enum(d, "{result_state}", CleanRoomTaskRunResultState), ) @@ -906,36 +902,36 @@ def as_dict(self) -> dict: """Serializes the CleanRoomsNotebookTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_room_name is not None: - body["clean_room_name"] = self.clean_room_name + body["{clean_room_name}"] = self.clean_room_name if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.notebook_base_parameters: - body["notebook_base_parameters"] = self.notebook_base_parameters + body["{notebook_base_parameters}"] = self.notebook_base_parameters if self.notebook_name is not None: - body["notebook_name"] = self.notebook_name + body["{notebook_name}"] = self.notebook_name return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomsNotebookTask into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_room_name is not None: - body["clean_room_name"] = self.clean_room_name + body["{clean_room_name}"] = self.clean_room_name if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.notebook_base_parameters: - body["notebook_base_parameters"] = self.notebook_base_parameters + body["{notebook_base_parameters}"] = self.notebook_base_parameters if self.notebook_name is not None: - body["notebook_name"] = self.notebook_name + body["{notebook_name}"] = self.notebook_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTask: """Deserializes the CleanRoomsNotebookTask from a dictionary.""" return cls( - clean_room_name=d.get("clean_room_name", None), - etag=d.get("etag", None), - notebook_base_parameters=d.get("notebook_base_parameters", None), - notebook_name=d.get("notebook_name", None), + clean_room_name=d.get("{clean_room_name}", None), + etag=d.get("{etag}", None), + notebook_base_parameters=d.get("{notebook_base_parameters}", None), + notebook_name=d.get("{notebook_name}", None), ) @@ -954,31 +950,31 @@ def as_dict(self) -> dict: """Serializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_room_job_run_state: - body["clean_room_job_run_state"] = self.clean_room_job_run_state.as_dict() + body["{clean_room_job_run_state}"] = self.clean_room_job_run_state.as_dict() if self.notebook_output: - body["notebook_output"] = self.notebook_output.as_dict() + body["{notebook_output}"] = self.notebook_output.as_dict() if self.output_schema_info: - body["output_schema_info"] = self.output_schema_info.as_dict() + body["{output_schema_info}"] = self.output_schema_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_room_job_run_state: - body["clean_room_job_run_state"] = self.clean_room_job_run_state + body["{clean_room_job_run_state}"] = self.clean_room_job_run_state if self.notebook_output: - body["notebook_output"] = self.notebook_output + body["{notebook_output}"] = self.notebook_output if self.output_schema_info: - body["output_schema_info"] = self.output_schema_info + body["{output_schema_info}"] = self.output_schema_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput: """Deserializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput from a dictionary.""" return cls( - clean_room_job_run_state=_from_dict(d, "clean_room_job_run_state", CleanRoomTaskRunState), - notebook_output=_from_dict(d, "notebook_output", NotebookOutput), - output_schema_info=_from_dict(d, "output_schema_info", OutputSchemaInfo), + clean_room_job_run_state=_from_dict(d, "{clean_room_job_run_state}", CleanRoomTaskRunState), + notebook_output=_from_dict(d, "{notebook_output}", NotebookOutput), + output_schema_info=_from_dict(d, "{output_schema_info}", OutputSchemaInfo), ) @@ -994,24 +990,24 @@ def as_dict(self) -> dict: """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" body = {} if self.jobs is not None: - body["jobs"] = self.jobs + body["{jobs}"] = self.jobs if self.notebooks is not None: - body["notebooks"] = self.notebooks + body["{notebooks}"] = self.notebooks return body def as_shallow_dict(self) -> dict: """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" body = {} if self.jobs is not None: - body["jobs"] = self.jobs + body["{jobs}"] = self.jobs if self.notebooks is not None: - body["notebooks"] = self.notebooks + body["{notebooks}"] = self.notebooks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: """Deserializes the ClientsTypes from a dictionary.""" - return cls(jobs=d.get("jobs", None), notebooks=d.get("notebooks", None)) + return cls(jobs=d.get("{jobs}", None), notebooks=d.get("{notebooks}", None)) @dataclass @@ -1037,24 +1033,24 @@ def as_dict(self) -> dict: """Serializes the ClusterInstance into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.spark_context_id is not None: - body["spark_context_id"] = self.spark_context_id + body["{spark_context_id}"] = self.spark_context_id return body def as_shallow_dict(self) -> dict: """Serializes the ClusterInstance into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.spark_context_id is not None: - body["spark_context_id"] = self.spark_context_id + body["{spark_context_id}"] = self.spark_context_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterInstance: """Deserializes the ClusterInstance from a dictionary.""" - return cls(cluster_id=d.get("cluster_id", None), spark_context_id=d.get("spark_context_id", None)) + return cls(cluster_id=d.get("{cluster_id}", None), spark_context_id=d.get("{spark_context_id}", None)) @dataclass @@ -1079,31 +1075,31 @@ def as_dict(self) -> dict: """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() + body["{dbfs}"] = self.dbfs.as_dict() if self.s3: - body["s3"] = self.s3.as_dict() + body["{s3}"] = self.s3.as_dict() if self.volumes: - body["volumes"] = self.volumes.as_dict() + body["{volumes}"] = self.volumes.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" body = {} if self.dbfs: - body["dbfs"] = self.dbfs + body["{dbfs}"] = self.dbfs if self.s3: - body["s3"] = self.s3 + body["{s3}"] = self.s3 if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: """Deserializes the ClusterLogConf from a dictionary.""" return cls( - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), + dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), + s3=_from_dict(d, "{s3}", S3StorageInfo), + volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), ) @@ -1129,36 +1125,36 @@ def as_dict(self) -> dict: """Serializes the ClusterSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.new_cluster: - body["new_cluster"] = self.new_cluster.as_dict() + body["{new_cluster}"] = self.new_cluster.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.new_cluster: - body["new_cluster"] = self.new_cluster + body["{new_cluster}"] = self.new_cluster return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSpec: """Deserializes the ClusterSpec from a dictionary.""" return cls( - existing_cluster_id=d.get("existing_cluster_id", None), - job_cluster_key=d.get("job_cluster_key", None), - libraries=_repeated_dict(d, "libraries", Library), - new_cluster=_from_dict(d, "new_cluster", ClusterSpec), + existing_cluster_id=d.get("{existing_cluster_id}", None), + job_cluster_key=d.get("{job_cluster_key}", None), + libraries=_repeated_dict(d, "{libraries}", Library), + new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), ) @@ -1179,31 +1175,31 @@ def as_dict(self) -> dict: """Serializes the ComputeConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.gpu_node_pool_id is not None: - body["gpu_node_pool_id"] = self.gpu_node_pool_id + body["{gpu_node_pool_id}"] = self.gpu_node_pool_id if self.gpu_type is not None: - body["gpu_type"] = self.gpu_type + body["{gpu_type}"] = self.gpu_type if self.num_gpus is not None: - body["num_gpus"] = self.num_gpus + body["{num_gpus}"] = self.num_gpus return body def as_shallow_dict(self) -> dict: """Serializes the ComputeConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.gpu_node_pool_id is not None: - body["gpu_node_pool_id"] = self.gpu_node_pool_id + body["{gpu_node_pool_id}"] = self.gpu_node_pool_id if self.gpu_type is not None: - body["gpu_type"] = self.gpu_type + body["{gpu_type}"] = self.gpu_type if self.num_gpus is not None: - body["num_gpus"] = self.num_gpus + body["{num_gpus}"] = self.num_gpus return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComputeConfig: """Deserializes the ComputeConfig from a dictionary.""" return cls( - gpu_node_pool_id=d.get("gpu_node_pool_id", None), - gpu_type=d.get("gpu_type", None), - num_gpus=d.get("num_gpus", None), + gpu_node_pool_id=d.get("{gpu_node_pool_id}", None), + gpu_type=d.get("{gpu_type}", None), + num_gpus=d.get("{num_gpus}", None), ) @@ -1238,28 +1234,28 @@ def as_dict(self) -> dict: """Serializes the ConditionTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.left is not None: - body["left"] = self.left + body["{left}"] = self.left if self.op is not None: - body["op"] = self.op.value + body["{op}"] = self.op.value if self.right is not None: - body["right"] = self.right + body["{right}"] = self.right return body def as_shallow_dict(self) -> dict: """Serializes the ConditionTask into a shallow dictionary of its immediate attributes.""" body = {} if self.left is not None: - body["left"] = self.left + body["{left}"] = self.left if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.right is not None: - body["right"] = self.right + body["{right}"] = self.right return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConditionTask: """Deserializes the ConditionTask from a dictionary.""" - return cls(left=d.get("left", None), op=_enum(d, "op", ConditionTaskOp), right=d.get("right", None)) + return cls(left=d.get("{left}", None), op=_enum(d, "{op}", ConditionTaskOp), right=d.get("{right}", None)) class ConditionTaskOp(Enum): @@ -1290,20 +1286,20 @@ def as_dict(self) -> dict: """Serializes the Continuous into a dictionary suitable for use as a JSON request body.""" body = {} if self.pause_status is not None: - body["pause_status"] = self.pause_status.value + body["{pause_status}"] = self.pause_status.value return body def as_shallow_dict(self) -> dict: """Serializes the Continuous into a shallow dictionary of its immediate attributes.""" body = {} if self.pause_status is not None: - body["pause_status"] = self.pause_status + body["{pause_status}"] = self.pause_status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Continuous: """Deserializes the Continuous from a dictionary.""" - return cls(pause_status=_enum(d, "pause_status", PauseStatus)) + return cls(pause_status=_enum(d, "{pause_status}", PauseStatus)) @dataclass @@ -1428,141 +1424,141 @@ def as_dict(self) -> dict: """Serializes the CreateJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.continuous: - body["continuous"] = self.continuous.as_dict() + body["{continuous}"] = self.continuous.as_dict() if self.deployment: - body["deployment"] = self.deployment.as_dict() + body["{deployment}"] = self.deployment.as_dict() if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.edit_mode is not None: - body["edit_mode"] = self.edit_mode.value + body["{edit_mode}"] = self.edit_mode.value if self.email_notifications: - body["email_notifications"] = self.email_notifications.as_dict() + body["{email_notifications}"] = self.email_notifications.as_dict() if self.environments: - body["environments"] = [v.as_dict() for v in self.environments] + body["{environments}"] = [v.as_dict() for v in self.environments] if self.format is not None: - body["format"] = self.format.value + body["{format}"] = self.format.value if self.git_source: - body["git_source"] = self.git_source.as_dict() + body["{git_source}"] = self.git_source.as_dict() if self.health: - body["health"] = self.health.as_dict() + body["{health}"] = self.health.as_dict() if self.job_clusters: - body["job_clusters"] = [v.as_dict() for v in self.job_clusters] + body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] if self.max_concurrent_runs is not None: - body["max_concurrent_runs"] = self.max_concurrent_runs + body["{max_concurrent_runs}"] = self.max_concurrent_runs if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notification_settings: - body["notification_settings"] = self.notification_settings.as_dict() + body["{notification_settings}"] = self.notification_settings.as_dict() if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.performance_target is not None: - body["performance_target"] = self.performance_target.value + body["{performance_target}"] = self.performance_target.value if self.queue: - body["queue"] = self.queue.as_dict() + body["{queue}"] = self.queue.as_dict() if self.run_as: - body["run_as"] = self.run_as.as_dict() + body["{run_as}"] = self.run_as.as_dict() if self.schedule: - body["schedule"] = self.schedule.as_dict() + body["{schedule}"] = self.schedule.as_dict() if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.tasks: - body["tasks"] = [v.as_dict() for v in self.tasks] + body["{tasks}"] = [v.as_dict() for v in self.tasks] if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.trigger: - body["trigger"] = self.trigger.as_dict() + body["{trigger}"] = self.trigger.as_dict() if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications.as_dict() + body["{webhook_notifications}"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateJob into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.continuous: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment + body["{deployment}"] = self.deployment if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.edit_mode is not None: - body["edit_mode"] = self.edit_mode + body["{edit_mode}"] = self.edit_mode if self.email_notifications: - body["email_notifications"] = self.email_notifications + body["{email_notifications}"] = self.email_notifications if self.environments: - body["environments"] = self.environments + body["{environments}"] = self.environments if self.format is not None: - body["format"] = self.format + body["{format}"] = self.format if self.git_source: - body["git_source"] = self.git_source + body["{git_source}"] = self.git_source if self.health: - body["health"] = self.health + body["{health}"] = self.health if self.job_clusters: - body["job_clusters"] = self.job_clusters + body["{job_clusters}"] = self.job_clusters if self.max_concurrent_runs is not None: - body["max_concurrent_runs"] = self.max_concurrent_runs + body["{max_concurrent_runs}"] = self.max_concurrent_runs if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notification_settings: - body["notification_settings"] = self.notification_settings + body["{notification_settings}"] = self.notification_settings if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.performance_target is not None: - body["performance_target"] = self.performance_target + body["{performance_target}"] = self.performance_target if self.queue: - body["queue"] = self.queue + body["{queue}"] = self.queue if self.run_as: - body["run_as"] = self.run_as + body["{run_as}"] = self.run_as if self.schedule: - body["schedule"] = self.schedule + body["{schedule}"] = self.schedule if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.tasks: - body["tasks"] = self.tasks + body["{tasks}"] = self.tasks if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.trigger: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications + body["{webhook_notifications}"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateJob: """Deserializes the CreateJob from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlRequest), - budget_policy_id=d.get("budget_policy_id", None), - continuous=_from_dict(d, "continuous", Continuous), - deployment=_from_dict(d, "deployment", JobDeployment), - description=d.get("description", None), - edit_mode=_enum(d, "edit_mode", JobEditMode), - email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), - environments=_repeated_dict(d, "environments", JobEnvironment), - format=_enum(d, "format", Format), - git_source=_from_dict(d, "git_source", GitSource), - health=_from_dict(d, "health", JobsHealthRules), - job_clusters=_repeated_dict(d, "job_clusters", JobCluster), - max_concurrent_runs=d.get("max_concurrent_runs", None), - name=d.get("name", None), - notification_settings=_from_dict(d, "notification_settings", JobNotificationSettings), - parameters=_repeated_dict(d, "parameters", JobParameterDefinition), - performance_target=_enum(d, "performance_target", PerformanceTarget), - queue=_from_dict(d, "queue", QueueSettings), - run_as=_from_dict(d, "run_as", JobRunAs), - schedule=_from_dict(d, "schedule", CronSchedule), - tags=d.get("tags", None), - tasks=_repeated_dict(d, "tasks", Task), - timeout_seconds=d.get("timeout_seconds", None), - trigger=_from_dict(d, "trigger", TriggerSettings), - webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), + access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlRequest), + budget_policy_id=d.get("{budget_policy_id}", None), + continuous=_from_dict(d, "{continuous}", Continuous), + deployment=_from_dict(d, "{deployment}", JobDeployment), + description=d.get("{description}", None), + edit_mode=_enum(d, "{edit_mode}", JobEditMode), + email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), + environments=_repeated_dict(d, "{environments}", JobEnvironment), + format=_enum(d, "{format}", Format), + git_source=_from_dict(d, "{git_source}", GitSource), + health=_from_dict(d, "{health}", JobsHealthRules), + job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), + max_concurrent_runs=d.get("{max_concurrent_runs}", None), + name=d.get("{name}", None), + notification_settings=_from_dict(d, "{notification_settings}", JobNotificationSettings), + parameters=_repeated_dict(d, "{parameters}", JobParameterDefinition), + performance_target=_enum(d, "{performance_target}", PerformanceTarget), + queue=_from_dict(d, "{queue}", QueueSettings), + run_as=_from_dict(d, "{run_as}", JobRunAs), + schedule=_from_dict(d, "{schedule}", CronSchedule), + tags=d.get("{tags}", None), + tasks=_repeated_dict(d, "{tasks}", Task), + timeout_seconds=d.get("{timeout_seconds}", None), + trigger=_from_dict(d, "{trigger}", TriggerSettings), + webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), ) @@ -1577,20 +1573,20 @@ def as_dict(self) -> dict: """Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" - return cls(job_id=d.get("job_id", None)) + return cls(job_id=d.get("{job_id}", None)) @dataclass @@ -1614,31 +1610,31 @@ def as_dict(self) -> dict: """Serializes the CronSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.pause_status is not None: - body["pause_status"] = self.pause_status.value + body["{pause_status}"] = self.pause_status.value if self.quartz_cron_expression is not None: - body["quartz_cron_expression"] = self.quartz_cron_expression + body["{quartz_cron_expression}"] = self.quartz_cron_expression if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body def as_shallow_dict(self) -> dict: """Serializes the CronSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.pause_status is not None: - body["pause_status"] = self.pause_status + body["{pause_status}"] = self.pause_status if self.quartz_cron_expression is not None: - body["quartz_cron_expression"] = self.quartz_cron_expression + body["{quartz_cron_expression}"] = self.quartz_cron_expression if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: """Deserializes the CronSchedule from a dictionary.""" return cls( - pause_status=_enum(d, "pause_status", PauseStatus), - quartz_cron_expression=d.get("quartz_cron_expression", None), - timezone_id=d.get("timezone_id", None), + pause_status=_enum(d, "{pause_status}", PauseStatus), + quartz_cron_expression=d.get("{quartz_cron_expression}", None), + timezone_id=d.get("{timezone_id}", None), ) @@ -1691,20 +1687,20 @@ def as_dict(self) -> dict: """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: """Deserializes the DbfsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -1720,24 +1716,24 @@ def as_dict(self) -> dict: """Serializes the DbtOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifacts_headers: - body["artifacts_headers"] = self.artifacts_headers + body["{artifacts_headers}"] = self.artifacts_headers if self.artifacts_link is not None: - body["artifacts_link"] = self.artifacts_link + body["{artifacts_link}"] = self.artifacts_link return body def as_shallow_dict(self) -> dict: """Serializes the DbtOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.artifacts_headers: - body["artifacts_headers"] = self.artifacts_headers + body["{artifacts_headers}"] = self.artifacts_headers if self.artifacts_link is not None: - body["artifacts_link"] = self.artifacts_link + body["{artifacts_link}"] = self.artifacts_link return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbtOutput: """Deserializes the DbtOutput from a dictionary.""" - return cls(artifacts_headers=d.get("artifacts_headers", None), artifacts_link=d.get("artifacts_link", None)) + return cls(artifacts_headers=d.get("{artifacts_headers}", None), artifacts_link=d.get("{artifacts_link}", None)) @dataclass @@ -1781,51 +1777,51 @@ def as_dict(self) -> dict: """Serializes the DbtTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.commands: - body["commands"] = [v for v in self.commands] + body["{commands}"] = [v for v in self.commands] if self.profiles_directory is not None: - body["profiles_directory"] = self.profiles_directory + body["{profiles_directory}"] = self.profiles_directory if self.project_directory is not None: - body["project_directory"] = self.project_directory + body["{project_directory}"] = self.project_directory if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.source is not None: - body["source"] = self.source.value + body["{source}"] = self.source.value if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the DbtTask into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.commands: - body["commands"] = self.commands + body["{commands}"] = self.commands if self.profiles_directory is not None: - body["profiles_directory"] = self.profiles_directory + body["{profiles_directory}"] = self.profiles_directory if self.project_directory is not None: - body["project_directory"] = self.project_directory + body["{project_directory}"] = self.project_directory if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbtTask: """Deserializes the DbtTask from a dictionary.""" return cls( - catalog=d.get("catalog", None), - commands=d.get("commands", None), - profiles_directory=d.get("profiles_directory", None), - project_directory=d.get("project_directory", None), - schema=d.get("schema", None), - source=_enum(d, "source", Source), - warehouse_id=d.get("warehouse_id", None), + catalog=d.get("{catalog}", None), + commands=d.get("{commands}", None), + profiles_directory=d.get("{profiles_directory}", None), + project_directory=d.get("{project_directory}", None), + schema=d.get("{schema}", None), + source=_enum(d, "{source}", Source), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -1838,20 +1834,20 @@ def as_dict(self) -> dict: """Serializes the DeleteJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body def as_shallow_dict(self) -> dict: """Serializes the DeleteJob into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteJob: """Deserializes the DeleteJob from a dictionary.""" - return cls(job_id=d.get("job_id", None)) + return cls(job_id=d.get("{job_id}", None)) @dataclass @@ -1881,20 +1877,20 @@ def as_dict(self) -> dict: """Serializes the DeleteRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the DeleteRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRun: """Deserializes the DeleteRun from a dictionary.""" - return cls(run_id=d.get("run_id", None)) + return cls(run_id=d.get("{run_id}", None)) @dataclass @@ -1927,24 +1923,24 @@ def as_dict(self) -> dict: """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" body = {} if self.password is not None: - body["password"] = self.password + body["{password}"] = self.password if self.username is not None: - body["username"] = self.username + body["{username}"] = self.username return body def as_shallow_dict(self) -> dict: """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" body = {} if self.password is not None: - body["password"] = self.password + body["{password}"] = self.password if self.username is not None: - body["username"] = self.username + body["{username}"] = self.username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: """Deserializes the DockerBasicAuth from a dictionary.""" - return cls(password=d.get("password", None), username=d.get("username", None)) + return cls(password=d.get("{password}", None), username=d.get("{username}", None)) @dataclass @@ -1959,24 +1955,24 @@ def as_dict(self) -> dict: """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" body = {} if self.basic_auth: - body["basic_auth"] = self.basic_auth.as_dict() + body["{basic_auth}"] = self.basic_auth.as_dict() if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" body = {} if self.basic_auth: - body["basic_auth"] = self.basic_auth + body["{basic_auth}"] = self.basic_auth if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DockerImage: """Deserializes the DockerImage from a dictionary.""" - return cls(basic_auth=_from_dict(d, "basic_auth", DockerBasicAuth), url=d.get("url", None)) + return cls(basic_auth=_from_dict(d, "{basic_auth}", DockerBasicAuth), url=d.get("{url}", None)) class EbsVolumeType(Enum): @@ -2009,29 +2005,31 @@ def as_dict(self) -> dict: """Serializes the EnforcePolicyComplianceForJobResponseJobClusterSettingsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.field is not None: - body["field"] = self.field + body["{field}"] = self.field if self.new_value is not None: - body["new_value"] = self.new_value + body["{new_value}"] = self.new_value if self.previous_value is not None: - body["previous_value"] = self.previous_value + body["{previous_value}"] = self.previous_value return body def as_shallow_dict(self) -> dict: """Serializes the EnforcePolicyComplianceForJobResponseJobClusterSettingsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.field is not None: - body["field"] = self.field + body["{field}"] = self.field if self.new_value is not None: - body["new_value"] = self.new_value + body["{new_value}"] = self.new_value if self.previous_value is not None: - body["previous_value"] = self.previous_value + body["{previous_value}"] = self.previous_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Deserializes the EnforcePolicyComplianceForJobResponseJobClusterSettingsChange from a dictionary.""" return cls( - field=d.get("field", None), new_value=d.get("new_value", None), previous_value=d.get("previous_value", None) + field=d.get("{field}", None), + new_value=d.get("{new_value}", None), + previous_value=d.get("{previous_value}", None), ) @@ -2047,24 +2045,24 @@ def as_dict(self) -> dict: """Serializes the EnforcePolicyComplianceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body def as_shallow_dict(self) -> dict: """Serializes the EnforcePolicyComplianceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceRequest: """Deserializes the EnforcePolicyComplianceRequest from a dictionary.""" - return cls(job_id=d.get("job_id", None), validate_only=d.get("validate_only", None)) + return cls(job_id=d.get("{job_id}", None), validate_only=d.get("{validate_only}", None)) @dataclass @@ -2087,33 +2085,33 @@ def as_dict(self) -> dict: """Serializes the EnforcePolicyComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_changes is not None: - body["has_changes"] = self.has_changes + body["{has_changes}"] = self.has_changes if self.job_cluster_changes: - body["job_cluster_changes"] = [v.as_dict() for v in self.job_cluster_changes] + body["{job_cluster_changes}"] = [v.as_dict() for v in self.job_cluster_changes] if self.settings: - body["settings"] = self.settings.as_dict() + body["{settings}"] = self.settings.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EnforcePolicyComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_changes is not None: - body["has_changes"] = self.has_changes + body["{has_changes}"] = self.has_changes if self.job_cluster_changes: - body["job_cluster_changes"] = self.job_cluster_changes + body["{job_cluster_changes}"] = self.job_cluster_changes if self.settings: - body["settings"] = self.settings + body["{settings}"] = self.settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceResponse: """Deserializes the EnforcePolicyComplianceResponse from a dictionary.""" return cls( - has_changes=d.get("has_changes", None), + has_changes=d.get("{has_changes}", None), job_cluster_changes=_repeated_dict( - d, "job_cluster_changes", EnforcePolicyComplianceForJobResponseJobClusterSettingsChange + d, "{job_cluster_changes}", EnforcePolicyComplianceForJobResponseJobClusterSettingsChange ), - settings=_from_dict(d, "settings", JobSettings), + settings=_from_dict(d, "{settings}", JobSettings), ) @@ -2139,24 +2137,24 @@ def as_dict(self) -> dict: """Serializes the Environment into a dictionary suitable for use as a JSON request body.""" body = {} if self.client is not None: - body["client"] = self.client + body["{client}"] = self.client if self.dependencies: - body["dependencies"] = [v for v in self.dependencies] + body["{dependencies}"] = [v for v in self.dependencies] return body def as_shallow_dict(self) -> dict: """Serializes the Environment into a shallow dictionary of its immediate attributes.""" body = {} if self.client is not None: - body["client"] = self.client + body["{client}"] = self.client if self.dependencies: - body["dependencies"] = self.dependencies + body["{dependencies}"] = self.dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Environment: """Deserializes the Environment from a dictionary.""" - return cls(client=d.get("client", None), dependencies=d.get("dependencies", None)) + return cls(client=d.get("{client}", None), dependencies=d.get("{dependencies}", None)) @dataclass @@ -2173,20 +2171,20 @@ def as_dict(self) -> dict: """Serializes the ExportRunOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.views: - body["views"] = [v.as_dict() for v in self.views] + body["{views}"] = [v.as_dict() for v in self.views] return body def as_shallow_dict(self) -> dict: """Serializes the ExportRunOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.views: - body["views"] = self.views + body["{views}"] = self.views return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExportRunOutput: """Deserializes the ExportRunOutput from a dictionary.""" - return cls(views=_repeated_dict(d, "views", ViewItem)) + return cls(views=_repeated_dict(d, "{views}", ViewItem)) @dataclass @@ -2208,31 +2206,31 @@ def as_dict(self) -> dict: """Serializes the FileArrivalTriggerConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.min_time_between_triggers_seconds is not None: - body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds + body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.wait_after_last_change_seconds is not None: - body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds + body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds return body def as_shallow_dict(self) -> dict: """Serializes the FileArrivalTriggerConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.min_time_between_triggers_seconds is not None: - body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds + body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.wait_after_last_change_seconds is not None: - body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds + body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileArrivalTriggerConfiguration: """Deserializes the FileArrivalTriggerConfiguration from a dictionary.""" return cls( - min_time_between_triggers_seconds=d.get("min_time_between_triggers_seconds", None), - url=d.get("url", None), - wait_after_last_change_seconds=d.get("wait_after_last_change_seconds", None), + min_time_between_triggers_seconds=d.get("{min_time_between_triggers_seconds}", None), + url=d.get("{url}", None), + wait_after_last_change_seconds=d.get("{wait_after_last_change_seconds}", None), ) @@ -2248,26 +2246,26 @@ def as_dict(self) -> dict: """Serializes the ForEachStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_message_stats: - body["error_message_stats"] = [v.as_dict() for v in self.error_message_stats] + body["{error_message_stats}"] = [v.as_dict() for v in self.error_message_stats] if self.task_run_stats: - body["task_run_stats"] = self.task_run_stats.as_dict() + body["{task_run_stats}"] = self.task_run_stats.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ForEachStats into a shallow dictionary of its immediate attributes.""" body = {} if self.error_message_stats: - body["error_message_stats"] = self.error_message_stats + body["{error_message_stats}"] = self.error_message_stats if self.task_run_stats: - body["task_run_stats"] = self.task_run_stats + body["{task_run_stats}"] = self.task_run_stats return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachStats: """Deserializes the ForEachStats from a dictionary.""" return cls( - error_message_stats=_repeated_dict(d, "error_message_stats", ForEachTaskErrorMessageStats), - task_run_stats=_from_dict(d, "task_run_stats", ForEachTaskTaskRunStats), + error_message_stats=_repeated_dict(d, "{error_message_stats}", ForEachTaskErrorMessageStats), + task_run_stats=_from_dict(d, "{task_run_stats}", ForEachTaskTaskRunStats), ) @@ -2287,29 +2285,29 @@ def as_dict(self) -> dict: """Serializes the ForEachTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.concurrency is not None: - body["concurrency"] = self.concurrency + body["{concurrency}"] = self.concurrency if self.inputs is not None: - body["inputs"] = self.inputs + body["{inputs}"] = self.inputs if self.task: - body["task"] = self.task.as_dict() + body["{task}"] = self.task.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ForEachTask into a shallow dictionary of its immediate attributes.""" body = {} if self.concurrency is not None: - body["concurrency"] = self.concurrency + body["{concurrency}"] = self.concurrency if self.inputs is not None: - body["inputs"] = self.inputs + body["{inputs}"] = self.inputs if self.task: - body["task"] = self.task + body["{task}"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachTask: """Deserializes the ForEachTask from a dictionary.""" return cls( - concurrency=d.get("concurrency", None), inputs=d.get("inputs", None), task=_from_dict(d, "task", Task) + concurrency=d.get("{concurrency}", None), inputs=d.get("{inputs}", None), task=_from_dict(d, "{task}", Task) ) @@ -2328,31 +2326,31 @@ def as_dict(self) -> dict: """Serializes the ForEachTaskErrorMessageStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.count is not None: - body["count"] = self.count + body["{count}"] = self.count if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.termination_category is not None: - body["termination_category"] = self.termination_category + body["{termination_category}"] = self.termination_category return body def as_shallow_dict(self) -> dict: """Serializes the ForEachTaskErrorMessageStats into a shallow dictionary of its immediate attributes.""" body = {} if self.count is not None: - body["count"] = self.count + body["{count}"] = self.count if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.termination_category is not None: - body["termination_category"] = self.termination_category + body["{termination_category}"] = self.termination_category return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachTaskErrorMessageStats: """Deserializes the ForEachTaskErrorMessageStats from a dictionary.""" return cls( - count=d.get("count", None), - error_message=d.get("error_message", None), - termination_category=d.get("termination_category", None), + count=d.get("{count}", None), + error_message=d.get("{error_message}", None), + termination_category=d.get("{termination_category}", None), ) @@ -2380,46 +2378,46 @@ def as_dict(self) -> dict: """Serializes the ForEachTaskTaskRunStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.active_iterations is not None: - body["active_iterations"] = self.active_iterations + body["{active_iterations}"] = self.active_iterations if self.completed_iterations is not None: - body["completed_iterations"] = self.completed_iterations + body["{completed_iterations}"] = self.completed_iterations if self.failed_iterations is not None: - body["failed_iterations"] = self.failed_iterations + body["{failed_iterations}"] = self.failed_iterations if self.scheduled_iterations is not None: - body["scheduled_iterations"] = self.scheduled_iterations + body["{scheduled_iterations}"] = self.scheduled_iterations if self.succeeded_iterations is not None: - body["succeeded_iterations"] = self.succeeded_iterations + body["{succeeded_iterations}"] = self.succeeded_iterations if self.total_iterations is not None: - body["total_iterations"] = self.total_iterations + body["{total_iterations}"] = self.total_iterations return body def as_shallow_dict(self) -> dict: """Serializes the ForEachTaskTaskRunStats into a shallow dictionary of its immediate attributes.""" body = {} if self.active_iterations is not None: - body["active_iterations"] = self.active_iterations + body["{active_iterations}"] = self.active_iterations if self.completed_iterations is not None: - body["completed_iterations"] = self.completed_iterations + body["{completed_iterations}"] = self.completed_iterations if self.failed_iterations is not None: - body["failed_iterations"] = self.failed_iterations + body["{failed_iterations}"] = self.failed_iterations if self.scheduled_iterations is not None: - body["scheduled_iterations"] = self.scheduled_iterations + body["{scheduled_iterations}"] = self.scheduled_iterations if self.succeeded_iterations is not None: - body["succeeded_iterations"] = self.succeeded_iterations + body["{succeeded_iterations}"] = self.succeeded_iterations if self.total_iterations is not None: - body["total_iterations"] = self.total_iterations + body["{total_iterations}"] = self.total_iterations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachTaskTaskRunStats: """Deserializes the ForEachTaskTaskRunStats from a dictionary.""" return cls( - active_iterations=d.get("active_iterations", None), - completed_iterations=d.get("completed_iterations", None), - failed_iterations=d.get("failed_iterations", None), - scheduled_iterations=d.get("scheduled_iterations", None), - succeeded_iterations=d.get("succeeded_iterations", None), - total_iterations=d.get("total_iterations", None), + active_iterations=d.get("{active_iterations}", None), + completed_iterations=d.get("{completed_iterations}", None), + failed_iterations=d.get("{failed_iterations}", None), + scheduled_iterations=d.get("{scheduled_iterations}", None), + succeeded_iterations=d.get("{succeeded_iterations}", None), + total_iterations=d.get("{total_iterations}", None), ) @@ -2468,46 +2466,46 @@ def as_dict(self) -> dict: """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size + body["{boot_disk_size}"] = self.boot_disk_size if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors + body["{use_preemptible_executors}"] = self.use_preemptible_executors if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size + body["{boot_disk_size}"] = self.boot_disk_size if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors + body["{use_preemptible_executors}"] = self.use_preemptible_executors if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: """Deserializes the GcpAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", GcpAvailability), - boot_disk_size=d.get("boot_disk_size", None), - google_service_account=d.get("google_service_account", None), - local_ssd_count=d.get("local_ssd_count", None), - use_preemptible_executors=d.get("use_preemptible_executors", None), - zone_id=d.get("zone_id", None), + availability=_enum(d, "{availability}", GcpAvailability), + boot_disk_size=d.get("{boot_disk_size}", None), + google_service_account=d.get("{google_service_account}", None), + local_ssd_count=d.get("{local_ssd_count}", None), + use_preemptible_executors=d.get("{use_preemptible_executors}", None), + zone_id=d.get("{zone_id}", None), ) @@ -2531,20 +2529,20 @@ def as_dict(self) -> dict: """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: """Deserializes the GcsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -2588,56 +2586,56 @@ def as_dict(self) -> dict: """Serializes the GenAiComputeTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.command is not None: - body["command"] = self.command + body["{command}"] = self.command if self.compute: - body["compute"] = self.compute.as_dict() + body["{compute}"] = self.compute.as_dict() if self.dl_runtime_image is not None: - body["dl_runtime_image"] = self.dl_runtime_image + body["{dl_runtime_image}"] = self.dl_runtime_image if self.mlflow_experiment_name is not None: - body["mlflow_experiment_name"] = self.mlflow_experiment_name + body["{mlflow_experiment_name}"] = self.mlflow_experiment_name if self.source is not None: - body["source"] = self.source.value + body["{source}"] = self.source.value if self.training_script_path is not None: - body["training_script_path"] = self.training_script_path + body["{training_script_path}"] = self.training_script_path if self.yaml_parameters is not None: - body["yaml_parameters"] = self.yaml_parameters + body["{yaml_parameters}"] = self.yaml_parameters if self.yaml_parameters_file_path is not None: - body["yaml_parameters_file_path"] = self.yaml_parameters_file_path + body["{yaml_parameters_file_path}"] = self.yaml_parameters_file_path return body def as_shallow_dict(self) -> dict: """Serializes the GenAiComputeTask into a shallow dictionary of its immediate attributes.""" body = {} if self.command is not None: - body["command"] = self.command + body["{command}"] = self.command if self.compute: - body["compute"] = self.compute + body["{compute}"] = self.compute if self.dl_runtime_image is not None: - body["dl_runtime_image"] = self.dl_runtime_image + body["{dl_runtime_image}"] = self.dl_runtime_image if self.mlflow_experiment_name is not None: - body["mlflow_experiment_name"] = self.mlflow_experiment_name + body["{mlflow_experiment_name}"] = self.mlflow_experiment_name if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.training_script_path is not None: - body["training_script_path"] = self.training_script_path + body["{training_script_path}"] = self.training_script_path if self.yaml_parameters is not None: - body["yaml_parameters"] = self.yaml_parameters + body["{yaml_parameters}"] = self.yaml_parameters if self.yaml_parameters_file_path is not None: - body["yaml_parameters_file_path"] = self.yaml_parameters_file_path + body["{yaml_parameters_file_path}"] = self.yaml_parameters_file_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenAiComputeTask: """Deserializes the GenAiComputeTask from a dictionary.""" return cls( - command=d.get("command", None), - compute=_from_dict(d, "compute", ComputeConfig), - dl_runtime_image=d.get("dl_runtime_image", None), - mlflow_experiment_name=d.get("mlflow_experiment_name", None), - source=_enum(d, "source", Source), - training_script_path=d.get("training_script_path", None), - yaml_parameters=d.get("yaml_parameters", None), - yaml_parameters_file_path=d.get("yaml_parameters_file_path", None), + command=d.get("{command}", None), + compute=_from_dict(d, "{compute}", ComputeConfig), + dl_runtime_image=d.get("{dl_runtime_image}", None), + mlflow_experiment_name=d.get("{mlflow_experiment_name}", None), + source=_enum(d, "{source}", Source), + training_script_path=d.get("{training_script_path}", None), + yaml_parameters=d.get("{yaml_parameters}", None), + yaml_parameters_file_path=d.get("{yaml_parameters_file_path}", None), ) @@ -2650,20 +2648,20 @@ def as_dict(self) -> dict: """Serializes the GetJobPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetJobPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetJobPermissionLevelsResponse: """Deserializes the GetJobPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", JobPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", JobPermissionsDescription)) @dataclass @@ -2683,24 +2681,24 @@ def as_dict(self) -> dict: """Serializes the GetPolicyComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body def as_shallow_dict(self) -> dict: """Serializes the GetPolicyComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPolicyComplianceResponse: """Deserializes the GetPolicyComplianceResponse from a dictionary.""" - return cls(is_compliant=d.get("is_compliant", None), violations=d.get("violations", None)) + return cls(is_compliant=d.get("{is_compliant}", None), violations=d.get("{violations}", None)) class GitProvider(Enum): @@ -2729,20 +2727,20 @@ def as_dict(self) -> dict: """Serializes the GitSnapshot into a dictionary suitable for use as a JSON request body.""" body = {} if self.used_commit is not None: - body["used_commit"] = self.used_commit + body["{used_commit}"] = self.used_commit return body def as_shallow_dict(self) -> dict: """Serializes the GitSnapshot into a shallow dictionary of its immediate attributes.""" body = {} if self.used_commit is not None: - body["used_commit"] = self.used_commit + body["{used_commit}"] = self.used_commit return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GitSnapshot: """Deserializes the GitSnapshot from a dictionary.""" - return cls(used_commit=d.get("used_commit", None)) + return cls(used_commit=d.get("{used_commit}", None)) @dataclass @@ -2785,51 +2783,51 @@ def as_dict(self) -> dict: """Serializes the GitSource into a dictionary suitable for use as a JSON request body.""" body = {} if self.git_branch is not None: - body["git_branch"] = self.git_branch + body["{git_branch}"] = self.git_branch if self.git_commit is not None: - body["git_commit"] = self.git_commit + body["{git_commit}"] = self.git_commit if self.git_provider is not None: - body["git_provider"] = self.git_provider.value + body["{git_provider}"] = self.git_provider.value if self.git_snapshot: - body["git_snapshot"] = self.git_snapshot.as_dict() + body["{git_snapshot}"] = self.git_snapshot.as_dict() if self.git_tag is not None: - body["git_tag"] = self.git_tag + body["{git_tag}"] = self.git_tag if self.git_url is not None: - body["git_url"] = self.git_url + body["{git_url}"] = self.git_url if self.job_source: - body["job_source"] = self.job_source.as_dict() + body["{job_source}"] = self.job_source.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GitSource into a shallow dictionary of its immediate attributes.""" body = {} if self.git_branch is not None: - body["git_branch"] = self.git_branch + body["{git_branch}"] = self.git_branch if self.git_commit is not None: - body["git_commit"] = self.git_commit + body["{git_commit}"] = self.git_commit if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_snapshot: - body["git_snapshot"] = self.git_snapshot + body["{git_snapshot}"] = self.git_snapshot if self.git_tag is not None: - body["git_tag"] = self.git_tag + body["{git_tag}"] = self.git_tag if self.git_url is not None: - body["git_url"] = self.git_url + body["{git_url}"] = self.git_url if self.job_source: - body["job_source"] = self.job_source + body["{job_source}"] = self.job_source return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GitSource: """Deserializes the GitSource from a dictionary.""" return cls( - git_branch=d.get("git_branch", None), - git_commit=d.get("git_commit", None), - git_provider=_enum(d, "git_provider", GitProvider), - git_snapshot=_from_dict(d, "git_snapshot", GitSnapshot), - git_tag=d.get("git_tag", None), - git_url=d.get("git_url", None), - job_source=_from_dict(d, "job_source", JobSource), + git_branch=d.get("{git_branch}", None), + git_commit=d.get("{git_commit}", None), + git_provider=_enum(d, "{git_provider}", GitProvider), + git_snapshot=_from_dict(d, "{git_snapshot}", GitSnapshot), + git_tag=d.get("{git_tag}", None), + git_url=d.get("{git_url}", None), + job_source=_from_dict(d, "{job_source}", JobSource), ) @@ -2869,51 +2867,51 @@ def as_dict(self) -> dict: """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.abfss: - body["abfss"] = self.abfss.as_dict() + body["{abfss}"] = self.abfss.as_dict() if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() + body["{dbfs}"] = self.dbfs.as_dict() if self.file: - body["file"] = self.file.as_dict() + body["{file}"] = self.file.as_dict() if self.gcs: - body["gcs"] = self.gcs.as_dict() + body["{gcs}"] = self.gcs.as_dict() if self.s3: - body["s3"] = self.s3.as_dict() + body["{s3}"] = self.s3.as_dict() if self.volumes: - body["volumes"] = self.volumes.as_dict() + body["{volumes}"] = self.volumes.as_dict() if self.workspace: - body["workspace"] = self.workspace.as_dict() + body["{workspace}"] = self.workspace.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.abfss: - body["abfss"] = self.abfss + body["{abfss}"] = self.abfss if self.dbfs: - body["dbfs"] = self.dbfs + body["{dbfs}"] = self.dbfs if self.file: - body["file"] = self.file + body["{file}"] = self.file if self.gcs: - body["gcs"] = self.gcs + body["{gcs}"] = self.gcs if self.s3: - body["s3"] = self.s3 + body["{s3}"] = self.s3 if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes if self.workspace: - body["workspace"] = self.workspace + body["{workspace}"] = self.workspace return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: """Deserializes the InitScriptInfo from a dictionary.""" return cls( - abfss=_from_dict(d, "abfss", Adlsgen2Info), - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - file=_from_dict(d, "file", LocalFileInfo), - gcs=_from_dict(d, "gcs", GcsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), - workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), + abfss=_from_dict(d, "{abfss}", Adlsgen2Info), + dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), + file=_from_dict(d, "{file}", LocalFileInfo), + gcs=_from_dict(d, "{gcs}", GcsStorageInfo), + s3=_from_dict(d, "{s3}", S3StorageInfo), + volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), + workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), ) @@ -2962,56 +2960,56 @@ def as_dict(self) -> dict: """Serializes the Job into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_time is not None: - body["created_time"] = self.created_time + body["{created_time}"] = self.created_time if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.run_as_user_name is not None: - body["run_as_user_name"] = self.run_as_user_name + body["{run_as_user_name}"] = self.run_as_user_name if self.settings: - body["settings"] = self.settings.as_dict() + body["{settings}"] = self.settings.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Job into a shallow dictionary of its immediate attributes.""" body = {} if self.created_time is not None: - body["created_time"] = self.created_time + body["{created_time}"] = self.created_time if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.run_as_user_name is not None: - body["run_as_user_name"] = self.run_as_user_name + body["{run_as_user_name}"] = self.run_as_user_name if self.settings: - body["settings"] = self.settings + body["{settings}"] = self.settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Job: """Deserializes the Job from a dictionary.""" return cls( - created_time=d.get("created_time", None), - creator_user_name=d.get("creator_user_name", None), - effective_budget_policy_id=d.get("effective_budget_policy_id", None), - has_more=d.get("has_more", None), - job_id=d.get("job_id", None), - next_page_token=d.get("next_page_token", None), - run_as_user_name=d.get("run_as_user_name", None), - settings=_from_dict(d, "settings", JobSettings), + created_time=d.get("{created_time}", None), + creator_user_name=d.get("{creator_user_name}", None), + effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), + has_more=d.get("{has_more}", None), + job_id=d.get("{job_id}", None), + next_page_token=d.get("{next_page_token}", None), + run_as_user_name=d.get("{run_as_user_name}", None), + settings=_from_dict(d, "{settings}", JobSettings), ) @@ -3033,36 +3031,36 @@ def as_dict(self) -> dict: """Serializes the JobAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the JobAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobAccessControlRequest: """Deserializes the JobAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", JobPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", JobPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3087,41 +3085,41 @@ def as_dict(self) -> dict: """Serializes the JobAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the JobAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobAccessControlResponse: """Deserializes the JobAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", JobPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", JobPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3139,25 +3137,26 @@ def as_dict(self) -> dict: """Serializes the JobCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.new_cluster: - body["new_cluster"] = self.new_cluster.as_dict() + body["{new_cluster}"] = self.new_cluster.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the JobCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.new_cluster: - body["new_cluster"] = self.new_cluster + body["{new_cluster}"] = self.new_cluster return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobCluster: """Deserializes the JobCluster from a dictionary.""" return cls( - job_cluster_key=d.get("job_cluster_key", None), new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec) + job_cluster_key=d.get("{job_cluster_key}", None), + new_cluster=_from_dict(d, "{new_cluster}", JobsClusterSpec), ) @@ -3179,29 +3178,31 @@ def as_dict(self) -> dict: """Serializes the JobCompliance into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body def as_shallow_dict(self) -> dict: """Serializes the JobCompliance into a shallow dictionary of its immediate attributes.""" body = {} if self.is_compliant is not None: - body["is_compliant"] = self.is_compliant + body["{is_compliant}"] = self.is_compliant if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.violations: - body["violations"] = self.violations + body["{violations}"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobCompliance: """Deserializes the JobCompliance from a dictionary.""" return cls( - is_compliant=d.get("is_compliant", None), job_id=d.get("job_id", None), violations=d.get("violations", None) + is_compliant=d.get("{is_compliant}", None), + job_id=d.get("{job_id}", None), + violations=d.get("{violations}", None), ) @@ -3219,24 +3220,24 @@ def as_dict(self) -> dict: """Serializes the JobDeployment into a dictionary suitable for use as a JSON request body.""" body = {} if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.metadata_file_path is not None: - body["metadata_file_path"] = self.metadata_file_path + body["{metadata_file_path}"] = self.metadata_file_path return body def as_shallow_dict(self) -> dict: """Serializes the JobDeployment into a shallow dictionary of its immediate attributes.""" body = {} if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.metadata_file_path is not None: - body["metadata_file_path"] = self.metadata_file_path + body["{metadata_file_path}"] = self.metadata_file_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobDeployment: """Deserializes the JobDeployment from a dictionary.""" - return cls(kind=_enum(d, "kind", JobDeploymentKind), metadata_file_path=d.get("metadata_file_path", None)) + return cls(kind=_enum(d, "{kind}", JobDeploymentKind), metadata_file_path=d.get("{metadata_file_path}", None)) class JobDeploymentKind(Enum): @@ -3294,46 +3295,46 @@ def as_dict(self) -> dict: """Serializes the JobEmailNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["on_duration_warning_threshold_exceeded"] = [v for v in self.on_duration_warning_threshold_exceeded] + body["{on_duration_warning_threshold_exceeded}"] = [v for v in self.on_duration_warning_threshold_exceeded] if self.on_failure: - body["on_failure"] = [v for v in self.on_failure] + body["{on_failure}"] = [v for v in self.on_failure] if self.on_start: - body["on_start"] = [v for v in self.on_start] + body["{on_start}"] = [v for v in self.on_start] if self.on_streaming_backlog_exceeded: - body["on_streaming_backlog_exceeded"] = [v for v in self.on_streaming_backlog_exceeded] + body["{on_streaming_backlog_exceeded}"] = [v for v in self.on_streaming_backlog_exceeded] if self.on_success: - body["on_success"] = [v for v in self.on_success] + body["{on_success}"] = [v for v in self.on_success] return body def as_shallow_dict(self) -> dict: """Serializes the JobEmailNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["on_duration_warning_threshold_exceeded"] = self.on_duration_warning_threshold_exceeded + body["{on_duration_warning_threshold_exceeded}"] = self.on_duration_warning_threshold_exceeded if self.on_failure: - body["on_failure"] = self.on_failure + body["{on_failure}"] = self.on_failure if self.on_start: - body["on_start"] = self.on_start + body["{on_start}"] = self.on_start if self.on_streaming_backlog_exceeded: - body["on_streaming_backlog_exceeded"] = self.on_streaming_backlog_exceeded + body["{on_streaming_backlog_exceeded}"] = self.on_streaming_backlog_exceeded if self.on_success: - body["on_success"] = self.on_success + body["{on_success}"] = self.on_success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobEmailNotifications: """Deserializes the JobEmailNotifications from a dictionary.""" return cls( - no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), - on_duration_warning_threshold_exceeded=d.get("on_duration_warning_threshold_exceeded", None), - on_failure=d.get("on_failure", None), - on_start=d.get("on_start", None), - on_streaming_backlog_exceeded=d.get("on_streaming_backlog_exceeded", None), - on_success=d.get("on_success", None), + no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), + on_duration_warning_threshold_exceeded=d.get("{on_duration_warning_threshold_exceeded}", None), + on_failure=d.get("{on_failure}", None), + on_start=d.get("{on_start}", None), + on_streaming_backlog_exceeded=d.get("{on_streaming_backlog_exceeded}", None), + on_success=d.get("{on_success}", None), ) @@ -3350,24 +3351,24 @@ def as_dict(self) -> dict: """Serializes the JobEnvironment into a dictionary suitable for use as a JSON request body.""" body = {} if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.spec: - body["spec"] = self.spec.as_dict() + body["{spec}"] = self.spec.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the JobEnvironment into a shallow dictionary of its immediate attributes.""" body = {} if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.spec: - body["spec"] = self.spec + body["{spec}"] = self.spec return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobEnvironment: """Deserializes the JobEnvironment from a dictionary.""" - return cls(environment_key=d.get("environment_key", None), spec=_from_dict(d, "spec", Environment)) + return cls(environment_key=d.get("{environment_key}", None), spec=_from_dict(d, "{spec}", Environment)) @dataclass @@ -3384,26 +3385,26 @@ def as_dict(self) -> dict: """Serializes the JobNotificationSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.no_alert_for_canceled_runs is not None: - body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs + body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs return body def as_shallow_dict(self) -> dict: """Serializes the JobNotificationSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.no_alert_for_canceled_runs is not None: - body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs + body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobNotificationSettings: """Deserializes the JobNotificationSettings from a dictionary.""" return cls( - no_alert_for_canceled_runs=d.get("no_alert_for_canceled_runs", None), - no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), + no_alert_for_canceled_runs=d.get("{no_alert_for_canceled_runs}", None), + no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), ) @@ -3422,28 +3423,28 @@ def as_dict(self) -> dict: """Serializes the JobParameter into a dictionary suitable for use as a JSON request body.""" body = {} if self.default is not None: - body["default"] = self.default + body["{default}"] = self.default if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the JobParameter into a shallow dictionary of its immediate attributes.""" body = {} if self.default is not None: - body["default"] = self.default + body["{default}"] = self.default if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobParameter: """Deserializes the JobParameter from a dictionary.""" - return cls(default=d.get("default", None), name=d.get("name", None), value=d.get("value", None)) + return cls(default=d.get("{default}", None), name=d.get("{name}", None), value=d.get("{value}", None)) @dataclass @@ -3458,24 +3459,24 @@ def as_dict(self) -> dict: """Serializes the JobParameterDefinition into a dictionary suitable for use as a JSON request body.""" body = {} if self.default is not None: - body["default"] = self.default + body["{default}"] = self.default if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the JobParameterDefinition into a shallow dictionary of its immediate attributes.""" body = {} if self.default is not None: - body["default"] = self.default + body["{default}"] = self.default if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobParameterDefinition: """Deserializes the JobParameterDefinition from a dictionary.""" - return cls(default=d.get("default", None), name=d.get("name", None)) + return cls(default=d.get("{default}", None), name=d.get("{name}", None)) @dataclass @@ -3491,31 +3492,31 @@ def as_dict(self) -> dict: """Serializes the JobPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the JobPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermission: """Deserializes the JobPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", JobPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", JobPermissionLevel), ) @@ -3540,31 +3541,31 @@ def as_dict(self) -> dict: """Serializes the JobPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the JobPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermissions: """Deserializes the JobPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -3579,25 +3580,26 @@ def as_dict(self) -> dict: """Serializes the JobPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the JobPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermissionsDescription: """Deserializes the JobPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", JobPermissionLevel) + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", JobPermissionLevel), ) @@ -3612,26 +3614,26 @@ def as_dict(self) -> dict: """Serializes the JobPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body def as_shallow_dict(self) -> dict: """Serializes the JobPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermissionsRequest: """Deserializes the JobPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlRequest), - job_id=d.get("job_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlRequest), + job_id=d.get("{job_id}", None), ) @@ -3654,24 +3656,24 @@ def as_dict(self) -> dict: """Serializes the JobRunAs into a dictionary suitable for use as a JSON request body.""" body = {} if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the JobRunAs into a shallow dictionary of its immediate attributes.""" body = {} if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobRunAs: """Deserializes the JobRunAs from a dictionary.""" - return cls(service_principal_name=d.get("service_principal_name", None), user_name=d.get("user_name", None)) + return cls(service_principal_name=d.get("{service_principal_name}", None), user_name=d.get("{user_name}", None)) @dataclass @@ -3793,136 +3795,136 @@ def as_dict(self) -> dict: """Serializes the JobSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.continuous: - body["continuous"] = self.continuous.as_dict() + body["{continuous}"] = self.continuous.as_dict() if self.deployment: - body["deployment"] = self.deployment.as_dict() + body["{deployment}"] = self.deployment.as_dict() if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.edit_mode is not None: - body["edit_mode"] = self.edit_mode.value + body["{edit_mode}"] = self.edit_mode.value if self.email_notifications: - body["email_notifications"] = self.email_notifications.as_dict() + body["{email_notifications}"] = self.email_notifications.as_dict() if self.environments: - body["environments"] = [v.as_dict() for v in self.environments] + body["{environments}"] = [v.as_dict() for v in self.environments] if self.format is not None: - body["format"] = self.format.value + body["{format}"] = self.format.value if self.git_source: - body["git_source"] = self.git_source.as_dict() + body["{git_source}"] = self.git_source.as_dict() if self.health: - body["health"] = self.health.as_dict() + body["{health}"] = self.health.as_dict() if self.job_clusters: - body["job_clusters"] = [v.as_dict() for v in self.job_clusters] + body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] if self.max_concurrent_runs is not None: - body["max_concurrent_runs"] = self.max_concurrent_runs + body["{max_concurrent_runs}"] = self.max_concurrent_runs if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notification_settings: - body["notification_settings"] = self.notification_settings.as_dict() + body["{notification_settings}"] = self.notification_settings.as_dict() if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.performance_target is not None: - body["performance_target"] = self.performance_target.value + body["{performance_target}"] = self.performance_target.value if self.queue: - body["queue"] = self.queue.as_dict() + body["{queue}"] = self.queue.as_dict() if self.run_as: - body["run_as"] = self.run_as.as_dict() + body["{run_as}"] = self.run_as.as_dict() if self.schedule: - body["schedule"] = self.schedule.as_dict() + body["{schedule}"] = self.schedule.as_dict() if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.tasks: - body["tasks"] = [v.as_dict() for v in self.tasks] + body["{tasks}"] = [v.as_dict() for v in self.tasks] if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.trigger: - body["trigger"] = self.trigger.as_dict() + body["{trigger}"] = self.trigger.as_dict() if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications.as_dict() + body["{webhook_notifications}"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the JobSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.continuous: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment + body["{deployment}"] = self.deployment if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.edit_mode is not None: - body["edit_mode"] = self.edit_mode + body["{edit_mode}"] = self.edit_mode if self.email_notifications: - body["email_notifications"] = self.email_notifications + body["{email_notifications}"] = self.email_notifications if self.environments: - body["environments"] = self.environments + body["{environments}"] = self.environments if self.format is not None: - body["format"] = self.format + body["{format}"] = self.format if self.git_source: - body["git_source"] = self.git_source + body["{git_source}"] = self.git_source if self.health: - body["health"] = self.health + body["{health}"] = self.health if self.job_clusters: - body["job_clusters"] = self.job_clusters + body["{job_clusters}"] = self.job_clusters if self.max_concurrent_runs is not None: - body["max_concurrent_runs"] = self.max_concurrent_runs + body["{max_concurrent_runs}"] = self.max_concurrent_runs if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notification_settings: - body["notification_settings"] = self.notification_settings + body["{notification_settings}"] = self.notification_settings if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.performance_target is not None: - body["performance_target"] = self.performance_target + body["{performance_target}"] = self.performance_target if self.queue: - body["queue"] = self.queue + body["{queue}"] = self.queue if self.run_as: - body["run_as"] = self.run_as + body["{run_as}"] = self.run_as if self.schedule: - body["schedule"] = self.schedule + body["{schedule}"] = self.schedule if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.tasks: - body["tasks"] = self.tasks + body["{tasks}"] = self.tasks if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.trigger: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications + body["{webhook_notifications}"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSettings: """Deserializes the JobSettings from a dictionary.""" return cls( - budget_policy_id=d.get("budget_policy_id", None), - continuous=_from_dict(d, "continuous", Continuous), - deployment=_from_dict(d, "deployment", JobDeployment), - description=d.get("description", None), - edit_mode=_enum(d, "edit_mode", JobEditMode), - email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), - environments=_repeated_dict(d, "environments", JobEnvironment), - format=_enum(d, "format", Format), - git_source=_from_dict(d, "git_source", GitSource), - health=_from_dict(d, "health", JobsHealthRules), - job_clusters=_repeated_dict(d, "job_clusters", JobCluster), - max_concurrent_runs=d.get("max_concurrent_runs", None), - name=d.get("name", None), - notification_settings=_from_dict(d, "notification_settings", JobNotificationSettings), - parameters=_repeated_dict(d, "parameters", JobParameterDefinition), - performance_target=_enum(d, "performance_target", PerformanceTarget), - queue=_from_dict(d, "queue", QueueSettings), - run_as=_from_dict(d, "run_as", JobRunAs), - schedule=_from_dict(d, "schedule", CronSchedule), - tags=d.get("tags", None), - tasks=_repeated_dict(d, "tasks", Task), - timeout_seconds=d.get("timeout_seconds", None), - trigger=_from_dict(d, "trigger", TriggerSettings), - webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), + budget_policy_id=d.get("{budget_policy_id}", None), + continuous=_from_dict(d, "{continuous}", Continuous), + deployment=_from_dict(d, "{deployment}", JobDeployment), + description=d.get("{description}", None), + edit_mode=_enum(d, "{edit_mode}", JobEditMode), + email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), + environments=_repeated_dict(d, "{environments}", JobEnvironment), + format=_enum(d, "{format}", Format), + git_source=_from_dict(d, "{git_source}", GitSource), + health=_from_dict(d, "{health}", JobsHealthRules), + job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), + max_concurrent_runs=d.get("{max_concurrent_runs}", None), + name=d.get("{name}", None), + notification_settings=_from_dict(d, "{notification_settings}", JobNotificationSettings), + parameters=_repeated_dict(d, "{parameters}", JobParameterDefinition), + performance_target=_enum(d, "{performance_target}", PerformanceTarget), + queue=_from_dict(d, "{queue}", QueueSettings), + run_as=_from_dict(d, "{run_as}", JobRunAs), + schedule=_from_dict(d, "{schedule}", CronSchedule), + tags=d.get("{tags}", None), + tasks=_repeated_dict(d, "{tasks}", Task), + timeout_seconds=d.get("{timeout_seconds}", None), + trigger=_from_dict(d, "{trigger}", TriggerSettings), + webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), ) @@ -3950,31 +3952,31 @@ def as_dict(self) -> dict: """Serializes the JobSource into a dictionary suitable for use as a JSON request body.""" body = {} if self.dirty_state is not None: - body["dirty_state"] = self.dirty_state.value + body["{dirty_state}"] = self.dirty_state.value if self.import_from_git_branch is not None: - body["import_from_git_branch"] = self.import_from_git_branch + body["{import_from_git_branch}"] = self.import_from_git_branch if self.job_config_path is not None: - body["job_config_path"] = self.job_config_path + body["{job_config_path}"] = self.job_config_path return body def as_shallow_dict(self) -> dict: """Serializes the JobSource into a shallow dictionary of its immediate attributes.""" body = {} if self.dirty_state is not None: - body["dirty_state"] = self.dirty_state + body["{dirty_state}"] = self.dirty_state if self.import_from_git_branch is not None: - body["import_from_git_branch"] = self.import_from_git_branch + body["{import_from_git_branch}"] = self.import_from_git_branch if self.job_config_path is not None: - body["job_config_path"] = self.job_config_path + body["{job_config_path}"] = self.job_config_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSource: """Deserializes the JobSource from a dictionary.""" return cls( - dirty_state=_enum(d, "dirty_state", JobSourceDirtyState), - import_from_git_branch=d.get("import_from_git_branch", None), - job_config_path=d.get("job_config_path", None), + dirty_state=_enum(d, "{dirty_state}", JobSourceDirtyState), + import_from_git_branch=d.get("{import_from_git_branch}", None), + job_config_path=d.get("{job_config_path}", None), ) @@ -4192,166 +4194,166 @@ def as_dict(self) -> dict: """Serializes the JobsClusterSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value + body["{data_security_mode}"] = self.data_security_mode.value if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() + body["{docker_image}"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value + body["{runtime_engine}"] = self.runtime_engine.value if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() + body["{workload_type}"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the JobsClusterSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes + body["{autotermination_minutes}"] = self.autotermination_minutes if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name + body["{cluster_name}"] = self.cluster_name if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode + body["{data_security_mode}"] = self.data_security_mode if self.docker_image: - body["docker_image"] = self.docker_image + body["{docker_image}"] = self.docker_image if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk + body["{enable_elastic_disk}"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node + body["{is_single_node}"] = self.is_single_node if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine + body["{runtime_engine}"] = self.runtime_engine if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name + body["{single_user_name}"] = self.single_user_name if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.spark_version is not None: - body["spark_version"] = self.spark_version + body["{spark_version}"] = self.spark_version if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime + body["{use_ml_runtime}"] = self.use_ml_runtime if self.workload_type: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobsClusterSpec: """Deserializes the JobsClusterSpec from a dictionary.""" return cls( - apply_policy_default_values=d.get("apply_policy_default_values", None), - autoscale=_from_dict(d, "autoscale", AutoScale), - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_name=d.get("cluster_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - kind=_enum(d, "kind", Kind), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - ssh_public_keys=d.get("ssh_public_keys", None), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), + apply_policy_default_values=d.get("{apply_policy_default_values}", None), + autoscale=_from_dict(d, "{autoscale}", AutoScale), + autotermination_minutes=d.get("{autotermination_minutes}", None), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + cluster_name=d.get("{cluster_name}", None), + custom_tags=d.get("{custom_tags}", None), + data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), + docker_image=_from_dict(d, "{docker_image}", DockerImage), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_elastic_disk=d.get("{enable_elastic_disk}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + is_single_node=d.get("{is_single_node}", None), + kind=_enum(d, "{kind}", Kind), + node_type_id=d.get("{node_type_id}", None), + num_workers=d.get("{num_workers}", None), + policy_id=d.get("{policy_id}", None), + runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), + single_user_name=d.get("{single_user_name}", None), + spark_conf=d.get("{spark_conf}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + spark_version=d.get("{spark_version}", None), + ssh_public_keys=d.get("{ssh_public_keys}", None), + use_ml_runtime=d.get("{use_ml_runtime}", None), + workload_type=_from_dict(d, "{workload_type}", WorkloadType), ) @@ -4402,31 +4404,31 @@ def as_dict(self) -> dict: """Serializes the JobsHealthRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.metric is not None: - body["metric"] = self.metric.value + body["{metric}"] = self.metric.value if self.op is not None: - body["op"] = self.op.value + body["{op}"] = self.op.value if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the JobsHealthRule into a shallow dictionary of its immediate attributes.""" body = {} if self.metric is not None: - body["metric"] = self.metric + body["{metric}"] = self.metric if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobsHealthRule: """Deserializes the JobsHealthRule from a dictionary.""" return cls( - metric=_enum(d, "metric", JobsHealthMetric), - op=_enum(d, "op", JobsHealthOperator), - value=d.get("value", None), + metric=_enum(d, "{metric}", JobsHealthMetric), + op=_enum(d, "{op}", JobsHealthOperator), + value=d.get("{value}", None), ) @@ -4440,20 +4442,20 @@ def as_dict(self) -> dict: """Serializes the JobsHealthRules into a dictionary suitable for use as a JSON request body.""" body = {} if self.rules: - body["rules"] = [v.as_dict() for v in self.rules] + body["{rules}"] = [v.as_dict() for v in self.rules] return body def as_shallow_dict(self) -> dict: """Serializes the JobsHealthRules into a shallow dictionary of its immediate attributes.""" body = {} if self.rules: - body["rules"] = self.rules + body["{rules}"] = self.rules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobsHealthRules: """Deserializes the JobsHealthRules from a dictionary.""" - return cls(rules=_repeated_dict(d, "rules", JobsHealthRule)) + return cls(rules=_repeated_dict(d, "{rules}", JobsHealthRule)) class Kind(Enum): @@ -4513,51 +4515,51 @@ def as_dict(self) -> dict: """Serializes the Library into a dictionary suitable for use as a JSON request body.""" body = {} if self.cran: - body["cran"] = self.cran.as_dict() + body["{cran}"] = self.cran.as_dict() if self.egg is not None: - body["egg"] = self.egg + body["{egg}"] = self.egg if self.jar is not None: - body["jar"] = self.jar + body["{jar}"] = self.jar if self.maven: - body["maven"] = self.maven.as_dict() + body["{maven}"] = self.maven.as_dict() if self.pypi: - body["pypi"] = self.pypi.as_dict() + body["{pypi}"] = self.pypi.as_dict() if self.requirements is not None: - body["requirements"] = self.requirements + body["{requirements}"] = self.requirements if self.whl is not None: - body["whl"] = self.whl + body["{whl}"] = self.whl return body def as_shallow_dict(self) -> dict: """Serializes the Library into a shallow dictionary of its immediate attributes.""" body = {} if self.cran: - body["cran"] = self.cran + body["{cran}"] = self.cran if self.egg is not None: - body["egg"] = self.egg + body["{egg}"] = self.egg if self.jar is not None: - body["jar"] = self.jar + body["{jar}"] = self.jar if self.maven: - body["maven"] = self.maven + body["{maven}"] = self.maven if self.pypi: - body["pypi"] = self.pypi + body["{pypi}"] = self.pypi if self.requirements is not None: - body["requirements"] = self.requirements + body["{requirements}"] = self.requirements if self.whl is not None: - body["whl"] = self.whl + body["{whl}"] = self.whl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Library: """Deserializes the Library from a dictionary.""" return cls( - cran=_from_dict(d, "cran", RCranLibrary), - egg=d.get("egg", None), - jar=d.get("jar", None), - maven=_from_dict(d, "maven", MavenLibrary), - pypi=_from_dict(d, "pypi", PythonPyPiLibrary), - requirements=d.get("requirements", None), - whl=d.get("whl", None), + cran=_from_dict(d, "{cran}", RCranLibrary), + egg=d.get("{egg}", None), + jar=d.get("{jar}", None), + maven=_from_dict(d, "{maven}", MavenLibrary), + pypi=_from_dict(d, "{pypi}", PythonPyPiLibrary), + requirements=d.get("{requirements}", None), + whl=d.get("{whl}", None), ) @@ -4578,31 +4580,31 @@ def as_dict(self) -> dict: """Serializes the ListJobComplianceForPolicyResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.jobs: - body["jobs"] = [v.as_dict() for v in self.jobs] + body["{jobs}"] = [v.as_dict() for v in self.jobs] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListJobComplianceForPolicyResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.jobs: - body["jobs"] = self.jobs + body["{jobs}"] = self.jobs if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListJobComplianceForPolicyResponse: """Deserializes the ListJobComplianceForPolicyResponse from a dictionary.""" return cls( - jobs=_repeated_dict(d, "jobs", JobCompliance), - next_page_token=d.get("next_page_token", None), - prev_page_token=d.get("prev_page_token", None), + jobs=_repeated_dict(d, "{jobs}", JobCompliance), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), ) @@ -4626,36 +4628,36 @@ def as_dict(self) -> dict: """Serializes the ListJobsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.jobs: - body["jobs"] = [v.as_dict() for v in self.jobs] + body["{jobs}"] = [v.as_dict() for v in self.jobs] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListJobsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.jobs: - body["jobs"] = self.jobs + body["{jobs}"] = self.jobs if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListJobsResponse: """Deserializes the ListJobsResponse from a dictionary.""" return cls( - has_more=d.get("has_more", None), - jobs=_repeated_dict(d, "jobs", BaseJob), - next_page_token=d.get("next_page_token", None), - prev_page_token=d.get("prev_page_token", None), + has_more=d.get("{has_more}", None), + jobs=_repeated_dict(d, "{jobs}", BaseJob), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), ) @@ -4680,36 +4682,36 @@ def as_dict(self) -> dict: """Serializes the ListRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token if self.runs: - body["runs"] = [v.as_dict() for v in self.runs] + body["{runs}"] = [v.as_dict() for v in self.runs] return body def as_shallow_dict(self) -> dict: """Serializes the ListRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token if self.runs: - body["runs"] = self.runs + body["{runs}"] = self.runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: """Deserializes the ListRunsResponse from a dictionary.""" return cls( - has_more=d.get("has_more", None), - next_page_token=d.get("next_page_token", None), - prev_page_token=d.get("prev_page_token", None), - runs=_repeated_dict(d, "runs", BaseRun), + has_more=d.get("{has_more}", None), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), + runs=_repeated_dict(d, "{runs}", BaseRun), ) @@ -4722,20 +4724,20 @@ def as_dict(self) -> dict: """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: """Deserializes the LocalFileInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -4748,26 +4750,26 @@ def as_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key + body["{log_analytics_primary_key}"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key + body["{log_analytics_primary_key}"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: """Deserializes the LogAnalyticsInfo from a dictionary.""" return cls( - log_analytics_primary_key=d.get("log_analytics_primary_key", None), - log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), + log_analytics_primary_key=d.get("{log_analytics_primary_key}", None), + log_analytics_workspace_id=d.get("{log_analytics_workspace_id}", None), ) @@ -4790,29 +4792,29 @@ def as_dict(self) -> dict: """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.coordinates is not None: - body["coordinates"] = self.coordinates + body["{coordinates}"] = self.coordinates if self.exclusions: - body["exclusions"] = [v for v in self.exclusions] + body["{exclusions}"] = [v for v in self.exclusions] if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body def as_shallow_dict(self) -> dict: """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.coordinates is not None: - body["coordinates"] = self.coordinates + body["{coordinates}"] = self.coordinates if self.exclusions: - body["exclusions"] = self.exclusions + body["{exclusions}"] = self.exclusions if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: """Deserializes the MavenLibrary from a dictionary.""" return cls( - coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) + coordinates=d.get("{coordinates}", None), exclusions=d.get("{exclusions}", None), repo=d.get("{repo}", None) ) @@ -4832,24 +4834,24 @@ def as_dict(self) -> dict: """Serializes the NotebookOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.result is not None: - body["result"] = self.result + body["{result}"] = self.result if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body def as_shallow_dict(self) -> dict: """Serializes the NotebookOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.result is not None: - body["result"] = self.result + body["{result}"] = self.result if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookOutput: """Deserializes the NotebookOutput from a dictionary.""" - return cls(result=d.get("result", None), truncated=d.get("truncated", None)) + return cls(result=d.get("{result}", None), truncated=d.get("{truncated}", None)) @dataclass @@ -4893,36 +4895,36 @@ def as_dict(self) -> dict: """Serializes the NotebookTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.base_parameters: - body["base_parameters"] = self.base_parameters + body["{base_parameters}"] = self.base_parameters if self.notebook_path is not None: - body["notebook_path"] = self.notebook_path + body["{notebook_path}"] = self.notebook_path if self.source is not None: - body["source"] = self.source.value + body["{source}"] = self.source.value if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the NotebookTask into a shallow dictionary of its immediate attributes.""" body = {} if self.base_parameters: - body["base_parameters"] = self.base_parameters + body["{base_parameters}"] = self.base_parameters if self.notebook_path is not None: - body["notebook_path"] = self.notebook_path + body["{notebook_path}"] = self.notebook_path if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookTask: """Deserializes the NotebookTask from a dictionary.""" return cls( - base_parameters=d.get("base_parameters", None), - notebook_path=d.get("notebook_path", None), - source=_enum(d, "source", Source), - warehouse_id=d.get("warehouse_id", None), + base_parameters=d.get("{base_parameters}", None), + notebook_path=d.get("{notebook_path}", None), + source=_enum(d, "{source}", Source), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -4942,31 +4944,31 @@ def as_dict(self) -> dict: """Serializes the OutputSchemaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name return body def as_shallow_dict(self) -> dict: """Serializes the OutputSchemaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OutputSchemaInfo: """Deserializes the OutputSchemaInfo from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - expiration_time=d.get("expiration_time", None), - schema_name=d.get("schema_name", None), + catalog_name=d.get("{catalog_name}", None), + expiration_time=d.get("{expiration_time}", None), + schema_name=d.get("{schema_name}", None), ) @@ -4998,24 +5000,24 @@ def as_dict(self) -> dict: """Serializes the PeriodicTriggerConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.interval is not None: - body["interval"] = self.interval + body["{interval}"] = self.interval if self.unit is not None: - body["unit"] = self.unit.value + body["{unit}"] = self.unit.value return body def as_shallow_dict(self) -> dict: """Serializes the PeriodicTriggerConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.interval is not None: - body["interval"] = self.interval + body["{interval}"] = self.interval if self.unit is not None: - body["unit"] = self.unit + body["{unit}"] = self.unit return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PeriodicTriggerConfiguration: """Deserializes the PeriodicTriggerConfiguration from a dictionary.""" - return cls(interval=d.get("interval", None), unit=_enum(d, "unit", PeriodicTriggerConfigurationTimeUnit)) + return cls(interval=d.get("{interval}", None), unit=_enum(d, "{unit}", PeriodicTriggerConfigurationTimeUnit)) class PeriodicTriggerConfigurationTimeUnit(Enum): @@ -5034,20 +5036,20 @@ def as_dict(self) -> dict: """Serializes the PipelineParams into a dictionary suitable for use as a JSON request body.""" body = {} if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh return body def as_shallow_dict(self) -> dict: """Serializes the PipelineParams into a shallow dictionary of its immediate attributes.""" body = {} if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineParams: """Deserializes the PipelineParams from a dictionary.""" - return cls(full_refresh=d.get("full_refresh", None)) + return cls(full_refresh=d.get("{full_refresh}", None)) @dataclass @@ -5062,24 +5064,24 @@ def as_dict(self) -> dict: """Serializes the PipelineTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id return body def as_shallow_dict(self) -> dict: """Serializes the PipelineTask into a shallow dictionary of its immediate attributes.""" body = {} if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineTask: """Deserializes the PipelineTask from a dictionary.""" - return cls(full_refresh=d.get("full_refresh", None), pipeline_id=d.get("pipeline_id", None)) + return cls(full_refresh=d.get("{full_refresh}", None), pipeline_id=d.get("{pipeline_id}", None)) @dataclass @@ -5095,24 +5097,24 @@ def as_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body def as_shallow_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PythonPyPiLibrary: """Deserializes the PythonPyPiLibrary from a dictionary.""" - return cls(package=d.get("package", None), repo=d.get("repo", None)) + return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) @dataclass @@ -5136,36 +5138,36 @@ def as_dict(self) -> dict: """Serializes the PythonWheelTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.entry_point is not None: - body["entry_point"] = self.entry_point + body["{entry_point}"] = self.entry_point if self.named_parameters: - body["named_parameters"] = self.named_parameters + body["{named_parameters}"] = self.named_parameters if self.package_name is not None: - body["package_name"] = self.package_name + body["{package_name}"] = self.package_name if self.parameters: - body["parameters"] = [v for v in self.parameters] + body["{parameters}"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: """Serializes the PythonWheelTask into a shallow dictionary of its immediate attributes.""" body = {} if self.entry_point is not None: - body["entry_point"] = self.entry_point + body["{entry_point}"] = self.entry_point if self.named_parameters: - body["named_parameters"] = self.named_parameters + body["{named_parameters}"] = self.named_parameters if self.package_name is not None: - body["package_name"] = self.package_name + body["{package_name}"] = self.package_name if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PythonWheelTask: """Deserializes the PythonWheelTask from a dictionary.""" return cls( - entry_point=d.get("entry_point", None), - named_parameters=d.get("named_parameters", None), - package_name=d.get("package_name", None), - parameters=d.get("parameters", None), + entry_point=d.get("{entry_point}", None), + named_parameters=d.get("{named_parameters}", None), + package_name=d.get("{package_name}", None), + parameters=d.get("{parameters}", None), ) @@ -5186,24 +5188,24 @@ def as_dict(self) -> dict: """Serializes the QueueDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["code"] = self.code.value + body["{code}"] = self.code.value if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body def as_shallow_dict(self) -> dict: """Serializes the QueueDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["code"] = self.code + body["{code}"] = self.code if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueueDetails: """Deserializes the QueueDetails from a dictionary.""" - return cls(code=_enum(d, "code", QueueDetailsCodeCode), message=d.get("message", None)) + return cls(code=_enum(d, "{code}", QueueDetailsCodeCode), message=d.get("{message}", None)) class QueueDetailsCodeCode(Enum): @@ -5227,20 +5229,20 @@ def as_dict(self) -> dict: """Serializes the QueueSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body def as_shallow_dict(self) -> dict: """Serializes the QueueSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueueSettings: """Deserializes the QueueSettings from a dictionary.""" - return cls(enabled=d.get("enabled", None)) + return cls(enabled=d.get("{enabled}", None)) @dataclass @@ -5255,24 +5257,24 @@ def as_dict(self) -> dict: """Serializes the RCranLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body def as_shallow_dict(self) -> dict: """Serializes the RCranLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["package"] = self.package + body["{package}"] = self.package if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RCranLibrary: """Deserializes the RCranLibrary from a dictionary.""" - return cls(package=d.get("package", None), repo=d.get("repo", None)) + return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) @dataclass @@ -5302,51 +5304,51 @@ def as_dict(self) -> dict: """Serializes the RepairHistoryItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() if self.task_run_ids: - body["task_run_ids"] = [v for v in self.task_run_ids] + body["{task_run_ids}"] = [v for v in self.task_run_ids] if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the RepairHistoryItem into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.status: - body["status"] = self.status + body["{status}"] = self.status if self.task_run_ids: - body["task_run_ids"] = self.task_run_ids + body["{task_run_ids}"] = self.task_run_ids if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepairHistoryItem: """Deserializes the RepairHistoryItem from a dictionary.""" return cls( - end_time=d.get("end_time", None), - id=d.get("id", None), - start_time=d.get("start_time", None), - state=_from_dict(d, "state", RunState), - status=_from_dict(d, "status", RunStatus), - task_run_ids=d.get("task_run_ids", None), - type=_enum(d, "type", RepairHistoryItemType), + end_time=d.get("{end_time}", None), + id=d.get("{id}", None), + start_time=d.get("{start_time}", None), + state=_from_dict(d, "{state}", RunState), + status=_from_dict(d, "{status}", RunStatus), + task_run_ids=d.get("{task_run_ids}", None), + type=_enum(d, "{type}", RepairHistoryItemType), ) @@ -5458,86 +5460,86 @@ def as_dict(self) -> dict: """Serializes the RepairRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["dbt_commands"] = [v for v in self.dbt_commands] + body["{dbt_commands}"] = [v for v in self.dbt_commands] if self.jar_params: - body["jar_params"] = [v for v in self.jar_params] + body["{jar_params}"] = [v for v in self.jar_params] if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.latest_repair_id is not None: - body["latest_repair_id"] = self.latest_repair_id + body["{latest_repair_id}"] = self.latest_repair_id if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params.as_dict() + body["{pipeline_params}"] = self.pipeline_params.as_dict() if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = [v for v in self.python_params] + body["{python_params}"] = [v for v in self.python_params] if self.rerun_all_failed_tasks is not None: - body["rerun_all_failed_tasks"] = self.rerun_all_failed_tasks + body["{rerun_all_failed_tasks}"] = self.rerun_all_failed_tasks if self.rerun_dependent_tasks is not None: - body["rerun_dependent_tasks"] = self.rerun_dependent_tasks + body["{rerun_dependent_tasks}"] = self.rerun_dependent_tasks if self.rerun_tasks: - body["rerun_tasks"] = [v for v in self.rerun_tasks] + body["{rerun_tasks}"] = [v for v in self.rerun_tasks] if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.spark_submit_params: - body["spark_submit_params"] = [v for v in self.spark_submit_params] + body["{spark_submit_params}"] = [v for v in self.spark_submit_params] if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body def as_shallow_dict(self) -> dict: """Serializes the RepairRun into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["dbt_commands"] = self.dbt_commands + body["{dbt_commands}"] = self.dbt_commands if self.jar_params: - body["jar_params"] = self.jar_params + body["{jar_params}"] = self.jar_params if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.latest_repair_id is not None: - body["latest_repair_id"] = self.latest_repair_id + body["{latest_repair_id}"] = self.latest_repair_id if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params + body["{pipeline_params}"] = self.pipeline_params if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = self.python_params + body["{python_params}"] = self.python_params if self.rerun_all_failed_tasks is not None: - body["rerun_all_failed_tasks"] = self.rerun_all_failed_tasks + body["{rerun_all_failed_tasks}"] = self.rerun_all_failed_tasks if self.rerun_dependent_tasks is not None: - body["rerun_dependent_tasks"] = self.rerun_dependent_tasks + body["{rerun_dependent_tasks}"] = self.rerun_dependent_tasks if self.rerun_tasks: - body["rerun_tasks"] = self.rerun_tasks + body["{rerun_tasks}"] = self.rerun_tasks if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.spark_submit_params: - body["spark_submit_params"] = self.spark_submit_params + body["{spark_submit_params}"] = self.spark_submit_params if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepairRun: """Deserializes the RepairRun from a dictionary.""" return cls( - dbt_commands=d.get("dbt_commands", None), - jar_params=d.get("jar_params", None), - job_parameters=d.get("job_parameters", None), - latest_repair_id=d.get("latest_repair_id", None), - notebook_params=d.get("notebook_params", None), - pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), - python_named_params=d.get("python_named_params", None), - python_params=d.get("python_params", None), - rerun_all_failed_tasks=d.get("rerun_all_failed_tasks", None), - rerun_dependent_tasks=d.get("rerun_dependent_tasks", None), - rerun_tasks=d.get("rerun_tasks", None), - run_id=d.get("run_id", None), - spark_submit_params=d.get("spark_submit_params", None), - sql_params=d.get("sql_params", None), + dbt_commands=d.get("{dbt_commands}", None), + jar_params=d.get("{jar_params}", None), + job_parameters=d.get("{job_parameters}", None), + latest_repair_id=d.get("{latest_repair_id}", None), + notebook_params=d.get("{notebook_params}", None), + pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), + python_named_params=d.get("{python_named_params}", None), + python_params=d.get("{python_params}", None), + rerun_all_failed_tasks=d.get("{rerun_all_failed_tasks}", None), + rerun_dependent_tasks=d.get("{rerun_dependent_tasks}", None), + rerun_tasks=d.get("{rerun_tasks}", None), + run_id=d.get("{run_id}", None), + spark_submit_params=d.get("{spark_submit_params}", None), + sql_params=d.get("{sql_params}", None), ) @@ -5553,20 +5555,20 @@ def as_dict(self) -> dict: """Serializes the RepairRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.repair_id is not None: - body["repair_id"] = self.repair_id + body["{repair_id}"] = self.repair_id return body def as_shallow_dict(self) -> dict: """Serializes the RepairRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.repair_id is not None: - body["repair_id"] = self.repair_id + body["{repair_id}"] = self.repair_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepairRunResponse: """Deserializes the RepairRunResponse from a dictionary.""" - return cls(repair_id=d.get("repair_id", None)) + return cls(repair_id=d.get("{repair_id}", None)) @dataclass @@ -5584,24 +5586,24 @@ def as_dict(self) -> dict: """Serializes the ResetJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.new_settings: - body["new_settings"] = self.new_settings.as_dict() + body["{new_settings}"] = self.new_settings.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ResetJob into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.new_settings: - body["new_settings"] = self.new_settings + body["{new_settings}"] = self.new_settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResetJob: """Deserializes the ResetJob from a dictionary.""" - return cls(job_id=d.get("job_id", None), new_settings=_from_dict(d, "new_settings", JobSettings)) + return cls(job_id=d.get("{job_id}", None), new_settings=_from_dict(d, "{new_settings}", JobSettings)) @dataclass @@ -5632,24 +5634,24 @@ def as_dict(self) -> dict: """Serializes the ResolvedConditionTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.left is not None: - body["left"] = self.left + body["{left}"] = self.left if self.right is not None: - body["right"] = self.right + body["{right}"] = self.right return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedConditionTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.left is not None: - body["left"] = self.left + body["{left}"] = self.left if self.right is not None: - body["right"] = self.right + body["{right}"] = self.right return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedConditionTaskValues: """Deserializes the ResolvedConditionTaskValues from a dictionary.""" - return cls(left=d.get("left", None), right=d.get("right", None)) + return cls(left=d.get("{left}", None), right=d.get("{right}", None)) @dataclass @@ -5660,20 +5662,20 @@ def as_dict(self) -> dict: """Serializes the ResolvedDbtTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.commands: - body["commands"] = [v for v in self.commands] + body["{commands}"] = [v for v in self.commands] return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedDbtTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.commands: - body["commands"] = self.commands + body["{commands}"] = self.commands return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedDbtTaskValues: """Deserializes the ResolvedDbtTaskValues from a dictionary.""" - return cls(commands=d.get("commands", None)) + return cls(commands=d.get("{commands}", None)) @dataclass @@ -5684,20 +5686,20 @@ def as_dict(self) -> dict: """Serializes the ResolvedNotebookTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.base_parameters: - body["base_parameters"] = self.base_parameters + body["{base_parameters}"] = self.base_parameters return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedNotebookTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.base_parameters: - body["base_parameters"] = self.base_parameters + body["{base_parameters}"] = self.base_parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedNotebookTaskValues: """Deserializes the ResolvedNotebookTaskValues from a dictionary.""" - return cls(base_parameters=d.get("base_parameters", None)) + return cls(base_parameters=d.get("{base_parameters}", None)) @dataclass @@ -5708,20 +5710,20 @@ def as_dict(self) -> dict: """Serializes the ResolvedParamPairValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedParamPairValues into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedParamPairValues: """Deserializes the ResolvedParamPairValues from a dictionary.""" - return cls(parameters=d.get("parameters", None)) + return cls(parameters=d.get("{parameters}", None)) @dataclass @@ -5734,24 +5736,24 @@ def as_dict(self) -> dict: """Serializes the ResolvedPythonWheelTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.named_parameters: - body["named_parameters"] = self.named_parameters + body["{named_parameters}"] = self.named_parameters if self.parameters: - body["parameters"] = [v for v in self.parameters] + body["{parameters}"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedPythonWheelTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.named_parameters: - body["named_parameters"] = self.named_parameters + body["{named_parameters}"] = self.named_parameters if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedPythonWheelTaskValues: """Deserializes the ResolvedPythonWheelTaskValues from a dictionary.""" - return cls(named_parameters=d.get("named_parameters", None), parameters=d.get("parameters", None)) + return cls(named_parameters=d.get("{named_parameters}", None), parameters=d.get("{parameters}", None)) @dataclass @@ -5764,24 +5766,24 @@ def as_dict(self) -> dict: """Serializes the ResolvedRunJobTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedRunJobTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedRunJobTaskValues: """Deserializes the ResolvedRunJobTaskValues from a dictionary.""" - return cls(job_parameters=d.get("job_parameters", None), parameters=d.get("parameters", None)) + return cls(job_parameters=d.get("{job_parameters}", None), parameters=d.get("{parameters}", None)) @dataclass @@ -5792,20 +5794,20 @@ def as_dict(self) -> dict: """Serializes the ResolvedStringParamsValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["parameters"] = [v for v in self.parameters] + body["{parameters}"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedStringParamsValues into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedStringParamsValues: """Deserializes the ResolvedStringParamsValues from a dictionary.""" - return cls(parameters=d.get("parameters", None)) + return cls(parameters=d.get("{parameters}", None)) @dataclass @@ -5834,66 +5836,66 @@ def as_dict(self) -> dict: """Serializes the ResolvedValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition_task: - body["condition_task"] = self.condition_task.as_dict() + body["{condition_task}"] = self.condition_task.as_dict() if self.dbt_task: - body["dbt_task"] = self.dbt_task.as_dict() + body["{dbt_task}"] = self.dbt_task.as_dict() if self.notebook_task: - body["notebook_task"] = self.notebook_task.as_dict() + body["{notebook_task}"] = self.notebook_task.as_dict() if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task.as_dict() + body["{python_wheel_task}"] = self.python_wheel_task.as_dict() if self.run_job_task: - body["run_job_task"] = self.run_job_task.as_dict() + body["{run_job_task}"] = self.run_job_task.as_dict() if self.simulation_task: - body["simulation_task"] = self.simulation_task.as_dict() + body["{simulation_task}"] = self.simulation_task.as_dict() if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task.as_dict() + body["{spark_jar_task}"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task.as_dict() + body["{spark_python_task}"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task.as_dict() + body["{spark_submit_task}"] = self.spark_submit_task.as_dict() if self.sql_task: - body["sql_task"] = self.sql_task.as_dict() + body["{sql_task}"] = self.sql_task.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ResolvedValues into a shallow dictionary of its immediate attributes.""" body = {} if self.condition_task: - body["condition_task"] = self.condition_task + body["{condition_task}"] = self.condition_task if self.dbt_task: - body["dbt_task"] = self.dbt_task + body["{dbt_task}"] = self.dbt_task if self.notebook_task: - body["notebook_task"] = self.notebook_task + body["{notebook_task}"] = self.notebook_task if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task + body["{python_wheel_task}"] = self.python_wheel_task if self.run_job_task: - body["run_job_task"] = self.run_job_task + body["{run_job_task}"] = self.run_job_task if self.simulation_task: - body["simulation_task"] = self.simulation_task + body["{simulation_task}"] = self.simulation_task if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task + body["{spark_jar_task}"] = self.spark_jar_task if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task + body["{spark_python_task}"] = self.spark_python_task if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task + body["{spark_submit_task}"] = self.spark_submit_task if self.sql_task: - body["sql_task"] = self.sql_task + body["{sql_task}"] = self.sql_task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedValues: """Deserializes the ResolvedValues from a dictionary.""" return cls( - condition_task=_from_dict(d, "condition_task", ResolvedConditionTaskValues), - dbt_task=_from_dict(d, "dbt_task", ResolvedDbtTaskValues), - notebook_task=_from_dict(d, "notebook_task", ResolvedNotebookTaskValues), - python_wheel_task=_from_dict(d, "python_wheel_task", ResolvedPythonWheelTaskValues), - run_job_task=_from_dict(d, "run_job_task", ResolvedRunJobTaskValues), - simulation_task=_from_dict(d, "simulation_task", ResolvedParamPairValues), - spark_jar_task=_from_dict(d, "spark_jar_task", ResolvedStringParamsValues), - spark_python_task=_from_dict(d, "spark_python_task", ResolvedStringParamsValues), - spark_submit_task=_from_dict(d, "spark_submit_task", ResolvedStringParamsValues), - sql_task=_from_dict(d, "sql_task", ResolvedParamPairValues), + condition_task=_from_dict(d, "{condition_task}", ResolvedConditionTaskValues), + dbt_task=_from_dict(d, "{dbt_task}", ResolvedDbtTaskValues), + notebook_task=_from_dict(d, "{notebook_task}", ResolvedNotebookTaskValues), + python_wheel_task=_from_dict(d, "{python_wheel_task}", ResolvedPythonWheelTaskValues), + run_job_task=_from_dict(d, "{run_job_task}", ResolvedRunJobTaskValues), + simulation_task=_from_dict(d, "{simulation_task}", ResolvedParamPairValues), + spark_jar_task=_from_dict(d, "{spark_jar_task}", ResolvedStringParamsValues), + spark_python_task=_from_dict(d, "{spark_python_task}", ResolvedStringParamsValues), + spark_submit_task=_from_dict(d, "{spark_submit_task}", ResolvedStringParamsValues), + sql_task=_from_dict(d, "{sql_task}", ResolvedParamPairValues), ) @@ -6063,191 +6065,191 @@ def as_dict(self) -> dict: """Serializes the Run into a dictionary suitable for use as a JSON request body.""" body = {} if self.attempt_number is not None: - body["attempt_number"] = self.attempt_number + body["{attempt_number}"] = self.attempt_number if self.cleanup_duration is not None: - body["cleanup_duration"] = self.cleanup_duration + body["{cleanup_duration}"] = self.cleanup_duration if self.cluster_instance: - body["cluster_instance"] = self.cluster_instance.as_dict() + body["{cluster_instance}"] = self.cluster_instance.as_dict() if self.cluster_spec: - body["cluster_spec"] = self.cluster_spec.as_dict() + body["{cluster_spec}"] = self.cluster_spec.as_dict() if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.effective_performance_target is not None: - body["effective_performance_target"] = self.effective_performance_target.value + body["{effective_performance_target}"] = self.effective_performance_target.value if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.execution_duration is not None: - body["execution_duration"] = self.execution_duration + body["{execution_duration}"] = self.execution_duration if self.git_source: - body["git_source"] = self.git_source.as_dict() + body["{git_source}"] = self.git_source.as_dict() if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.iterations: - body["iterations"] = [v.as_dict() for v in self.iterations] + body["{iterations}"] = [v.as_dict() for v in self.iterations] if self.job_clusters: - body["job_clusters"] = [v.as_dict() for v in self.job_clusters] + body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = [v.as_dict() for v in self.job_parameters] + body["{job_parameters}"] = [v.as_dict() for v in self.job_parameters] if self.job_run_id is not None: - body["job_run_id"] = self.job_run_id + body["{job_run_id}"] = self.job_run_id if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.number_in_job is not None: - body["number_in_job"] = self.number_in_job + body["{number_in_job}"] = self.number_in_job if self.original_attempt_run_id is not None: - body["original_attempt_run_id"] = self.original_attempt_run_id + body["{original_attempt_run_id}"] = self.original_attempt_run_id if self.overriding_parameters: - body["overriding_parameters"] = self.overriding_parameters.as_dict() + body["{overriding_parameters}"] = self.overriding_parameters.as_dict() if self.queue_duration is not None: - body["queue_duration"] = self.queue_duration + body["{queue_duration}"] = self.queue_duration if self.repair_history: - body["repair_history"] = [v.as_dict() for v in self.repair_history] + body["{repair_history}"] = [v.as_dict() for v in self.repair_history] if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_page_url is not None: - body["run_page_url"] = self.run_page_url + body["{run_page_url}"] = self.run_page_url if self.run_type is not None: - body["run_type"] = self.run_type.value + body["{run_type}"] = self.run_type.value if self.schedule: - body["schedule"] = self.schedule.as_dict() + body["{schedule}"] = self.schedule.as_dict() if self.setup_duration is not None: - body["setup_duration"] = self.setup_duration + body["{setup_duration}"] = self.setup_duration if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() if self.tasks: - body["tasks"] = [v.as_dict() for v in self.tasks] + body["{tasks}"] = [v.as_dict() for v in self.tasks] if self.trigger is not None: - body["trigger"] = self.trigger.value + body["{trigger}"] = self.trigger.value if self.trigger_info: - body["trigger_info"] = self.trigger_info.as_dict() + body["{trigger_info}"] = self.trigger_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Run into a shallow dictionary of its immediate attributes.""" body = {} if self.attempt_number is not None: - body["attempt_number"] = self.attempt_number + body["{attempt_number}"] = self.attempt_number if self.cleanup_duration is not None: - body["cleanup_duration"] = self.cleanup_duration + body["{cleanup_duration}"] = self.cleanup_duration if self.cluster_instance: - body["cluster_instance"] = self.cluster_instance + body["{cluster_instance}"] = self.cluster_instance if self.cluster_spec: - body["cluster_spec"] = self.cluster_spec + body["{cluster_spec}"] = self.cluster_spec if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.effective_performance_target is not None: - body["effective_performance_target"] = self.effective_performance_target + body["{effective_performance_target}"] = self.effective_performance_target if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.execution_duration is not None: - body["execution_duration"] = self.execution_duration + body["{execution_duration}"] = self.execution_duration if self.git_source: - body["git_source"] = self.git_source + body["{git_source}"] = self.git_source if self.has_more is not None: - body["has_more"] = self.has_more + body["{has_more}"] = self.has_more if self.iterations: - body["iterations"] = self.iterations + body["{iterations}"] = self.iterations if self.job_clusters: - body["job_clusters"] = self.job_clusters + body["{job_clusters}"] = self.job_clusters if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.job_run_id is not None: - body["job_run_id"] = self.job_run_id + body["{job_run_id}"] = self.job_run_id if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.number_in_job is not None: - body["number_in_job"] = self.number_in_job + body["{number_in_job}"] = self.number_in_job if self.original_attempt_run_id is not None: - body["original_attempt_run_id"] = self.original_attempt_run_id + body["{original_attempt_run_id}"] = self.original_attempt_run_id if self.overriding_parameters: - body["overriding_parameters"] = self.overriding_parameters + body["{overriding_parameters}"] = self.overriding_parameters if self.queue_duration is not None: - body["queue_duration"] = self.queue_duration + body["{queue_duration}"] = self.queue_duration if self.repair_history: - body["repair_history"] = self.repair_history + body["{repair_history}"] = self.repair_history if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_page_url is not None: - body["run_page_url"] = self.run_page_url + body["{run_page_url}"] = self.run_page_url if self.run_type is not None: - body["run_type"] = self.run_type + body["{run_type}"] = self.run_type if self.schedule: - body["schedule"] = self.schedule + body["{schedule}"] = self.schedule if self.setup_duration is not None: - body["setup_duration"] = self.setup_duration + body["{setup_duration}"] = self.setup_duration if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.status: - body["status"] = self.status + body["{status}"] = self.status if self.tasks: - body["tasks"] = self.tasks + body["{tasks}"] = self.tasks if self.trigger is not None: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger if self.trigger_info: - body["trigger_info"] = self.trigger_info + body["{trigger_info}"] = self.trigger_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Run: """Deserializes the Run from a dictionary.""" return cls( - attempt_number=d.get("attempt_number", None), - cleanup_duration=d.get("cleanup_duration", None), - cluster_instance=_from_dict(d, "cluster_instance", ClusterInstance), - cluster_spec=_from_dict(d, "cluster_spec", ClusterSpec), - creator_user_name=d.get("creator_user_name", None), - description=d.get("description", None), - effective_performance_target=_enum(d, "effective_performance_target", PerformanceTarget), - end_time=d.get("end_time", None), - execution_duration=d.get("execution_duration", None), - git_source=_from_dict(d, "git_source", GitSource), - has_more=d.get("has_more", None), - iterations=_repeated_dict(d, "iterations", RunTask), - job_clusters=_repeated_dict(d, "job_clusters", JobCluster), - job_id=d.get("job_id", None), - job_parameters=_repeated_dict(d, "job_parameters", JobParameter), - job_run_id=d.get("job_run_id", None), - next_page_token=d.get("next_page_token", None), - number_in_job=d.get("number_in_job", None), - original_attempt_run_id=d.get("original_attempt_run_id", None), - overriding_parameters=_from_dict(d, "overriding_parameters", RunParameters), - queue_duration=d.get("queue_duration", None), - repair_history=_repeated_dict(d, "repair_history", RepairHistoryItem), - run_duration=d.get("run_duration", None), - run_id=d.get("run_id", None), - run_name=d.get("run_name", None), - run_page_url=d.get("run_page_url", None), - run_type=_enum(d, "run_type", RunType), - schedule=_from_dict(d, "schedule", CronSchedule), - setup_duration=d.get("setup_duration", None), - start_time=d.get("start_time", None), - state=_from_dict(d, "state", RunState), - status=_from_dict(d, "status", RunStatus), - tasks=_repeated_dict(d, "tasks", RunTask), - trigger=_enum(d, "trigger", TriggerType), - trigger_info=_from_dict(d, "trigger_info", TriggerInfo), + attempt_number=d.get("{attempt_number}", None), + cleanup_duration=d.get("{cleanup_duration}", None), + cluster_instance=_from_dict(d, "{cluster_instance}", ClusterInstance), + cluster_spec=_from_dict(d, "{cluster_spec}", ClusterSpec), + creator_user_name=d.get("{creator_user_name}", None), + description=d.get("{description}", None), + effective_performance_target=_enum(d, "{effective_performance_target}", PerformanceTarget), + end_time=d.get("{end_time}", None), + execution_duration=d.get("{execution_duration}", None), + git_source=_from_dict(d, "{git_source}", GitSource), + has_more=d.get("{has_more}", None), + iterations=_repeated_dict(d, "{iterations}", RunTask), + job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), + job_id=d.get("{job_id}", None), + job_parameters=_repeated_dict(d, "{job_parameters}", JobParameter), + job_run_id=d.get("{job_run_id}", None), + next_page_token=d.get("{next_page_token}", None), + number_in_job=d.get("{number_in_job}", None), + original_attempt_run_id=d.get("{original_attempt_run_id}", None), + overriding_parameters=_from_dict(d, "{overriding_parameters}", RunParameters), + queue_duration=d.get("{queue_duration}", None), + repair_history=_repeated_dict(d, "{repair_history}", RepairHistoryItem), + run_duration=d.get("{run_duration}", None), + run_id=d.get("{run_id}", None), + run_name=d.get("{run_name}", None), + run_page_url=d.get("{run_page_url}", None), + run_type=_enum(d, "{run_type}", RunType), + schedule=_from_dict(d, "{schedule}", CronSchedule), + setup_duration=d.get("{setup_duration}", None), + start_time=d.get("{start_time}", None), + state=_from_dict(d, "{state}", RunState), + status=_from_dict(d, "{status}", RunStatus), + tasks=_repeated_dict(d, "{tasks}", RunTask), + trigger=_enum(d, "{trigger}", TriggerType), + trigger_info=_from_dict(d, "{trigger_info}", TriggerInfo), ) @@ -6280,36 +6282,36 @@ def as_dict(self) -> dict: """Serializes the RunConditionTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.left is not None: - body["left"] = self.left + body["{left}"] = self.left if self.op is not None: - body["op"] = self.op.value + body["{op}"] = self.op.value if self.outcome is not None: - body["outcome"] = self.outcome + body["{outcome}"] = self.outcome if self.right is not None: - body["right"] = self.right + body["{right}"] = self.right return body def as_shallow_dict(self) -> dict: """Serializes the RunConditionTask into a shallow dictionary of its immediate attributes.""" body = {} if self.left is not None: - body["left"] = self.left + body["{left}"] = self.left if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.outcome is not None: - body["outcome"] = self.outcome + body["{outcome}"] = self.outcome if self.right is not None: - body["right"] = self.right + body["{right}"] = self.right return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunConditionTask: """Deserializes the RunConditionTask from a dictionary.""" return cls( - left=d.get("left", None), - op=_enum(d, "op", ConditionTaskOp), - outcome=d.get("outcome", None), - right=d.get("right", None), + left=d.get("{left}", None), + op=_enum(d, "{op}", ConditionTaskOp), + outcome=d.get("{outcome}", None), + right=d.get("{right}", None), ) @@ -6333,36 +6335,36 @@ def as_dict(self) -> dict: """Serializes the RunForEachTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.concurrency is not None: - body["concurrency"] = self.concurrency + body["{concurrency}"] = self.concurrency if self.inputs is not None: - body["inputs"] = self.inputs + body["{inputs}"] = self.inputs if self.stats: - body["stats"] = self.stats.as_dict() + body["{stats}"] = self.stats.as_dict() if self.task: - body["task"] = self.task.as_dict() + body["{task}"] = self.task.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the RunForEachTask into a shallow dictionary of its immediate attributes.""" body = {} if self.concurrency is not None: - body["concurrency"] = self.concurrency + body["{concurrency}"] = self.concurrency if self.inputs is not None: - body["inputs"] = self.inputs + body["{inputs}"] = self.inputs if self.stats: - body["stats"] = self.stats + body["{stats}"] = self.stats if self.task: - body["task"] = self.task + body["{task}"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunForEachTask: """Deserializes the RunForEachTask from a dictionary.""" return cls( - concurrency=d.get("concurrency", None), - inputs=d.get("inputs", None), - stats=_from_dict(d, "stats", ForEachStats), - task=_from_dict(d, "task", Task), + concurrency=d.get("{concurrency}", None), + inputs=d.get("{inputs}", None), + stats=_from_dict(d, "{stats}", ForEachStats), + task=_from_dict(d, "{task}", Task), ) @@ -6393,20 +6395,20 @@ def as_dict(self) -> dict: """Serializes the RunJobOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the RunJobOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunJobOutput: """Deserializes the RunJobOutput from a dictionary.""" - return cls(run_id=d.get("run_id", None)) + return cls(run_id=d.get("{run_id}", None)) @dataclass @@ -6495,66 +6497,66 @@ def as_dict(self) -> dict: """Serializes the RunJobTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["dbt_commands"] = [v for v in self.dbt_commands] + body["{dbt_commands}"] = [v for v in self.dbt_commands] if self.jar_params: - body["jar_params"] = [v for v in self.jar_params] + body["{jar_params}"] = [v for v in self.jar_params] if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params.as_dict() + body["{pipeline_params}"] = self.pipeline_params.as_dict() if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = [v for v in self.python_params] + body["{python_params}"] = [v for v in self.python_params] if self.spark_submit_params: - body["spark_submit_params"] = [v for v in self.spark_submit_params] + body["{spark_submit_params}"] = [v for v in self.spark_submit_params] if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body def as_shallow_dict(self) -> dict: """Serializes the RunJobTask into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["dbt_commands"] = self.dbt_commands + body["{dbt_commands}"] = self.dbt_commands if self.jar_params: - body["jar_params"] = self.jar_params + body["{jar_params}"] = self.jar_params if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params + body["{pipeline_params}"] = self.pipeline_params if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = self.python_params + body["{python_params}"] = self.python_params if self.spark_submit_params: - body["spark_submit_params"] = self.spark_submit_params + body["{spark_submit_params}"] = self.spark_submit_params if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunJobTask: """Deserializes the RunJobTask from a dictionary.""" return cls( - dbt_commands=d.get("dbt_commands", None), - jar_params=d.get("jar_params", None), - job_id=d.get("job_id", None), - job_parameters=d.get("job_parameters", None), - notebook_params=d.get("notebook_params", None), - pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), - python_named_params=d.get("python_named_params", None), - python_params=d.get("python_params", None), - spark_submit_params=d.get("spark_submit_params", None), - sql_params=d.get("sql_params", None), + dbt_commands=d.get("{dbt_commands}", None), + jar_params=d.get("{jar_params}", None), + job_id=d.get("{job_id}", None), + job_parameters=d.get("{job_parameters}", None), + notebook_params=d.get("{notebook_params}", None), + pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), + python_named_params=d.get("{python_named_params}", None), + python_params=d.get("{python_params}", None), + spark_submit_params=d.get("{spark_submit_params}", None), + sql_params=d.get("{sql_params}", None), ) @@ -6706,86 +6708,86 @@ def as_dict(self) -> dict: """Serializes the RunNow into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["dbt_commands"] = [v for v in self.dbt_commands] + body["{dbt_commands}"] = [v for v in self.dbt_commands] if self.idempotency_token is not None: - body["idempotency_token"] = self.idempotency_token + body["{idempotency_token}"] = self.idempotency_token if self.jar_params: - body["jar_params"] = [v for v in self.jar_params] + body["{jar_params}"] = [v for v in self.jar_params] if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.only: - body["only"] = [v for v in self.only] + body["{only}"] = [v for v in self.only] if self.performance_target is not None: - body["performance_target"] = self.performance_target.value + body["{performance_target}"] = self.performance_target.value if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params.as_dict() + body["{pipeline_params}"] = self.pipeline_params.as_dict() if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = [v for v in self.python_params] + body["{python_params}"] = [v for v in self.python_params] if self.queue: - body["queue"] = self.queue.as_dict() + body["{queue}"] = self.queue.as_dict() if self.spark_submit_params: - body["spark_submit_params"] = [v for v in self.spark_submit_params] + body["{spark_submit_params}"] = [v for v in self.spark_submit_params] if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body def as_shallow_dict(self) -> dict: """Serializes the RunNow into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["dbt_commands"] = self.dbt_commands + body["{dbt_commands}"] = self.dbt_commands if self.idempotency_token is not None: - body["idempotency_token"] = self.idempotency_token + body["{idempotency_token}"] = self.idempotency_token if self.jar_params: - body["jar_params"] = self.jar_params + body["{jar_params}"] = self.jar_params if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_parameters: - body["job_parameters"] = self.job_parameters + body["{job_parameters}"] = self.job_parameters if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.only: - body["only"] = self.only + body["{only}"] = self.only if self.performance_target is not None: - body["performance_target"] = self.performance_target + body["{performance_target}"] = self.performance_target if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params + body["{pipeline_params}"] = self.pipeline_params if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = self.python_params + body["{python_params}"] = self.python_params if self.queue: - body["queue"] = self.queue + body["{queue}"] = self.queue if self.spark_submit_params: - body["spark_submit_params"] = self.spark_submit_params + body["{spark_submit_params}"] = self.spark_submit_params if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunNow: """Deserializes the RunNow from a dictionary.""" return cls( - dbt_commands=d.get("dbt_commands", None), - idempotency_token=d.get("idempotency_token", None), - jar_params=d.get("jar_params", None), - job_id=d.get("job_id", None), - job_parameters=d.get("job_parameters", None), - notebook_params=d.get("notebook_params", None), - only=d.get("only", None), - performance_target=_enum(d, "performance_target", PerformanceTarget), - pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), - python_named_params=d.get("python_named_params", None), - python_params=d.get("python_params", None), - queue=_from_dict(d, "queue", QueueSettings), - spark_submit_params=d.get("spark_submit_params", None), - sql_params=d.get("sql_params", None), + dbt_commands=d.get("{dbt_commands}", None), + idempotency_token=d.get("{idempotency_token}", None), + jar_params=d.get("{jar_params}", None), + job_id=d.get("{job_id}", None), + job_parameters=d.get("{job_parameters}", None), + notebook_params=d.get("{notebook_params}", None), + only=d.get("{only}", None), + performance_target=_enum(d, "{performance_target}", PerformanceTarget), + pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), + python_named_params=d.get("{python_named_params}", None), + python_params=d.get("{python_params}", None), + queue=_from_dict(d, "{queue}", QueueSettings), + spark_submit_params=d.get("{spark_submit_params}", None), + sql_params=d.get("{sql_params}", None), ) @@ -6803,24 +6805,24 @@ def as_dict(self) -> dict: """Serializes the RunNowResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.number_in_job is not None: - body["number_in_job"] = self.number_in_job + body["{number_in_job}"] = self.number_in_job if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the RunNowResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.number_in_job is not None: - body["number_in_job"] = self.number_in_job + body["{number_in_job}"] = self.number_in_job if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunNowResponse: """Deserializes the RunNowResponse from a dictionary.""" - return cls(number_in_job=d.get("number_in_job", None), run_id=d.get("run_id", None)) + return cls(number_in_job=d.get("{number_in_job}", None), run_id=d.get("{run_id}", None)) @dataclass @@ -6875,54 +6877,54 @@ def as_dict(self) -> dict: """Serializes the RunOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms_notebook_output: - body["clean_rooms_notebook_output"] = self.clean_rooms_notebook_output.as_dict() + body["{clean_rooms_notebook_output}"] = self.clean_rooms_notebook_output.as_dict() if self.dbt_output: - body["dbt_output"] = self.dbt_output.as_dict() + body["{dbt_output}"] = self.dbt_output.as_dict() if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.error_trace is not None: - body["error_trace"] = self.error_trace + body["{error_trace}"] = self.error_trace if self.info is not None: - body["info"] = self.info + body["{info}"] = self.info if self.logs is not None: - body["logs"] = self.logs + body["{logs}"] = self.logs if self.logs_truncated is not None: - body["logs_truncated"] = self.logs_truncated + body["{logs_truncated}"] = self.logs_truncated if self.metadata: - body["metadata"] = self.metadata.as_dict() + body["{metadata}"] = self.metadata.as_dict() if self.notebook_output: - body["notebook_output"] = self.notebook_output.as_dict() + body["{notebook_output}"] = self.notebook_output.as_dict() if self.run_job_output: - body["run_job_output"] = self.run_job_output.as_dict() + body["{run_job_output}"] = self.run_job_output.as_dict() if self.sql_output: - body["sql_output"] = self.sql_output.as_dict() + body["{sql_output}"] = self.sql_output.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the RunOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms_notebook_output: - body["clean_rooms_notebook_output"] = self.clean_rooms_notebook_output + body["{clean_rooms_notebook_output}"] = self.clean_rooms_notebook_output if self.dbt_output: - body["dbt_output"] = self.dbt_output + body["{dbt_output}"] = self.dbt_output if self.error is not None: - body["error"] = self.error + body["{error}"] = self.error if self.error_trace is not None: - body["error_trace"] = self.error_trace + body["{error_trace}"] = self.error_trace if self.info is not None: - body["info"] = self.info + body["{info}"] = self.info if self.logs is not None: - body["logs"] = self.logs + body["{logs}"] = self.logs if self.logs_truncated is not None: - body["logs_truncated"] = self.logs_truncated + body["{logs_truncated}"] = self.logs_truncated if self.metadata: - body["metadata"] = self.metadata + body["{metadata}"] = self.metadata if self.notebook_output: - body["notebook_output"] = self.notebook_output + body["{notebook_output}"] = self.notebook_output if self.run_job_output: - body["run_job_output"] = self.run_job_output + body["{run_job_output}"] = self.run_job_output if self.sql_output: - body["sql_output"] = self.sql_output + body["{sql_output}"] = self.sql_output return body @classmethod @@ -6930,18 +6932,18 @@ def from_dict(cls, d: Dict[str, Any]) -> RunOutput: """Deserializes the RunOutput from a dictionary.""" return cls( clean_rooms_notebook_output=_from_dict( - d, "clean_rooms_notebook_output", CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput + d, "{clean_rooms_notebook_output}", CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput ), - dbt_output=_from_dict(d, "dbt_output", DbtOutput), - error=d.get("error", None), - error_trace=d.get("error_trace", None), - info=d.get("info", None), - logs=d.get("logs", None), - logs_truncated=d.get("logs_truncated", None), - metadata=_from_dict(d, "metadata", Run), - notebook_output=_from_dict(d, "notebook_output", NotebookOutput), - run_job_output=_from_dict(d, "run_job_output", RunJobOutput), - sql_output=_from_dict(d, "sql_output", SqlOutput), + dbt_output=_from_dict(d, "{dbt_output}", DbtOutput), + error=d.get("{error}", None), + error_trace=d.get("{error_trace}", None), + info=d.get("{info}", None), + logs=d.get("{logs}", None), + logs_truncated=d.get("{logs_truncated}", None), + metadata=_from_dict(d, "{metadata}", Run), + notebook_output=_from_dict(d, "{notebook_output}", NotebookOutput), + run_job_output=_from_dict(d, "{run_job_output}", RunJobOutput), + sql_output=_from_dict(d, "{sql_output}", SqlOutput), ) @@ -7025,56 +7027,56 @@ def as_dict(self) -> dict: """Serializes the RunParameters into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["dbt_commands"] = [v for v in self.dbt_commands] + body["{dbt_commands}"] = [v for v in self.dbt_commands] if self.jar_params: - body["jar_params"] = [v for v in self.jar_params] + body["{jar_params}"] = [v for v in self.jar_params] if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params.as_dict() + body["{pipeline_params}"] = self.pipeline_params.as_dict() if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = [v for v in self.python_params] + body["{python_params}"] = [v for v in self.python_params] if self.spark_submit_params: - body["spark_submit_params"] = [v for v in self.spark_submit_params] + body["{spark_submit_params}"] = [v for v in self.spark_submit_params] if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body def as_shallow_dict(self) -> dict: """Serializes the RunParameters into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["dbt_commands"] = self.dbt_commands + body["{dbt_commands}"] = self.dbt_commands if self.jar_params: - body["jar_params"] = self.jar_params + body["{jar_params}"] = self.jar_params if self.notebook_params: - body["notebook_params"] = self.notebook_params + body["{notebook_params}"] = self.notebook_params if self.pipeline_params: - body["pipeline_params"] = self.pipeline_params + body["{pipeline_params}"] = self.pipeline_params if self.python_named_params: - body["python_named_params"] = self.python_named_params + body["{python_named_params}"] = self.python_named_params if self.python_params: - body["python_params"] = self.python_params + body["{python_params}"] = self.python_params if self.spark_submit_params: - body["spark_submit_params"] = self.spark_submit_params + body["{spark_submit_params}"] = self.spark_submit_params if self.sql_params: - body["sql_params"] = self.sql_params + body["{sql_params}"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunParameters: """Deserializes the RunParameters from a dictionary.""" return cls( - dbt_commands=d.get("dbt_commands", None), - jar_params=d.get("jar_params", None), - notebook_params=d.get("notebook_params", None), - pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), - python_named_params=d.get("python_named_params", None), - python_params=d.get("python_params", None), - spark_submit_params=d.get("spark_submit_params", None), - sql_params=d.get("sql_params", None), + dbt_commands=d.get("{dbt_commands}", None), + jar_params=d.get("{jar_params}", None), + notebook_params=d.get("{notebook_params}", None), + pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), + python_named_params=d.get("{python_named_params}", None), + python_params=d.get("{python_params}", None), + spark_submit_params=d.get("{spark_submit_params}", None), + sql_params=d.get("{sql_params}", None), ) @@ -7127,41 +7129,41 @@ def as_dict(self) -> dict: """Serializes the RunState into a dictionary suitable for use as a JSON request body.""" body = {} if self.life_cycle_state is not None: - body["life_cycle_state"] = self.life_cycle_state.value + body["{life_cycle_state}"] = self.life_cycle_state.value if self.queue_reason is not None: - body["queue_reason"] = self.queue_reason + body["{queue_reason}"] = self.queue_reason if self.result_state is not None: - body["result_state"] = self.result_state.value + body["{result_state}"] = self.result_state.value if self.state_message is not None: - body["state_message"] = self.state_message + body["{state_message}"] = self.state_message if self.user_cancelled_or_timedout is not None: - body["user_cancelled_or_timedout"] = self.user_cancelled_or_timedout + body["{user_cancelled_or_timedout}"] = self.user_cancelled_or_timedout return body def as_shallow_dict(self) -> dict: """Serializes the RunState into a shallow dictionary of its immediate attributes.""" body = {} if self.life_cycle_state is not None: - body["life_cycle_state"] = self.life_cycle_state + body["{life_cycle_state}"] = self.life_cycle_state if self.queue_reason is not None: - body["queue_reason"] = self.queue_reason + body["{queue_reason}"] = self.queue_reason if self.result_state is not None: - body["result_state"] = self.result_state + body["{result_state}"] = self.result_state if self.state_message is not None: - body["state_message"] = self.state_message + body["{state_message}"] = self.state_message if self.user_cancelled_or_timedout is not None: - body["user_cancelled_or_timedout"] = self.user_cancelled_or_timedout + body["{user_cancelled_or_timedout}"] = self.user_cancelled_or_timedout return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunState: """Deserializes the RunState from a dictionary.""" return cls( - life_cycle_state=_enum(d, "life_cycle_state", RunLifeCycleState), - queue_reason=d.get("queue_reason", None), - result_state=_enum(d, "result_state", RunResultState), - state_message=d.get("state_message", None), - user_cancelled_or_timedout=d.get("user_cancelled_or_timedout", None), + life_cycle_state=_enum(d, "{life_cycle_state}", RunLifeCycleState), + queue_reason=d.get("{queue_reason}", None), + result_state=_enum(d, "{result_state}", RunResultState), + state_message=d.get("{state_message}", None), + user_cancelled_or_timedout=d.get("{user_cancelled_or_timedout}", None), ) @@ -7183,31 +7185,31 @@ def as_dict(self) -> dict: """Serializes the RunStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.queue_details: - body["queue_details"] = self.queue_details.as_dict() + body["{queue_details}"] = self.queue_details.as_dict() if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.termination_details: - body["termination_details"] = self.termination_details.as_dict() + body["{termination_details}"] = self.termination_details.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the RunStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.queue_details: - body["queue_details"] = self.queue_details + body["{queue_details}"] = self.queue_details if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.termination_details: - body["termination_details"] = self.termination_details + body["{termination_details}"] = self.termination_details return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunStatus: """Deserializes the RunStatus from a dictionary.""" return cls( - queue_details=_from_dict(d, "queue_details", QueueDetails), - state=_enum(d, "state", RunLifecycleStateV2State), - termination_details=_from_dict(d, "termination_details", TerminationDetails), + queue_details=_from_dict(d, "{queue_details}", QueueDetails), + state=_enum(d, "{state}", RunLifecycleStateV2State), + termination_details=_from_dict(d, "{termination_details}", TerminationDetails), ) @@ -7411,231 +7413,231 @@ def as_dict(self) -> dict: """Serializes the RunTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.attempt_number is not None: - body["attempt_number"] = self.attempt_number + body["{attempt_number}"] = self.attempt_number if self.clean_rooms_notebook_task: - body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() + body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task.as_dict() if self.cleanup_duration is not None: - body["cleanup_duration"] = self.cleanup_duration + body["{cleanup_duration}"] = self.cleanup_duration if self.cluster_instance: - body["cluster_instance"] = self.cluster_instance.as_dict() + body["{cluster_instance}"] = self.cluster_instance.as_dict() if self.condition_task: - body["condition_task"] = self.condition_task.as_dict() + body["{condition_task}"] = self.condition_task.as_dict() if self.dbt_task: - body["dbt_task"] = self.dbt_task.as_dict() + body["{dbt_task}"] = self.dbt_task.as_dict() if self.depends_on: - body["depends_on"] = [v.as_dict() for v in self.depends_on] + body["{depends_on}"] = [v.as_dict() for v in self.depends_on] if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.disabled is not None: - body["disabled"] = self.disabled + body["{disabled}"] = self.disabled if self.effective_performance_target is not None: - body["effective_performance_target"] = self.effective_performance_target.value + body["{effective_performance_target}"] = self.effective_performance_target.value if self.email_notifications: - body["email_notifications"] = self.email_notifications.as_dict() + body["{email_notifications}"] = self.email_notifications.as_dict() if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.execution_duration is not None: - body["execution_duration"] = self.execution_duration + body["{execution_duration}"] = self.execution_duration if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.for_each_task: - body["for_each_task"] = self.for_each_task.as_dict() + body["{for_each_task}"] = self.for_each_task.as_dict() if self.gen_ai_compute_task: - body["gen_ai_compute_task"] = self.gen_ai_compute_task.as_dict() + body["{gen_ai_compute_task}"] = self.gen_ai_compute_task.as_dict() if self.git_source: - body["git_source"] = self.git_source.as_dict() + body["{git_source}"] = self.git_source.as_dict() if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.new_cluster: - body["new_cluster"] = self.new_cluster.as_dict() + body["{new_cluster}"] = self.new_cluster.as_dict() if self.notebook_task: - body["notebook_task"] = self.notebook_task.as_dict() + body["{notebook_task}"] = self.notebook_task.as_dict() if self.notification_settings: - body["notification_settings"] = self.notification_settings.as_dict() + body["{notification_settings}"] = self.notification_settings.as_dict() if self.pipeline_task: - body["pipeline_task"] = self.pipeline_task.as_dict() + body["{pipeline_task}"] = self.pipeline_task.as_dict() if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task.as_dict() + body["{python_wheel_task}"] = self.python_wheel_task.as_dict() if self.queue_duration is not None: - body["queue_duration"] = self.queue_duration + body["{queue_duration}"] = self.queue_duration if self.resolved_values: - body["resolved_values"] = self.resolved_values.as_dict() + body["{resolved_values}"] = self.resolved_values.as_dict() if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_if is not None: - body["run_if"] = self.run_if.value + body["{run_if}"] = self.run_if.value if self.run_job_task: - body["run_job_task"] = self.run_job_task.as_dict() + body["{run_job_task}"] = self.run_job_task.as_dict() if self.run_page_url is not None: - body["run_page_url"] = self.run_page_url + body["{run_page_url}"] = self.run_page_url if self.setup_duration is not None: - body["setup_duration"] = self.setup_duration + body["{setup_duration}"] = self.setup_duration if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task.as_dict() + body["{spark_jar_task}"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task.as_dict() + body["{spark_python_task}"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task.as_dict() + body["{spark_submit_task}"] = self.spark_submit_task.as_dict() if self.sql_task: - body["sql_task"] = self.sql_task.as_dict() + body["{sql_task}"] = self.sql_task.as_dict() if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications.as_dict() + body["{webhook_notifications}"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the RunTask into a shallow dictionary of its immediate attributes.""" body = {} if self.attempt_number is not None: - body["attempt_number"] = self.attempt_number + body["{attempt_number}"] = self.attempt_number if self.clean_rooms_notebook_task: - body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task + body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task if self.cleanup_duration is not None: - body["cleanup_duration"] = self.cleanup_duration + body["{cleanup_duration}"] = self.cleanup_duration if self.cluster_instance: - body["cluster_instance"] = self.cluster_instance + body["{cluster_instance}"] = self.cluster_instance if self.condition_task: - body["condition_task"] = self.condition_task + body["{condition_task}"] = self.condition_task if self.dbt_task: - body["dbt_task"] = self.dbt_task + body["{dbt_task}"] = self.dbt_task if self.depends_on: - body["depends_on"] = self.depends_on + body["{depends_on}"] = self.depends_on if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.disabled is not None: - body["disabled"] = self.disabled + body["{disabled}"] = self.disabled if self.effective_performance_target is not None: - body["effective_performance_target"] = self.effective_performance_target + body["{effective_performance_target}"] = self.effective_performance_target if self.email_notifications: - body["email_notifications"] = self.email_notifications + body["{email_notifications}"] = self.email_notifications if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.execution_duration is not None: - body["execution_duration"] = self.execution_duration + body["{execution_duration}"] = self.execution_duration if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.for_each_task: - body["for_each_task"] = self.for_each_task + body["{for_each_task}"] = self.for_each_task if self.gen_ai_compute_task: - body["gen_ai_compute_task"] = self.gen_ai_compute_task + body["{gen_ai_compute_task}"] = self.gen_ai_compute_task if self.git_source: - body["git_source"] = self.git_source + body["{git_source}"] = self.git_source if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.new_cluster: - body["new_cluster"] = self.new_cluster + body["{new_cluster}"] = self.new_cluster if self.notebook_task: - body["notebook_task"] = self.notebook_task + body["{notebook_task}"] = self.notebook_task if self.notification_settings: - body["notification_settings"] = self.notification_settings + body["{notification_settings}"] = self.notification_settings if self.pipeline_task: - body["pipeline_task"] = self.pipeline_task + body["{pipeline_task}"] = self.pipeline_task if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task + body["{python_wheel_task}"] = self.python_wheel_task if self.queue_duration is not None: - body["queue_duration"] = self.queue_duration + body["{queue_duration}"] = self.queue_duration if self.resolved_values: - body["resolved_values"] = self.resolved_values + body["{resolved_values}"] = self.resolved_values if self.run_duration is not None: - body["run_duration"] = self.run_duration + body["{run_duration}"] = self.run_duration if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_if is not None: - body["run_if"] = self.run_if + body["{run_if}"] = self.run_if if self.run_job_task: - body["run_job_task"] = self.run_job_task + body["{run_job_task}"] = self.run_job_task if self.run_page_url is not None: - body["run_page_url"] = self.run_page_url + body["{run_page_url}"] = self.run_page_url if self.setup_duration is not None: - body["setup_duration"] = self.setup_duration + body["{setup_duration}"] = self.setup_duration if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task + body["{spark_jar_task}"] = self.spark_jar_task if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task + body["{spark_python_task}"] = self.spark_python_task if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task + body["{spark_submit_task}"] = self.spark_submit_task if self.sql_task: - body["sql_task"] = self.sql_task + body["{sql_task}"] = self.sql_task if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.status: - body["status"] = self.status + body["{status}"] = self.status if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications + body["{webhook_notifications}"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunTask: """Deserializes the RunTask from a dictionary.""" return cls( - attempt_number=d.get("attempt_number", None), - clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), - cleanup_duration=d.get("cleanup_duration", None), - cluster_instance=_from_dict(d, "cluster_instance", ClusterInstance), - condition_task=_from_dict(d, "condition_task", RunConditionTask), - dbt_task=_from_dict(d, "dbt_task", DbtTask), - depends_on=_repeated_dict(d, "depends_on", TaskDependency), - description=d.get("description", None), - disabled=d.get("disabled", None), - effective_performance_target=_enum(d, "effective_performance_target", PerformanceTarget), - email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), - end_time=d.get("end_time", None), - environment_key=d.get("environment_key", None), - execution_duration=d.get("execution_duration", None), - existing_cluster_id=d.get("existing_cluster_id", None), - for_each_task=_from_dict(d, "for_each_task", RunForEachTask), - gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), - git_source=_from_dict(d, "git_source", GitSource), - job_cluster_key=d.get("job_cluster_key", None), - libraries=_repeated_dict(d, "libraries", Library), - new_cluster=_from_dict(d, "new_cluster", ClusterSpec), - notebook_task=_from_dict(d, "notebook_task", NotebookTask), - notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), - pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), - python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), - queue_duration=d.get("queue_duration", None), - resolved_values=_from_dict(d, "resolved_values", ResolvedValues), - run_duration=d.get("run_duration", None), - run_id=d.get("run_id", None), - run_if=_enum(d, "run_if", RunIf), - run_job_task=_from_dict(d, "run_job_task", RunJobTask), - run_page_url=d.get("run_page_url", None), - setup_duration=d.get("setup_duration", None), - spark_jar_task=_from_dict(d, "spark_jar_task", SparkJarTask), - spark_python_task=_from_dict(d, "spark_python_task", SparkPythonTask), - spark_submit_task=_from_dict(d, "spark_submit_task", SparkSubmitTask), - sql_task=_from_dict(d, "sql_task", SqlTask), - start_time=d.get("start_time", None), - state=_from_dict(d, "state", RunState), - status=_from_dict(d, "status", RunStatus), - task_key=d.get("task_key", None), - timeout_seconds=d.get("timeout_seconds", None), - webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), + attempt_number=d.get("{attempt_number}", None), + clean_rooms_notebook_task=_from_dict(d, "{clean_rooms_notebook_task}", CleanRoomsNotebookTask), + cleanup_duration=d.get("{cleanup_duration}", None), + cluster_instance=_from_dict(d, "{cluster_instance}", ClusterInstance), + condition_task=_from_dict(d, "{condition_task}", RunConditionTask), + dbt_task=_from_dict(d, "{dbt_task}", DbtTask), + depends_on=_repeated_dict(d, "{depends_on}", TaskDependency), + description=d.get("{description}", None), + disabled=d.get("{disabled}", None), + effective_performance_target=_enum(d, "{effective_performance_target}", PerformanceTarget), + email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), + end_time=d.get("{end_time}", None), + environment_key=d.get("{environment_key}", None), + execution_duration=d.get("{execution_duration}", None), + existing_cluster_id=d.get("{existing_cluster_id}", None), + for_each_task=_from_dict(d, "{for_each_task}", RunForEachTask), + gen_ai_compute_task=_from_dict(d, "{gen_ai_compute_task}", GenAiComputeTask), + git_source=_from_dict(d, "{git_source}", GitSource), + job_cluster_key=d.get("{job_cluster_key}", None), + libraries=_repeated_dict(d, "{libraries}", Library), + new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), + notebook_task=_from_dict(d, "{notebook_task}", NotebookTask), + notification_settings=_from_dict(d, "{notification_settings}", TaskNotificationSettings), + pipeline_task=_from_dict(d, "{pipeline_task}", PipelineTask), + python_wheel_task=_from_dict(d, "{python_wheel_task}", PythonWheelTask), + queue_duration=d.get("{queue_duration}", None), + resolved_values=_from_dict(d, "{resolved_values}", ResolvedValues), + run_duration=d.get("{run_duration}", None), + run_id=d.get("{run_id}", None), + run_if=_enum(d, "{run_if}", RunIf), + run_job_task=_from_dict(d, "{run_job_task}", RunJobTask), + run_page_url=d.get("{run_page_url}", None), + setup_duration=d.get("{setup_duration}", None), + spark_jar_task=_from_dict(d, "{spark_jar_task}", SparkJarTask), + spark_python_task=_from_dict(d, "{spark_python_task}", SparkPythonTask), + spark_submit_task=_from_dict(d, "{spark_submit_task}", SparkSubmitTask), + sql_task=_from_dict(d, "{sql_task}", SqlTask), + start_time=d.get("{start_time}", None), + state=_from_dict(d, "{state}", RunState), + status=_from_dict(d, "{status}", RunStatus), + task_key=d.get("{task_key}", None), + timeout_seconds=d.get("{timeout_seconds}", None), + webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), ) @@ -7699,51 +7701,51 @@ def as_dict(self) -> dict: """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl + body["{canned_acl}"] = self.canned_acl if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption + body["{enable_encryption}"] = self.enable_encryption if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type + body["{encryption_type}"] = self.encryption_type if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.kms_key is not None: - body["kms_key"] = self.kms_key + body["{kms_key}"] = self.kms_key if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl + body["{canned_acl}"] = self.canned_acl if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption + body["{enable_encryption}"] = self.enable_encryption if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type + body["{encryption_type}"] = self.encryption_type if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.kms_key is not None: - body["kms_key"] = self.kms_key + body["{kms_key}"] = self.kms_key if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: """Deserializes the S3StorageInfo from a dictionary.""" return cls( - canned_acl=d.get("canned_acl", None), - destination=d.get("destination", None), - enable_encryption=d.get("enable_encryption", None), - encryption_type=d.get("encryption_type", None), - endpoint=d.get("endpoint", None), - kms_key=d.get("kms_key", None), - region=d.get("region", None), + canned_acl=d.get("{canned_acl}", None), + destination=d.get("{destination}", None), + enable_encryption=d.get("{enable_encryption}", None), + encryption_type=d.get("{encryption_type}", None), + endpoint=d.get("{endpoint}", None), + kms_key=d.get("{kms_key}", None), + region=d.get("{region}", None), ) @@ -7787,36 +7789,36 @@ def as_dict(self) -> dict: """Serializes the SparkJarTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.jar_uri is not None: - body["jar_uri"] = self.jar_uri + body["{jar_uri}"] = self.jar_uri if self.main_class_name is not None: - body["main_class_name"] = self.main_class_name + body["{main_class_name}"] = self.main_class_name if self.parameters: - body["parameters"] = [v for v in self.parameters] + body["{parameters}"] = [v for v in self.parameters] if self.run_as_repl is not None: - body["run_as_repl"] = self.run_as_repl + body["{run_as_repl}"] = self.run_as_repl return body def as_shallow_dict(self) -> dict: """Serializes the SparkJarTask into a shallow dictionary of its immediate attributes.""" body = {} if self.jar_uri is not None: - body["jar_uri"] = self.jar_uri + body["{jar_uri}"] = self.jar_uri if self.main_class_name is not None: - body["main_class_name"] = self.main_class_name + body["{main_class_name}"] = self.main_class_name if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.run_as_repl is not None: - body["run_as_repl"] = self.run_as_repl + body["{run_as_repl}"] = self.run_as_repl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkJarTask: """Deserializes the SparkJarTask from a dictionary.""" return cls( - jar_uri=d.get("jar_uri", None), - main_class_name=d.get("main_class_name", None), - parameters=d.get("parameters", None), - run_as_repl=d.get("run_as_repl", None), + jar_uri=d.get("{jar_uri}", None), + main_class_name=d.get("{main_class_name}", None), + parameters=d.get("{parameters}", None), + run_as_repl=d.get("{run_as_repl}", None), ) @@ -7848,31 +7850,31 @@ def as_dict(self) -> dict: """Serializes the SparkPythonTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["parameters"] = [v for v in self.parameters] + body["{parameters}"] = [v for v in self.parameters] if self.python_file is not None: - body["python_file"] = self.python_file + body["{python_file}"] = self.python_file if self.source is not None: - body["source"] = self.source.value + body["{source}"] = self.source.value return body def as_shallow_dict(self) -> dict: """Serializes the SparkPythonTask into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.python_file is not None: - body["python_file"] = self.python_file + body["{python_file}"] = self.python_file if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkPythonTask: """Deserializes the SparkPythonTask from a dictionary.""" return cls( - parameters=d.get("parameters", None), - python_file=d.get("python_file", None), - source=_enum(d, "source", Source), + parameters=d.get("{parameters}", None), + python_file=d.get("{python_file}", None), + source=_enum(d, "{source}", Source), ) @@ -7889,20 +7891,20 @@ def as_dict(self) -> dict: """Serializes the SparkSubmitTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["parameters"] = [v for v in self.parameters] + body["{parameters}"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: """Serializes the SparkSubmitTask into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkSubmitTask: """Deserializes the SparkSubmitTask from a dictionary.""" - return cls(parameters=d.get("parameters", None)) + return cls(parameters=d.get("{parameters}", None)) @dataclass @@ -7930,41 +7932,41 @@ def as_dict(self) -> dict: """Serializes the SqlAlertOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_state is not None: - body["alert_state"] = self.alert_state.value + body["{alert_state}"] = self.alert_state.value if self.output_link is not None: - body["output_link"] = self.output_link + body["{output_link}"] = self.output_link if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.sql_statements: - body["sql_statements"] = [v.as_dict() for v in self.sql_statements] + body["{sql_statements}"] = [v.as_dict() for v in self.sql_statements] if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the SqlAlertOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_state is not None: - body["alert_state"] = self.alert_state + body["{alert_state}"] = self.alert_state if self.output_link is not None: - body["output_link"] = self.output_link + body["{output_link}"] = self.output_link if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.sql_statements: - body["sql_statements"] = self.sql_statements + body["{sql_statements}"] = self.sql_statements if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlAlertOutput: """Deserializes the SqlAlertOutput from a dictionary.""" return cls( - alert_state=_enum(d, "alert_state", SqlAlertState), - output_link=d.get("output_link", None), - query_text=d.get("query_text", None), - sql_statements=_repeated_dict(d, "sql_statements", SqlStatementOutput), - warehouse_id=d.get("warehouse_id", None), + alert_state=_enum(d, "{alert_state}", SqlAlertState), + output_link=d.get("{output_link}", None), + query_text=d.get("{query_text}", None), + sql_statements=_repeated_dict(d, "{sql_statements}", SqlStatementOutput), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -7991,25 +7993,25 @@ def as_dict(self) -> dict: """Serializes the SqlDashboardOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id if self.widgets: - body["widgets"] = [v.as_dict() for v in self.widgets] + body["{widgets}"] = [v.as_dict() for v in self.widgets] return body def as_shallow_dict(self) -> dict: """Serializes the SqlDashboardOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id if self.widgets: - body["widgets"] = self.widgets + body["{widgets}"] = self.widgets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlDashboardOutput: """Deserializes the SqlDashboardOutput from a dictionary.""" return cls( - warehouse_id=d.get("warehouse_id", None), widgets=_repeated_dict(d, "widgets", SqlDashboardWidgetOutput) + warehouse_id=d.get("{warehouse_id}", None), widgets=_repeated_dict(d, "{widgets}", SqlDashboardWidgetOutput) ) @@ -8040,51 +8042,51 @@ def as_dict(self) -> dict: """Serializes the SqlDashboardWidgetOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.error: - body["error"] = self.error.as_dict() + body["{error}"] = self.error.as_dict() if self.output_link is not None: - body["output_link"] = self.output_link + body["{output_link}"] = self.output_link if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.widget_id is not None: - body["widget_id"] = self.widget_id + body["{widget_id}"] = self.widget_id if self.widget_title is not None: - body["widget_title"] = self.widget_title + body["{widget_title}"] = self.widget_title return body def as_shallow_dict(self) -> dict: """Serializes the SqlDashboardWidgetOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.error: - body["error"] = self.error + body["{error}"] = self.error if self.output_link is not None: - body["output_link"] = self.output_link + body["{output_link}"] = self.output_link if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.widget_id is not None: - body["widget_id"] = self.widget_id + body["{widget_id}"] = self.widget_id if self.widget_title is not None: - body["widget_title"] = self.widget_title + body["{widget_title}"] = self.widget_title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlDashboardWidgetOutput: """Deserializes the SqlDashboardWidgetOutput from a dictionary.""" return cls( - end_time=d.get("end_time", None), - error=_from_dict(d, "error", SqlOutputError), - output_link=d.get("output_link", None), - start_time=d.get("start_time", None), - status=_enum(d, "status", SqlDashboardWidgetOutputStatus), - widget_id=d.get("widget_id", None), - widget_title=d.get("widget_title", None), + end_time=d.get("{end_time}", None), + error=_from_dict(d, "{error}", SqlOutputError), + output_link=d.get("{output_link}", None), + start_time=d.get("{start_time}", None), + status=_enum(d, "{status}", SqlDashboardWidgetOutputStatus), + widget_id=d.get("{widget_id}", None), + widget_title=d.get("{widget_title}", None), ) @@ -8112,31 +8114,31 @@ def as_dict(self) -> dict: """Serializes the SqlOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_output: - body["alert_output"] = self.alert_output.as_dict() + body["{alert_output}"] = self.alert_output.as_dict() if self.dashboard_output: - body["dashboard_output"] = self.dashboard_output.as_dict() + body["{dashboard_output}"] = self.dashboard_output.as_dict() if self.query_output: - body["query_output"] = self.query_output.as_dict() + body["{query_output}"] = self.query_output.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the SqlOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_output: - body["alert_output"] = self.alert_output + body["{alert_output}"] = self.alert_output if self.dashboard_output: - body["dashboard_output"] = self.dashboard_output + body["{dashboard_output}"] = self.dashboard_output if self.query_output: - body["query_output"] = self.query_output + body["{query_output}"] = self.query_output return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlOutput: """Deserializes the SqlOutput from a dictionary.""" return cls( - alert_output=_from_dict(d, "alert_output", SqlAlertOutput), - dashboard_output=_from_dict(d, "dashboard_output", SqlDashboardOutput), - query_output=_from_dict(d, "query_output", SqlQueryOutput), + alert_output=_from_dict(d, "{alert_output}", SqlAlertOutput), + dashboard_output=_from_dict(d, "{dashboard_output}", SqlDashboardOutput), + query_output=_from_dict(d, "{query_output}", SqlQueryOutput), ) @@ -8149,20 +8151,20 @@ def as_dict(self) -> dict: """Serializes the SqlOutputError into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body def as_shallow_dict(self) -> dict: """Serializes the SqlOutputError into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlOutputError: """Deserializes the SqlOutputError from a dictionary.""" - return cls(message=d.get("message", None)) + return cls(message=d.get("{message}", None)) @dataclass @@ -8185,41 +8187,41 @@ def as_dict(self) -> dict: """Serializes the SqlQueryOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_id is not None: - body["endpoint_id"] = self.endpoint_id + body["{endpoint_id}"] = self.endpoint_id if self.output_link is not None: - body["output_link"] = self.output_link + body["{output_link}"] = self.output_link if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.sql_statements: - body["sql_statements"] = [v.as_dict() for v in self.sql_statements] + body["{sql_statements}"] = [v.as_dict() for v in self.sql_statements] if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the SqlQueryOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_id is not None: - body["endpoint_id"] = self.endpoint_id + body["{endpoint_id}"] = self.endpoint_id if self.output_link is not None: - body["output_link"] = self.output_link + body["{output_link}"] = self.output_link if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.sql_statements: - body["sql_statements"] = self.sql_statements + body["{sql_statements}"] = self.sql_statements if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlQueryOutput: """Deserializes the SqlQueryOutput from a dictionary.""" return cls( - endpoint_id=d.get("endpoint_id", None), - output_link=d.get("output_link", None), - query_text=d.get("query_text", None), - sql_statements=_repeated_dict(d, "sql_statements", SqlStatementOutput), - warehouse_id=d.get("warehouse_id", None), + endpoint_id=d.get("{endpoint_id}", None), + output_link=d.get("{output_link}", None), + query_text=d.get("{query_text}", None), + sql_statements=_repeated_dict(d, "{sql_statements}", SqlStatementOutput), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -8232,20 +8234,20 @@ def as_dict(self) -> dict: """Serializes the SqlStatementOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.lookup_key is not None: - body["lookup_key"] = self.lookup_key + body["{lookup_key}"] = self.lookup_key return body def as_shallow_dict(self) -> dict: """Serializes the SqlStatementOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.lookup_key is not None: - body["lookup_key"] = self.lookup_key + body["{lookup_key}"] = self.lookup_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlStatementOutput: """Deserializes the SqlStatementOutput from a dictionary.""" - return cls(lookup_key=d.get("lookup_key", None)) + return cls(lookup_key=d.get("{lookup_key}", None)) @dataclass @@ -8275,46 +8277,46 @@ def as_dict(self) -> dict: """Serializes the SqlTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert: - body["alert"] = self.alert.as_dict() + body["{alert}"] = self.alert.as_dict() if self.dashboard: - body["dashboard"] = self.dashboard.as_dict() + body["{dashboard}"] = self.dashboard.as_dict() if self.file: - body["file"] = self.file.as_dict() + body["{file}"] = self.file.as_dict() if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.query: - body["query"] = self.query.as_dict() + body["{query}"] = self.query.as_dict() if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the SqlTask into a shallow dictionary of its immediate attributes.""" body = {} if self.alert: - body["alert"] = self.alert + body["{alert}"] = self.alert if self.dashboard: - body["dashboard"] = self.dashboard + body["{dashboard}"] = self.dashboard if self.file: - body["file"] = self.file + body["{file}"] = self.file if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.query: - body["query"] = self.query + body["{query}"] = self.query if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTask: """Deserializes the SqlTask from a dictionary.""" return cls( - alert=_from_dict(d, "alert", SqlTaskAlert), - dashboard=_from_dict(d, "dashboard", SqlTaskDashboard), - file=_from_dict(d, "file", SqlTaskFile), - parameters=d.get("parameters", None), - query=_from_dict(d, "query", SqlTaskQuery), - warehouse_id=d.get("warehouse_id", None), + alert=_from_dict(d, "{alert}", SqlTaskAlert), + dashboard=_from_dict(d, "{dashboard}", SqlTaskDashboard), + file=_from_dict(d, "{file}", SqlTaskFile), + parameters=d.get("{parameters}", None), + query=_from_dict(d, "{query}", SqlTaskQuery), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -8333,31 +8335,31 @@ def as_dict(self) -> dict: """Serializes the SqlTaskAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_id is not None: - body["alert_id"] = self.alert_id + body["{alert_id}"] = self.alert_id if self.pause_subscriptions is not None: - body["pause_subscriptions"] = self.pause_subscriptions + body["{pause_subscriptions}"] = self.pause_subscriptions if self.subscriptions: - body["subscriptions"] = [v.as_dict() for v in self.subscriptions] + body["{subscriptions}"] = [v.as_dict() for v in self.subscriptions] return body def as_shallow_dict(self) -> dict: """Serializes the SqlTaskAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_id is not None: - body["alert_id"] = self.alert_id + body["{alert_id}"] = self.alert_id if self.pause_subscriptions is not None: - body["pause_subscriptions"] = self.pause_subscriptions + body["{pause_subscriptions}"] = self.pause_subscriptions if self.subscriptions: - body["subscriptions"] = self.subscriptions + body["{subscriptions}"] = self.subscriptions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskAlert: """Deserializes the SqlTaskAlert from a dictionary.""" return cls( - alert_id=d.get("alert_id", None), - pause_subscriptions=d.get("pause_subscriptions", None), - subscriptions=_repeated_dict(d, "subscriptions", SqlTaskSubscription), + alert_id=d.get("{alert_id}", None), + pause_subscriptions=d.get("{pause_subscriptions}", None), + subscriptions=_repeated_dict(d, "{subscriptions}", SqlTaskSubscription), ) @@ -8379,36 +8381,36 @@ def as_dict(self) -> dict: """Serializes the SqlTaskDashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.pause_subscriptions is not None: - body["pause_subscriptions"] = self.pause_subscriptions + body["{pause_subscriptions}"] = self.pause_subscriptions if self.subscriptions: - body["subscriptions"] = [v.as_dict() for v in self.subscriptions] + body["{subscriptions}"] = [v.as_dict() for v in self.subscriptions] return body def as_shallow_dict(self) -> dict: """Serializes the SqlTaskDashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.pause_subscriptions is not None: - body["pause_subscriptions"] = self.pause_subscriptions + body["{pause_subscriptions}"] = self.pause_subscriptions if self.subscriptions: - body["subscriptions"] = self.subscriptions + body["{subscriptions}"] = self.subscriptions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskDashboard: """Deserializes the SqlTaskDashboard from a dictionary.""" return cls( - custom_subject=d.get("custom_subject", None), - dashboard_id=d.get("dashboard_id", None), - pause_subscriptions=d.get("pause_subscriptions", None), - subscriptions=_repeated_dict(d, "subscriptions", SqlTaskSubscription), + custom_subject=d.get("{custom_subject}", None), + dashboard_id=d.get("{dashboard_id}", None), + pause_subscriptions=d.get("{pause_subscriptions}", None), + subscriptions=_repeated_dict(d, "{subscriptions}", SqlTaskSubscription), ) @@ -8431,24 +8433,24 @@ def as_dict(self) -> dict: """Serializes the SqlTaskFile into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.source is not None: - body["source"] = self.source.value + body["{source}"] = self.source.value return body def as_shallow_dict(self) -> dict: """Serializes the SqlTaskFile into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskFile: """Deserializes the SqlTaskFile from a dictionary.""" - return cls(path=d.get("path", None), source=_enum(d, "source", Source)) + return cls(path=d.get("{path}", None), source=_enum(d, "{source}", Source)) @dataclass @@ -8460,20 +8462,20 @@ def as_dict(self) -> dict: """Serializes the SqlTaskQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id return body def as_shallow_dict(self) -> dict: """Serializes the SqlTaskQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskQuery: """Deserializes the SqlTaskQuery from a dictionary.""" - return cls(query_id=d.get("query_id", None)) + return cls(query_id=d.get("{query_id}", None)) @dataclass @@ -8491,24 +8493,24 @@ def as_dict(self) -> dict: """Serializes the SqlTaskSubscription into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_id is not None: - body["destination_id"] = self.destination_id + body["{destination_id}"] = self.destination_id if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the SqlTaskSubscription into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_id is not None: - body["destination_id"] = self.destination_id + body["{destination_id}"] = self.destination_id if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskSubscription: """Deserializes the SqlTaskSubscription from a dictionary.""" - return cls(destination_id=d.get("destination_id", None), user_name=d.get("user_name", None)) + return cls(destination_id=d.get("{destination_id}", None), user_name=d.get("{user_name}", None)) @dataclass @@ -8579,86 +8581,86 @@ def as_dict(self) -> dict: """Serializes the SubmitRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.email_notifications: - body["email_notifications"] = self.email_notifications.as_dict() + body["{email_notifications}"] = self.email_notifications.as_dict() if self.environments: - body["environments"] = [v.as_dict() for v in self.environments] + body["{environments}"] = [v.as_dict() for v in self.environments] if self.git_source: - body["git_source"] = self.git_source.as_dict() + body["{git_source}"] = self.git_source.as_dict() if self.health: - body["health"] = self.health.as_dict() + body["{health}"] = self.health.as_dict() if self.idempotency_token is not None: - body["idempotency_token"] = self.idempotency_token + body["{idempotency_token}"] = self.idempotency_token if self.notification_settings: - body["notification_settings"] = self.notification_settings.as_dict() + body["{notification_settings}"] = self.notification_settings.as_dict() if self.queue: - body["queue"] = self.queue.as_dict() + body["{queue}"] = self.queue.as_dict() if self.run_as: - body["run_as"] = self.run_as.as_dict() + body["{run_as}"] = self.run_as.as_dict() if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.tasks: - body["tasks"] = [v.as_dict() for v in self.tasks] + body["{tasks}"] = [v.as_dict() for v in self.tasks] if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications.as_dict() + body["{webhook_notifications}"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the SubmitRun into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.email_notifications: - body["email_notifications"] = self.email_notifications + body["{email_notifications}"] = self.email_notifications if self.environments: - body["environments"] = self.environments + body["{environments}"] = self.environments if self.git_source: - body["git_source"] = self.git_source + body["{git_source}"] = self.git_source if self.health: - body["health"] = self.health + body["{health}"] = self.health if self.idempotency_token is not None: - body["idempotency_token"] = self.idempotency_token + body["{idempotency_token}"] = self.idempotency_token if self.notification_settings: - body["notification_settings"] = self.notification_settings + body["{notification_settings}"] = self.notification_settings if self.queue: - body["queue"] = self.queue + body["{queue}"] = self.queue if self.run_as: - body["run_as"] = self.run_as + body["{run_as}"] = self.run_as if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.tasks: - body["tasks"] = self.tasks + body["{tasks}"] = self.tasks if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications + body["{webhook_notifications}"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubmitRun: """Deserializes the SubmitRun from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlRequest), - budget_policy_id=d.get("budget_policy_id", None), - email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), - environments=_repeated_dict(d, "environments", JobEnvironment), - git_source=_from_dict(d, "git_source", GitSource), - health=_from_dict(d, "health", JobsHealthRules), - idempotency_token=d.get("idempotency_token", None), - notification_settings=_from_dict(d, "notification_settings", JobNotificationSettings), - queue=_from_dict(d, "queue", QueueSettings), - run_as=_from_dict(d, "run_as", JobRunAs), - run_name=d.get("run_name", None), - tasks=_repeated_dict(d, "tasks", SubmitTask), - timeout_seconds=d.get("timeout_seconds", None), - webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), + access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlRequest), + budget_policy_id=d.get("{budget_policy_id}", None), + email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), + environments=_repeated_dict(d, "{environments}", JobEnvironment), + git_source=_from_dict(d, "{git_source}", GitSource), + health=_from_dict(d, "{health}", JobsHealthRules), + idempotency_token=d.get("{idempotency_token}", None), + notification_settings=_from_dict(d, "{notification_settings}", JobNotificationSettings), + queue=_from_dict(d, "{queue}", QueueSettings), + run_as=_from_dict(d, "{run_as}", JobRunAs), + run_name=d.get("{run_name}", None), + tasks=_repeated_dict(d, "{tasks}", SubmitTask), + timeout_seconds=d.get("{timeout_seconds}", None), + webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), ) @@ -8673,20 +8675,20 @@ def as_dict(self) -> dict: """Serializes the SubmitRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the SubmitRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubmitRunResponse: """Deserializes the SubmitRunResponse from a dictionary.""" - return cls(run_id=d.get("run_id", None)) + return cls(run_id=d.get("{run_id}", None)) @dataclass @@ -8745,7 +8747,7 @@ class SubmitTask: """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[JobsClusterSpec] = None + new_cluster: Optional[ClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8809,146 +8811,146 @@ def as_dict(self) -> dict: """Serializes the SubmitTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms_notebook_task: - body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() + body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task.as_dict() if self.condition_task: - body["condition_task"] = self.condition_task.as_dict() + body["{condition_task}"] = self.condition_task.as_dict() if self.dbt_task: - body["dbt_task"] = self.dbt_task.as_dict() + body["{dbt_task}"] = self.dbt_task.as_dict() if self.depends_on: - body["depends_on"] = [v.as_dict() for v in self.depends_on] + body["{depends_on}"] = [v.as_dict() for v in self.depends_on] if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.email_notifications: - body["email_notifications"] = self.email_notifications.as_dict() + body["{email_notifications}"] = self.email_notifications.as_dict() if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.for_each_task: - body["for_each_task"] = self.for_each_task.as_dict() + body["{for_each_task}"] = self.for_each_task.as_dict() if self.gen_ai_compute_task: - body["gen_ai_compute_task"] = self.gen_ai_compute_task.as_dict() + body["{gen_ai_compute_task}"] = self.gen_ai_compute_task.as_dict() if self.health: - body["health"] = self.health.as_dict() + body["{health}"] = self.health.as_dict() if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.new_cluster: - body["new_cluster"] = self.new_cluster.as_dict() + body["{new_cluster}"] = self.new_cluster.as_dict() if self.notebook_task: - body["notebook_task"] = self.notebook_task.as_dict() + body["{notebook_task}"] = self.notebook_task.as_dict() if self.notification_settings: - body["notification_settings"] = self.notification_settings.as_dict() + body["{notification_settings}"] = self.notification_settings.as_dict() if self.pipeline_task: - body["pipeline_task"] = self.pipeline_task.as_dict() + body["{pipeline_task}"] = self.pipeline_task.as_dict() if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task.as_dict() + body["{python_wheel_task}"] = self.python_wheel_task.as_dict() if self.run_if is not None: - body["run_if"] = self.run_if.value + body["{run_if}"] = self.run_if.value if self.run_job_task: - body["run_job_task"] = self.run_job_task.as_dict() + body["{run_job_task}"] = self.run_job_task.as_dict() if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task.as_dict() + body["{spark_jar_task}"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task.as_dict() + body["{spark_python_task}"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task.as_dict() + body["{spark_submit_task}"] = self.spark_submit_task.as_dict() if self.sql_task: - body["sql_task"] = self.sql_task.as_dict() + body["{sql_task}"] = self.sql_task.as_dict() if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications.as_dict() + body["{webhook_notifications}"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the SubmitTask into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms_notebook_task: - body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task + body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task if self.condition_task: - body["condition_task"] = self.condition_task + body["{condition_task}"] = self.condition_task if self.dbt_task: - body["dbt_task"] = self.dbt_task + body["{dbt_task}"] = self.dbt_task if self.depends_on: - body["depends_on"] = self.depends_on + body["{depends_on}"] = self.depends_on if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.email_notifications: - body["email_notifications"] = self.email_notifications + body["{email_notifications}"] = self.email_notifications if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.for_each_task: - body["for_each_task"] = self.for_each_task + body["{for_each_task}"] = self.for_each_task if self.gen_ai_compute_task: - body["gen_ai_compute_task"] = self.gen_ai_compute_task + body["{gen_ai_compute_task}"] = self.gen_ai_compute_task if self.health: - body["health"] = self.health + body["{health}"] = self.health if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.new_cluster: - body["new_cluster"] = self.new_cluster + body["{new_cluster}"] = self.new_cluster if self.notebook_task: - body["notebook_task"] = self.notebook_task + body["{notebook_task}"] = self.notebook_task if self.notification_settings: - body["notification_settings"] = self.notification_settings + body["{notification_settings}"] = self.notification_settings if self.pipeline_task: - body["pipeline_task"] = self.pipeline_task + body["{pipeline_task}"] = self.pipeline_task if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task + body["{python_wheel_task}"] = self.python_wheel_task if self.run_if is not None: - body["run_if"] = self.run_if + body["{run_if}"] = self.run_if if self.run_job_task: - body["run_job_task"] = self.run_job_task + body["{run_job_task}"] = self.run_job_task if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task + body["{spark_jar_task}"] = self.spark_jar_task if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task + body["{spark_python_task}"] = self.spark_python_task if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task + body["{spark_submit_task}"] = self.spark_submit_task if self.sql_task: - body["sql_task"] = self.sql_task + body["{sql_task}"] = self.sql_task if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications + body["{webhook_notifications}"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: """Deserializes the SubmitTask from a dictionary.""" return cls( - clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), - condition_task=_from_dict(d, "condition_task", ConditionTask), - dbt_task=_from_dict(d, "dbt_task", DbtTask), - depends_on=_repeated_dict(d, "depends_on", TaskDependency), - description=d.get("description", None), - email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), - environment_key=d.get("environment_key", None), - existing_cluster_id=d.get("existing_cluster_id", None), - for_each_task=_from_dict(d, "for_each_task", ForEachTask), - gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), - health=_from_dict(d, "health", JobsHealthRules), - libraries=_repeated_dict(d, "libraries", Library), - new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), - notebook_task=_from_dict(d, "notebook_task", NotebookTask), - notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), - pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), - python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), - run_if=_enum(d, "run_if", RunIf), - run_job_task=_from_dict(d, "run_job_task", RunJobTask), - spark_jar_task=_from_dict(d, "spark_jar_task", SparkJarTask), - spark_python_task=_from_dict(d, "spark_python_task", SparkPythonTask), - spark_submit_task=_from_dict(d, "spark_submit_task", SparkSubmitTask), - sql_task=_from_dict(d, "sql_task", SqlTask), - task_key=d.get("task_key", None), - timeout_seconds=d.get("timeout_seconds", None), - webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), + clean_rooms_notebook_task=_from_dict(d, "{clean_rooms_notebook_task}", CleanRoomsNotebookTask), + condition_task=_from_dict(d, "{condition_task}", ConditionTask), + dbt_task=_from_dict(d, "{dbt_task}", DbtTask), + depends_on=_repeated_dict(d, "{depends_on}", TaskDependency), + description=d.get("{description}", None), + email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), + environment_key=d.get("{environment_key}", None), + existing_cluster_id=d.get("{existing_cluster_id}", None), + for_each_task=_from_dict(d, "{for_each_task}", ForEachTask), + gen_ai_compute_task=_from_dict(d, "{gen_ai_compute_task}", GenAiComputeTask), + health=_from_dict(d, "{health}", JobsHealthRules), + libraries=_repeated_dict(d, "{libraries}", Library), + new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), + notebook_task=_from_dict(d, "{notebook_task}", NotebookTask), + notification_settings=_from_dict(d, "{notification_settings}", TaskNotificationSettings), + pipeline_task=_from_dict(d, "{pipeline_task}", PipelineTask), + python_wheel_task=_from_dict(d, "{python_wheel_task}", PythonWheelTask), + run_if=_enum(d, "{run_if}", RunIf), + run_job_task=_from_dict(d, "{run_job_task}", RunJobTask), + spark_jar_task=_from_dict(d, "{spark_jar_task}", SparkJarTask), + spark_python_task=_from_dict(d, "{spark_python_task}", SparkPythonTask), + spark_submit_task=_from_dict(d, "{spark_submit_task}", SparkSubmitTask), + sql_task=_from_dict(d, "{sql_task}", SqlTask), + task_key=d.get("{task_key}", None), + timeout_seconds=d.get("{timeout_seconds}", None), + webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), ) @@ -8974,36 +8976,36 @@ def as_dict(self) -> dict: """Serializes the TableUpdateTriggerConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition is not None: - body["condition"] = self.condition.value + body["{condition}"] = self.condition.value if self.min_time_between_triggers_seconds is not None: - body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds + body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds if self.table_names: - body["table_names"] = [v for v in self.table_names] + body["{table_names}"] = [v for v in self.table_names] if self.wait_after_last_change_seconds is not None: - body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds + body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds return body def as_shallow_dict(self) -> dict: """Serializes the TableUpdateTriggerConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.condition is not None: - body["condition"] = self.condition + body["{condition}"] = self.condition if self.min_time_between_triggers_seconds is not None: - body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds + body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds if self.table_names: - body["table_names"] = self.table_names + body["{table_names}"] = self.table_names if self.wait_after_last_change_seconds is not None: - body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds + body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableUpdateTriggerConfiguration: """Deserializes the TableUpdateTriggerConfiguration from a dictionary.""" return cls( - condition=_enum(d, "condition", Condition), - min_time_between_triggers_seconds=d.get("min_time_between_triggers_seconds", None), - table_names=d.get("table_names", None), - wait_after_last_change_seconds=d.get("wait_after_last_change_seconds", None), + condition=_enum(d, "{condition}", Condition), + min_time_between_triggers_seconds=d.get("{min_time_between_triggers_seconds}", None), + table_names=d.get("{table_names}", None), + wait_after_last_change_seconds=d.get("{wait_after_last_change_seconds}", None), ) @@ -9152,171 +9154,171 @@ def as_dict(self) -> dict: """Serializes the Task into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms_notebook_task: - body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() + body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task.as_dict() if self.condition_task: - body["condition_task"] = self.condition_task.as_dict() + body["{condition_task}"] = self.condition_task.as_dict() if self.dbt_task: - body["dbt_task"] = self.dbt_task.as_dict() + body["{dbt_task}"] = self.dbt_task.as_dict() if self.depends_on: - body["depends_on"] = [v.as_dict() for v in self.depends_on] + body["{depends_on}"] = [v.as_dict() for v in self.depends_on] if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.disable_auto_optimization is not None: - body["disable_auto_optimization"] = self.disable_auto_optimization + body["{disable_auto_optimization}"] = self.disable_auto_optimization if self.email_notifications: - body["email_notifications"] = self.email_notifications.as_dict() + body["{email_notifications}"] = self.email_notifications.as_dict() if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.for_each_task: - body["for_each_task"] = self.for_each_task.as_dict() + body["{for_each_task}"] = self.for_each_task.as_dict() if self.gen_ai_compute_task: - body["gen_ai_compute_task"] = self.gen_ai_compute_task.as_dict() + body["{gen_ai_compute_task}"] = self.gen_ai_compute_task.as_dict() if self.health: - body["health"] = self.health.as_dict() + body["{health}"] = self.health.as_dict() if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.max_retries is not None: - body["max_retries"] = self.max_retries + body["{max_retries}"] = self.max_retries if self.min_retry_interval_millis is not None: - body["min_retry_interval_millis"] = self.min_retry_interval_millis + body["{min_retry_interval_millis}"] = self.min_retry_interval_millis if self.new_cluster: - body["new_cluster"] = self.new_cluster.as_dict() + body["{new_cluster}"] = self.new_cluster.as_dict() if self.notebook_task: - body["notebook_task"] = self.notebook_task.as_dict() + body["{notebook_task}"] = self.notebook_task.as_dict() if self.notification_settings: - body["notification_settings"] = self.notification_settings.as_dict() + body["{notification_settings}"] = self.notification_settings.as_dict() if self.pipeline_task: - body["pipeline_task"] = self.pipeline_task.as_dict() + body["{pipeline_task}"] = self.pipeline_task.as_dict() if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task.as_dict() + body["{python_wheel_task}"] = self.python_wheel_task.as_dict() if self.retry_on_timeout is not None: - body["retry_on_timeout"] = self.retry_on_timeout + body["{retry_on_timeout}"] = self.retry_on_timeout if self.run_if is not None: - body["run_if"] = self.run_if.value + body["{run_if}"] = self.run_if.value if self.run_job_task: - body["run_job_task"] = self.run_job_task.as_dict() + body["{run_job_task}"] = self.run_job_task.as_dict() if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task.as_dict() + body["{spark_jar_task}"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task.as_dict() + body["{spark_python_task}"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task.as_dict() + body["{spark_submit_task}"] = self.spark_submit_task.as_dict() if self.sql_task: - body["sql_task"] = self.sql_task.as_dict() + body["{sql_task}"] = self.sql_task.as_dict() if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications.as_dict() + body["{webhook_notifications}"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Task into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms_notebook_task: - body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task + body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task if self.condition_task: - body["condition_task"] = self.condition_task + body["{condition_task}"] = self.condition_task if self.dbt_task: - body["dbt_task"] = self.dbt_task + body["{dbt_task}"] = self.dbt_task if self.depends_on: - body["depends_on"] = self.depends_on + body["{depends_on}"] = self.depends_on if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.disable_auto_optimization is not None: - body["disable_auto_optimization"] = self.disable_auto_optimization + body["{disable_auto_optimization}"] = self.disable_auto_optimization if self.email_notifications: - body["email_notifications"] = self.email_notifications + body["{email_notifications}"] = self.email_notifications if self.environment_key is not None: - body["environment_key"] = self.environment_key + body["{environment_key}"] = self.environment_key if self.existing_cluster_id is not None: - body["existing_cluster_id"] = self.existing_cluster_id + body["{existing_cluster_id}"] = self.existing_cluster_id if self.for_each_task: - body["for_each_task"] = self.for_each_task + body["{for_each_task}"] = self.for_each_task if self.gen_ai_compute_task: - body["gen_ai_compute_task"] = self.gen_ai_compute_task + body["{gen_ai_compute_task}"] = self.gen_ai_compute_task if self.health: - body["health"] = self.health + body["{health}"] = self.health if self.job_cluster_key is not None: - body["job_cluster_key"] = self.job_cluster_key + body["{job_cluster_key}"] = self.job_cluster_key if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.max_retries is not None: - body["max_retries"] = self.max_retries + body["{max_retries}"] = self.max_retries if self.min_retry_interval_millis is not None: - body["min_retry_interval_millis"] = self.min_retry_interval_millis + body["{min_retry_interval_millis}"] = self.min_retry_interval_millis if self.new_cluster: - body["new_cluster"] = self.new_cluster + body["{new_cluster}"] = self.new_cluster if self.notebook_task: - body["notebook_task"] = self.notebook_task + body["{notebook_task}"] = self.notebook_task if self.notification_settings: - body["notification_settings"] = self.notification_settings + body["{notification_settings}"] = self.notification_settings if self.pipeline_task: - body["pipeline_task"] = self.pipeline_task + body["{pipeline_task}"] = self.pipeline_task if self.python_wheel_task: - body["python_wheel_task"] = self.python_wheel_task + body["{python_wheel_task}"] = self.python_wheel_task if self.retry_on_timeout is not None: - body["retry_on_timeout"] = self.retry_on_timeout + body["{retry_on_timeout}"] = self.retry_on_timeout if self.run_if is not None: - body["run_if"] = self.run_if + body["{run_if}"] = self.run_if if self.run_job_task: - body["run_job_task"] = self.run_job_task + body["{run_job_task}"] = self.run_job_task if self.spark_jar_task: - body["spark_jar_task"] = self.spark_jar_task + body["{spark_jar_task}"] = self.spark_jar_task if self.spark_python_task: - body["spark_python_task"] = self.spark_python_task + body["{spark_python_task}"] = self.spark_python_task if self.spark_submit_task: - body["spark_submit_task"] = self.spark_submit_task + body["{spark_submit_task}"] = self.spark_submit_task if self.sql_task: - body["sql_task"] = self.sql_task + body["{sql_task}"] = self.sql_task if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key if self.timeout_seconds is not None: - body["timeout_seconds"] = self.timeout_seconds + body["{timeout_seconds}"] = self.timeout_seconds if self.webhook_notifications: - body["webhook_notifications"] = self.webhook_notifications + body["{webhook_notifications}"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Task: """Deserializes the Task from a dictionary.""" return cls( - clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), - condition_task=_from_dict(d, "condition_task", ConditionTask), - dbt_task=_from_dict(d, "dbt_task", DbtTask), - depends_on=_repeated_dict(d, "depends_on", TaskDependency), - description=d.get("description", None), - disable_auto_optimization=d.get("disable_auto_optimization", None), - email_notifications=_from_dict(d, "email_notifications", TaskEmailNotifications), - environment_key=d.get("environment_key", None), - existing_cluster_id=d.get("existing_cluster_id", None), - for_each_task=_from_dict(d, "for_each_task", ForEachTask), - gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), - health=_from_dict(d, "health", JobsHealthRules), - job_cluster_key=d.get("job_cluster_key", None), - libraries=_repeated_dict(d, "libraries", Library), - max_retries=d.get("max_retries", None), - min_retry_interval_millis=d.get("min_retry_interval_millis", None), - new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), - notebook_task=_from_dict(d, "notebook_task", NotebookTask), - notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), - pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), - python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), - retry_on_timeout=d.get("retry_on_timeout", None), - run_if=_enum(d, "run_if", RunIf), - run_job_task=_from_dict(d, "run_job_task", RunJobTask), - spark_jar_task=_from_dict(d, "spark_jar_task", SparkJarTask), - spark_python_task=_from_dict(d, "spark_python_task", SparkPythonTask), - spark_submit_task=_from_dict(d, "spark_submit_task", SparkSubmitTask), - sql_task=_from_dict(d, "sql_task", SqlTask), - task_key=d.get("task_key", None), - timeout_seconds=d.get("timeout_seconds", None), - webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), + clean_rooms_notebook_task=_from_dict(d, "{clean_rooms_notebook_task}", CleanRoomsNotebookTask), + condition_task=_from_dict(d, "{condition_task}", ConditionTask), + dbt_task=_from_dict(d, "{dbt_task}", DbtTask), + depends_on=_repeated_dict(d, "{depends_on}", TaskDependency), + description=d.get("{description}", None), + disable_auto_optimization=d.get("{disable_auto_optimization}", None), + email_notifications=_from_dict(d, "{email_notifications}", TaskEmailNotifications), + environment_key=d.get("{environment_key}", None), + existing_cluster_id=d.get("{existing_cluster_id}", None), + for_each_task=_from_dict(d, "{for_each_task}", ForEachTask), + gen_ai_compute_task=_from_dict(d, "{gen_ai_compute_task}", GenAiComputeTask), + health=_from_dict(d, "{health}", JobsHealthRules), + job_cluster_key=d.get("{job_cluster_key}", None), + libraries=_repeated_dict(d, "{libraries}", Library), + max_retries=d.get("{max_retries}", None), + min_retry_interval_millis=d.get("{min_retry_interval_millis}", None), + new_cluster=_from_dict(d, "{new_cluster}", JobsClusterSpec), + notebook_task=_from_dict(d, "{notebook_task}", NotebookTask), + notification_settings=_from_dict(d, "{notification_settings}", TaskNotificationSettings), + pipeline_task=_from_dict(d, "{pipeline_task}", PipelineTask), + python_wheel_task=_from_dict(d, "{python_wheel_task}", PythonWheelTask), + retry_on_timeout=d.get("{retry_on_timeout}", None), + run_if=_enum(d, "{run_if}", RunIf), + run_job_task=_from_dict(d, "{run_job_task}", RunJobTask), + spark_jar_task=_from_dict(d, "{spark_jar_task}", SparkJarTask), + spark_python_task=_from_dict(d, "{spark_python_task}", SparkPythonTask), + spark_submit_task=_from_dict(d, "{spark_submit_task}", SparkSubmitTask), + sql_task=_from_dict(d, "{sql_task}", SqlTask), + task_key=d.get("{task_key}", None), + timeout_seconds=d.get("{timeout_seconds}", None), + webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), ) @@ -9333,24 +9335,24 @@ def as_dict(self) -> dict: """Serializes the TaskDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.outcome is not None: - body["outcome"] = self.outcome + body["{outcome}"] = self.outcome if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key return body def as_shallow_dict(self) -> dict: """Serializes the TaskDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.outcome is not None: - body["outcome"] = self.outcome + body["{outcome}"] = self.outcome if self.task_key is not None: - body["task_key"] = self.task_key + body["{task_key}"] = self.task_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TaskDependency: """Deserializes the TaskDependency from a dictionary.""" - return cls(outcome=d.get("outcome", None), task_key=d.get("task_key", None)) + return cls(outcome=d.get("{outcome}", None), task_key=d.get("{task_key}", None)) @dataclass @@ -9392,46 +9394,46 @@ def as_dict(self) -> dict: """Serializes the TaskEmailNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["on_duration_warning_threshold_exceeded"] = [v for v in self.on_duration_warning_threshold_exceeded] + body["{on_duration_warning_threshold_exceeded}"] = [v for v in self.on_duration_warning_threshold_exceeded] if self.on_failure: - body["on_failure"] = [v for v in self.on_failure] + body["{on_failure}"] = [v for v in self.on_failure] if self.on_start: - body["on_start"] = [v for v in self.on_start] + body["{on_start}"] = [v for v in self.on_start] if self.on_streaming_backlog_exceeded: - body["on_streaming_backlog_exceeded"] = [v for v in self.on_streaming_backlog_exceeded] + body["{on_streaming_backlog_exceeded}"] = [v for v in self.on_streaming_backlog_exceeded] if self.on_success: - body["on_success"] = [v for v in self.on_success] + body["{on_success}"] = [v for v in self.on_success] return body def as_shallow_dict(self) -> dict: """Serializes the TaskEmailNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["on_duration_warning_threshold_exceeded"] = self.on_duration_warning_threshold_exceeded + body["{on_duration_warning_threshold_exceeded}"] = self.on_duration_warning_threshold_exceeded if self.on_failure: - body["on_failure"] = self.on_failure + body["{on_failure}"] = self.on_failure if self.on_start: - body["on_start"] = self.on_start + body["{on_start}"] = self.on_start if self.on_streaming_backlog_exceeded: - body["on_streaming_backlog_exceeded"] = self.on_streaming_backlog_exceeded + body["{on_streaming_backlog_exceeded}"] = self.on_streaming_backlog_exceeded if self.on_success: - body["on_success"] = self.on_success + body["{on_success}"] = self.on_success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TaskEmailNotifications: """Deserializes the TaskEmailNotifications from a dictionary.""" return cls( - no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), - on_duration_warning_threshold_exceeded=d.get("on_duration_warning_threshold_exceeded", None), - on_failure=d.get("on_failure", None), - on_start=d.get("on_start", None), - on_streaming_backlog_exceeded=d.get("on_streaming_backlog_exceeded", None), - on_success=d.get("on_success", None), + no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), + on_duration_warning_threshold_exceeded=d.get("{on_duration_warning_threshold_exceeded}", None), + on_failure=d.get("{on_failure}", None), + on_start=d.get("{on_start}", None), + on_streaming_backlog_exceeded=d.get("{on_streaming_backlog_exceeded}", None), + on_success=d.get("{on_success}", None), ) @@ -9454,31 +9456,31 @@ def as_dict(self) -> dict: """Serializes the TaskNotificationSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_on_last_attempt is not None: - body["alert_on_last_attempt"] = self.alert_on_last_attempt + body["{alert_on_last_attempt}"] = self.alert_on_last_attempt if self.no_alert_for_canceled_runs is not None: - body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs + body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs return body def as_shallow_dict(self) -> dict: """Serializes the TaskNotificationSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_on_last_attempt is not None: - body["alert_on_last_attempt"] = self.alert_on_last_attempt + body["{alert_on_last_attempt}"] = self.alert_on_last_attempt if self.no_alert_for_canceled_runs is not None: - body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs + body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs + body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TaskNotificationSettings: """Deserializes the TaskNotificationSettings from a dictionary.""" return cls( - alert_on_last_attempt=d.get("alert_on_last_attempt", None), - no_alert_for_canceled_runs=d.get("no_alert_for_canceled_runs", None), - no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), + alert_on_last_attempt=d.get("{alert_on_last_attempt}", None), + no_alert_for_canceled_runs=d.get("{no_alert_for_canceled_runs}", None), + no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), ) @@ -9600,31 +9602,31 @@ def as_dict(self) -> dict: """Serializes the TerminationDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["code"] = self.code.value + body["{code}"] = self.code.value if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the TerminationDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["code"] = self.code + body["{code}"] = self.code if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TerminationDetails: """Deserializes the TerminationDetails from a dictionary.""" return cls( - code=_enum(d, "code", TerminationCodeCode), - message=d.get("message", None), - type=_enum(d, "type", TerminationTypeType), + code=_enum(d, "{code}", TerminationCodeCode), + message=d.get("{message}", None), + type=_enum(d, "{type}", TerminationTypeType), ) @@ -9654,20 +9656,20 @@ def as_dict(self) -> dict: """Serializes the TriggerInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the TriggerInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TriggerInfo: """Deserializes the TriggerInfo from a dictionary.""" - return cls(run_id=d.get("run_id", None)) + return cls(run_id=d.get("{run_id}", None)) @dataclass @@ -9690,41 +9692,41 @@ def as_dict(self) -> dict: """Serializes the TriggerSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_arrival: - body["file_arrival"] = self.file_arrival.as_dict() + body["{file_arrival}"] = self.file_arrival.as_dict() if self.pause_status is not None: - body["pause_status"] = self.pause_status.value + body["{pause_status}"] = self.pause_status.value if self.periodic: - body["periodic"] = self.periodic.as_dict() + body["{periodic}"] = self.periodic.as_dict() if self.table: - body["table"] = self.table.as_dict() + body["{table}"] = self.table.as_dict() if self.table_update: - body["table_update"] = self.table_update.as_dict() + body["{table_update}"] = self.table_update.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TriggerSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.file_arrival: - body["file_arrival"] = self.file_arrival + body["{file_arrival}"] = self.file_arrival if self.pause_status is not None: - body["pause_status"] = self.pause_status + body["{pause_status}"] = self.pause_status if self.periodic: - body["periodic"] = self.periodic + body["{periodic}"] = self.periodic if self.table: - body["table"] = self.table + body["{table}"] = self.table if self.table_update: - body["table_update"] = self.table_update + body["{table_update}"] = self.table_update return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TriggerSettings: """Deserializes the TriggerSettings from a dictionary.""" return cls( - file_arrival=_from_dict(d, "file_arrival", FileArrivalTriggerConfiguration), - pause_status=_enum(d, "pause_status", PauseStatus), - periodic=_from_dict(d, "periodic", PeriodicTriggerConfiguration), - table=_from_dict(d, "table", TableUpdateTriggerConfiguration), - table_update=_from_dict(d, "table_update", TableUpdateTriggerConfiguration), + file_arrival=_from_dict(d, "{file_arrival}", FileArrivalTriggerConfiguration), + pause_status=_enum(d, "{pause_status}", PauseStatus), + periodic=_from_dict(d, "{periodic}", PeriodicTriggerConfiguration), + table=_from_dict(d, "{table}", TableUpdateTriggerConfiguration), + table_update=_from_dict(d, "{table_update}", TableUpdateTriggerConfiguration), ) @@ -9773,31 +9775,31 @@ def as_dict(self) -> dict: """Serializes the UpdateJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.fields_to_remove: - body["fields_to_remove"] = [v for v in self.fields_to_remove] + body["{fields_to_remove}"] = [v for v in self.fields_to_remove] if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.new_settings: - body["new_settings"] = self.new_settings.as_dict() + body["{new_settings}"] = self.new_settings.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateJob into a shallow dictionary of its immediate attributes.""" body = {} if self.fields_to_remove: - body["fields_to_remove"] = self.fields_to_remove + body["{fields_to_remove}"] = self.fields_to_remove if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.new_settings: - body["new_settings"] = self.new_settings + body["{new_settings}"] = self.new_settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateJob: """Deserializes the UpdateJob from a dictionary.""" return cls( - fields_to_remove=d.get("fields_to_remove", None), - job_id=d.get("job_id", None), - new_settings=_from_dict(d, "new_settings", JobSettings), + fields_to_remove=d.get("{fields_to_remove}", None), + job_id=d.get("{job_id}", None), + new_settings=_from_dict(d, "{new_settings}", JobSettings), ) @@ -9835,28 +9837,28 @@ def as_dict(self) -> dict: """Serializes the ViewItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the ViewItem into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ViewItem: """Deserializes the ViewItem from a dictionary.""" - return cls(content=d.get("content", None), name=d.get("name", None), type=_enum(d, "type", ViewType)) + return cls(content=d.get("{content}", None), name=d.get("{name}", None), type=_enum(d, "{type}", ViewType)) class ViewType(Enum): @@ -9887,20 +9889,20 @@ def as_dict(self) -> dict: """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: """Deserializes the VolumesStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -9911,20 +9913,20 @@ def as_dict(self) -> dict: """Serializes the Webhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the Webhook into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Webhook: """Deserializes the Webhook from a dictionary.""" - return cls(id=d.get("id", None)) + return cls(id=d.get("{id}", None)) @dataclass @@ -9958,43 +9960,45 @@ def as_dict(self) -> dict: """Serializes the WebhookNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.on_duration_warning_threshold_exceeded: - body["on_duration_warning_threshold_exceeded"] = [ + body["{on_duration_warning_threshold_exceeded}"] = [ v.as_dict() for v in self.on_duration_warning_threshold_exceeded ] if self.on_failure: - body["on_failure"] = [v.as_dict() for v in self.on_failure] + body["{on_failure}"] = [v.as_dict() for v in self.on_failure] if self.on_start: - body["on_start"] = [v.as_dict() for v in self.on_start] + body["{on_start}"] = [v.as_dict() for v in self.on_start] if self.on_streaming_backlog_exceeded: - body["on_streaming_backlog_exceeded"] = [v.as_dict() for v in self.on_streaming_backlog_exceeded] + body["{on_streaming_backlog_exceeded}"] = [v.as_dict() for v in self.on_streaming_backlog_exceeded] if self.on_success: - body["on_success"] = [v.as_dict() for v in self.on_success] + body["{on_success}"] = [v.as_dict() for v in self.on_success] return body def as_shallow_dict(self) -> dict: """Serializes the WebhookNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.on_duration_warning_threshold_exceeded: - body["on_duration_warning_threshold_exceeded"] = self.on_duration_warning_threshold_exceeded + body["{on_duration_warning_threshold_exceeded}"] = self.on_duration_warning_threshold_exceeded if self.on_failure: - body["on_failure"] = self.on_failure + body["{on_failure}"] = self.on_failure if self.on_start: - body["on_start"] = self.on_start + body["{on_start}"] = self.on_start if self.on_streaming_backlog_exceeded: - body["on_streaming_backlog_exceeded"] = self.on_streaming_backlog_exceeded + body["{on_streaming_backlog_exceeded}"] = self.on_streaming_backlog_exceeded if self.on_success: - body["on_success"] = self.on_success + body["{on_success}"] = self.on_success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WebhookNotifications: """Deserializes the WebhookNotifications from a dictionary.""" return cls( - on_duration_warning_threshold_exceeded=_repeated_dict(d, "on_duration_warning_threshold_exceeded", Webhook), - on_failure=_repeated_dict(d, "on_failure", Webhook), - on_start=_repeated_dict(d, "on_start", Webhook), - on_streaming_backlog_exceeded=_repeated_dict(d, "on_streaming_backlog_exceeded", Webhook), - on_success=_repeated_dict(d, "on_success", Webhook), + on_duration_warning_threshold_exceeded=_repeated_dict( + d, "{on_duration_warning_threshold_exceeded}", Webhook + ), + on_failure=_repeated_dict(d, "{on_failure}", Webhook), + on_start=_repeated_dict(d, "{on_start}", Webhook), + on_streaming_backlog_exceeded=_repeated_dict(d, "{on_streaming_backlog_exceeded}", Webhook), + on_success=_repeated_dict(d, "{on_success}", Webhook), ) @@ -10009,20 +10013,20 @@ def as_dict(self) -> dict: """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" body = {} if self.clients: - body["clients"] = self.clients.as_dict() + body["{clients}"] = self.clients.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" body = {} if self.clients: - body["clients"] = self.clients + body["{clients}"] = self.clients return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: """Deserializes the WorkloadType from a dictionary.""" - return cls(clients=_from_dict(d, "clients", ClientsTypes)) + return cls(clients=_from_dict(d, "{clients}", ClientsTypes)) @dataclass @@ -10036,20 +10040,20 @@ def as_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: """Deserializes the WorkspaceStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) class JobsAPI: @@ -10072,40 +10076,6 @@ class JobsAPI: def __init__(self, api_client): self._api = api_client - def wait_get_run_job_terminated_or_skipped( - self, run_id: int, timeout=timedelta(minutes=20), callback: Optional[Callable[[Run], None]] = None - ) -> Run: - deadline = time.time() + timeout.total_seconds() - target_states = ( - RunLifeCycleState.TERMINATED, - RunLifeCycleState.SKIPPED, - ) - failure_states = (RunLifeCycleState.INTERNAL_ERROR,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get_run(run_id=run_id) - status = poll.state.life_cycle_state - status_message = f"current status: {status}" - if poll.state: - status_message = poll.state.state_message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach TERMINATED or SKIPPED, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"run_id={run_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Optional[int] = None): """Cancel all runs of a job. @@ -10122,11 +10092,11 @@ def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Opt """ body = {} if all_queued_runs is not None: - body["all_queued_runs"] = all_queued_runs + body["{all_queued_runs}"] = all_queued_runs if job_id is not None: - body["job_id"] = job_id + body["{job_id}"] = job_id headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("POST", "/api/2.2/jobs/runs/cancel-all", body=body, headers=headers) @@ -10142,20 +10112,18 @@ def cancel_run(self, run_id: int) -> Wait[Run]: :returns: Long-running operation waiter for :class:`Run`. - See :method:wait_get_run_job_terminated_or_skipped for more details. + See :method:WaitGetRunJobTerminatedOrSkipped for more details. """ body = {} if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.2/jobs/runs/cancel", body=body, headers=headers) return Wait( - self.wait_get_run_job_terminated_or_skipped, - response=CancelRunResponse.from_dict(op_response), - run_id=run_id, + self.WaitGetRunJobTerminatedOrSkipped, response=CancelRunResponse.from_dict(op_response), run_id=run_id ) def cancel_run_and_wait(self, run_id: int, timeout=timedelta(minutes=20)) -> Run: @@ -10288,58 +10256,58 @@ def create( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] if budget_policy_id is not None: - body["budget_policy_id"] = budget_policy_id + body["{budget_policy_id}"] = budget_policy_id if continuous is not None: - body["continuous"] = continuous.as_dict() + body["{continuous}"] = continuous.as_dict() if deployment is not None: - body["deployment"] = deployment.as_dict() + body["{deployment}"] = deployment.as_dict() if description is not None: - body["description"] = description + body["{description}"] = description if edit_mode is not None: - body["edit_mode"] = edit_mode.value + body["{edit_mode}"] = edit_mode.value if email_notifications is not None: - body["email_notifications"] = email_notifications.as_dict() + body["{email_notifications}"] = email_notifications.as_dict() if environments is not None: - body["environments"] = [v.as_dict() for v in environments] + body["{environments}"] = [v.as_dict() for v in environments] if format is not None: - body["format"] = format.value + body["{format}"] = format.value if git_source is not None: - body["git_source"] = git_source.as_dict() + body["{git_source}"] = git_source.as_dict() if health is not None: - body["health"] = health.as_dict() + body["{health}"] = health.as_dict() if job_clusters is not None: - body["job_clusters"] = [v.as_dict() for v in job_clusters] + body["{job_clusters}"] = [v.as_dict() for v in job_clusters] if max_concurrent_runs is not None: - body["max_concurrent_runs"] = max_concurrent_runs + body["{max_concurrent_runs}"] = max_concurrent_runs if name is not None: - body["name"] = name + body["{name}"] = name if notification_settings is not None: - body["notification_settings"] = notification_settings.as_dict() + body["{notification_settings}"] = notification_settings.as_dict() if parameters is not None: - body["parameters"] = [v.as_dict() for v in parameters] + body["{parameters}"] = [v.as_dict() for v in parameters] if performance_target is not None: - body["performance_target"] = performance_target.value + body["{performance_target}"] = performance_target.value if queue is not None: - body["queue"] = queue.as_dict() + body["{queue}"] = queue.as_dict() if run_as is not None: - body["run_as"] = run_as.as_dict() + body["{run_as}"] = run_as.as_dict() if schedule is not None: - body["schedule"] = schedule.as_dict() + body["{schedule}"] = schedule.as_dict() if tags is not None: - body["tags"] = tags + body["{tags}"] = tags if tasks is not None: - body["tasks"] = [v.as_dict() for v in tasks] + body["{tasks}"] = [v.as_dict() for v in tasks] if timeout_seconds is not None: - body["timeout_seconds"] = timeout_seconds + body["{timeout_seconds}"] = timeout_seconds if trigger is not None: - body["trigger"] = trigger.as_dict() + body["{trigger}"] = trigger.as_dict() if webhook_notifications is not None: - body["webhook_notifications"] = webhook_notifications.as_dict() + body["{webhook_notifications}"] = webhook_notifications.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.2/jobs/create", body=body, headers=headers) @@ -10357,9 +10325,9 @@ def delete(self, job_id: int): """ body = {} if job_id is not None: - body["job_id"] = job_id + body["{job_id}"] = job_id headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("POST", "/api/2.2/jobs/delete", body=body, headers=headers) @@ -10376,9 +10344,9 @@ def delete_run(self, run_id: int): """ body = {} if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("POST", "/api/2.2/jobs/runs/delete", body=body, headers=headers) @@ -10398,11 +10366,11 @@ def export_run(self, run_id: int, *, views_to_export: Optional[ViewsToExport] = query = {} if run_id is not None: - query["run_id"] = run_id + query["{run_id}"] = run_id if views_to_export is not None: - query["views_to_export"] = views_to_export.value + query["{views_to_export}"] = views_to_export.value headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.2/jobs/runs/export", query=query, headers=headers) @@ -10431,11 +10399,11 @@ def get(self, job_id: int, *, page_token: Optional[str] = None) -> Job: query = {} if job_id is not None: - query["job_id"] = job_id + query["{job_id}"] = job_id if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.2/jobs/get", query=query, headers=headers) @@ -10453,7 +10421,7 @@ def get_permission_levels(self, job_id: str) -> GetJobPermissionLevelsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/jobs/{job_id}/permissionLevels", headers=headers) @@ -10471,7 +10439,7 @@ def get_permissions(self, job_id: str) -> JobPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/jobs/{job_id}", headers=headers) @@ -10511,15 +10479,15 @@ def get_run( query = {} if include_history is not None: - query["include_history"] = include_history + query["{include_history}"] = include_history if include_resolved_values is not None: - query["include_resolved_values"] = include_resolved_values + query["{include_resolved_values}"] = include_resolved_values if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if run_id is not None: - query["run_id"] = run_id + query["{run_id}"] = run_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.2/jobs/runs/get", query=query, headers=headers) @@ -10545,9 +10513,9 @@ def get_run_output(self, run_id: int) -> RunOutput: query = {} if run_id is not None: - query["run_id"] = run_id + query["{run_id}"] = run_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.2/jobs/runs/get-output", query=query, headers=headers) @@ -10586,27 +10554,27 @@ def list( query = {} if expand_tasks is not None: - query["expand_tasks"] = expand_tasks + query["{expand_tasks}"] = expand_tasks if limit is not None: - query["limit"] = limit + query["{limit}"] = limit if name is not None: - query["name"] = name + query["{name}"] = name if offset is not None: - query["offset"] = offset + query["{offset}"] = offset if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.2/jobs/list", query=query, headers=headers) - if "jobs" in json: - for v in json["jobs"]: + if "{jobs}" in json: + for v in json["{jobs}"]: yield BaseJob.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_runs( self, @@ -10661,37 +10629,37 @@ def list_runs( query = {} if active_only is not None: - query["active_only"] = active_only + query["{active_only}"] = active_only if completed_only is not None: - query["completed_only"] = completed_only + query["{completed_only}"] = completed_only if expand_tasks is not None: - query["expand_tasks"] = expand_tasks + query["{expand_tasks}"] = expand_tasks if job_id is not None: - query["job_id"] = job_id + query["{job_id}"] = job_id if limit is not None: - query["limit"] = limit + query["{limit}"] = limit if offset is not None: - query["offset"] = offset + query["{offset}"] = offset if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if run_type is not None: - query["run_type"] = run_type.value + query["{run_type}"] = run_type.value if start_time_from is not None: - query["start_time_from"] = start_time_from + query["{start_time_from}"] = start_time_from if start_time_to is not None: - query["start_time_to"] = start_time_to + query["{start_time_to}"] = start_time_to headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.2/jobs/runs/list", query=query, headers=headers) - if "runs" in json: - for v in json["runs"]: + if "{runs}" in json: + for v in json["{runs}"]: yield BaseRun.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def repair_run( self, @@ -10799,47 +10767,45 @@ def repair_run( :returns: Long-running operation waiter for :class:`Run`. - See :method:wait_get_run_job_terminated_or_skipped for more details. + See :method:WaitGetRunJobTerminatedOrSkipped for more details. """ body = {} if dbt_commands is not None: - body["dbt_commands"] = [v for v in dbt_commands] + body["{dbt_commands}"] = [v for v in dbt_commands] if jar_params is not None: - body["jar_params"] = [v for v in jar_params] + body["{jar_params}"] = [v for v in jar_params] if job_parameters is not None: - body["job_parameters"] = job_parameters + body["{job_parameters}"] = job_parameters if latest_repair_id is not None: - body["latest_repair_id"] = latest_repair_id + body["{latest_repair_id}"] = latest_repair_id if notebook_params is not None: - body["notebook_params"] = notebook_params + body["{notebook_params}"] = notebook_params if pipeline_params is not None: - body["pipeline_params"] = pipeline_params.as_dict() + body["{pipeline_params}"] = pipeline_params.as_dict() if python_named_params is not None: - body["python_named_params"] = python_named_params + body["{python_named_params}"] = python_named_params if python_params is not None: - body["python_params"] = [v for v in python_params] + body["{python_params}"] = [v for v in python_params] if rerun_all_failed_tasks is not None: - body["rerun_all_failed_tasks"] = rerun_all_failed_tasks + body["{rerun_all_failed_tasks}"] = rerun_all_failed_tasks if rerun_dependent_tasks is not None: - body["rerun_dependent_tasks"] = rerun_dependent_tasks + body["{rerun_dependent_tasks}"] = rerun_dependent_tasks if rerun_tasks is not None: - body["rerun_tasks"] = [v for v in rerun_tasks] + body["{rerun_tasks}"] = [v for v in rerun_tasks] if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id if spark_submit_params is not None: - body["spark_submit_params"] = [v for v in spark_submit_params] + body["{spark_submit_params}"] = [v for v in spark_submit_params] if sql_params is not None: - body["sql_params"] = sql_params + body["{sql_params}"] = sql_params headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.2/jobs/runs/repair", body=body, headers=headers) return Wait( - self.wait_get_run_job_terminated_or_skipped, - response=RepairRunResponse.from_dict(op_response), - run_id=run_id, + self.WaitGetRunJobTerminatedOrSkipped, response=RepairRunResponse.from_dict(op_response), run_id=run_id ) def repair_run_and_wait( @@ -10896,11 +10862,11 @@ def reset(self, job_id: int, new_settings: JobSettings): """ body = {} if job_id is not None: - body["job_id"] = job_id + body["{job_id}"] = job_id if new_settings is not None: - body["new_settings"] = new_settings.as_dict() + body["{new_settings}"] = new_settings.as_dict() headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("POST", "/api/2.2/jobs/reset", body=body, headers=headers) @@ -11022,47 +10988,47 @@ def run_now( :returns: Long-running operation waiter for :class:`Run`. - See :method:wait_get_run_job_terminated_or_skipped for more details. + See :method:WaitGetRunJobTerminatedOrSkipped for more details. """ body = {} if dbt_commands is not None: - body["dbt_commands"] = [v for v in dbt_commands] + body["{dbt_commands}"] = [v for v in dbt_commands] if idempotency_token is not None: - body["idempotency_token"] = idempotency_token + body["{idempotency_token}"] = idempotency_token if jar_params is not None: - body["jar_params"] = [v for v in jar_params] + body["{jar_params}"] = [v for v in jar_params] if job_id is not None: - body["job_id"] = job_id + body["{job_id}"] = job_id if job_parameters is not None: - body["job_parameters"] = job_parameters + body["{job_parameters}"] = job_parameters if notebook_params is not None: - body["notebook_params"] = notebook_params + body["{notebook_params}"] = notebook_params if only is not None: - body["only"] = [v for v in only] + body["{only}"] = [v for v in only] if performance_target is not None: - body["performance_target"] = performance_target.value + body["{performance_target}"] = performance_target.value if pipeline_params is not None: - body["pipeline_params"] = pipeline_params.as_dict() + body["{pipeline_params}"] = pipeline_params.as_dict() if python_named_params is not None: - body["python_named_params"] = python_named_params + body["{python_named_params}"] = python_named_params if python_params is not None: - body["python_params"] = [v for v in python_params] + body["{python_params}"] = [v for v in python_params] if queue is not None: - body["queue"] = queue.as_dict() + body["{queue}"] = queue.as_dict() if spark_submit_params is not None: - body["spark_submit_params"] = [v for v in spark_submit_params] + body["{spark_submit_params}"] = [v for v in spark_submit_params] if sql_params is not None: - body["sql_params"] = sql_params + body["{sql_params}"] = sql_params headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.2/jobs/run-now", body=body, headers=headers) return Wait( - self.wait_get_run_job_terminated_or_skipped, + self.WaitGetRunJobTerminatedOrSkipped, response=RunNowResponse.from_dict(op_response), - run_id=op_response["run_id"], + run_id=op_response["{run_id}"], ) def run_now_and_wait( @@ -11117,10 +11083,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/jobs/{job_id}", body=body, headers=headers) @@ -11201,47 +11167,47 @@ def submit( :returns: Long-running operation waiter for :class:`Run`. - See :method:wait_get_run_job_terminated_or_skipped for more details. + See :method:WaitGetRunJobTerminatedOrSkipped for more details. """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] if budget_policy_id is not None: - body["budget_policy_id"] = budget_policy_id + body["{budget_policy_id}"] = budget_policy_id if email_notifications is not None: - body["email_notifications"] = email_notifications.as_dict() + body["{email_notifications}"] = email_notifications.as_dict() if environments is not None: - body["environments"] = [v.as_dict() for v in environments] + body["{environments}"] = [v.as_dict() for v in environments] if git_source is not None: - body["git_source"] = git_source.as_dict() + body["{git_source}"] = git_source.as_dict() if health is not None: - body["health"] = health.as_dict() + body["{health}"] = health.as_dict() if idempotency_token is not None: - body["idempotency_token"] = idempotency_token + body["{idempotency_token}"] = idempotency_token if notification_settings is not None: - body["notification_settings"] = notification_settings.as_dict() + body["{notification_settings}"] = notification_settings.as_dict() if queue is not None: - body["queue"] = queue.as_dict() + body["{queue}"] = queue.as_dict() if run_as is not None: - body["run_as"] = run_as.as_dict() + body["{run_as}"] = run_as.as_dict() if run_name is not None: - body["run_name"] = run_name + body["{run_name}"] = run_name if tasks is not None: - body["tasks"] = [v.as_dict() for v in tasks] + body["{tasks}"] = [v.as_dict() for v in tasks] if timeout_seconds is not None: - body["timeout_seconds"] = timeout_seconds + body["{timeout_seconds}"] = timeout_seconds if webhook_notifications is not None: - body["webhook_notifications"] = webhook_notifications.as_dict() + body["{webhook_notifications}"] = webhook_notifications.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.2/jobs/runs/submit", body=body, headers=headers) return Wait( - self.wait_get_run_job_terminated_or_skipped, + self.WaitGetRunJobTerminatedOrSkipped, response=SubmitRunResponse.from_dict(op_response), - run_id=op_response["run_id"], + run_id=op_response["{run_id}"], ) def submit_and_wait( @@ -11309,13 +11275,13 @@ def update( """ body = {} if fields_to_remove is not None: - body["fields_to_remove"] = [v for v in fields_to_remove] + body["{fields_to_remove}"] = [v for v in fields_to_remove] if job_id is not None: - body["job_id"] = job_id + body["{job_id}"] = job_id if new_settings is not None: - body["new_settings"] = new_settings.as_dict() + body["{new_settings}"] = new_settings.as_dict() headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("POST", "/api/2.2/jobs/update", body=body, headers=headers) @@ -11335,10 +11301,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/permissions/jobs/{job_id}", body=body, headers=headers) @@ -11378,12 +11344,12 @@ def enforce_compliance( """ body = {} if job_id is not None: - body["job_id"] = job_id + body["{job_id}"] = job_id if validate_only is not None: - body["validate_only"] = validate_only + body["{validate_only}"] = validate_only headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/policies/jobs/enforce-compliance", body=body, headers=headers) @@ -11404,9 +11370,9 @@ def get_compliance(self, job_id: int) -> GetPolicyComplianceResponse: query = {} if job_id is not None: - query["job_id"] = job_id + query["{job_id}"] = job_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/policies/jobs/get-compliance", query=query, headers=headers) @@ -11435,20 +11401,20 @@ def list_compliance( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if policy_id is not None: - query["policy_id"] = policy_id + query["{policy_id}"] = policy_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/policies/jobs/list-compliance", query=query, headers=headers) - if "jobs" in json: - for v in json["jobs"]: + if "{jobs}" in json: + for v in json["{jobs}"]: yield JobCompliance.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] diff --git a/databricks/sdk/service/marketplace.py b/databricks/sdk/marketplace/v2/impl.py similarity index 69% rename from databricks/sdk/service/marketplace.py rename to databricks/sdk/marketplace/v2/impl.py index 6d3a8815b..a3c2425ad 100755 --- a/databricks/sdk/service/marketplace.py +++ b/databricks/sdk/marketplace/v2/impl.py @@ -7,11 +7,11 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (_enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -25,24 +25,24 @@ def as_dict(self) -> dict: """Serializes the AddExchangeForListingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id return body def as_shallow_dict(self) -> dict: """Serializes the AddExchangeForListingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddExchangeForListingRequest: """Deserializes the AddExchangeForListingRequest from a dictionary.""" - return cls(exchange_id=d.get("exchange_id", None), listing_id=d.get("listing_id", None)) + return cls(exchange_id=d.get("{exchange_id}", None), listing_id=d.get("{listing_id}", None)) @dataclass @@ -53,20 +53,20 @@ def as_dict(self) -> dict: """Serializes the AddExchangeForListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_for_listing: - body["exchange_for_listing"] = self.exchange_for_listing.as_dict() + body["{exchange_for_listing}"] = self.exchange_for_listing.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AddExchangeForListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_for_listing: - body["exchange_for_listing"] = self.exchange_for_listing + body["{exchange_for_listing}"] = self.exchange_for_listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddExchangeForListingResponse: """Deserializes the AddExchangeForListingResponse from a dictionary.""" - return cls(exchange_for_listing=_from_dict(d, "exchange_for_listing", ExchangeListing)) + return cls(exchange_for_listing=_from_dict(d, "{exchange_for_listing}", ExchangeListing)) class AssetType(Enum): @@ -88,20 +88,20 @@ def as_dict(self) -> dict: """Serializes the BatchGetListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["listings"] = [v.as_dict() for v in self.listings] + body["{listings}"] = [v.as_dict() for v in self.listings] return body def as_shallow_dict(self) -> dict: """Serializes the BatchGetListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["listings"] = self.listings + body["{listings}"] = self.listings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BatchGetListingsResponse: """Deserializes the BatchGetListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "listings", Listing)) + return cls(listings=_repeated_dict(d, "{listings}", Listing)) @dataclass @@ -112,20 +112,20 @@ def as_dict(self) -> dict: """Serializes the BatchGetProvidersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.providers: - body["providers"] = [v.as_dict() for v in self.providers] + body["{providers}"] = [v.as_dict() for v in self.providers] return body def as_shallow_dict(self) -> dict: """Serializes the BatchGetProvidersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.providers: - body["providers"] = self.providers + body["{providers}"] = self.providers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BatchGetProvidersResponse: """Deserializes the BatchGetProvidersResponse from a dictionary.""" - return cls(providers=_repeated_dict(d, "providers", ProviderInfo)) + return cls(providers=_repeated_dict(d, "{providers}", ProviderInfo)) class Category(Enum): @@ -162,20 +162,20 @@ def as_dict(self) -> dict: """Serializes the ConsumerTerms into a dictionary suitable for use as a JSON request body.""" body = {} if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the ConsumerTerms into a shallow dictionary of its immediate attributes.""" body = {} if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConsumerTerms: """Deserializes the ConsumerTerms from a dictionary.""" - return cls(version=d.get("version", None)) + return cls(version=d.get("{version}", None)) @dataclass @@ -194,36 +194,36 @@ def as_dict(self) -> dict: """Serializes the ContactInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.company is not None: - body["company"] = self.company + body["{company}"] = self.company if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email if self.first_name is not None: - body["first_name"] = self.first_name + body["{first_name}"] = self.first_name if self.last_name is not None: - body["last_name"] = self.last_name + body["{last_name}"] = self.last_name return body def as_shallow_dict(self) -> dict: """Serializes the ContactInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.company is not None: - body["company"] = self.company + body["{company}"] = self.company if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email if self.first_name is not None: - body["first_name"] = self.first_name + body["{first_name}"] = self.first_name if self.last_name is not None: - body["last_name"] = self.last_name + body["{last_name}"] = self.last_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ContactInfo: """Deserializes the ContactInfo from a dictionary.""" return cls( - company=d.get("company", None), - email=d.get("email", None), - first_name=d.get("first_name", None), - last_name=d.get("last_name", None), + company=d.get("{company}", None), + email=d.get("{email}", None), + first_name=d.get("{first_name}", None), + last_name=d.get("{last_name}", None), ) @@ -241,20 +241,20 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeFilterRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter: - body["filter"] = self.filter.as_dict() + body["{filter}"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeFilterRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.filter: - body["filter"] = self.filter + body["{filter}"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeFilterRequest: """Deserializes the CreateExchangeFilterRequest from a dictionary.""" - return cls(filter=_from_dict(d, "filter", ExchangeFilter)) + return cls(filter=_from_dict(d, "{filter}", ExchangeFilter)) @dataclass @@ -265,20 +265,20 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeFilterResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter_id is not None: - body["filter_id"] = self.filter_id + body["{filter_id}"] = self.filter_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeFilterResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.filter_id is not None: - body["filter_id"] = self.filter_id + body["{filter_id}"] = self.filter_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeFilterResponse: """Deserializes the CreateExchangeFilterResponse from a dictionary.""" - return cls(filter_id=d.get("filter_id", None)) + return cls(filter_id=d.get("{filter_id}", None)) @dataclass @@ -289,20 +289,20 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["exchange"] = self.exchange.as_dict() + body["{exchange}"] = self.exchange.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["exchange"] = self.exchange + body["{exchange}"] = self.exchange return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeRequest: """Deserializes the CreateExchangeRequest from a dictionary.""" - return cls(exchange=_from_dict(d, "exchange", Exchange)) + return cls(exchange=_from_dict(d, "{exchange}", Exchange)) @dataclass @@ -313,20 +313,20 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeResponse: """Deserializes the CreateExchangeResponse from a dictionary.""" - return cls(exchange_id=d.get("exchange_id", None)) + return cls(exchange_id=d.get("{exchange_id}", None)) @dataclass @@ -343,36 +343,36 @@ def as_dict(self) -> dict: """Serializes the CreateFileRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.file_parent: - body["file_parent"] = self.file_parent.as_dict() + body["{file_parent}"] = self.file_parent.as_dict() if self.marketplace_file_type is not None: - body["marketplace_file_type"] = self.marketplace_file_type.value + body["{marketplace_file_type}"] = self.marketplace_file_type.value if self.mime_type is not None: - body["mime_type"] = self.mime_type + body["{mime_type}"] = self.mime_type return body def as_shallow_dict(self) -> dict: """Serializes the CreateFileRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.file_parent: - body["file_parent"] = self.file_parent + body["{file_parent}"] = self.file_parent if self.marketplace_file_type is not None: - body["marketplace_file_type"] = self.marketplace_file_type + body["{marketplace_file_type}"] = self.marketplace_file_type if self.mime_type is not None: - body["mime_type"] = self.mime_type + body["{mime_type}"] = self.mime_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFileRequest: """Deserializes the CreateFileRequest from a dictionary.""" return cls( - display_name=d.get("display_name", None), - file_parent=_from_dict(d, "file_parent", FileParent), - marketplace_file_type=_enum(d, "marketplace_file_type", MarketplaceFileType), - mime_type=d.get("mime_type", None), + display_name=d.get("{display_name}", None), + file_parent=_from_dict(d, "{file_parent}", FileParent), + marketplace_file_type=_enum(d, "{marketplace_file_type}", MarketplaceFileType), + mime_type=d.get("{mime_type}", None), ) @@ -387,24 +387,24 @@ def as_dict(self) -> dict: """Serializes the CreateFileResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_info: - body["file_info"] = self.file_info.as_dict() + body["{file_info}"] = self.file_info.as_dict() if self.upload_url is not None: - body["upload_url"] = self.upload_url + body["{upload_url}"] = self.upload_url return body def as_shallow_dict(self) -> dict: """Serializes the CreateFileResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.file_info: - body["file_info"] = self.file_info + body["{file_info}"] = self.file_info if self.upload_url is not None: - body["upload_url"] = self.upload_url + body["{upload_url}"] = self.upload_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFileResponse: """Deserializes the CreateFileResponse from a dictionary.""" - return cls(file_info=_from_dict(d, "file_info", FileInfo), upload_url=d.get("upload_url", None)) + return cls(file_info=_from_dict(d, "{file_info}", FileInfo), upload_url=d.get("{upload_url}", None)) @dataclass @@ -426,46 +426,46 @@ def as_dict(self) -> dict: """Serializes the CreateInstallationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.accepted_consumer_terms: - body["accepted_consumer_terms"] = self.accepted_consumer_terms.as_dict() + body["{accepted_consumer_terms}"] = self.accepted_consumer_terms.as_dict() if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type.value + body["{recipient_type}"] = self.recipient_type.value if self.repo_detail: - body["repo_detail"] = self.repo_detail.as_dict() + body["{repo_detail}"] = self.repo_detail.as_dict() if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name return body def as_shallow_dict(self) -> dict: """Serializes the CreateInstallationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.accepted_consumer_terms: - body["accepted_consumer_terms"] = self.accepted_consumer_terms + body["{accepted_consumer_terms}"] = self.accepted_consumer_terms if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type + body["{recipient_type}"] = self.recipient_type if self.repo_detail: - body["repo_detail"] = self.repo_detail + body["{repo_detail}"] = self.repo_detail if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateInstallationRequest: """Deserializes the CreateInstallationRequest from a dictionary.""" return cls( - accepted_consumer_terms=_from_dict(d, "accepted_consumer_terms", ConsumerTerms), - catalog_name=d.get("catalog_name", None), - listing_id=d.get("listing_id", None), - recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), - repo_detail=_from_dict(d, "repo_detail", RepoInstallation), - share_name=d.get("share_name", None), + accepted_consumer_terms=_from_dict(d, "{accepted_consumer_terms}", ConsumerTerms), + catalog_name=d.get("{catalog_name}", None), + listing_id=d.get("{listing_id}", None), + recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), + repo_detail=_from_dict(d, "{repo_detail}", RepoInstallation), + share_name=d.get("{share_name}", None), ) @@ -477,20 +477,20 @@ def as_dict(self) -> dict: """Serializes the CreateListingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing: - body["listing"] = self.listing.as_dict() + body["{listing}"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateListingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.listing: - body["listing"] = self.listing + body["{listing}"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateListingRequest: """Deserializes the CreateListingRequest from a dictionary.""" - return cls(listing=_from_dict(d, "listing", Listing)) + return cls(listing=_from_dict(d, "{listing}", Listing)) @dataclass @@ -501,20 +501,20 @@ def as_dict(self) -> dict: """Serializes the CreateListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateListingResponse: """Deserializes the CreateListingResponse from a dictionary.""" - return cls(listing_id=d.get("listing_id", None)) + return cls(listing_id=d.get("{listing_id}", None)) @dataclass @@ -543,61 +543,61 @@ def as_dict(self) -> dict: """Serializes the CreatePersonalizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.accepted_consumer_terms: - body["accepted_consumer_terms"] = self.accepted_consumer_terms.as_dict() + body["{accepted_consumer_terms}"] = self.accepted_consumer_terms.as_dict() if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.company is not None: - body["company"] = self.company + body["{company}"] = self.company if self.first_name is not None: - body["first_name"] = self.first_name + body["{first_name}"] = self.first_name if self.intended_use is not None: - body["intended_use"] = self.intended_use + body["{intended_use}"] = self.intended_use if self.is_from_lighthouse is not None: - body["is_from_lighthouse"] = self.is_from_lighthouse + body["{is_from_lighthouse}"] = self.is_from_lighthouse if self.last_name is not None: - body["last_name"] = self.last_name + body["{last_name}"] = self.last_name if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type.value + body["{recipient_type}"] = self.recipient_type.value return body def as_shallow_dict(self) -> dict: """Serializes the CreatePersonalizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.accepted_consumer_terms: - body["accepted_consumer_terms"] = self.accepted_consumer_terms + body["{accepted_consumer_terms}"] = self.accepted_consumer_terms if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.company is not None: - body["company"] = self.company + body["{company}"] = self.company if self.first_name is not None: - body["first_name"] = self.first_name + body["{first_name}"] = self.first_name if self.intended_use is not None: - body["intended_use"] = self.intended_use + body["{intended_use}"] = self.intended_use if self.is_from_lighthouse is not None: - body["is_from_lighthouse"] = self.is_from_lighthouse + body["{is_from_lighthouse}"] = self.is_from_lighthouse if self.last_name is not None: - body["last_name"] = self.last_name + body["{last_name}"] = self.last_name if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type + body["{recipient_type}"] = self.recipient_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePersonalizationRequest: """Deserializes the CreatePersonalizationRequest from a dictionary.""" return cls( - accepted_consumer_terms=_from_dict(d, "accepted_consumer_terms", ConsumerTerms), - comment=d.get("comment", None), - company=d.get("company", None), - first_name=d.get("first_name", None), - intended_use=d.get("intended_use", None), - is_from_lighthouse=d.get("is_from_lighthouse", None), - last_name=d.get("last_name", None), - listing_id=d.get("listing_id", None), - recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), + accepted_consumer_terms=_from_dict(d, "{accepted_consumer_terms}", ConsumerTerms), + comment=d.get("{comment}", None), + company=d.get("{company}", None), + first_name=d.get("{first_name}", None), + intended_use=d.get("{intended_use}", None), + is_from_lighthouse=d.get("{is_from_lighthouse}", None), + last_name=d.get("{last_name}", None), + listing_id=d.get("{listing_id}", None), + recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), ) @@ -609,20 +609,20 @@ def as_dict(self) -> dict: """Serializes the CreatePersonalizationRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the CreatePersonalizationRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePersonalizationRequestResponse: """Deserializes the CreatePersonalizationRequestResponse from a dictionary.""" - return cls(id=d.get("id", None)) + return cls(id=d.get("{id}", None)) @dataclass @@ -633,20 +633,20 @@ def as_dict(self) -> dict: """Serializes the CreateProviderRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.provider: - body["provider"] = self.provider.as_dict() + body["{provider}"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateProviderRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.provider: - body["provider"] = self.provider + body["{provider}"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateProviderRequest: """Deserializes the CreateProviderRequest from a dictionary.""" - return cls(provider=_from_dict(d, "provider", ProviderInfo)) + return cls(provider=_from_dict(d, "{provider}", ProviderInfo)) @dataclass @@ -657,20 +657,20 @@ def as_dict(self) -> dict: """Serializes the CreateProviderResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the CreateProviderResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateProviderResponse: """Deserializes the CreateProviderResponse from a dictionary.""" - return cls(id=d.get("id", None)) + return cls(id=d.get("{id}", None)) class DataRefresh(Enum): @@ -696,24 +696,24 @@ def as_dict(self) -> dict: """Serializes the DataRefreshInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.interval is not None: - body["interval"] = self.interval + body["{interval}"] = self.interval if self.unit is not None: - body["unit"] = self.unit.value + body["{unit}"] = self.unit.value return body def as_shallow_dict(self) -> dict: """Serializes the DataRefreshInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.interval is not None: - body["interval"] = self.interval + body["{interval}"] = self.interval if self.unit is not None: - body["unit"] = self.unit + body["{unit}"] = self.unit return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataRefreshInfo: """Deserializes the DataRefreshInfo from a dictionary.""" - return cls(interval=d.get("interval", None), unit=_enum(d, "unit", DataRefresh)) + return cls(interval=d.get("{interval}", None), unit=_enum(d, "{unit}", DataRefresh)) @dataclass @@ -854,61 +854,61 @@ def as_dict(self) -> dict: """Serializes the Exchange into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.filters: - body["filters"] = [v.as_dict() for v in self.filters] + body["{filters}"] = [v.as_dict() for v in self.filters] if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.linked_listings: - body["linked_listings"] = [v.as_dict() for v in self.linked_listings] + body["{linked_listings}"] = [v.as_dict() for v in self.linked_listings] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the Exchange into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.filters: - body["filters"] = self.filters + body["{filters}"] = self.filters if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.linked_listings: - body["linked_listings"] = self.linked_listings + body["{linked_listings}"] = self.linked_listings if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Exchange: """Deserializes the Exchange from a dictionary.""" return cls( - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - filters=_repeated_dict(d, "filters", ExchangeFilter), - id=d.get("id", None), - linked_listings=_repeated_dict(d, "linked_listings", ExchangeListing), - name=d.get("name", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + filters=_repeated_dict(d, "{filters}", ExchangeFilter), + id=d.get("{id}", None), + linked_listings=_repeated_dict(d, "{linked_listings}", ExchangeListing), + name=d.get("{name}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -936,61 +936,61 @@ def as_dict(self) -> dict: """Serializes the ExchangeFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id if self.filter_type is not None: - body["filter_type"] = self.filter_type.value + body["{filter_type}"] = self.filter_type.value if self.filter_value is not None: - body["filter_value"] = self.filter_value + body["{filter_value}"] = self.filter_value if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the ExchangeFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id if self.filter_type is not None: - body["filter_type"] = self.filter_type + body["{filter_type}"] = self.filter_type if self.filter_value is not None: - body["filter_value"] = self.filter_value + body["{filter_value}"] = self.filter_value if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeFilter: """Deserializes the ExchangeFilter from a dictionary.""" return cls( - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - exchange_id=d.get("exchange_id", None), - filter_type=_enum(d, "filter_type", ExchangeFilterType), - filter_value=d.get("filter_value", None), - id=d.get("id", None), - name=d.get("name", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + exchange_id=d.get("{exchange_id}", None), + filter_type=_enum(d, "{filter_type}", ExchangeFilterType), + filter_value=d.get("{filter_value}", None), + id=d.get("{id}", None), + name=d.get("{name}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -1019,51 +1019,51 @@ def as_dict(self) -> dict: """Serializes the ExchangeListing into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id if self.exchange_name is not None: - body["exchange_name"] = self.exchange_name + body["{exchange_name}"] = self.exchange_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.listing_name is not None: - body["listing_name"] = self.listing_name + body["{listing_name}"] = self.listing_name return body def as_shallow_dict(self) -> dict: """Serializes the ExchangeListing into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.exchange_id is not None: - body["exchange_id"] = self.exchange_id + body["{exchange_id}"] = self.exchange_id if self.exchange_name is not None: - body["exchange_name"] = self.exchange_name + body["{exchange_name}"] = self.exchange_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.listing_name is not None: - body["listing_name"] = self.listing_name + body["{listing_name}"] = self.listing_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeListing: """Deserializes the ExchangeListing from a dictionary.""" return cls( - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - exchange_id=d.get("exchange_id", None), - exchange_name=d.get("exchange_name", None), - id=d.get("id", None), - listing_id=d.get("listing_id", None), - listing_name=d.get("listing_name", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + exchange_id=d.get("{exchange_id}", None), + exchange_name=d.get("{exchange_name}", None), + id=d.get("{id}", None), + listing_id=d.get("{listing_id}", None), + listing_name=d.get("{listing_name}", None), ) @@ -1095,66 +1095,66 @@ def as_dict(self) -> dict: """Serializes the FileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.download_link is not None: - body["download_link"] = self.download_link + body["{download_link}"] = self.download_link if self.file_parent: - body["file_parent"] = self.file_parent.as_dict() + body["{file_parent}"] = self.file_parent.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.marketplace_file_type is not None: - body["marketplace_file_type"] = self.marketplace_file_type.value + body["{marketplace_file_type}"] = self.marketplace_file_type.value if self.mime_type is not None: - body["mime_type"] = self.mime_type + body["{mime_type}"] = self.mime_type if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body def as_shallow_dict(self) -> dict: """Serializes the FileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.download_link is not None: - body["download_link"] = self.download_link + body["{download_link}"] = self.download_link if self.file_parent: - body["file_parent"] = self.file_parent + body["{file_parent}"] = self.file_parent if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.marketplace_file_type is not None: - body["marketplace_file_type"] = self.marketplace_file_type + body["{marketplace_file_type}"] = self.marketplace_file_type if self.mime_type is not None: - body["mime_type"] = self.mime_type + body["{mime_type}"] = self.mime_type if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" return cls( - created_at=d.get("created_at", None), - display_name=d.get("display_name", None), - download_link=d.get("download_link", None), - file_parent=_from_dict(d, "file_parent", FileParent), - id=d.get("id", None), - marketplace_file_type=_enum(d, "marketplace_file_type", MarketplaceFileType), - mime_type=d.get("mime_type", None), - status=_enum(d, "status", FileStatus), - status_message=d.get("status_message", None), - updated_at=d.get("updated_at", None), + created_at=d.get("{created_at}", None), + display_name=d.get("{display_name}", None), + download_link=d.get("{download_link}", None), + file_parent=_from_dict(d, "{file_parent}", FileParent), + id=d.get("{id}", None), + marketplace_file_type=_enum(d, "{marketplace_file_type}", MarketplaceFileType), + mime_type=d.get("{mime_type}", None), + status=_enum(d, "{status}", FileStatus), + status_message=d.get("{status_message}", None), + updated_at=d.get("{updated_at}", None), ) @@ -1169,24 +1169,26 @@ def as_dict(self) -> dict: """Serializes the FileParent into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_parent_type is not None: - body["file_parent_type"] = self.file_parent_type.value + body["{file_parent_type}"] = self.file_parent_type.value if self.parent_id is not None: - body["parent_id"] = self.parent_id + body["{parent_id}"] = self.parent_id return body def as_shallow_dict(self) -> dict: """Serializes the FileParent into a shallow dictionary of its immediate attributes.""" body = {} if self.file_parent_type is not None: - body["file_parent_type"] = self.file_parent_type + body["{file_parent_type}"] = self.file_parent_type if self.parent_id is not None: - body["parent_id"] = self.parent_id + body["{parent_id}"] = self.parent_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileParent: """Deserializes the FileParent from a dictionary.""" - return cls(file_parent_type=_enum(d, "file_parent_type", FileParentType), parent_id=d.get("parent_id", None)) + return cls( + file_parent_type=_enum(d, "{file_parent_type}", FileParentType), parent_id=d.get("{parent_id}", None) + ) class FileParentType(Enum): @@ -1218,20 +1220,20 @@ def as_dict(self) -> dict: """Serializes the GetExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["exchange"] = self.exchange.as_dict() + body["{exchange}"] = self.exchange.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["exchange"] = self.exchange + body["{exchange}"] = self.exchange return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExchangeResponse: """Deserializes the GetExchangeResponse from a dictionary.""" - return cls(exchange=_from_dict(d, "exchange", Exchange)) + return cls(exchange=_from_dict(d, "{exchange}", Exchange)) @dataclass @@ -1242,20 +1244,20 @@ def as_dict(self) -> dict: """Serializes the GetFileResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_info: - body["file_info"] = self.file_info.as_dict() + body["{file_info}"] = self.file_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetFileResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.file_info: - body["file_info"] = self.file_info + body["{file_info}"] = self.file_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetFileResponse: """Deserializes the GetFileResponse from a dictionary.""" - return cls(file_info=_from_dict(d, "file_info", FileInfo)) + return cls(file_info=_from_dict(d, "{file_info}", FileInfo)) @dataclass @@ -1267,20 +1269,20 @@ def as_dict(self) -> dict: """Serializes the GetLatestVersionProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the GetLatestVersionProviderAnalyticsDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetLatestVersionProviderAnalyticsDashboardResponse: """Deserializes the GetLatestVersionProviderAnalyticsDashboardResponse from a dictionary.""" - return cls(version=d.get("version", None)) + return cls(version=d.get("{version}", None)) @dataclass @@ -1293,26 +1295,26 @@ def as_dict(self) -> dict: """Serializes the GetListingContentMetadataResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.shared_data_objects: - body["shared_data_objects"] = [v.as_dict() for v in self.shared_data_objects] + body["{shared_data_objects}"] = [v.as_dict() for v in self.shared_data_objects] return body def as_shallow_dict(self) -> dict: """Serializes the GetListingContentMetadataResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.shared_data_objects: - body["shared_data_objects"] = self.shared_data_objects + body["{shared_data_objects}"] = self.shared_data_objects return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetListingContentMetadataResponse: """Deserializes the GetListingContentMetadataResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - shared_data_objects=_repeated_dict(d, "shared_data_objects", SharedDataObject), + next_page_token=d.get("{next_page_token}", None), + shared_data_objects=_repeated_dict(d, "{shared_data_objects}", SharedDataObject), ) @@ -1324,20 +1326,20 @@ def as_dict(self) -> dict: """Serializes the GetListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing: - body["listing"] = self.listing.as_dict() + body["{listing}"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listing: - body["listing"] = self.listing + body["{listing}"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetListingResponse: """Deserializes the GetListingResponse from a dictionary.""" - return cls(listing=_from_dict(d, "listing", Listing)) + return cls(listing=_from_dict(d, "{listing}", Listing)) @dataclass @@ -1350,24 +1352,24 @@ def as_dict(self) -> dict: """Serializes the GetListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["listings"] = [v.as_dict() for v in self.listings] + body["{listings}"] = [v.as_dict() for v in self.listings] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the GetListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["listings"] = self.listings + body["{listings}"] = self.listings if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetListingsResponse: """Deserializes the GetListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "listings", Listing), next_page_token=d.get("next_page_token", None)) + return cls(listings=_repeated_dict(d, "{listings}", Listing), next_page_token=d.get("{next_page_token}", None)) @dataclass @@ -1378,20 +1380,20 @@ def as_dict(self) -> dict: """Serializes the GetPersonalizationRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.personalization_requests: - body["personalization_requests"] = [v.as_dict() for v in self.personalization_requests] + body["{personalization_requests}"] = [v.as_dict() for v in self.personalization_requests] return body def as_shallow_dict(self) -> dict: """Serializes the GetPersonalizationRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.personalization_requests: - body["personalization_requests"] = self.personalization_requests + body["{personalization_requests}"] = self.personalization_requests return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPersonalizationRequestResponse: """Deserializes the GetPersonalizationRequestResponse from a dictionary.""" - return cls(personalization_requests=_repeated_dict(d, "personalization_requests", PersonalizationRequest)) + return cls(personalization_requests=_repeated_dict(d, "{personalization_requests}", PersonalizationRequest)) @dataclass @@ -1402,20 +1404,20 @@ def as_dict(self) -> dict: """Serializes the GetProviderResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.provider: - body["provider"] = self.provider.as_dict() + body["{provider}"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetProviderResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.provider: - body["provider"] = self.provider + body["{provider}"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetProviderResponse: """Deserializes the GetProviderResponse from a dictionary.""" - return cls(provider=_from_dict(d, "provider", ProviderInfo)) + return cls(provider=_from_dict(d, "{provider}", ProviderInfo)) @dataclass @@ -1426,20 +1428,20 @@ def as_dict(self) -> dict: """Serializes the Installation into a dictionary suitable for use as a JSON request body.""" body = {} if self.installation: - body["installation"] = self.installation.as_dict() + body["{installation}"] = self.installation.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Installation into a shallow dictionary of its immediate attributes.""" body = {} if self.installation: - body["installation"] = self.installation + body["{installation}"] = self.installation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Installation: """Deserializes the Installation from a dictionary.""" - return cls(installation=_from_dict(d, "installation", InstallationDetail)) + return cls(installation=_from_dict(d, "{installation}", InstallationDetail)) @dataclass @@ -1474,81 +1476,81 @@ def as_dict(self) -> dict: """Serializes the InstallationDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.installed_on is not None: - body["installed_on"] = self.installed_on + body["{installed_on}"] = self.installed_on if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.listing_name is not None: - body["listing_name"] = self.listing_name + body["{listing_name}"] = self.listing_name if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type.value + body["{recipient_type}"] = self.recipient_type.value if self.repo_name is not None: - body["repo_name"] = self.repo_name + body["{repo_name}"] = self.repo_name if self.repo_path is not None: - body["repo_path"] = self.repo_path + body["{repo_path}"] = self.repo_path if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.token_detail: - body["token_detail"] = self.token_detail.as_dict() + body["{token_detail}"] = self.token_detail.as_dict() if self.tokens: - body["tokens"] = [v.as_dict() for v in self.tokens] + body["{tokens}"] = [v.as_dict() for v in self.tokens] return body def as_shallow_dict(self) -> dict: """Serializes the InstallationDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.installed_on is not None: - body["installed_on"] = self.installed_on + body["{installed_on}"] = self.installed_on if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.listing_name is not None: - body["listing_name"] = self.listing_name + body["{listing_name}"] = self.listing_name if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type + body["{recipient_type}"] = self.recipient_type if self.repo_name is not None: - body["repo_name"] = self.repo_name + body["{repo_name}"] = self.repo_name if self.repo_path is not None: - body["repo_path"] = self.repo_path + body["{repo_path}"] = self.repo_path if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.token_detail: - body["token_detail"] = self.token_detail + body["{token_detail}"] = self.token_detail if self.tokens: - body["tokens"] = self.tokens + body["{tokens}"] = self.tokens return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstallationDetail: """Deserializes the InstallationDetail from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - error_message=d.get("error_message", None), - id=d.get("id", None), - installed_on=d.get("installed_on", None), - listing_id=d.get("listing_id", None), - listing_name=d.get("listing_name", None), - recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), - repo_name=d.get("repo_name", None), - repo_path=d.get("repo_path", None), - share_name=d.get("share_name", None), - status=_enum(d, "status", InstallationStatus), - token_detail=_from_dict(d, "token_detail", TokenDetail), - tokens=_repeated_dict(d, "tokens", TokenInfo), + catalog_name=d.get("{catalog_name}", None), + error_message=d.get("{error_message}", None), + id=d.get("{id}", None), + installed_on=d.get("{installed_on}", None), + listing_id=d.get("{listing_id}", None), + listing_name=d.get("{listing_name}", None), + recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), + repo_name=d.get("{repo_name}", None), + repo_path=d.get("{repo_path}", None), + share_name=d.get("{share_name}", None), + status=_enum(d, "{status}", InstallationStatus), + token_detail=_from_dict(d, "{token_detail}", TokenDetail), + tokens=_repeated_dict(d, "{tokens}", TokenInfo), ) @@ -1568,26 +1570,26 @@ def as_dict(self) -> dict: """Serializes the ListAllInstallationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.installations: - body["installations"] = [v.as_dict() for v in self.installations] + body["{installations}"] = [v.as_dict() for v in self.installations] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListAllInstallationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.installations: - body["installations"] = self.installations + body["{installations}"] = self.installations if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAllInstallationsResponse: """Deserializes the ListAllInstallationsResponse from a dictionary.""" return cls( - installations=_repeated_dict(d, "installations", InstallationDetail), - next_page_token=d.get("next_page_token", None), + installations=_repeated_dict(d, "{installations}", InstallationDetail), + next_page_token=d.get("{next_page_token}", None), ) @@ -1601,26 +1603,26 @@ def as_dict(self) -> dict: """Serializes the ListAllPersonalizationRequestsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.personalization_requests: - body["personalization_requests"] = [v.as_dict() for v in self.personalization_requests] + body["{personalization_requests}"] = [v.as_dict() for v in self.personalization_requests] return body def as_shallow_dict(self) -> dict: """Serializes the ListAllPersonalizationRequestsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.personalization_requests: - body["personalization_requests"] = self.personalization_requests + body["{personalization_requests}"] = self.personalization_requests return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAllPersonalizationRequestsResponse: """Deserializes the ListAllPersonalizationRequestsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - personalization_requests=_repeated_dict(d, "personalization_requests", PersonalizationRequest), + next_page_token=d.get("{next_page_token}", None), + personalization_requests=_repeated_dict(d, "{personalization_requests}", PersonalizationRequest), ) @@ -1634,24 +1636,26 @@ def as_dict(self) -> dict: """Serializes the ListExchangeFiltersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.filters: - body["filters"] = [v.as_dict() for v in self.filters] + body["{filters}"] = [v.as_dict() for v in self.filters] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListExchangeFiltersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.filters: - body["filters"] = self.filters + body["{filters}"] = self.filters if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExchangeFiltersResponse: """Deserializes the ListExchangeFiltersResponse from a dictionary.""" - return cls(filters=_repeated_dict(d, "filters", ExchangeFilter), next_page_token=d.get("next_page_token", None)) + return cls( + filters=_repeated_dict(d, "{filters}", ExchangeFilter), next_page_token=d.get("{next_page_token}", None) + ) @dataclass @@ -1664,26 +1668,26 @@ def as_dict(self) -> dict: """Serializes the ListExchangesForListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_listing: - body["exchange_listing"] = [v.as_dict() for v in self.exchange_listing] + body["{exchange_listing}"] = [v.as_dict() for v in self.exchange_listing] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListExchangesForListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_listing: - body["exchange_listing"] = self.exchange_listing + body["{exchange_listing}"] = self.exchange_listing if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExchangesForListingResponse: """Deserializes the ListExchangesForListingResponse from a dictionary.""" return cls( - exchange_listing=_repeated_dict(d, "exchange_listing", ExchangeListing), - next_page_token=d.get("next_page_token", None), + exchange_listing=_repeated_dict(d, "{exchange_listing}", ExchangeListing), + next_page_token=d.get("{next_page_token}", None), ) @@ -1697,24 +1701,26 @@ def as_dict(self) -> dict: """Serializes the ListExchangesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchanges: - body["exchanges"] = [v.as_dict() for v in self.exchanges] + body["{exchanges}"] = [v.as_dict() for v in self.exchanges] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListExchangesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchanges: - body["exchanges"] = self.exchanges + body["{exchanges}"] = self.exchanges if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExchangesResponse: """Deserializes the ListExchangesResponse from a dictionary.""" - return cls(exchanges=_repeated_dict(d, "exchanges", Exchange), next_page_token=d.get("next_page_token", None)) + return cls( + exchanges=_repeated_dict(d, "{exchanges}", Exchange), next_page_token=d.get("{next_page_token}", None) + ) @dataclass @@ -1727,24 +1733,26 @@ def as_dict(self) -> dict: """Serializes the ListFilesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_infos: - body["file_infos"] = [v.as_dict() for v in self.file_infos] + body["{file_infos}"] = [v.as_dict() for v in self.file_infos] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListFilesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.file_infos: - body["file_infos"] = self.file_infos + body["{file_infos}"] = self.file_infos if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFilesResponse: """Deserializes the ListFilesResponse from a dictionary.""" - return cls(file_infos=_repeated_dict(d, "file_infos", FileInfo), next_page_token=d.get("next_page_token", None)) + return cls( + file_infos=_repeated_dict(d, "{file_infos}", FileInfo), next_page_token=d.get("{next_page_token}", None) + ) @dataclass @@ -1757,26 +1765,26 @@ def as_dict(self) -> dict: """Serializes the ListFulfillmentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.fulfillments: - body["fulfillments"] = [v.as_dict() for v in self.fulfillments] + body["{fulfillments}"] = [v.as_dict() for v in self.fulfillments] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListFulfillmentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.fulfillments: - body["fulfillments"] = self.fulfillments + body["{fulfillments}"] = self.fulfillments if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFulfillmentsResponse: """Deserializes the ListFulfillmentsResponse from a dictionary.""" return cls( - fulfillments=_repeated_dict(d, "fulfillments", ListingFulfillment), - next_page_token=d.get("next_page_token", None), + fulfillments=_repeated_dict(d, "{fulfillments}", ListingFulfillment), + next_page_token=d.get("{next_page_token}", None), ) @@ -1790,26 +1798,26 @@ def as_dict(self) -> dict: """Serializes the ListInstallationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.installations: - body["installations"] = [v.as_dict() for v in self.installations] + body["{installations}"] = [v.as_dict() for v in self.installations] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListInstallationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.installations: - body["installations"] = self.installations + body["{installations}"] = self.installations if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListInstallationsResponse: """Deserializes the ListInstallationsResponse from a dictionary.""" return cls( - installations=_repeated_dict(d, "installations", InstallationDetail), - next_page_token=d.get("next_page_token", None), + installations=_repeated_dict(d, "{installations}", InstallationDetail), + next_page_token=d.get("{next_page_token}", None), ) @@ -1823,26 +1831,26 @@ def as_dict(self) -> dict: """Serializes the ListListingsForExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_listings: - body["exchange_listings"] = [v.as_dict() for v in self.exchange_listings] + body["{exchange_listings}"] = [v.as_dict() for v in self.exchange_listings] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListListingsForExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_listings: - body["exchange_listings"] = self.exchange_listings + body["{exchange_listings}"] = self.exchange_listings if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListListingsForExchangeResponse: """Deserializes the ListListingsForExchangeResponse from a dictionary.""" return cls( - exchange_listings=_repeated_dict(d, "exchange_listings", ExchangeListing), - next_page_token=d.get("next_page_token", None), + exchange_listings=_repeated_dict(d, "{exchange_listings}", ExchangeListing), + next_page_token=d.get("{next_page_token}", None), ) @@ -1856,24 +1864,24 @@ def as_dict(self) -> dict: """Serializes the ListListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["listings"] = [v.as_dict() for v in self.listings] + body["{listings}"] = [v.as_dict() for v in self.listings] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["listings"] = self.listings + body["{listings}"] = self.listings if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListListingsResponse: """Deserializes the ListListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "listings", Listing), next_page_token=d.get("next_page_token", None)) + return cls(listings=_repeated_dict(d, "{listings}", Listing), next_page_token=d.get("{next_page_token}", None)) @dataclass @@ -1889,28 +1897,28 @@ def as_dict(self) -> dict: """Serializes the ListProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the ListProviderAnalyticsDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProviderAnalyticsDashboardResponse: """Deserializes the ListProviderAnalyticsDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("dashboard_id", None), id=d.get("id", None), version=d.get("version", None)) + return cls(dashboard_id=d.get("{dashboard_id}", None), id=d.get("{id}", None), version=d.get("{version}", None)) @dataclass @@ -1923,25 +1931,25 @@ def as_dict(self) -> dict: """Serializes the ListProvidersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.providers: - body["providers"] = [v.as_dict() for v in self.providers] + body["{providers}"] = [v.as_dict() for v in self.providers] return body def as_shallow_dict(self) -> dict: """Serializes the ListProvidersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.providers: - body["providers"] = self.providers + body["{providers}"] = self.providers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProvidersResponse: """Deserializes the ListProvidersResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), providers=_repeated_dict(d, "providers", ProviderInfo) + next_page_token=d.get("{next_page_token}", None), providers=_repeated_dict(d, "{providers}", ProviderInfo) ) @@ -1957,31 +1965,31 @@ def as_dict(self) -> dict: """Serializes the Listing into a dictionary suitable for use as a JSON request body.""" body = {} if self.detail: - body["detail"] = self.detail.as_dict() + body["{detail}"] = self.detail.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.summary: - body["summary"] = self.summary.as_dict() + body["{summary}"] = self.summary.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Listing into a shallow dictionary of its immediate attributes.""" body = {} if self.detail: - body["detail"] = self.detail + body["{detail}"] = self.detail if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.summary: - body["summary"] = self.summary + body["{summary}"] = self.summary return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Listing: """Deserializes the Listing from a dictionary.""" return cls( - detail=_from_dict(d, "detail", ListingDetail), - id=d.get("id", None), - summary=_from_dict(d, "summary", ListingSummary), + detail=_from_dict(d, "{detail}", ListingDetail), + id=d.get("{id}", None), + summary=_from_dict(d, "{summary}", ListingSummary), ) @@ -2048,111 +2056,111 @@ def as_dict(self) -> dict: """Serializes the ListingDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets: - body["assets"] = [v.value for v in self.assets] + body["{assets}"] = [v.value for v in self.assets] if self.collection_date_end is not None: - body["collection_date_end"] = self.collection_date_end + body["{collection_date_end}"] = self.collection_date_end if self.collection_date_start is not None: - body["collection_date_start"] = self.collection_date_start + body["{collection_date_start}"] = self.collection_date_start if self.collection_granularity: - body["collection_granularity"] = self.collection_granularity.as_dict() + body["{collection_granularity}"] = self.collection_granularity.as_dict() if self.cost is not None: - body["cost"] = self.cost.value + body["{cost}"] = self.cost.value if self.data_source is not None: - body["data_source"] = self.data_source + body["{data_source}"] = self.data_source if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.documentation_link is not None: - body["documentation_link"] = self.documentation_link + body["{documentation_link}"] = self.documentation_link if self.embedded_notebook_file_infos: - body["embedded_notebook_file_infos"] = [v.as_dict() for v in self.embedded_notebook_file_infos] + body["{embedded_notebook_file_infos}"] = [v.as_dict() for v in self.embedded_notebook_file_infos] if self.file_ids: - body["file_ids"] = [v for v in self.file_ids] + body["{file_ids}"] = [v for v in self.file_ids] if self.geographical_coverage is not None: - body["geographical_coverage"] = self.geographical_coverage + body["{geographical_coverage}"] = self.geographical_coverage if self.license is not None: - body["license"] = self.license + body["{license}"] = self.license if self.pricing_model is not None: - body["pricing_model"] = self.pricing_model + body["{pricing_model}"] = self.pricing_model if self.privacy_policy_link is not None: - body["privacy_policy_link"] = self.privacy_policy_link + body["{privacy_policy_link}"] = self.privacy_policy_link if self.size is not None: - body["size"] = self.size + body["{size}"] = self.size if self.support_link is not None: - body["support_link"] = self.support_link + body["{support_link}"] = self.support_link if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.terms_of_service is not None: - body["terms_of_service"] = self.terms_of_service + body["{terms_of_service}"] = self.terms_of_service if self.update_frequency: - body["update_frequency"] = self.update_frequency.as_dict() + body["{update_frequency}"] = self.update_frequency.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ListingDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.assets: - body["assets"] = self.assets + body["{assets}"] = self.assets if self.collection_date_end is not None: - body["collection_date_end"] = self.collection_date_end + body["{collection_date_end}"] = self.collection_date_end if self.collection_date_start is not None: - body["collection_date_start"] = self.collection_date_start + body["{collection_date_start}"] = self.collection_date_start if self.collection_granularity: - body["collection_granularity"] = self.collection_granularity + body["{collection_granularity}"] = self.collection_granularity if self.cost is not None: - body["cost"] = self.cost + body["{cost}"] = self.cost if self.data_source is not None: - body["data_source"] = self.data_source + body["{data_source}"] = self.data_source if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.documentation_link is not None: - body["documentation_link"] = self.documentation_link + body["{documentation_link}"] = self.documentation_link if self.embedded_notebook_file_infos: - body["embedded_notebook_file_infos"] = self.embedded_notebook_file_infos + body["{embedded_notebook_file_infos}"] = self.embedded_notebook_file_infos if self.file_ids: - body["file_ids"] = self.file_ids + body["{file_ids}"] = self.file_ids if self.geographical_coverage is not None: - body["geographical_coverage"] = self.geographical_coverage + body["{geographical_coverage}"] = self.geographical_coverage if self.license is not None: - body["license"] = self.license + body["{license}"] = self.license if self.pricing_model is not None: - body["pricing_model"] = self.pricing_model + body["{pricing_model}"] = self.pricing_model if self.privacy_policy_link is not None: - body["privacy_policy_link"] = self.privacy_policy_link + body["{privacy_policy_link}"] = self.privacy_policy_link if self.size is not None: - body["size"] = self.size + body["{size}"] = self.size if self.support_link is not None: - body["support_link"] = self.support_link + body["{support_link}"] = self.support_link if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.terms_of_service is not None: - body["terms_of_service"] = self.terms_of_service + body["{terms_of_service}"] = self.terms_of_service if self.update_frequency: - body["update_frequency"] = self.update_frequency + body["{update_frequency}"] = self.update_frequency return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingDetail: """Deserializes the ListingDetail from a dictionary.""" return cls( - assets=_repeated_enum(d, "assets", AssetType), - collection_date_end=d.get("collection_date_end", None), - collection_date_start=d.get("collection_date_start", None), - collection_granularity=_from_dict(d, "collection_granularity", DataRefreshInfo), - cost=_enum(d, "cost", Cost), - data_source=d.get("data_source", None), - description=d.get("description", None), - documentation_link=d.get("documentation_link", None), - embedded_notebook_file_infos=_repeated_dict(d, "embedded_notebook_file_infos", FileInfo), - file_ids=d.get("file_ids", None), - geographical_coverage=d.get("geographical_coverage", None), - license=d.get("license", None), - pricing_model=d.get("pricing_model", None), - privacy_policy_link=d.get("privacy_policy_link", None), - size=d.get("size", None), - support_link=d.get("support_link", None), - tags=_repeated_dict(d, "tags", ListingTag), - terms_of_service=d.get("terms_of_service", None), - update_frequency=_from_dict(d, "update_frequency", DataRefreshInfo), + assets=_repeated_enum(d, "{assets}", AssetType), + collection_date_end=d.get("{collection_date_end}", None), + collection_date_start=d.get("{collection_date_start}", None), + collection_granularity=_from_dict(d, "{collection_granularity}", DataRefreshInfo), + cost=_enum(d, "{cost}", Cost), + data_source=d.get("{data_source}", None), + description=d.get("{description}", None), + documentation_link=d.get("{documentation_link}", None), + embedded_notebook_file_infos=_repeated_dict(d, "{embedded_notebook_file_infos}", FileInfo), + file_ids=d.get("{file_ids}", None), + geographical_coverage=d.get("{geographical_coverage}", None), + license=d.get("{license}", None), + pricing_model=d.get("{pricing_model}", None), + privacy_policy_link=d.get("{privacy_policy_link}", None), + size=d.get("{size}", None), + support_link=d.get("{support_link}", None), + tags=_repeated_dict(d, "{tags}", ListingTag), + terms_of_service=d.get("{terms_of_service}", None), + update_frequency=_from_dict(d, "{update_frequency}", DataRefreshInfo), ) @@ -2172,41 +2180,41 @@ def as_dict(self) -> dict: """Serializes the ListingFulfillment into a dictionary suitable for use as a JSON request body.""" body = {} if self.fulfillment_type is not None: - body["fulfillment_type"] = self.fulfillment_type.value + body["{fulfillment_type}"] = self.fulfillment_type.value if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type.value + body["{recipient_type}"] = self.recipient_type.value if self.repo_info: - body["repo_info"] = self.repo_info.as_dict() + body["{repo_info}"] = self.repo_info.as_dict() if self.share_info: - body["share_info"] = self.share_info.as_dict() + body["{share_info}"] = self.share_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ListingFulfillment into a shallow dictionary of its immediate attributes.""" body = {} if self.fulfillment_type is not None: - body["fulfillment_type"] = self.fulfillment_type + body["{fulfillment_type}"] = self.fulfillment_type if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type + body["{recipient_type}"] = self.recipient_type if self.repo_info: - body["repo_info"] = self.repo_info + body["{repo_info}"] = self.repo_info if self.share_info: - body["share_info"] = self.share_info + body["{share_info}"] = self.share_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingFulfillment: """Deserializes the ListingFulfillment from a dictionary.""" return cls( - fulfillment_type=_enum(d, "fulfillment_type", FulfillmentType), - listing_id=d.get("listing_id", None), - recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), - repo_info=_from_dict(d, "repo_info", RepoInfo), - share_info=_from_dict(d, "share_info", ShareInfo), + fulfillment_type=_enum(d, "{fulfillment_type}", FulfillmentType), + listing_id=d.get("{listing_id}", None), + recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), + repo_info=_from_dict(d, "{repo_info}", RepoInfo), + share_info=_from_dict(d, "{share_info}", ShareInfo), ) @@ -2218,20 +2226,20 @@ def as_dict(self) -> dict: """Serializes the ListingSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.visibility is not None: - body["visibility"] = self.visibility.value + body["{visibility}"] = self.visibility.value return body def as_shallow_dict(self) -> dict: """Serializes the ListingSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.visibility is not None: - body["visibility"] = self.visibility + body["{visibility}"] = self.visibility return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingSetting: """Deserializes the ListingSetting from a dictionary.""" - return cls(visibility=_enum(d, "visibility", Visibility)) + return cls(visibility=_enum(d, "{visibility}", Visibility)) class ListingShareType(Enum): @@ -2296,111 +2304,111 @@ def as_dict(self) -> dict: """Serializes the ListingSummary into a dictionary suitable for use as a JSON request body.""" body = {} if self.categories: - body["categories"] = [v.value for v in self.categories] + body["{categories}"] = [v.value for v in self.categories] if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.created_by_id is not None: - body["created_by_id"] = self.created_by_id + body["{created_by_id}"] = self.created_by_id if self.exchange_ids: - body["exchange_ids"] = [v for v in self.exchange_ids] + body["{exchange_ids}"] = [v for v in self.exchange_ids] if self.git_repo: - body["git_repo"] = self.git_repo.as_dict() + body["{git_repo}"] = self.git_repo.as_dict() if self.listing_type is not None: - body["listingType"] = self.listing_type.value + body["{listing_type}"] = self.listing_type.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.provider_id is not None: - body["provider_id"] = self.provider_id + body["{provider_id}"] = self.provider_id if self.provider_region: - body["provider_region"] = self.provider_region.as_dict() + body["{provider_region}"] = self.provider_region.as_dict() if self.published_at is not None: - body["published_at"] = self.published_at + body["{published_at}"] = self.published_at if self.published_by is not None: - body["published_by"] = self.published_by + body["{published_by}"] = self.published_by if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() if self.share: - body["share"] = self.share.as_dict() + body["{share}"] = self.share.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.subtitle is not None: - body["subtitle"] = self.subtitle + body["{subtitle}"] = self.subtitle if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.updated_by_id is not None: - body["updated_by_id"] = self.updated_by_id + body["{updated_by_id}"] = self.updated_by_id return body def as_shallow_dict(self) -> dict: """Serializes the ListingSummary into a shallow dictionary of its immediate attributes.""" body = {} if self.categories: - body["categories"] = self.categories + body["{categories}"] = self.categories if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.created_by_id is not None: - body["created_by_id"] = self.created_by_id + body["{created_by_id}"] = self.created_by_id if self.exchange_ids: - body["exchange_ids"] = self.exchange_ids + body["{exchange_ids}"] = self.exchange_ids if self.git_repo: - body["git_repo"] = self.git_repo + body["{git_repo}"] = self.git_repo if self.listing_type is not None: - body["listingType"] = self.listing_type + body["{listing_type}"] = self.listing_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.provider_id is not None: - body["provider_id"] = self.provider_id + body["{provider_id}"] = self.provider_id if self.provider_region: - body["provider_region"] = self.provider_region + body["{provider_region}"] = self.provider_region if self.published_at is not None: - body["published_at"] = self.published_at + body["{published_at}"] = self.published_at if self.published_by is not None: - body["published_by"] = self.published_by + body["{published_by}"] = self.published_by if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting if self.share: - body["share"] = self.share + body["{share}"] = self.share if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.subtitle is not None: - body["subtitle"] = self.subtitle + body["{subtitle}"] = self.subtitle if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by if self.updated_by_id is not None: - body["updated_by_id"] = self.updated_by_id + body["{updated_by_id}"] = self.updated_by_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingSummary: """Deserializes the ListingSummary from a dictionary.""" return cls( - categories=_repeated_enum(d, "categories", Category), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - created_by_id=d.get("created_by_id", None), - exchange_ids=d.get("exchange_ids", None), - git_repo=_from_dict(d, "git_repo", RepoInfo), - listing_type=_enum(d, "listingType", ListingType), - name=d.get("name", None), - provider_id=d.get("provider_id", None), - provider_region=_from_dict(d, "provider_region", RegionInfo), - published_at=d.get("published_at", None), - published_by=d.get("published_by", None), - setting=_from_dict(d, "setting", ListingSetting), - share=_from_dict(d, "share", ShareInfo), - status=_enum(d, "status", ListingStatus), - subtitle=d.get("subtitle", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), - updated_by_id=d.get("updated_by_id", None), + categories=_repeated_enum(d, "{categories}", Category), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + created_by_id=d.get("{created_by_id}", None), + exchange_ids=d.get("{exchange_ids}", None), + git_repo=_from_dict(d, "{git_repo}", RepoInfo), + listing_type=_enum(d, "{listing_type}", ListingType), + name=d.get("{name}", None), + provider_id=d.get("{provider_id}", None), + provider_region=_from_dict(d, "{provider_region}", RegionInfo), + published_at=d.get("{published_at}", None), + published_by=d.get("{published_by}", None), + setting=_from_dict(d, "{setting}", ListingSetting), + share=_from_dict(d, "{share}", ShareInfo), + status=_enum(d, "{status}", ListingStatus), + subtitle=d.get("{subtitle}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), + updated_by_id=d.get("{updated_by_id}", None), ) @@ -2416,24 +2424,24 @@ def as_dict(self) -> dict: """Serializes the ListingTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.tag_name is not None: - body["tag_name"] = self.tag_name.value + body["{tag_name}"] = self.tag_name.value if self.tag_values: - body["tag_values"] = [v for v in self.tag_values] + body["{tag_values}"] = [v for v in self.tag_values] return body def as_shallow_dict(self) -> dict: """Serializes the ListingTag into a shallow dictionary of its immediate attributes.""" body = {} if self.tag_name is not None: - body["tag_name"] = self.tag_name + body["{tag_name}"] = self.tag_name if self.tag_values: - body["tag_values"] = self.tag_values + body["{tag_values}"] = self.tag_values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingTag: """Deserializes the ListingTag from a dictionary.""" - return cls(tag_name=_enum(d, "tag_name", ListingTagType), tag_values=d.get("tag_values", None)) + return cls(tag_name=_enum(d, "{tag_name}", ListingTagType), tag_values=d.get("{tag_values}", None)) class ListingTagType(Enum): @@ -2494,96 +2502,96 @@ def as_dict(self) -> dict: """Serializes the PersonalizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.consumer_region: - body["consumer_region"] = self.consumer_region.as_dict() + body["{consumer_region}"] = self.consumer_region.as_dict() if self.contact_info: - body["contact_info"] = self.contact_info.as_dict() + body["{contact_info}"] = self.contact_info.as_dict() if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.intended_use is not None: - body["intended_use"] = self.intended_use + body["{intended_use}"] = self.intended_use if self.is_from_lighthouse is not None: - body["is_from_lighthouse"] = self.is_from_lighthouse + body["{is_from_lighthouse}"] = self.is_from_lighthouse if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.listing_name is not None: - body["listing_name"] = self.listing_name + body["{listing_name}"] = self.listing_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.provider_id is not None: - body["provider_id"] = self.provider_id + body["{provider_id}"] = self.provider_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type.value + body["{recipient_type}"] = self.recipient_type.value if self.share: - body["share"] = self.share.as_dict() + body["{share}"] = self.share.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body def as_shallow_dict(self) -> dict: """Serializes the PersonalizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.consumer_region: - body["consumer_region"] = self.consumer_region + body["{consumer_region}"] = self.consumer_region if self.contact_info: - body["contact_info"] = self.contact_info + body["{contact_info}"] = self.contact_info if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.intended_use is not None: - body["intended_use"] = self.intended_use + body["{intended_use}"] = self.intended_use if self.is_from_lighthouse is not None: - body["is_from_lighthouse"] = self.is_from_lighthouse + body["{is_from_lighthouse}"] = self.is_from_lighthouse if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.listing_name is not None: - body["listing_name"] = self.listing_name + body["{listing_name}"] = self.listing_name if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.provider_id is not None: - body["provider_id"] = self.provider_id + body["{provider_id}"] = self.provider_id if self.recipient_type is not None: - body["recipient_type"] = self.recipient_type + body["{recipient_type}"] = self.recipient_type if self.share: - body["share"] = self.share + body["{share}"] = self.share if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PersonalizationRequest: """Deserializes the PersonalizationRequest from a dictionary.""" return cls( - comment=d.get("comment", None), - consumer_region=_from_dict(d, "consumer_region", RegionInfo), - contact_info=_from_dict(d, "contact_info", ContactInfo), - created_at=d.get("created_at", None), - id=d.get("id", None), - intended_use=d.get("intended_use", None), - is_from_lighthouse=d.get("is_from_lighthouse", None), - listing_id=d.get("listing_id", None), - listing_name=d.get("listing_name", None), - metastore_id=d.get("metastore_id", None), - provider_id=d.get("provider_id", None), - recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), - share=_from_dict(d, "share", ShareInfo), - status=_enum(d, "status", PersonalizationRequestStatus), - status_message=d.get("status_message", None), - updated_at=d.get("updated_at", None), + comment=d.get("{comment}", None), + consumer_region=_from_dict(d, "{consumer_region}", RegionInfo), + contact_info=_from_dict(d, "{contact_info}", ContactInfo), + created_at=d.get("{created_at}", None), + id=d.get("{id}", None), + intended_use=d.get("{intended_use}", None), + is_from_lighthouse=d.get("{is_from_lighthouse}", None), + listing_id=d.get("{listing_id}", None), + listing_name=d.get("{listing_name}", None), + metastore_id=d.get("{metastore_id}", None), + provider_id=d.get("{provider_id}", None), + recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), + share=_from_dict(d, "{share}", ShareInfo), + status=_enum(d, "{status}", PersonalizationRequestStatus), + status_message=d.get("{status_message}", None), + updated_at=d.get("{updated_at}", None), ) @@ -2603,20 +2611,20 @@ def as_dict(self) -> dict: """Serializes the ProviderAnalyticsDashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the ProviderAnalyticsDashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderAnalyticsDashboard: """Deserializes the ProviderAnalyticsDashboard from a dictionary.""" - return cls(id=d.get("id", None)) + return cls(id=d.get("{id}", None)) @dataclass @@ -2655,86 +2663,86 @@ def as_dict(self) -> dict: """Serializes the ProviderInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.business_contact_email is not None: - body["business_contact_email"] = self.business_contact_email + body["{business_contact_email}"] = self.business_contact_email if self.company_website_link is not None: - body["company_website_link"] = self.company_website_link + body["{company_website_link}"] = self.company_website_link if self.dark_mode_icon_file_id is not None: - body["dark_mode_icon_file_id"] = self.dark_mode_icon_file_id + body["{dark_mode_icon_file_id}"] = self.dark_mode_icon_file_id if self.dark_mode_icon_file_path is not None: - body["dark_mode_icon_file_path"] = self.dark_mode_icon_file_path + body["{dark_mode_icon_file_path}"] = self.dark_mode_icon_file_path if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.icon_file_id is not None: - body["icon_file_id"] = self.icon_file_id + body["{icon_file_id}"] = self.icon_file_id if self.icon_file_path is not None: - body["icon_file_path"] = self.icon_file_path + body["{icon_file_path}"] = self.icon_file_path if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_featured is not None: - body["is_featured"] = self.is_featured + body["{is_featured}"] = self.is_featured if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.privacy_policy_link is not None: - body["privacy_policy_link"] = self.privacy_policy_link + body["{privacy_policy_link}"] = self.privacy_policy_link if self.published_by is not None: - body["published_by"] = self.published_by + body["{published_by}"] = self.published_by if self.support_contact_email is not None: - body["support_contact_email"] = self.support_contact_email + body["{support_contact_email}"] = self.support_contact_email if self.term_of_service_link is not None: - body["term_of_service_link"] = self.term_of_service_link + body["{term_of_service_link}"] = self.term_of_service_link return body def as_shallow_dict(self) -> dict: """Serializes the ProviderInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.business_contact_email is not None: - body["business_contact_email"] = self.business_contact_email + body["{business_contact_email}"] = self.business_contact_email if self.company_website_link is not None: - body["company_website_link"] = self.company_website_link + body["{company_website_link}"] = self.company_website_link if self.dark_mode_icon_file_id is not None: - body["dark_mode_icon_file_id"] = self.dark_mode_icon_file_id + body["{dark_mode_icon_file_id}"] = self.dark_mode_icon_file_id if self.dark_mode_icon_file_path is not None: - body["dark_mode_icon_file_path"] = self.dark_mode_icon_file_path + body["{dark_mode_icon_file_path}"] = self.dark_mode_icon_file_path if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.icon_file_id is not None: - body["icon_file_id"] = self.icon_file_id + body["{icon_file_id}"] = self.icon_file_id if self.icon_file_path is not None: - body["icon_file_path"] = self.icon_file_path + body["{icon_file_path}"] = self.icon_file_path if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_featured is not None: - body["is_featured"] = self.is_featured + body["{is_featured}"] = self.is_featured if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.privacy_policy_link is not None: - body["privacy_policy_link"] = self.privacy_policy_link + body["{privacy_policy_link}"] = self.privacy_policy_link if self.published_by is not None: - body["published_by"] = self.published_by + body["{published_by}"] = self.published_by if self.support_contact_email is not None: - body["support_contact_email"] = self.support_contact_email + body["{support_contact_email}"] = self.support_contact_email if self.term_of_service_link is not None: - body["term_of_service_link"] = self.term_of_service_link + body["{term_of_service_link}"] = self.term_of_service_link return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderInfo: """Deserializes the ProviderInfo from a dictionary.""" return cls( - business_contact_email=d.get("business_contact_email", None), - company_website_link=d.get("company_website_link", None), - dark_mode_icon_file_id=d.get("dark_mode_icon_file_id", None), - dark_mode_icon_file_path=d.get("dark_mode_icon_file_path", None), - description=d.get("description", None), - icon_file_id=d.get("icon_file_id", None), - icon_file_path=d.get("icon_file_path", None), - id=d.get("id", None), - is_featured=d.get("is_featured", None), - name=d.get("name", None), - privacy_policy_link=d.get("privacy_policy_link", None), - published_by=d.get("published_by", None), - support_contact_email=d.get("support_contact_email", None), - term_of_service_link=d.get("term_of_service_link", None), + business_contact_email=d.get("{business_contact_email}", None), + company_website_link=d.get("{company_website_link}", None), + dark_mode_icon_file_id=d.get("{dark_mode_icon_file_id}", None), + dark_mode_icon_file_path=d.get("{dark_mode_icon_file_path}", None), + description=d.get("{description}", None), + icon_file_id=d.get("{icon_file_id}", None), + icon_file_path=d.get("{icon_file_path}", None), + id=d.get("{id}", None), + is_featured=d.get("{is_featured}", None), + name=d.get("{name}", None), + privacy_policy_link=d.get("{privacy_policy_link}", None), + published_by=d.get("{published_by}", None), + support_contact_email=d.get("{support_contact_email}", None), + term_of_service_link=d.get("{term_of_service_link}", None), ) @@ -2748,24 +2756,24 @@ def as_dict(self) -> dict: """Serializes the RegionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the RegionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegionInfo: """Deserializes the RegionInfo from a dictionary.""" - return cls(cloud=d.get("cloud", None), region=d.get("region", None)) + return cls(cloud=d.get("{cloud}", None), region=d.get("{region}", None)) @dataclass @@ -2795,20 +2803,20 @@ def as_dict(self) -> dict: """Serializes the RepoInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.git_repo_url is not None: - body["git_repo_url"] = self.git_repo_url + body["{git_repo_url}"] = self.git_repo_url return body def as_shallow_dict(self) -> dict: """Serializes the RepoInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.git_repo_url is not None: - body["git_repo_url"] = self.git_repo_url + body["{git_repo_url}"] = self.git_repo_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoInfo: """Deserializes the RepoInfo from a dictionary.""" - return cls(git_repo_url=d.get("git_repo_url", None)) + return cls(git_repo_url=d.get("{git_repo_url}", None)) @dataclass @@ -2824,24 +2832,24 @@ def as_dict(self) -> dict: """Serializes the RepoInstallation into a dictionary suitable for use as a JSON request body.""" body = {} if self.repo_name is not None: - body["repo_name"] = self.repo_name + body["{repo_name}"] = self.repo_name if self.repo_path is not None: - body["repo_path"] = self.repo_path + body["{repo_path}"] = self.repo_path return body def as_shallow_dict(self) -> dict: """Serializes the RepoInstallation into a shallow dictionary of its immediate attributes.""" body = {} if self.repo_name is not None: - body["repo_name"] = self.repo_name + body["{repo_name}"] = self.repo_name if self.repo_path is not None: - body["repo_path"] = self.repo_path + body["{repo_path}"] = self.repo_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoInstallation: """Deserializes the RepoInstallation from a dictionary.""" - return cls(repo_name=d.get("repo_name", None), repo_path=d.get("repo_path", None)) + return cls(repo_name=d.get("{repo_name}", None), repo_path=d.get("{repo_path}", None)) @dataclass @@ -2854,24 +2862,24 @@ def as_dict(self) -> dict: """Serializes the SearchListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["listings"] = [v.as_dict() for v in self.listings] + body["{listings}"] = [v.as_dict() for v in self.listings] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the SearchListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["listings"] = self.listings + body["{listings}"] = self.listings if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchListingsResponse: """Deserializes the SearchListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "listings", Listing), next_page_token=d.get("next_page_token", None)) + return cls(listings=_repeated_dict(d, "{listings}", Listing), next_page_token=d.get("{next_page_token}", None)) @dataclass @@ -2884,24 +2892,24 @@ def as_dict(self) -> dict: """Serializes the ShareInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the ShareInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ShareInfo: """Deserializes the ShareInfo from a dictionary.""" - return cls(name=d.get("name", None), type=_enum(d, "type", ListingShareType)) + return cls(name=d.get("{name}", None), type=_enum(d, "{type}", ListingShareType)) @dataclass @@ -2916,24 +2924,24 @@ def as_dict(self) -> dict: """Serializes the SharedDataObject into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_object_type is not None: - body["data_object_type"] = self.data_object_type + body["{data_object_type}"] = self.data_object_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the SharedDataObject into a shallow dictionary of its immediate attributes.""" body = {} if self.data_object_type is not None: - body["data_object_type"] = self.data_object_type + body["{data_object_type}"] = self.data_object_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SharedDataObject: """Deserializes the SharedDataObject from a dictionary.""" - return cls(data_object_type=d.get("data_object_type", None), name=d.get("name", None)) + return cls(data_object_type=d.get("{data_object_type}", None), name=d.get("{name}", None)) @dataclass @@ -2952,36 +2960,36 @@ def as_dict(self) -> dict: """Serializes the TokenDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.bearer_token is not None: - body["bearerToken"] = self.bearer_token + body["{bearer_token}"] = self.bearer_token if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.expiration_time is not None: - body["expirationTime"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.share_credentials_version is not None: - body["shareCredentialsVersion"] = self.share_credentials_version + body["{share_credentials_version}"] = self.share_credentials_version return body def as_shallow_dict(self) -> dict: """Serializes the TokenDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.bearer_token is not None: - body["bearerToken"] = self.bearer_token + body["{bearer_token}"] = self.bearer_token if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.expiration_time is not None: - body["expirationTime"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.share_credentials_version is not None: - body["shareCredentialsVersion"] = self.share_credentials_version + body["{share_credentials_version}"] = self.share_credentials_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenDetail: """Deserializes the TokenDetail from a dictionary.""" return cls( - bearer_token=d.get("bearerToken", None), - endpoint=d.get("endpoint", None), - expiration_time=d.get("expirationTime", None), - share_credentials_version=d.get("shareCredentialsVersion", None), + bearer_token=d.get("{bearer_token}", None), + endpoint=d.get("{endpoint}", None), + expiration_time=d.get("{expiration_time}", None), + share_credentials_version=d.get("{share_credentials_version}", None), ) @@ -3013,51 +3021,51 @@ def as_dict(self) -> dict: """Serializes the TokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.activation_url is not None: - body["activation_url"] = self.activation_url + body["{activation_url}"] = self.activation_url if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the TokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.activation_url is not None: - body["activation_url"] = self.activation_url + body["{activation_url}"] = self.activation_url if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenInfo: """Deserializes the TokenInfo from a dictionary.""" return cls( - activation_url=d.get("activation_url", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - expiration_time=d.get("expiration_time", None), - id=d.get("id", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + activation_url=d.get("{activation_url}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + expiration_time=d.get("{expiration_time}", None), + id=d.get("{id}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -3071,24 +3079,24 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeFilterRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter: - body["filter"] = self.filter.as_dict() + body["{filter}"] = self.filter.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeFilterRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.filter: - body["filter"] = self.filter + body["{filter}"] = self.filter if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeFilterRequest: """Deserializes the UpdateExchangeFilterRequest from a dictionary.""" - return cls(filter=_from_dict(d, "filter", ExchangeFilter), id=d.get("id", None)) + return cls(filter=_from_dict(d, "{filter}", ExchangeFilter), id=d.get("{id}", None)) @dataclass @@ -3099,20 +3107,20 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeFilterResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter: - body["filter"] = self.filter.as_dict() + body["{filter}"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeFilterResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.filter: - body["filter"] = self.filter + body["{filter}"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeFilterResponse: """Deserializes the UpdateExchangeFilterResponse from a dictionary.""" - return cls(filter=_from_dict(d, "filter", ExchangeFilter)) + return cls(filter=_from_dict(d, "{filter}", ExchangeFilter)) @dataclass @@ -3125,24 +3133,24 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["exchange"] = self.exchange.as_dict() + body["{exchange}"] = self.exchange.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["exchange"] = self.exchange + body["{exchange}"] = self.exchange if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeRequest: """Deserializes the UpdateExchangeRequest from a dictionary.""" - return cls(exchange=_from_dict(d, "exchange", Exchange), id=d.get("id", None)) + return cls(exchange=_from_dict(d, "{exchange}", Exchange), id=d.get("{id}", None)) @dataclass @@ -3153,20 +3161,20 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["exchange"] = self.exchange.as_dict() + body["{exchange}"] = self.exchange.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["exchange"] = self.exchange + body["{exchange}"] = self.exchange return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeResponse: """Deserializes the UpdateExchangeResponse from a dictionary.""" - return cls(exchange=_from_dict(d, "exchange", Exchange)) + return cls(exchange=_from_dict(d, "{exchange}", Exchange)) @dataclass @@ -3183,36 +3191,36 @@ def as_dict(self) -> dict: """Serializes the UpdateInstallationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.installation: - body["installation"] = self.installation.as_dict() + body["{installation}"] = self.installation.as_dict() if self.installation_id is not None: - body["installation_id"] = self.installation_id + body["{installation_id}"] = self.installation_id if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.rotate_token is not None: - body["rotate_token"] = self.rotate_token + body["{rotate_token}"] = self.rotate_token return body def as_shallow_dict(self) -> dict: """Serializes the UpdateInstallationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.installation: - body["installation"] = self.installation + body["{installation}"] = self.installation if self.installation_id is not None: - body["installation_id"] = self.installation_id + body["{installation_id}"] = self.installation_id if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.rotate_token is not None: - body["rotate_token"] = self.rotate_token + body["{rotate_token}"] = self.rotate_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateInstallationRequest: """Deserializes the UpdateInstallationRequest from a dictionary.""" return cls( - installation=_from_dict(d, "installation", InstallationDetail), - installation_id=d.get("installation_id", None), - listing_id=d.get("listing_id", None), - rotate_token=d.get("rotate_token", None), + installation=_from_dict(d, "{installation}", InstallationDetail), + installation_id=d.get("{installation_id}", None), + listing_id=d.get("{listing_id}", None), + rotate_token=d.get("{rotate_token}", None), ) @@ -3224,20 +3232,20 @@ def as_dict(self) -> dict: """Serializes the UpdateInstallationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.installation: - body["installation"] = self.installation.as_dict() + body["{installation}"] = self.installation.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateInstallationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.installation: - body["installation"] = self.installation + body["{installation}"] = self.installation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateInstallationResponse: """Deserializes the UpdateInstallationResponse from a dictionary.""" - return cls(installation=_from_dict(d, "installation", InstallationDetail)) + return cls(installation=_from_dict(d, "{installation}", InstallationDetail)) @dataclass @@ -3250,24 +3258,24 @@ def as_dict(self) -> dict: """Serializes the UpdateListingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.listing: - body["listing"] = self.listing.as_dict() + body["{listing}"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateListingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.listing: - body["listing"] = self.listing + body["{listing}"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateListingRequest: """Deserializes the UpdateListingRequest from a dictionary.""" - return cls(id=d.get("id", None), listing=_from_dict(d, "listing", Listing)) + return cls(id=d.get("{id}", None), listing=_from_dict(d, "{listing}", Listing)) @dataclass @@ -3278,20 +3286,20 @@ def as_dict(self) -> dict: """Serializes the UpdateListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing: - body["listing"] = self.listing.as_dict() + body["{listing}"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listing: - body["listing"] = self.listing + body["{listing}"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateListingResponse: """Deserializes the UpdateListingResponse from a dictionary.""" - return cls(listing=_from_dict(d, "listing", Listing)) + return cls(listing=_from_dict(d, "{listing}", Listing)) @dataclass @@ -3310,41 +3318,41 @@ def as_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.reason is not None: - body["reason"] = self.reason + body["{reason}"] = self.reason if self.request_id is not None: - body["request_id"] = self.request_id + body["{request_id}"] = self.request_id if self.share: - body["share"] = self.share.as_dict() + body["{share}"] = self.share.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.listing_id is not None: - body["listing_id"] = self.listing_id + body["{listing_id}"] = self.listing_id if self.reason is not None: - body["reason"] = self.reason + body["{reason}"] = self.reason if self.request_id is not None: - body["request_id"] = self.request_id + body["{request_id}"] = self.request_id if self.share: - body["share"] = self.share + body["{share}"] = self.share if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePersonalizationRequestRequest: """Deserializes the UpdatePersonalizationRequestRequest from a dictionary.""" return cls( - listing_id=d.get("listing_id", None), - reason=d.get("reason", None), - request_id=d.get("request_id", None), - share=_from_dict(d, "share", ShareInfo), - status=_enum(d, "status", PersonalizationRequestStatus), + listing_id=d.get("{listing_id}", None), + reason=d.get("{reason}", None), + request_id=d.get("{request_id}", None), + share=_from_dict(d, "{share}", ShareInfo), + status=_enum(d, "{status}", PersonalizationRequestStatus), ) @@ -3356,20 +3364,20 @@ def as_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.request: - body["request"] = self.request.as_dict() + body["{request}"] = self.request.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.request: - body["request"] = self.request + body["{request}"] = self.request return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePersonalizationRequestResponse: """Deserializes the UpdatePersonalizationRequestResponse from a dictionary.""" - return cls(request=_from_dict(d, "request", PersonalizationRequest)) + return cls(request=_from_dict(d, "{request}", PersonalizationRequest)) @dataclass @@ -3385,24 +3393,24 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderAnalyticsDashboardRequest: """Deserializes the UpdateProviderAnalyticsDashboardRequest from a dictionary.""" - return cls(id=d.get("id", None), version=d.get("version", None)) + return cls(id=d.get("{id}", None), version=d.get("{version}", None)) @dataclass @@ -3419,28 +3427,28 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderAnalyticsDashboardResponse: """Deserializes the UpdateProviderAnalyticsDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("dashboard_id", None), id=d.get("id", None), version=d.get("version", None)) + return cls(dashboard_id=d.get("{dashboard_id}", None), id=d.get("{id}", None), version=d.get("{version}", None)) @dataclass @@ -3453,24 +3461,24 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.provider: - body["provider"] = self.provider.as_dict() + body["{provider}"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.provider: - body["provider"] = self.provider + body["{provider}"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderRequest: """Deserializes the UpdateProviderRequest from a dictionary.""" - return cls(id=d.get("id", None), provider=_from_dict(d, "provider", ProviderInfo)) + return cls(id=d.get("{id}", None), provider=_from_dict(d, "{provider}", ProviderInfo)) @dataclass @@ -3481,20 +3489,20 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.provider: - body["provider"] = self.provider.as_dict() + body["{provider}"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.provider: - body["provider"] = self.provider + body["{provider}"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderResponse: """Deserializes the UpdateProviderResponse from a dictionary.""" - return cls(provider=_from_dict(d, "provider", ProviderInfo)) + return cls(provider=_from_dict(d, "{provider}", ProviderInfo)) class Visibility(Enum): @@ -3525,23 +3533,23 @@ def get( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.1/marketplace-consumer/listings/{listing_id}/content", query=query, headers=headers ) - if "shared_data_objects" in json: - for v in json["shared_data_objects"]: + if "{shared_data_objects}" in json: + for v in json["{shared_data_objects}"]: yield SharedDataObject.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list( self, listing_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3562,23 +3570,23 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.1/marketplace-consumer/listings/{listing_id}/fulfillments", query=query, headers=headers ) - if "fulfillments" in json: - for v in json["fulfillments"]: + if "{fulfillments}" in json: + for v in json["{fulfillments}"]: yield ListingFulfillment.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class ConsumerInstallationsAPI: @@ -3613,18 +3621,18 @@ def create( """ body = {} if accepted_consumer_terms is not None: - body["accepted_consumer_terms"] = accepted_consumer_terms.as_dict() + body["{accepted_consumer_terms}"] = accepted_consumer_terms.as_dict() if catalog_name is not None: - body["catalog_name"] = catalog_name + body["{catalog_name}"] = catalog_name if recipient_type is not None: - body["recipient_type"] = recipient_type.value + body["{recipient_type}"] = recipient_type.value if repo_detail is not None: - body["repo_detail"] = repo_detail.as_dict() + body["{repo_detail}"] = repo_detail.as_dict() if share_name is not None: - body["share_name"] = share_name + body["{share_name}"] = share_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3644,7 +3652,7 @@ def delete(self, listing_id: str, installation_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -3668,21 +3676,21 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/installations", query=query, headers=headers) - if "installations" in json: - for v in json["installations"]: + if "{installations}" in json: + for v in json["{installations}"]: yield InstallationDetail.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_listing_installations( self, listing_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3700,11 +3708,11 @@ def list_listing_installations( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -3714,12 +3722,12 @@ def list_listing_installations( query=query, headers=headers, ) - if "installations" in json: - for v in json["installations"]: + if "{installations}" in json: + for v in json["{installations}"]: yield InstallationDetail.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -3745,12 +3753,12 @@ def update( """ body = {} if installation is not None: - body["installation"] = installation.as_dict() + body["{installation}"] = installation.as_dict() if rotate_token is not None: - body["rotate_token"] = rotate_token + body["{rotate_token}"] = rotate_token headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3781,9 +3789,9 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetListingsRespo query = {} if ids is not None: - query["ids"] = [v for v in ids] + query["{ids}"] = [v for v in ids] headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/marketplace-consumer/listings:batchGet", query=query, headers=headers) @@ -3800,7 +3808,7 @@ def get(self, id: str) -> GetListingResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/marketplace-consumer/listings/{id}", headers=headers) @@ -3845,35 +3853,35 @@ def list( query = {} if assets is not None: - query["assets"] = [v.value for v in assets] + query["{assets}"] = [v.value for v in assets] if categories is not None: - query["categories"] = [v.value for v in categories] + query["{categories}"] = [v.value for v in categories] if is_free is not None: - query["is_free"] = is_free + query["{is_free}"] = is_free if is_private_exchange is not None: - query["is_private_exchange"] = is_private_exchange + query["{is_private_exchange}"] = is_private_exchange if is_staff_pick is not None: - query["is_staff_pick"] = is_staff_pick + query["{is_staff_pick}"] = is_staff_pick if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if provider_ids is not None: - query["provider_ids"] = [v for v in provider_ids] + query["{provider_ids}"] = [v for v in provider_ids] if tags is not None: - query["tags"] = [v.as_dict() for v in tags] + query["{tags}"] = [v.as_dict() for v in tags] headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/listings", query=query, headers=headers) - if "listings" in json: - for v in json["listings"]: + if "{listings}" in json: + for v in json["{listings}"]: yield Listing.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def search( self, @@ -3910,33 +3918,33 @@ def search( query = {} if assets is not None: - query["assets"] = [v.value for v in assets] + query["{assets}"] = [v.value for v in assets] if categories is not None: - query["categories"] = [v.value for v in categories] + query["{categories}"] = [v.value for v in categories] if is_free is not None: - query["is_free"] = is_free + query["{is_free}"] = is_free if is_private_exchange is not None: - query["is_private_exchange"] = is_private_exchange + query["{is_private_exchange}"] = is_private_exchange if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if provider_ids is not None: - query["provider_ids"] = [v for v in provider_ids] + query["{provider_ids}"] = [v for v in provider_ids] if query is not None: - query["query"] = query + query["{query}"] = query headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/search-listings", query=query, headers=headers) - if "listings" in json: - for v in json["listings"]: + if "{listings}" in json: + for v in json["{listings}"]: yield Listing.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class ConsumerPersonalizationRequestsAPI: @@ -3976,24 +3984,24 @@ def create( """ body = {} if accepted_consumer_terms is not None: - body["accepted_consumer_terms"] = accepted_consumer_terms.as_dict() + body["{accepted_consumer_terms}"] = accepted_consumer_terms.as_dict() if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if company is not None: - body["company"] = company + body["{company}"] = company if first_name is not None: - body["first_name"] = first_name + body["{first_name}"] = first_name if intended_use is not None: - body["intended_use"] = intended_use + body["{intended_use}"] = intended_use if is_from_lighthouse is not None: - body["is_from_lighthouse"] = is_from_lighthouse + body["{is_from_lighthouse}"] = is_from_lighthouse if last_name is not None: - body["last_name"] = last_name + body["{last_name}"] = last_name if recipient_type is not None: - body["recipient_type"] = recipient_type.value + body["{recipient_type}"] = recipient_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -4016,7 +4024,7 @@ def get(self, listing_id: str) -> GetPersonalizationRequestResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -4039,23 +4047,23 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", "/api/2.1/marketplace-consumer/personalization-requests", query=query, headers=headers ) - if "personalization_requests" in json: - for v in json["personalization_requests"]: + if "{personalization_requests}" in json: + for v in json["{personalization_requests}"]: yield PersonalizationRequest.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class ConsumerProvidersAPI: @@ -4076,9 +4084,9 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetProvidersResp query = {} if ids is not None: - query["ids"] = [v for v in ids] + query["{ids}"] = [v for v in ids] headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.1/marketplace-consumer/providers:batchGet", query=query, headers=headers) @@ -4095,7 +4103,7 @@ def get(self, id: str) -> GetProviderResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/marketplace-consumer/providers/{id}", headers=headers) @@ -4117,23 +4125,23 @@ def list( query = {} if is_featured is not None: - query["is_featured"] = is_featured + query["{is_featured}"] = is_featured if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/providers", query=query, headers=headers) - if "providers" in json: - for v in json["providers"]: + if "{providers}" in json: + for v in json["{providers}"]: yield ProviderInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class ProviderExchangeFiltersAPI: @@ -4153,10 +4161,10 @@ def create(self, filter: ExchangeFilter) -> CreateExchangeFilterResponse: """ body = {} if filter is not None: - body["filter"] = filter.as_dict() + body["{filter}"] = filter.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/marketplace-exchange/filters", body=body, headers=headers) @@ -4173,7 +4181,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/marketplace-exchange/filters/{id}", headers=headers) @@ -4194,23 +4202,23 @@ def list( query = {} if exchange_id is not None: - query["exchange_id"] = exchange_id + query["{exchange_id}"] = exchange_id if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-exchange/filters", query=query, headers=headers) - if "filters" in json: - for v in json["filters"]: + if "{filters}" in json: + for v in json["{filters}"]: yield ExchangeFilter.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterResponse: """Update exchange filter. @@ -4224,10 +4232,10 @@ def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterRespons """ body = {} if filter is not None: - body["filter"] = filter.as_dict() + body["{filter}"] = filter.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/marketplace-exchange/filters/{id}", body=body, headers=headers) @@ -4252,12 +4260,12 @@ def add_listing_to_exchange(self, listing_id: str, exchange_id: str) -> AddExcha """ body = {} if exchange_id is not None: - body["exchange_id"] = exchange_id + body["{exchange_id}"] = exchange_id if listing_id is not None: - body["listing_id"] = listing_id + body["{listing_id}"] = listing_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/marketplace-exchange/exchanges-for-listing", body=body, headers=headers) @@ -4274,10 +4282,10 @@ def create(self, exchange: Exchange) -> CreateExchangeResponse: """ body = {} if exchange is not None: - body["exchange"] = exchange.as_dict() + body["{exchange}"] = exchange.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/marketplace-exchange/exchanges", body=body, headers=headers) @@ -4294,7 +4302,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/marketplace-exchange/exchanges/{id}", headers=headers) @@ -4310,7 +4318,7 @@ def delete_listing_from_exchange(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/marketplace-exchange/exchanges-for-listing/{id}", headers=headers) @@ -4326,7 +4334,7 @@ def get(self, id: str) -> GetExchangeResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/marketplace-exchange/exchanges/{id}", headers=headers) @@ -4345,21 +4353,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-exchange/exchanges", query=query, headers=headers) - if "exchanges" in json: - for v in json["exchanges"]: + if "{exchanges}" in json: + for v in json["{exchanges}"]: yield Exchange.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_exchanges_for_listing( self, listing_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -4377,25 +4385,25 @@ def list_exchanges_for_listing( query = {} if listing_id is not None: - query["listing_id"] = listing_id + query["{listing_id}"] = listing_id if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", "/api/2.0/marketplace-exchange/exchanges-for-listing", query=query, headers=headers ) - if "exchange_listing" in json: - for v in json["exchange_listing"]: + if "{exchange_listing}" in json: + for v in json["{exchange_listing}"]: yield ExchangeListing.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_listings_for_exchange( self, exchange_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -4413,25 +4421,25 @@ def list_listings_for_exchange( query = {} if exchange_id is not None: - query["exchange_id"] = exchange_id + query["{exchange_id}"] = exchange_id if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", "/api/2.0/marketplace-exchange/listings-for-exchange", query=query, headers=headers ) - if "exchange_listings" in json: - for v in json["exchange_listings"]: + if "{exchange_listings}" in json: + for v in json["{exchange_listings}"]: yield ExchangeListing.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: """Update exchange. @@ -4445,10 +4453,10 @@ def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: """ body = {} if exchange is not None: - body["exchange"] = exchange.as_dict() + body["{exchange}"] = exchange.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/marketplace-exchange/exchanges/{id}", body=body, headers=headers) @@ -4482,16 +4490,16 @@ def create( """ body = {} if display_name is not None: - body["display_name"] = display_name + body["{display_name}"] = display_name if file_parent is not None: - body["file_parent"] = file_parent.as_dict() + body["{file_parent}"] = file_parent.as_dict() if marketplace_file_type is not None: - body["marketplace_file_type"] = marketplace_file_type.value + body["{marketplace_file_type}"] = marketplace_file_type.value if mime_type is not None: - body["mime_type"] = mime_type + body["{mime_type}"] = mime_type headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/marketplace-provider/files", body=body, headers=headers) @@ -4508,7 +4516,7 @@ def delete(self, file_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/marketplace-provider/files/{file_id}", headers=headers) @@ -4524,7 +4532,7 @@ def get(self, file_id: str) -> GetFileResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/marketplace-provider/files/{file_id}", headers=headers) @@ -4546,23 +4554,23 @@ def list( query = {} if file_parent is not None: - query["file_parent"] = file_parent.as_dict() + query["{file_parent}"] = file_parent.as_dict() if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/files", query=query, headers=headers) - if "file_infos" in json: - for v in json["file_infos"]: + if "{file_infos}" in json: + for v in json["{file_infos}"]: yield FileInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class ProviderListingsAPI: @@ -4583,10 +4591,10 @@ def create(self, listing: Listing) -> CreateListingResponse: """ body = {} if listing is not None: - body["listing"] = listing.as_dict() + body["{listing}"] = listing.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/marketplace-provider/listing", body=body, headers=headers) @@ -4603,7 +4611,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/marketplace-provider/listings/{id}", headers=headers) @@ -4619,7 +4627,7 @@ def get(self, id: str) -> GetListingResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/marketplace-provider/listings/{id}", headers=headers) @@ -4638,21 +4646,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/listings", query=query, headers=headers) - if "listings" in json: - for v in json["listings"]: + if "{listings}" in json: + for v in json["{listings}"]: yield Listing.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, id: str, listing: Listing) -> UpdateListingResponse: """Update listing. @@ -4666,10 +4674,10 @@ def update(self, id: str, listing: Listing) -> UpdateListingResponse: """ body = {} if listing is not None: - body["listing"] = listing.as_dict() + body["{listing}"] = listing.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/marketplace-provider/listings/{id}", body=body, headers=headers) @@ -4699,23 +4707,23 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", "/api/2.0/marketplace-provider/personalization-requests", query=query, headers=headers ) - if "personalization_requests" in json: - for v in json["personalization_requests"]: + if "{personalization_requests}" in json: + for v in json["{personalization_requests}"]: yield PersonalizationRequest.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -4740,14 +4748,14 @@ def update( """ body = {} if reason is not None: - body["reason"] = reason + body["{reason}"] = reason if share is not None: - body["share"] = share.as_dict() + body["{share}"] = share.as_dict() if status is not None: - body["status"] = status.value + body["{status}"] = status.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -4775,7 +4783,7 @@ def create(self) -> ProviderAnalyticsDashboard: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("POST", "/api/2.0/marketplace-provider/analytics_dashboard", headers=headers) @@ -4790,7 +4798,7 @@ def get(self) -> ListProviderAnalyticsDashboardResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/marketplace-provider/analytics_dashboard", headers=headers) @@ -4805,7 +4813,7 @@ def get_latest_version(self) -> GetLatestVersionProviderAnalyticsDashboardRespon """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/marketplace-provider/analytics_dashboard/latest", headers=headers) @@ -4826,10 +4834,10 @@ def update(self, id: str, *, version: Optional[int] = None) -> UpdateProviderAna """ body = {} if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/marketplace-provider/analytics_dashboard/{id}", body=body, headers=headers) @@ -4853,10 +4861,10 @@ def create(self, provider: ProviderInfo) -> CreateProviderResponse: """ body = {} if provider is not None: - body["provider"] = provider.as_dict() + body["{provider}"] = provider.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/marketplace-provider/provider", body=body, headers=headers) @@ -4873,7 +4881,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/marketplace-provider/providers/{id}", headers=headers) @@ -4889,7 +4897,7 @@ def get(self, id: str) -> GetProviderResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/marketplace-provider/providers/{id}", headers=headers) @@ -4908,21 +4916,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/providers", query=query, headers=headers) - if "providers" in json: - for v in json["providers"]: + if "{providers}" in json: + for v in json["{providers}"]: yield ProviderInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse: """Update provider. @@ -4936,10 +4944,10 @@ def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse: """ body = {} if provider is not None: - body["provider"] = provider.as_dict() + body["{provider}"] = provider.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/marketplace-provider/providers/{id}", body=body, headers=headers) diff --git a/databricks/sdk/service/ml.py b/databricks/sdk/ml/v2/impl.py similarity index 76% rename from databricks/sdk/service/ml.py rename to databricks/sdk/ml/v2/impl.py index 709f400e0..597386986 100755 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/ml/v2/impl.py @@ -3,19 +3,16 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -84,61 +81,61 @@ def as_dict(self) -> dict: """Serializes the Activity into a dictionary suitable for use as a JSON request body.""" body = {} if self.activity_type is not None: - body["activity_type"] = self.activity_type.value + body["{activity_type}"] = self.activity_type.value if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.from_stage is not None: - body["from_stage"] = self.from_stage.value + body["{from_stage}"] = self.from_stage.value if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.system_comment is not None: - body["system_comment"] = self.system_comment + body["{system_comment}"] = self.system_comment if self.to_stage is not None: - body["to_stage"] = self.to_stage.value + body["{to_stage}"] = self.to_stage.value if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the Activity into a shallow dictionary of its immediate attributes.""" body = {} if self.activity_type is not None: - body["activity_type"] = self.activity_type + body["{activity_type}"] = self.activity_type if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.from_stage is not None: - body["from_stage"] = self.from_stage + body["{from_stage}"] = self.from_stage if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.system_comment is not None: - body["system_comment"] = self.system_comment + body["{system_comment}"] = self.system_comment if self.to_stage is not None: - body["to_stage"] = self.to_stage + body["{to_stage}"] = self.to_stage if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Activity: """Deserializes the Activity from a dictionary.""" return cls( - activity_type=_enum(d, "activity_type", ActivityType), - comment=d.get("comment", None), - creation_timestamp=d.get("creation_timestamp", None), - from_stage=_enum(d, "from_stage", Stage), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - system_comment=d.get("system_comment", None), - to_stage=_enum(d, "to_stage", Stage), - user_id=d.get("user_id", None), + activity_type=_enum(d, "{activity_type}", ActivityType), + comment=d.get("{comment}", None), + creation_timestamp=d.get("{creation_timestamp}", None), + from_stage=_enum(d, "{from_stage}", Stage), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + system_comment=d.get("{system_comment}", None), + to_stage=_enum(d, "{to_stage}", Stage), + user_id=d.get("{user_id}", None), ) @@ -208,41 +205,41 @@ def as_dict(self) -> dict: """Serializes the ApproveTransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.archive_existing_versions is not None: - body["archive_existing_versions"] = self.archive_existing_versions + body["{archive_existing_versions}"] = self.archive_existing_versions if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage.value + body["{stage}"] = self.stage.value if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the ApproveTransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.archive_existing_versions is not None: - body["archive_existing_versions"] = self.archive_existing_versions + body["{archive_existing_versions}"] = self.archive_existing_versions if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage + body["{stage}"] = self.stage if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApproveTransitionRequest: """Deserializes the ApproveTransitionRequest from a dictionary.""" return cls( - archive_existing_versions=d.get("archive_existing_versions", None), - comment=d.get("comment", None), - name=d.get("name", None), - stage=_enum(d, "stage", Stage), - version=d.get("version", None), + archive_existing_versions=d.get("{archive_existing_versions}", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + stage=_enum(d, "{stage}", Stage), + version=d.get("{version}", None), ) @@ -255,20 +252,20 @@ def as_dict(self) -> dict: """Serializes the ApproveTransitionRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.activity: - body["activity"] = self.activity.as_dict() + body["{activity}"] = self.activity.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ApproveTransitionRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.activity: - body["activity"] = self.activity + body["{activity}"] = self.activity return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApproveTransitionRequestResponse: """Deserializes the ApproveTransitionRequestResponse from a dictionary.""" - return cls(activity=_from_dict(d, "activity", Activity)) + return cls(activity=_from_dict(d, "{activity}", Activity)) class CommentActivityAction(Enum): @@ -307,46 +304,46 @@ def as_dict(self) -> dict: """Serializes the CommentObject into a dictionary suitable for use as a JSON request body.""" body = {} if self.available_actions: - body["available_actions"] = [v.value for v in self.available_actions] + body["{available_actions}"] = [v.value for v in self.available_actions] if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the CommentObject into a shallow dictionary of its immediate attributes.""" body = {} if self.available_actions: - body["available_actions"] = self.available_actions + body["{available_actions}"] = self.available_actions if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CommentObject: """Deserializes the CommentObject from a dictionary.""" return cls( - available_actions=_repeated_enum(d, "available_actions", CommentActivityAction), - comment=d.get("comment", None), - creation_timestamp=d.get("creation_timestamp", None), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - user_id=d.get("user_id", None), + available_actions=_repeated_enum(d, "{available_actions}", CommentActivityAction), + comment=d.get("{comment}", None), + creation_timestamp=d.get("{creation_timestamp}", None), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + user_id=d.get("{user_id}", None), ) @@ -365,28 +362,28 @@ def as_dict(self) -> dict: """Serializes the CreateComment into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the CreateComment into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateComment: """Deserializes the CreateComment from a dictionary.""" - return cls(comment=d.get("comment", None), name=d.get("name", None), version=d.get("version", None)) + return cls(comment=d.get("{comment}", None), name=d.get("{name}", None), version=d.get("{version}", None)) @dataclass @@ -398,20 +395,20 @@ def as_dict(self) -> dict: """Serializes the CreateCommentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment: - body["comment"] = self.comment.as_dict() + body["{comment}"] = self.comment.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateCommentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.comment: - body["comment"] = self.comment + body["{comment}"] = self.comment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCommentResponse: """Deserializes the CreateCommentResponse from a dictionary.""" - return cls(comment=_from_dict(d, "comment", CommentObject)) + return cls(comment=_from_dict(d, "{comment}", CommentObject)) @dataclass @@ -433,31 +430,31 @@ def as_dict(self) -> dict: """Serializes the CreateExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_location is not None: - body["artifact_location"] = self.artifact_location + body["{artifact_location}"] = self.artifact_location if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the CreateExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_location is not None: - body["artifact_location"] = self.artifact_location + body["{artifact_location}"] = self.artifact_location if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExperiment: """Deserializes the CreateExperiment from a dictionary.""" return cls( - artifact_location=d.get("artifact_location", None), - name=d.get("name", None), - tags=_repeated_dict(d, "tags", ExperimentTag), + artifact_location=d.get("{artifact_location}", None), + name=d.get("{name}", None), + tags=_repeated_dict(d, "{tags}", ExperimentTag), ) @@ -470,20 +467,20 @@ def as_dict(self) -> dict: """Serializes the CreateExperimentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateExperimentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExperimentResponse: """Deserializes the CreateExperimentResponse from a dictionary.""" - return cls(experiment_id=d.get("experiment_id", None)) + return cls(experiment_id=d.get("{experiment_id}", None)) @dataclass @@ -548,91 +545,91 @@ def as_dict(self) -> dict: """Serializes the CreateForecastingExperimentRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_weights_column is not None: - body["custom_weights_column"] = self.custom_weights_column + body["{custom_weights_column}"] = self.custom_weights_column if self.experiment_path is not None: - body["experiment_path"] = self.experiment_path + body["{experiment_path}"] = self.experiment_path if self.forecast_granularity is not None: - body["forecast_granularity"] = self.forecast_granularity + body["{forecast_granularity}"] = self.forecast_granularity if self.forecast_horizon is not None: - body["forecast_horizon"] = self.forecast_horizon + body["{forecast_horizon}"] = self.forecast_horizon if self.holiday_regions: - body["holiday_regions"] = [v for v in self.holiday_regions] + body["{holiday_regions}"] = [v for v in self.holiday_regions] if self.max_runtime is not None: - body["max_runtime"] = self.max_runtime + body["{max_runtime}"] = self.max_runtime if self.prediction_data_path is not None: - body["prediction_data_path"] = self.prediction_data_path + body["{prediction_data_path}"] = self.prediction_data_path if self.primary_metric is not None: - body["primary_metric"] = self.primary_metric + body["{primary_metric}"] = self.primary_metric if self.register_to is not None: - body["register_to"] = self.register_to + body["{register_to}"] = self.register_to if self.split_column is not None: - body["split_column"] = self.split_column + body["{split_column}"] = self.split_column if self.target_column is not None: - body["target_column"] = self.target_column + body["{target_column}"] = self.target_column if self.time_column is not None: - body["time_column"] = self.time_column + body["{time_column}"] = self.time_column if self.timeseries_identifier_columns: - body["timeseries_identifier_columns"] = [v for v in self.timeseries_identifier_columns] + body["{timeseries_identifier_columns}"] = [v for v in self.timeseries_identifier_columns] if self.train_data_path is not None: - body["train_data_path"] = self.train_data_path + body["{train_data_path}"] = self.train_data_path if self.training_frameworks: - body["training_frameworks"] = [v for v in self.training_frameworks] + body["{training_frameworks}"] = [v for v in self.training_frameworks] return body def as_shallow_dict(self) -> dict: """Serializes the CreateForecastingExperimentRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_weights_column is not None: - body["custom_weights_column"] = self.custom_weights_column + body["{custom_weights_column}"] = self.custom_weights_column if self.experiment_path is not None: - body["experiment_path"] = self.experiment_path + body["{experiment_path}"] = self.experiment_path if self.forecast_granularity is not None: - body["forecast_granularity"] = self.forecast_granularity + body["{forecast_granularity}"] = self.forecast_granularity if self.forecast_horizon is not None: - body["forecast_horizon"] = self.forecast_horizon + body["{forecast_horizon}"] = self.forecast_horizon if self.holiday_regions: - body["holiday_regions"] = self.holiday_regions + body["{holiday_regions}"] = self.holiday_regions if self.max_runtime is not None: - body["max_runtime"] = self.max_runtime + body["{max_runtime}"] = self.max_runtime if self.prediction_data_path is not None: - body["prediction_data_path"] = self.prediction_data_path + body["{prediction_data_path}"] = self.prediction_data_path if self.primary_metric is not None: - body["primary_metric"] = self.primary_metric + body["{primary_metric}"] = self.primary_metric if self.register_to is not None: - body["register_to"] = self.register_to + body["{register_to}"] = self.register_to if self.split_column is not None: - body["split_column"] = self.split_column + body["{split_column}"] = self.split_column if self.target_column is not None: - body["target_column"] = self.target_column + body["{target_column}"] = self.target_column if self.time_column is not None: - body["time_column"] = self.time_column + body["{time_column}"] = self.time_column if self.timeseries_identifier_columns: - body["timeseries_identifier_columns"] = self.timeseries_identifier_columns + body["{timeseries_identifier_columns}"] = self.timeseries_identifier_columns if self.train_data_path is not None: - body["train_data_path"] = self.train_data_path + body["{train_data_path}"] = self.train_data_path if self.training_frameworks: - body["training_frameworks"] = self.training_frameworks + body["{training_frameworks}"] = self.training_frameworks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateForecastingExperimentRequest: """Deserializes the CreateForecastingExperimentRequest from a dictionary.""" return cls( - custom_weights_column=d.get("custom_weights_column", None), - experiment_path=d.get("experiment_path", None), - forecast_granularity=d.get("forecast_granularity", None), - forecast_horizon=d.get("forecast_horizon", None), - holiday_regions=d.get("holiday_regions", None), - max_runtime=d.get("max_runtime", None), - prediction_data_path=d.get("prediction_data_path", None), - primary_metric=d.get("primary_metric", None), - register_to=d.get("register_to", None), - split_column=d.get("split_column", None), - target_column=d.get("target_column", None), - time_column=d.get("time_column", None), - timeseries_identifier_columns=d.get("timeseries_identifier_columns", None), - train_data_path=d.get("train_data_path", None), - training_frameworks=d.get("training_frameworks", None), + custom_weights_column=d.get("{custom_weights_column}", None), + experiment_path=d.get("{experiment_path}", None), + forecast_granularity=d.get("{forecast_granularity}", None), + forecast_horizon=d.get("{forecast_horizon}", None), + holiday_regions=d.get("{holiday_regions}", None), + max_runtime=d.get("{max_runtime}", None), + prediction_data_path=d.get("{prediction_data_path}", None), + primary_metric=d.get("{primary_metric}", None), + register_to=d.get("{register_to}", None), + split_column=d.get("{split_column}", None), + target_column=d.get("{target_column}", None), + time_column=d.get("{time_column}", None), + timeseries_identifier_columns=d.get("{timeseries_identifier_columns}", None), + train_data_path=d.get("{train_data_path}", None), + training_frameworks=d.get("{training_frameworks}", None), ) @@ -645,20 +642,20 @@ def as_dict(self) -> dict: """Serializes the CreateForecastingExperimentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateForecastingExperimentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateForecastingExperimentResponse: """Deserializes the CreateForecastingExperimentResponse from a dictionary.""" - return cls(experiment_id=d.get("experiment_id", None)) + return cls(experiment_id=d.get("{experiment_id}", None)) @dataclass @@ -676,29 +673,31 @@ def as_dict(self) -> dict: """Serializes the CreateModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the CreateModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelRequest: """Deserializes the CreateModelRequest from a dictionary.""" return cls( - description=d.get("description", None), name=d.get("name", None), tags=_repeated_dict(d, "tags", ModelTag) + description=d.get("{description}", None), + name=d.get("{name}", None), + tags=_repeated_dict(d, "{tags}", ModelTag), ) @@ -710,20 +709,20 @@ def as_dict(self) -> dict: """Serializes the CreateModelResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.registered_model: - body["registered_model"] = self.registered_model.as_dict() + body["{registered_model}"] = self.registered_model.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateModelResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.registered_model: - body["registered_model"] = self.registered_model + body["{registered_model}"] = self.registered_model return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelResponse: """Deserializes the CreateModelResponse from a dictionary.""" - return cls(registered_model=_from_dict(d, "registered_model", Model)) + return cls(registered_model=_from_dict(d, "{registered_model}", Model)) @dataclass @@ -752,46 +751,46 @@ def as_dict(self) -> dict: """Serializes the CreateModelVersionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_link is not None: - body["run_link"] = self.run_link + body["{run_link}"] = self.run_link if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the CreateModelVersionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_link is not None: - body["run_link"] = self.run_link + body["{run_link}"] = self.run_link if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionRequest: """Deserializes the CreateModelVersionRequest from a dictionary.""" return cls( - description=d.get("description", None), - name=d.get("name", None), - run_id=d.get("run_id", None), - run_link=d.get("run_link", None), - source=d.get("source", None), - tags=_repeated_dict(d, "tags", ModelVersionTag), + description=d.get("{description}", None), + name=d.get("{name}", None), + run_id=d.get("{run_id}", None), + run_link=d.get("{run_link}", None), + source=d.get("{source}", None), + tags=_repeated_dict(d, "{tags}", ModelVersionTag), ) @@ -804,20 +803,20 @@ def as_dict(self) -> dict: """Serializes the CreateModelVersionResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_version: - body["model_version"] = self.model_version.as_dict() + body["{model_version}"] = self.model_version.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateModelVersionResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_version: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionResponse: """Deserializes the CreateModelVersionResponse from a dictionary.""" - return cls(model_version=_from_dict(d, "model_version", ModelVersion)) + return cls(model_version=_from_dict(d, "{model_version}", ModelVersion)) @dataclass @@ -875,46 +874,46 @@ def as_dict(self) -> dict: """Serializes the CreateRegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.events: - body["events"] = [v.value for v in self.events] + body["{events}"] = [v.value for v in self.events] if self.http_url_spec: - body["http_url_spec"] = self.http_url_spec.as_dict() + body["{http_url_spec}"] = self.http_url_spec.as_dict() if self.job_spec: - body["job_spec"] = self.job_spec.as_dict() + body["{job_spec}"] = self.job_spec.as_dict() if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the CreateRegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.events: - body["events"] = self.events + body["{events}"] = self.events if self.http_url_spec: - body["http_url_spec"] = self.http_url_spec + body["{http_url_spec}"] = self.http_url_spec if self.job_spec: - body["job_spec"] = self.job_spec + body["{job_spec}"] = self.job_spec if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRegistryWebhook: """Deserializes the CreateRegistryWebhook from a dictionary.""" return cls( - description=d.get("description", None), - events=_repeated_enum(d, "events", RegistryWebhookEvent), - http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec), - job_spec=_from_dict(d, "job_spec", JobSpec), - model_name=d.get("model_name", None), - status=_enum(d, "status", RegistryWebhookStatus), + description=d.get("{description}", None), + events=_repeated_enum(d, "{events}", RegistryWebhookEvent), + http_url_spec=_from_dict(d, "{http_url_spec}", HttpUrlSpec), + job_spec=_from_dict(d, "{job_spec}", JobSpec), + model_name=d.get("{model_name}", None), + status=_enum(d, "{status}", RegistryWebhookStatus), ) @@ -940,41 +939,41 @@ def as_dict(self) -> dict: """Serializes the CreateRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateRun into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRun: """Deserializes the CreateRun from a dictionary.""" return cls( - experiment_id=d.get("experiment_id", None), - run_name=d.get("run_name", None), - start_time=d.get("start_time", None), - tags=_repeated_dict(d, "tags", RunTag), - user_id=d.get("user_id", None), + experiment_id=d.get("{experiment_id}", None), + run_name=d.get("{run_name}", None), + start_time=d.get("{start_time}", None), + tags=_repeated_dict(d, "{tags}", RunTag), + user_id=d.get("{user_id}", None), ) @@ -987,20 +986,20 @@ def as_dict(self) -> dict: """Serializes the CreateRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run: - body["run"] = self.run.as_dict() + body["{run}"] = self.run.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run: - body["run"] = self.run + body["{run}"] = self.run return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRunResponse: """Deserializes the CreateRunResponse from a dictionary.""" - return cls(run=_from_dict(d, "run", Run)) + return cls(run=_from_dict(d, "{run}", Run)) @dataclass @@ -1029,36 +1028,36 @@ def as_dict(self) -> dict: """Serializes the CreateTransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage.value + body["{stage}"] = self.stage.value if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the CreateTransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage + body["{stage}"] = self.stage if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTransitionRequest: """Deserializes the CreateTransitionRequest from a dictionary.""" return cls( - comment=d.get("comment", None), - name=d.get("name", None), - stage=_enum(d, "stage", Stage), - version=d.get("version", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + stage=_enum(d, "{stage}", Stage), + version=d.get("{version}", None), ) @@ -1071,20 +1070,20 @@ def as_dict(self) -> dict: """Serializes the CreateTransitionRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.request: - body["request"] = self.request.as_dict() + body["{request}"] = self.request.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateTransitionRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.request: - body["request"] = self.request + body["{request}"] = self.request return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTransitionRequestResponse: """Deserializes the CreateTransitionRequestResponse from a dictionary.""" - return cls(request=_from_dict(d, "request", TransitionRequest)) + return cls(request=_from_dict(d, "{request}", TransitionRequest)) @dataclass @@ -1095,20 +1094,20 @@ def as_dict(self) -> dict: """Serializes the CreateWebhookResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.webhook: - body["webhook"] = self.webhook.as_dict() + body["{webhook}"] = self.webhook.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateWebhookResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.webhook: - body["webhook"] = self.webhook + body["{webhook}"] = self.webhook return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWebhookResponse: """Deserializes the CreateWebhookResponse from a dictionary.""" - return cls(webhook=_from_dict(d, "webhook", RegistryWebhook)) + return cls(webhook=_from_dict(d, "{webhook}", RegistryWebhook)) @dataclass @@ -1142,46 +1141,46 @@ def as_dict(self) -> dict: """Serializes the Dataset into a dictionary suitable for use as a JSON request body.""" body = {} if self.digest is not None: - body["digest"] = self.digest + body["{digest}"] = self.digest if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.profile is not None: - body["profile"] = self.profile + body["{profile}"] = self.profile if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.source_type is not None: - body["source_type"] = self.source_type + body["{source_type}"] = self.source_type return body def as_shallow_dict(self) -> dict: """Serializes the Dataset into a shallow dictionary of its immediate attributes.""" body = {} if self.digest is not None: - body["digest"] = self.digest + body["{digest}"] = self.digest if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.profile is not None: - body["profile"] = self.profile + body["{profile}"] = self.profile if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.source_type is not None: - body["source_type"] = self.source_type + body["{source_type}"] = self.source_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dataset: """Deserializes the Dataset from a dictionary.""" return cls( - digest=d.get("digest", None), - name=d.get("name", None), - profile=d.get("profile", None), - schema=d.get("schema", None), - source=d.get("source", None), - source_type=d.get("source_type", None), + digest=d.get("{digest}", None), + name=d.get("{name}", None), + profile=d.get("{profile}", None), + schema=d.get("{schema}", None), + source=d.get("{source}", None), + source_type=d.get("{source_type}", None), ) @@ -1199,24 +1198,24 @@ def as_dict(self) -> dict: """Serializes the DatasetInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset: - body["dataset"] = self.dataset.as_dict() + body["{dataset}"] = self.dataset.as_dict() if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the DatasetInput into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset: - body["dataset"] = self.dataset + body["{dataset}"] = self.dataset if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatasetInput: """Deserializes the DatasetInput from a dictionary.""" - return cls(dataset=_from_dict(d, "dataset", Dataset), tags=_repeated_dict(d, "tags", InputTag)) + return cls(dataset=_from_dict(d, "{dataset}", Dataset), tags=_repeated_dict(d, "{tags}", InputTag)) @dataclass @@ -1246,20 +1245,20 @@ def as_dict(self) -> dict: """Serializes the DeleteExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body def as_shallow_dict(self) -> dict: """Serializes the DeleteExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteExperiment: """Deserializes the DeleteExperiment from a dictionary.""" - return cls(experiment_id=d.get("experiment_id", None)) + return cls(experiment_id=d.get("{experiment_id}", None)) @dataclass @@ -1361,20 +1360,20 @@ def as_dict(self) -> dict: """Serializes the DeleteRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the DeleteRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRun: """Deserializes the DeleteRun from a dictionary.""" - return cls(run_id=d.get("run_id", None)) + return cls(run_id=d.get("{run_id}", None)) @dataclass @@ -1412,31 +1411,31 @@ def as_dict(self) -> dict: """Serializes the DeleteRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.max_runs is not None: - body["max_runs"] = self.max_runs + body["{max_runs}"] = self.max_runs if self.max_timestamp_millis is not None: - body["max_timestamp_millis"] = self.max_timestamp_millis + body["{max_timestamp_millis}"] = self.max_timestamp_millis return body def as_shallow_dict(self) -> dict: """Serializes the DeleteRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.max_runs is not None: - body["max_runs"] = self.max_runs + body["{max_runs}"] = self.max_runs if self.max_timestamp_millis is not None: - body["max_timestamp_millis"] = self.max_timestamp_millis + body["{max_timestamp_millis}"] = self.max_timestamp_millis return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRuns: """Deserializes the DeleteRuns from a dictionary.""" return cls( - experiment_id=d.get("experiment_id", None), - max_runs=d.get("max_runs", None), - max_timestamp_millis=d.get("max_timestamp_millis", None), + experiment_id=d.get("{experiment_id}", None), + max_runs=d.get("{max_runs}", None), + max_timestamp_millis=d.get("{max_timestamp_millis}", None), ) @@ -1449,20 +1448,20 @@ def as_dict(self) -> dict: """Serializes the DeleteRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.runs_deleted is not None: - body["runs_deleted"] = self.runs_deleted + body["{runs_deleted}"] = self.runs_deleted return body def as_shallow_dict(self) -> dict: """Serializes the DeleteRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.runs_deleted is not None: - body["runs_deleted"] = self.runs_deleted + body["{runs_deleted}"] = self.runs_deleted return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRunsResponse: """Deserializes the DeleteRunsResponse from a dictionary.""" - return cls(runs_deleted=d.get("runs_deleted", None)) + return cls(runs_deleted=d.get("{runs_deleted}", None)) @dataclass @@ -1477,24 +1476,24 @@ def as_dict(self) -> dict: """Serializes the DeleteTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the DeleteTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteTag: """Deserializes the DeleteTag from a dictionary.""" - return cls(key=d.get("key", None), run_id=d.get("run_id", None)) + return cls(key=d.get("{key}", None), run_id=d.get("{run_id}", None)) @dataclass @@ -1589,51 +1588,51 @@ def as_dict(self) -> dict: """Serializes the Experiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_location is not None: - body["artifact_location"] = self.artifact_location + body["{artifact_location}"] = self.artifact_location if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.last_update_time is not None: - body["last_update_time"] = self.last_update_time + body["{last_update_time}"] = self.last_update_time if self.lifecycle_stage is not None: - body["lifecycle_stage"] = self.lifecycle_stage + body["{lifecycle_stage}"] = self.lifecycle_stage if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the Experiment into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_location is not None: - body["artifact_location"] = self.artifact_location + body["{artifact_location}"] = self.artifact_location if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.last_update_time is not None: - body["last_update_time"] = self.last_update_time + body["{last_update_time}"] = self.last_update_time if self.lifecycle_stage is not None: - body["lifecycle_stage"] = self.lifecycle_stage + body["{lifecycle_stage}"] = self.lifecycle_stage if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Experiment: """Deserializes the Experiment from a dictionary.""" return cls( - artifact_location=d.get("artifact_location", None), - creation_time=d.get("creation_time", None), - experiment_id=d.get("experiment_id", None), - last_update_time=d.get("last_update_time", None), - lifecycle_stage=d.get("lifecycle_stage", None), - name=d.get("name", None), - tags=_repeated_dict(d, "tags", ExperimentTag), + artifact_location=d.get("{artifact_location}", None), + creation_time=d.get("{creation_time}", None), + experiment_id=d.get("{experiment_id}", None), + last_update_time=d.get("{last_update_time}", None), + lifecycle_stage=d.get("{lifecycle_stage}", None), + name=d.get("{name}", None), + tags=_repeated_dict(d, "{tags}", ExperimentTag), ) @@ -1655,36 +1654,36 @@ def as_dict(self) -> dict: """Serializes the ExperimentAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ExperimentAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentAccessControlRequest: """Deserializes the ExperimentAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", ExperimentPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -1709,41 +1708,41 @@ def as_dict(self) -> dict: """Serializes the ExperimentAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ExperimentAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentAccessControlResponse: """Deserializes the ExperimentAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", ExperimentPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", ExperimentPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -1760,31 +1759,31 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermission: """Deserializes the ExperimentPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", ExperimentPermissionLevel), ) @@ -1808,31 +1807,31 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissions: """Deserializes the ExperimentPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ExperimentAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ExperimentAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -1847,26 +1846,26 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissionsDescription: """Deserializes the ExperimentPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", ExperimentPermissionLevel), ) @@ -1881,26 +1880,26 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissionsRequest: """Deserializes the ExperimentPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ExperimentAccessControlRequest), - experiment_id=d.get("experiment_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ExperimentAccessControlRequest), + experiment_id=d.get("{experiment_id}", None), ) @@ -1918,24 +1917,24 @@ def as_dict(self) -> dict: """Serializes the ExperimentTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the ExperimentTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentTag: """Deserializes the ExperimentTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -1955,28 +1954,28 @@ def as_dict(self) -> dict: """Serializes the FileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_size is not None: - body["file_size"] = self.file_size + body["{file_size}"] = self.file_size if self.is_dir is not None: - body["is_dir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the FileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.file_size is not None: - body["file_size"] = self.file_size + body["{file_size}"] = self.file_size if self.is_dir is not None: - body["is_dir"] = self.is_dir + body["{is_dir}"] = self.is_dir if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" - return cls(file_size=d.get("file_size", None), is_dir=d.get("is_dir", None), path=d.get("path", None)) + return cls(file_size=d.get("{file_size}", None), is_dir=d.get("{is_dir}", None), path=d.get("{path}", None)) @dataclass @@ -1996,31 +1995,31 @@ def as_dict(self) -> dict: """Serializes the ForecastingExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.experiment_page_url is not None: - body["experiment_page_url"] = self.experiment_page_url + body["{experiment_page_url}"] = self.experiment_page_url if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the ForecastingExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.experiment_page_url is not None: - body["experiment_page_url"] = self.experiment_page_url + body["{experiment_page_url}"] = self.experiment_page_url if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForecastingExperiment: """Deserializes the ForecastingExperiment from a dictionary.""" return cls( - experiment_id=d.get("experiment_id", None), - experiment_page_url=d.get("experiment_page_url", None), - state=_enum(d, "state", ForecastingExperimentState), + experiment_id=d.get("{experiment_id}", None), + experiment_page_url=d.get("{experiment_page_url}", None), + state=_enum(d, "{state}", ForecastingExperimentState), ) @@ -2042,20 +2041,20 @@ def as_dict(self) -> dict: """Serializes the GetExperimentByNameResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment: - body["experiment"] = self.experiment.as_dict() + body["{experiment}"] = self.experiment.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetExperimentByNameResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment: - body["experiment"] = self.experiment + body["{experiment}"] = self.experiment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExperimentByNameResponse: """Deserializes the GetExperimentByNameResponse from a dictionary.""" - return cls(experiment=_from_dict(d, "experiment", Experiment)) + return cls(experiment=_from_dict(d, "{experiment}", Experiment)) @dataclass @@ -2067,20 +2066,20 @@ def as_dict(self) -> dict: """Serializes the GetExperimentPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetExperimentPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExperimentPermissionLevelsResponse: """Deserializes the GetExperimentPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ExperimentPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ExperimentPermissionsDescription)) @dataclass @@ -2092,20 +2091,20 @@ def as_dict(self) -> dict: """Serializes the GetExperimentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment: - body["experiment"] = self.experiment.as_dict() + body["{experiment}"] = self.experiment.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetExperimentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment: - body["experiment"] = self.experiment + body["{experiment}"] = self.experiment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExperimentResponse: """Deserializes the GetExperimentResponse from a dictionary.""" - return cls(experiment=_from_dict(d, "experiment", Experiment)) + return cls(experiment=_from_dict(d, "{experiment}", Experiment)) @dataclass @@ -2120,24 +2119,24 @@ def as_dict(self) -> dict: """Serializes the GetLatestVersionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stages: - body["stages"] = [v for v in self.stages] + body["{stages}"] = [v for v in self.stages] return body def as_shallow_dict(self) -> dict: """Serializes the GetLatestVersionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stages: - body["stages"] = self.stages + body["{stages}"] = self.stages return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetLatestVersionsRequest: """Deserializes the GetLatestVersionsRequest from a dictionary.""" - return cls(name=d.get("name", None), stages=d.get("stages", None)) + return cls(name=d.get("{name}", None), stages=d.get("{stages}", None)) @dataclass @@ -2150,20 +2149,20 @@ def as_dict(self) -> dict: """Serializes the GetLatestVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_versions: - body["model_versions"] = [v.as_dict() for v in self.model_versions] + body["{model_versions}"] = [v.as_dict() for v in self.model_versions] return body def as_shallow_dict(self) -> dict: """Serializes the GetLatestVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_versions: - body["model_versions"] = self.model_versions + body["{model_versions}"] = self.model_versions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetLatestVersionsResponse: """Deserializes the GetLatestVersionsResponse from a dictionary.""" - return cls(model_versions=_repeated_dict(d, "model_versions", ModelVersion)) + return cls(model_versions=_repeated_dict(d, "{model_versions}", ModelVersion)) @dataclass @@ -2181,24 +2180,24 @@ def as_dict(self) -> dict: """Serializes the GetMetricHistoryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.metrics: - body["metrics"] = [v.as_dict() for v in self.metrics] + body["{metrics}"] = [v.as_dict() for v in self.metrics] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the GetMetricHistoryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.metrics: - body["metrics"] = self.metrics + body["{metrics}"] = self.metrics if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetMetricHistoryResponse: """Deserializes the GetMetricHistoryResponse from a dictionary.""" - return cls(metrics=_repeated_dict(d, "metrics", Metric), next_page_token=d.get("next_page_token", None)) + return cls(metrics=_repeated_dict(d, "{metrics}", Metric), next_page_token=d.get("{next_page_token}", None)) @dataclass @@ -2209,20 +2208,20 @@ def as_dict(self) -> dict: """Serializes the GetModelResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.registered_model_databricks: - body["registered_model_databricks"] = self.registered_model_databricks.as_dict() + body["{registered_model_databricks}"] = self.registered_model_databricks.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetModelResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.registered_model_databricks: - body["registered_model_databricks"] = self.registered_model_databricks + body["{registered_model_databricks}"] = self.registered_model_databricks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetModelResponse: """Deserializes the GetModelResponse from a dictionary.""" - return cls(registered_model_databricks=_from_dict(d, "registered_model_databricks", ModelDatabricks)) + return cls(registered_model_databricks=_from_dict(d, "{registered_model_databricks}", ModelDatabricks)) @dataclass @@ -2234,20 +2233,20 @@ def as_dict(self) -> dict: """Serializes the GetModelVersionDownloadUriResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_uri is not None: - body["artifact_uri"] = self.artifact_uri + body["{artifact_uri}"] = self.artifact_uri return body def as_shallow_dict(self) -> dict: """Serializes the GetModelVersionDownloadUriResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_uri is not None: - body["artifact_uri"] = self.artifact_uri + body["{artifact_uri}"] = self.artifact_uri return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetModelVersionDownloadUriResponse: """Deserializes the GetModelVersionDownloadUriResponse from a dictionary.""" - return cls(artifact_uri=d.get("artifact_uri", None)) + return cls(artifact_uri=d.get("{artifact_uri}", None)) @dataclass @@ -2258,20 +2257,20 @@ def as_dict(self) -> dict: """Serializes the GetModelVersionResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_version: - body["model_version"] = self.model_version.as_dict() + body["{model_version}"] = self.model_version.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetModelVersionResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_version: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetModelVersionResponse: """Deserializes the GetModelVersionResponse from a dictionary.""" - return cls(model_version=_from_dict(d, "model_version", ModelVersion)) + return cls(model_version=_from_dict(d, "{model_version}", ModelVersion)) @dataclass @@ -2283,20 +2282,20 @@ def as_dict(self) -> dict: """Serializes the GetRegisteredModelPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetRegisteredModelPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRegisteredModelPermissionLevelsResponse: """Deserializes the GetRegisteredModelPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", RegisteredModelPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", RegisteredModelPermissionsDescription)) @dataclass @@ -2308,20 +2307,20 @@ def as_dict(self) -> dict: """Serializes the GetRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run: - body["run"] = self.run.as_dict() + body["{run}"] = self.run.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run: - body["run"] = self.run + body["{run}"] = self.run return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRunResponse: """Deserializes the GetRunResponse from a dictionary.""" - return cls(run=_from_dict(d, "run", Run)) + return cls(run=_from_dict(d, "{run}", Run)) @dataclass @@ -2349,36 +2348,36 @@ def as_dict(self) -> dict: """Serializes the HttpUrlSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.authorization is not None: - body["authorization"] = self.authorization + body["{authorization}"] = self.authorization if self.enable_ssl_verification is not None: - body["enable_ssl_verification"] = self.enable_ssl_verification + body["{enable_ssl_verification}"] = self.enable_ssl_verification if self.secret is not None: - body["secret"] = self.secret + body["{secret}"] = self.secret if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the HttpUrlSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.authorization is not None: - body["authorization"] = self.authorization + body["{authorization}"] = self.authorization if self.enable_ssl_verification is not None: - body["enable_ssl_verification"] = self.enable_ssl_verification + body["{enable_ssl_verification}"] = self.enable_ssl_verification if self.secret is not None: - body["secret"] = self.secret + body["{secret}"] = self.secret if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> HttpUrlSpec: """Deserializes the HttpUrlSpec from a dictionary.""" return cls( - authorization=d.get("authorization", None), - enable_ssl_verification=d.get("enable_ssl_verification", None), - secret=d.get("secret", None), - url=d.get("url", None), + authorization=d.get("{authorization}", None), + enable_ssl_verification=d.get("{enable_ssl_verification}", None), + secret=d.get("{secret}", None), + url=d.get("{url}", None), ) @@ -2398,24 +2397,24 @@ def as_dict(self) -> dict: """Serializes the HttpUrlSpecWithoutSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.enable_ssl_verification is not None: - body["enable_ssl_verification"] = self.enable_ssl_verification + body["{enable_ssl_verification}"] = self.enable_ssl_verification if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the HttpUrlSpecWithoutSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.enable_ssl_verification is not None: - body["enable_ssl_verification"] = self.enable_ssl_verification + body["{enable_ssl_verification}"] = self.enable_ssl_verification if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> HttpUrlSpecWithoutSecret: """Deserializes the HttpUrlSpecWithoutSecret from a dictionary.""" - return cls(enable_ssl_verification=d.get("enable_ssl_verification", None), url=d.get("url", None)) + return cls(enable_ssl_verification=d.get("{enable_ssl_verification}", None), url=d.get("{url}", None)) @dataclass @@ -2432,24 +2431,24 @@ def as_dict(self) -> dict: """Serializes the InputTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the InputTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InputTag: """Deserializes the InputTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -2468,31 +2467,31 @@ def as_dict(self) -> dict: """Serializes the JobSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_token is not None: - body["access_token"] = self.access_token + body["{access_token}"] = self.access_token if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.workspace_url is not None: - body["workspace_url"] = self.workspace_url + body["{workspace_url}"] = self.workspace_url return body def as_shallow_dict(self) -> dict: """Serializes the JobSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.access_token is not None: - body["access_token"] = self.access_token + body["{access_token}"] = self.access_token if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.workspace_url is not None: - body["workspace_url"] = self.workspace_url + body["{workspace_url}"] = self.workspace_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSpec: """Deserializes the JobSpec from a dictionary.""" return cls( - access_token=d.get("access_token", None), - job_id=d.get("job_id", None), - workspace_url=d.get("workspace_url", None), + access_token=d.get("{access_token}", None), + job_id=d.get("{job_id}", None), + workspace_url=d.get("{workspace_url}", None), ) @@ -2510,24 +2509,24 @@ def as_dict(self) -> dict: """Serializes the JobSpecWithoutSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.workspace_url is not None: - body["workspace_url"] = self.workspace_url + body["{workspace_url}"] = self.workspace_url return body def as_shallow_dict(self) -> dict: """Serializes the JobSpecWithoutSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.workspace_url is not None: - body["workspace_url"] = self.workspace_url + body["{workspace_url}"] = self.workspace_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSpecWithoutSecret: """Deserializes the JobSpecWithoutSecret from a dictionary.""" - return cls(job_id=d.get("job_id", None), workspace_url=d.get("workspace_url", None)) + return cls(job_id=d.get("{job_id}", None), workspace_url=d.get("{workspace_url}", None)) @dataclass @@ -2545,31 +2544,31 @@ def as_dict(self) -> dict: """Serializes the ListArtifactsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.files: - body["files"] = [v.as_dict() for v in self.files] + body["{files}"] = [v.as_dict() for v in self.files] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.root_uri is not None: - body["root_uri"] = self.root_uri + body["{root_uri}"] = self.root_uri return body def as_shallow_dict(self) -> dict: """Serializes the ListArtifactsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.files: - body["files"] = self.files + body["{files}"] = self.files if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.root_uri is not None: - body["root_uri"] = self.root_uri + body["{root_uri}"] = self.root_uri return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListArtifactsResponse: """Deserializes the ListArtifactsResponse from a dictionary.""" return cls( - files=_repeated_dict(d, "files", FileInfo), - next_page_token=d.get("next_page_token", None), - root_uri=d.get("root_uri", None), + files=_repeated_dict(d, "{files}", FileInfo), + next_page_token=d.get("{next_page_token}", None), + root_uri=d.get("{root_uri}", None), ) @@ -2586,25 +2585,25 @@ def as_dict(self) -> dict: """Serializes the ListExperimentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiments: - body["experiments"] = [v.as_dict() for v in self.experiments] + body["{experiments}"] = [v.as_dict() for v in self.experiments] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListExperimentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiments: - body["experiments"] = self.experiments + body["{experiments}"] = self.experiments if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExperimentsResponse: """Deserializes the ListExperimentsResponse from a dictionary.""" return cls( - experiments=_repeated_dict(d, "experiments", Experiment), next_page_token=d.get("next_page_token", None) + experiments=_repeated_dict(d, "{experiments}", Experiment), next_page_token=d.get("{next_page_token}", None) ) @@ -2619,26 +2618,26 @@ def as_dict(self) -> dict: """Serializes the ListModelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.registered_models: - body["registered_models"] = [v.as_dict() for v in self.registered_models] + body["{registered_models}"] = [v.as_dict() for v in self.registered_models] return body def as_shallow_dict(self) -> dict: """Serializes the ListModelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.registered_models: - body["registered_models"] = self.registered_models + body["{registered_models}"] = self.registered_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListModelsResponse: """Deserializes the ListModelsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - registered_models=_repeated_dict(d, "registered_models", Model), + next_page_token=d.get("{next_page_token}", None), + registered_models=_repeated_dict(d, "{registered_models}", Model), ) @@ -2654,25 +2653,25 @@ def as_dict(self) -> dict: """Serializes the ListRegistryWebhooks into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.webhooks: - body["webhooks"] = [v.as_dict() for v in self.webhooks] + body["{webhooks}"] = [v.as_dict() for v in self.webhooks] return body def as_shallow_dict(self) -> dict: """Serializes the ListRegistryWebhooks into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.webhooks: - body["webhooks"] = self.webhooks + body["{webhooks}"] = self.webhooks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListRegistryWebhooks: """Deserializes the ListRegistryWebhooks from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), webhooks=_repeated_dict(d, "webhooks", RegistryWebhook) + next_page_token=d.get("{next_page_token}", None), webhooks=_repeated_dict(d, "{webhooks}", RegistryWebhook) ) @@ -2685,20 +2684,20 @@ def as_dict(self) -> dict: """Serializes the ListTransitionRequestsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.requests: - body["requests"] = [v.as_dict() for v in self.requests] + body["{requests}"] = [v.as_dict() for v in self.requests] return body def as_shallow_dict(self) -> dict: """Serializes the ListTransitionRequestsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.requests: - body["requests"] = self.requests + body["{requests}"] = self.requests return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTransitionRequestsResponse: """Deserializes the ListTransitionRequestsResponse from a dictionary.""" - return cls(requests=_repeated_dict(d, "requests", Activity)) + return cls(requests=_repeated_dict(d, "{requests}", Activity)) @dataclass @@ -2722,36 +2721,36 @@ def as_dict(self) -> dict: """Serializes the LogBatch into a dictionary suitable for use as a JSON request body.""" body = {} if self.metrics: - body["metrics"] = [v.as_dict() for v in self.metrics] + body["{metrics}"] = [v.as_dict() for v in self.metrics] if self.params: - body["params"] = [v.as_dict() for v in self.params] + body["{params}"] = [v.as_dict() for v in self.params] if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the LogBatch into a shallow dictionary of its immediate attributes.""" body = {} if self.metrics: - body["metrics"] = self.metrics + body["{metrics}"] = self.metrics if self.params: - body["params"] = self.params + body["{params}"] = self.params if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogBatch: """Deserializes the LogBatch from a dictionary.""" return cls( - metrics=_repeated_dict(d, "metrics", Metric), - params=_repeated_dict(d, "params", Param), - run_id=d.get("run_id", None), - tags=_repeated_dict(d, "tags", RunTag), + metrics=_repeated_dict(d, "{metrics}", Metric), + params=_repeated_dict(d, "{params}", Param), + run_id=d.get("{run_id}", None), + tags=_repeated_dict(d, "{tags}", RunTag), ) @@ -2788,31 +2787,31 @@ def as_dict(self) -> dict: """Serializes the LogInputs into a dictionary suitable for use as a JSON request body.""" body = {} if self.datasets: - body["datasets"] = [v.as_dict() for v in self.datasets] + body["{datasets}"] = [v.as_dict() for v in self.datasets] if self.models: - body["models"] = [v.as_dict() for v in self.models] + body["{models}"] = [v.as_dict() for v in self.models] if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the LogInputs into a shallow dictionary of its immediate attributes.""" body = {} if self.datasets: - body["datasets"] = self.datasets + body["{datasets}"] = self.datasets if self.models: - body["models"] = self.models + body["{models}"] = self.models if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogInputs: """Deserializes the LogInputs from a dictionary.""" return cls( - datasets=_repeated_dict(d, "datasets", DatasetInput), - models=_repeated_dict(d, "models", ModelInput), - run_id=d.get("run_id", None), + datasets=_repeated_dict(d, "{datasets}", DatasetInput), + models=_repeated_dict(d, "{models}", ModelInput), + run_id=d.get("{run_id}", None), ) @@ -2870,61 +2869,61 @@ def as_dict(self) -> dict: """Serializes the LogMetric into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset_digest is not None: - body["dataset_digest"] = self.dataset_digest + body["{dataset_digest}"] = self.dataset_digest if self.dataset_name is not None: - body["dataset_name"] = self.dataset_name + body["{dataset_name}"] = self.dataset_name if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.model_id is not None: - body["model_id"] = self.model_id + body["{model_id}"] = self.model_id if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.step is not None: - body["step"] = self.step + body["{step}"] = self.step if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the LogMetric into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset_digest is not None: - body["dataset_digest"] = self.dataset_digest + body["{dataset_digest}"] = self.dataset_digest if self.dataset_name is not None: - body["dataset_name"] = self.dataset_name + body["{dataset_name}"] = self.dataset_name if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.model_id is not None: - body["model_id"] = self.model_id + body["{model_id}"] = self.model_id if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.step is not None: - body["step"] = self.step + body["{step}"] = self.step if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogMetric: """Deserializes the LogMetric from a dictionary.""" return cls( - dataset_digest=d.get("dataset_digest", None), - dataset_name=d.get("dataset_name", None), - key=d.get("key", None), - model_id=d.get("model_id", None), - run_id=d.get("run_id", None), - run_uuid=d.get("run_uuid", None), - step=d.get("step", None), - timestamp=d.get("timestamp", None), - value=d.get("value", None), + dataset_digest=d.get("{dataset_digest}", None), + dataset_name=d.get("{dataset_name}", None), + key=d.get("{key}", None), + model_id=d.get("{model_id}", None), + run_id=d.get("{run_id}", None), + run_uuid=d.get("{run_uuid}", None), + step=d.get("{step}", None), + timestamp=d.get("{timestamp}", None), + value=d.get("{value}", None), ) @@ -2958,24 +2957,24 @@ def as_dict(self) -> dict: """Serializes the LogModel into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_json is not None: - body["model_json"] = self.model_json + body["{model_json}"] = self.model_json if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the LogModel into a shallow dictionary of its immediate attributes.""" body = {} if self.model_json is not None: - body["model_json"] = self.model_json + body["{model_json}"] = self.model_json if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogModel: """Deserializes the LogModel from a dictionary.""" - return cls(model_json=d.get("model_json", None), run_id=d.get("run_id", None)) + return cls(model_json=d.get("{model_json}", None), run_id=d.get("{run_id}", None)) @dataclass @@ -3008,24 +3007,24 @@ def as_dict(self) -> dict: """Serializes the LogOutputsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.models: - body["models"] = [v.as_dict() for v in self.models] + body["{models}"] = [v.as_dict() for v in self.models] if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the LogOutputsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.models: - body["models"] = self.models + body["{models}"] = self.models if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogOutputsRequest: """Deserializes the LogOutputsRequest from a dictionary.""" - return cls(models=_repeated_dict(d, "models", ModelOutput), run_id=d.get("run_id", None)) + return cls(models=_repeated_dict(d, "{models}", ModelOutput), run_id=d.get("{run_id}", None)) @dataclass @@ -3047,36 +3046,36 @@ def as_dict(self) -> dict: """Serializes the LogParam into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the LogParam into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogParam: """Deserializes the LogParam from a dictionary.""" return cls( - key=d.get("key", None), - run_id=d.get("run_id", None), - run_uuid=d.get("run_uuid", None), - value=d.get("value", None), + key=d.get("{key}", None), + run_id=d.get("{run_id}", None), + run_uuid=d.get("{run_uuid}", None), + value=d.get("{value}", None), ) @@ -3133,56 +3132,56 @@ def as_dict(self) -> dict: """Serializes the Metric into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset_digest is not None: - body["dataset_digest"] = self.dataset_digest + body["{dataset_digest}"] = self.dataset_digest if self.dataset_name is not None: - body["dataset_name"] = self.dataset_name + body["{dataset_name}"] = self.dataset_name if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.model_id is not None: - body["model_id"] = self.model_id + body["{model_id}"] = self.model_id if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.step is not None: - body["step"] = self.step + body["{step}"] = self.step if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the Metric into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset_digest is not None: - body["dataset_digest"] = self.dataset_digest + body["{dataset_digest}"] = self.dataset_digest if self.dataset_name is not None: - body["dataset_name"] = self.dataset_name + body["{dataset_name}"] = self.dataset_name if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.model_id is not None: - body["model_id"] = self.model_id + body["{model_id}"] = self.model_id if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.step is not None: - body["step"] = self.step + body["{step}"] = self.step if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Metric: """Deserializes the Metric from a dictionary.""" return cls( - dataset_digest=d.get("dataset_digest", None), - dataset_name=d.get("dataset_name", None), - key=d.get("key", None), - model_id=d.get("model_id", None), - run_id=d.get("run_id", None), - step=d.get("step", None), - timestamp=d.get("timestamp", None), - value=d.get("value", None), + dataset_digest=d.get("{dataset_digest}", None), + dataset_name=d.get("{dataset_name}", None), + key=d.get("{key}", None), + model_id=d.get("{model_id}", None), + run_id=d.get("{run_id}", None), + step=d.get("{step}", None), + timestamp=d.get("{timestamp}", None), + value=d.get("{value}", None), ) @@ -3214,51 +3213,51 @@ def as_dict(self) -> dict: """Serializes the Model into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.latest_versions: - body["latest_versions"] = [v.as_dict() for v in self.latest_versions] + body["{latest_versions}"] = [v.as_dict() for v in self.latest_versions] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the Model into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.latest_versions: - body["latest_versions"] = self.latest_versions + body["{latest_versions}"] = self.latest_versions if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Model: """Deserializes the Model from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - description=d.get("description", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - latest_versions=_repeated_dict(d, "latest_versions", ModelVersion), - name=d.get("name", None), - tags=_repeated_dict(d, "tags", ModelTag), - user_id=d.get("user_id", None), + creation_timestamp=d.get("{creation_timestamp}", None), + description=d.get("{description}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + latest_versions=_repeated_dict(d, "{latest_versions}", ModelVersion), + name=d.get("{name}", None), + tags=_repeated_dict(d, "{tags}", ModelTag), + user_id=d.get("{user_id}", None), ) @@ -3296,61 +3295,61 @@ def as_dict(self) -> dict: """Serializes the ModelDatabricks into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.latest_versions: - body["latest_versions"] = [v.as_dict() for v in self.latest_versions] + body["{latest_versions}"] = [v.as_dict() for v in self.latest_versions] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the ModelDatabricks into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.latest_versions: - body["latest_versions"] = self.latest_versions + body["{latest_versions}"] = self.latest_versions if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelDatabricks: """Deserializes the ModelDatabricks from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - description=d.get("description", None), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - latest_versions=_repeated_dict(d, "latest_versions", ModelVersion), - name=d.get("name", None), - permission_level=_enum(d, "permission_level", PermissionLevel), - tags=_repeated_dict(d, "tags", ModelTag), - user_id=d.get("user_id", None), + creation_timestamp=d.get("{creation_timestamp}", None), + description=d.get("{description}", None), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + latest_versions=_repeated_dict(d, "{latest_versions}", ModelVersion), + name=d.get("{name}", None), + permission_level=_enum(d, "{permission_level}", PermissionLevel), + tags=_repeated_dict(d, "{tags}", ModelTag), + user_id=d.get("{user_id}", None), ) @@ -3365,20 +3364,20 @@ def as_dict(self) -> dict: """Serializes the ModelInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_id is not None: - body["model_id"] = self.model_id + body["{model_id}"] = self.model_id return body def as_shallow_dict(self) -> dict: """Serializes the ModelInput into a shallow dictionary of its immediate attributes.""" body = {} if self.model_id is not None: - body["model_id"] = self.model_id + body["{model_id}"] = self.model_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelInput: """Deserializes the ModelInput from a dictionary.""" - return cls(model_id=d.get("model_id", None)) + return cls(model_id=d.get("{model_id}", None)) @dataclass @@ -3393,24 +3392,24 @@ def as_dict(self) -> dict: """Serializes the ModelTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the ModelTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelTag: """Deserializes the ModelTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -3459,81 +3458,81 @@ def as_dict(self) -> dict: """Serializes the ModelVersion into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.current_stage is not None: - body["current_stage"] = self.current_stage + body["{current_stage}"] = self.current_stage if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_link is not None: - body["run_link"] = self.run_link + body["{run_link}"] = self.run_link if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the ModelVersion into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.current_stage is not None: - body["current_stage"] = self.current_stage + body["{current_stage}"] = self.current_stage if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_link is not None: - body["run_link"] = self.run_link + body["{run_link}"] = self.run_link if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersion: """Deserializes the ModelVersion from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - current_stage=d.get("current_stage", None), - description=d.get("description", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - name=d.get("name", None), - run_id=d.get("run_id", None), - run_link=d.get("run_link", None), - source=d.get("source", None), - status=_enum(d, "status", ModelVersionStatus), - status_message=d.get("status_message", None), - tags=_repeated_dict(d, "tags", ModelVersionTag), - user_id=d.get("user_id", None), - version=d.get("version", None), + creation_timestamp=d.get("{creation_timestamp}", None), + current_stage=d.get("{current_stage}", None), + description=d.get("{description}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + name=d.get("{name}", None), + run_id=d.get("{run_id}", None), + run_link=d.get("{run_link}", None), + source=d.get("{source}", None), + status=_enum(d, "{status}", ModelVersionStatus), + status_message=d.get("{status_message}", None), + tags=_repeated_dict(d, "{tags}", ModelVersionTag), + user_id=d.get("{user_id}", None), + version=d.get("{version}", None), ) @@ -3602,86 +3601,86 @@ def as_dict(self) -> dict: """Serializes the ModelVersionDatabricks into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.current_stage is not None: - body["current_stage"] = self.current_stage.value + body["{current_stage}"] = self.current_stage.value if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_link is not None: - body["run_link"] = self.run_link + body["{run_link}"] = self.run_link if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the ModelVersionDatabricks into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.current_stage is not None: - body["current_stage"] = self.current_stage + body["{current_stage}"] = self.current_stage if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_link is not None: - body["run_link"] = self.run_link + body["{run_link}"] = self.run_link if self.source is not None: - body["source"] = self.source + body["{source}"] = self.source if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersionDatabricks: """Deserializes the ModelVersionDatabricks from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - current_stage=_enum(d, "current_stage", Stage), - description=d.get("description", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - name=d.get("name", None), - permission_level=_enum(d, "permission_level", PermissionLevel), - run_id=d.get("run_id", None), - run_link=d.get("run_link", None), - source=d.get("source", None), - status=_enum(d, "status", Status), - status_message=d.get("status_message", None), - tags=_repeated_dict(d, "tags", ModelVersionTag), - user_id=d.get("user_id", None), - version=d.get("version", None), + creation_timestamp=d.get("{creation_timestamp}", None), + current_stage=_enum(d, "{current_stage}", Stage), + description=d.get("{description}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + name=d.get("{name}", None), + permission_level=_enum(d, "{permission_level}", PermissionLevel), + run_id=d.get("{run_id}", None), + run_link=d.get("{run_link}", None), + source=d.get("{source}", None), + status=_enum(d, "{status}", Status), + status_message=d.get("{status_message}", None), + tags=_repeated_dict(d, "{tags}", ModelVersionTag), + user_id=d.get("{user_id}", None), + version=d.get("{version}", None), ) @@ -3705,24 +3704,24 @@ def as_dict(self) -> dict: """Serializes the ModelVersionTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the ModelVersionTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersionTag: """Deserializes the ModelVersionTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -3739,24 +3738,24 @@ def as_dict(self) -> dict: """Serializes the Param into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the Param into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Param: """Deserializes the Param from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) class PermissionLevel(Enum): @@ -3788,36 +3787,36 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAccessControlRequest: """Deserializes the RegisteredModelAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", RegisteredModelPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3842,41 +3841,41 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAccessControlResponse: """Deserializes the RegisteredModelAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", RegisteredModelPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", RegisteredModelPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3893,31 +3892,31 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermission: """Deserializes the RegisteredModelPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", RegisteredModelPermissionLevel), ) @@ -3943,31 +3942,31 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissions: """Deserializes the RegisteredModelPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", RegisteredModelAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", RegisteredModelAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -3982,26 +3981,26 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissionsDescription: """Deserializes the RegisteredModelPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", RegisteredModelPermissionLevel), ) @@ -4016,26 +4015,26 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.registered_model_id is not None: - body["registered_model_id"] = self.registered_model_id + body["{registered_model_id}"] = self.registered_model_id return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.registered_model_id is not None: - body["registered_model_id"] = self.registered_model_id + body["{registered_model_id}"] = self.registered_model_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissionsRequest: """Deserializes the RegisteredModelPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", RegisteredModelAccessControlRequest), - registered_model_id=d.get("registered_model_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", RegisteredModelAccessControlRequest), + registered_model_id=d.get("{registered_model_id}", None), ) @@ -4103,61 +4102,61 @@ def as_dict(self) -> dict: """Serializes the RegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.events: - body["events"] = [v.value for v in self.events] + body["{events}"] = [v.value for v in self.events] if self.http_url_spec: - body["http_url_spec"] = self.http_url_spec.as_dict() + body["{http_url_spec}"] = self.http_url_spec.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.job_spec: - body["job_spec"] = self.job_spec.as_dict() + body["{job_spec}"] = self.job_spec.as_dict() if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the RegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.events: - body["events"] = self.events + body["{events}"] = self.events if self.http_url_spec: - body["http_url_spec"] = self.http_url_spec + body["{http_url_spec}"] = self.http_url_spec if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.job_spec: - body["job_spec"] = self.job_spec + body["{job_spec}"] = self.job_spec if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegistryWebhook: """Deserializes the RegistryWebhook from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - description=d.get("description", None), - events=_repeated_enum(d, "events", RegistryWebhookEvent), - http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpecWithoutSecret), - id=d.get("id", None), - job_spec=_from_dict(d, "job_spec", JobSpecWithoutSecret), - last_updated_timestamp=d.get("last_updated_timestamp", None), - model_name=d.get("model_name", None), - status=_enum(d, "status", RegistryWebhookStatus), + creation_timestamp=d.get("{creation_timestamp}", None), + description=d.get("{description}", None), + events=_repeated_enum(d, "{events}", RegistryWebhookEvent), + http_url_spec=_from_dict(d, "{http_url_spec}", HttpUrlSpecWithoutSecret), + id=d.get("{id}", None), + job_spec=_from_dict(d, "{job_spec}", JobSpecWithoutSecret), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + model_name=d.get("{model_name}", None), + status=_enum(d, "{status}", RegistryWebhookStatus), ) @@ -4217,36 +4216,36 @@ def as_dict(self) -> dict: """Serializes the RejectTransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage.value + body["{stage}"] = self.stage.value if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the RejectTransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage + body["{stage}"] = self.stage if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RejectTransitionRequest: """Deserializes the RejectTransitionRequest from a dictionary.""" return cls( - comment=d.get("comment", None), - name=d.get("name", None), - stage=_enum(d, "stage", Stage), - version=d.get("version", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + stage=_enum(d, "{stage}", Stage), + version=d.get("{version}", None), ) @@ -4259,20 +4258,20 @@ def as_dict(self) -> dict: """Serializes the RejectTransitionRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.activity: - body["activity"] = self.activity.as_dict() + body["{activity}"] = self.activity.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the RejectTransitionRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.activity: - body["activity"] = self.activity + body["{activity}"] = self.activity return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RejectTransitionRequestResponse: """Deserializes the RejectTransitionRequestResponse from a dictionary.""" - return cls(activity=_from_dict(d, "activity", Activity)) + return cls(activity=_from_dict(d, "{activity}", Activity)) @dataclass @@ -4287,24 +4286,24 @@ def as_dict(self) -> dict: """Serializes the RenameModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name return body def as_shallow_dict(self) -> dict: """Serializes the RenameModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RenameModelRequest: """Deserializes the RenameModelRequest from a dictionary.""" - return cls(name=d.get("name", None), new_name=d.get("new_name", None)) + return cls(name=d.get("{name}", None), new_name=d.get("{new_name}", None)) @dataclass @@ -4315,20 +4314,20 @@ def as_dict(self) -> dict: """Serializes the RenameModelResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.registered_model: - body["registered_model"] = self.registered_model.as_dict() + body["{registered_model}"] = self.registered_model.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the RenameModelResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.registered_model: - body["registered_model"] = self.registered_model + body["{registered_model}"] = self.registered_model return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RenameModelResponse: """Deserializes the RenameModelResponse from a dictionary.""" - return cls(registered_model=_from_dict(d, "registered_model", Model)) + return cls(registered_model=_from_dict(d, "{registered_model}", Model)) @dataclass @@ -4340,20 +4339,20 @@ def as_dict(self) -> dict: """Serializes the RestoreExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body def as_shallow_dict(self) -> dict: """Serializes the RestoreExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreExperiment: """Deserializes the RestoreExperiment from a dictionary.""" - return cls(experiment_id=d.get("experiment_id", None)) + return cls(experiment_id=d.get("{experiment_id}", None)) @dataclass @@ -4383,20 +4382,20 @@ def as_dict(self) -> dict: """Serializes the RestoreRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body def as_shallow_dict(self) -> dict: """Serializes the RestoreRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreRun: """Deserializes the RestoreRun from a dictionary.""" - return cls(run_id=d.get("run_id", None)) + return cls(run_id=d.get("{run_id}", None)) @dataclass @@ -4434,31 +4433,31 @@ def as_dict(self) -> dict: """Serializes the RestoreRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.max_runs is not None: - body["max_runs"] = self.max_runs + body["{max_runs}"] = self.max_runs if self.min_timestamp_millis is not None: - body["min_timestamp_millis"] = self.min_timestamp_millis + body["{min_timestamp_millis}"] = self.min_timestamp_millis return body def as_shallow_dict(self) -> dict: """Serializes the RestoreRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.max_runs is not None: - body["max_runs"] = self.max_runs + body["{max_runs}"] = self.max_runs if self.min_timestamp_millis is not None: - body["min_timestamp_millis"] = self.min_timestamp_millis + body["{min_timestamp_millis}"] = self.min_timestamp_millis return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreRuns: """Deserializes the RestoreRuns from a dictionary.""" return cls( - experiment_id=d.get("experiment_id", None), - max_runs=d.get("max_runs", None), - min_timestamp_millis=d.get("min_timestamp_millis", None), + experiment_id=d.get("{experiment_id}", None), + max_runs=d.get("{max_runs}", None), + min_timestamp_millis=d.get("{min_timestamp_millis}", None), ) @@ -4471,20 +4470,20 @@ def as_dict(self) -> dict: """Serializes the RestoreRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.runs_restored is not None: - body["runs_restored"] = self.runs_restored + body["{runs_restored}"] = self.runs_restored return body def as_shallow_dict(self) -> dict: """Serializes the RestoreRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.runs_restored is not None: - body["runs_restored"] = self.runs_restored + body["{runs_restored}"] = self.runs_restored return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreRunsResponse: """Deserializes the RestoreRunsResponse from a dictionary.""" - return cls(runs_restored=d.get("runs_restored", None)) + return cls(runs_restored=d.get("{runs_restored}", None)) @dataclass @@ -4504,31 +4503,31 @@ def as_dict(self) -> dict: """Serializes the Run into a dictionary suitable for use as a JSON request body.""" body = {} if self.data: - body["data"] = self.data.as_dict() + body["{data}"] = self.data.as_dict() if self.info: - body["info"] = self.info.as_dict() + body["{info}"] = self.info.as_dict() if self.inputs: - body["inputs"] = self.inputs.as_dict() + body["{inputs}"] = self.inputs.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Run into a shallow dictionary of its immediate attributes.""" body = {} if self.data: - body["data"] = self.data + body["{data}"] = self.data if self.info: - body["info"] = self.info + body["{info}"] = self.info if self.inputs: - body["inputs"] = self.inputs + body["{inputs}"] = self.inputs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Run: """Deserializes the Run from a dictionary.""" return cls( - data=_from_dict(d, "data", RunData), - info=_from_dict(d, "info", RunInfo), - inputs=_from_dict(d, "inputs", RunInputs), + data=_from_dict(d, "{data}", RunData), + info=_from_dict(d, "{info}", RunInfo), + inputs=_from_dict(d, "{inputs}", RunInputs), ) @@ -4549,31 +4548,31 @@ def as_dict(self) -> dict: """Serializes the RunData into a dictionary suitable for use as a JSON request body.""" body = {} if self.metrics: - body["metrics"] = [v.as_dict() for v in self.metrics] + body["{metrics}"] = [v.as_dict() for v in self.metrics] if self.params: - body["params"] = [v.as_dict() for v in self.params] + body["{params}"] = [v.as_dict() for v in self.params] if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the RunData into a shallow dictionary of its immediate attributes.""" body = {} if self.metrics: - body["metrics"] = self.metrics + body["{metrics}"] = self.metrics if self.params: - body["params"] = self.params + body["{params}"] = self.params if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunData: """Deserializes the RunData from a dictionary.""" return cls( - metrics=_repeated_dict(d, "metrics", Metric), - params=_repeated_dict(d, "params", Param), - tags=_repeated_dict(d, "tags", RunTag), + metrics=_repeated_dict(d, "{metrics}", Metric), + params=_repeated_dict(d, "{params}", Param), + tags=_repeated_dict(d, "{tags}", RunTag), ) @@ -4619,66 +4618,66 @@ def as_dict(self) -> dict: """Serializes the RunInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_uri is not None: - body["artifact_uri"] = self.artifact_uri + body["{artifact_uri}"] = self.artifact_uri if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.lifecycle_stage is not None: - body["lifecycle_stage"] = self.lifecycle_stage + body["{lifecycle_stage}"] = self.lifecycle_stage if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the RunInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_uri is not None: - body["artifact_uri"] = self.artifact_uri + body["{artifact_uri}"] = self.artifact_uri if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.lifecycle_stage is not None: - body["lifecycle_stage"] = self.lifecycle_stage + body["{lifecycle_stage}"] = self.lifecycle_stage if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunInfo: """Deserializes the RunInfo from a dictionary.""" return cls( - artifact_uri=d.get("artifact_uri", None), - end_time=d.get("end_time", None), - experiment_id=d.get("experiment_id", None), - lifecycle_stage=d.get("lifecycle_stage", None), - run_id=d.get("run_id", None), - run_name=d.get("run_name", None), - run_uuid=d.get("run_uuid", None), - start_time=d.get("start_time", None), - status=_enum(d, "status", RunInfoStatus), - user_id=d.get("user_id", None), + artifact_uri=d.get("{artifact_uri}", None), + end_time=d.get("{end_time}", None), + experiment_id=d.get("{experiment_id}", None), + lifecycle_stage=d.get("{lifecycle_stage}", None), + run_id=d.get("{run_id}", None), + run_name=d.get("{run_name}", None), + run_uuid=d.get("{run_uuid}", None), + start_time=d.get("{start_time}", None), + status=_enum(d, "{status}", RunInfoStatus), + user_id=d.get("{user_id}", None), ) @@ -4709,26 +4708,26 @@ def as_dict(self) -> dict: """Serializes the RunInputs into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset_inputs: - body["dataset_inputs"] = [v.as_dict() for v in self.dataset_inputs] + body["{dataset_inputs}"] = [v.as_dict() for v in self.dataset_inputs] if self.model_inputs: - body["model_inputs"] = [v.as_dict() for v in self.model_inputs] + body["{model_inputs}"] = [v.as_dict() for v in self.model_inputs] return body def as_shallow_dict(self) -> dict: """Serializes the RunInputs into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset_inputs: - body["dataset_inputs"] = self.dataset_inputs + body["{dataset_inputs}"] = self.dataset_inputs if self.model_inputs: - body["model_inputs"] = self.model_inputs + body["{model_inputs}"] = self.model_inputs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunInputs: """Deserializes the RunInputs from a dictionary.""" return cls( - dataset_inputs=_repeated_dict(d, "dataset_inputs", DatasetInput), - model_inputs=_repeated_dict(d, "model_inputs", ModelInput), + dataset_inputs=_repeated_dict(d, "{dataset_inputs}", DatasetInput), + model_inputs=_repeated_dict(d, "{model_inputs}", ModelInput), ) @@ -4746,24 +4745,24 @@ def as_dict(self) -> dict: """Serializes the RunTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the RunTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunTag: """Deserializes the RunTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -4790,41 +4789,41 @@ def as_dict(self) -> dict: """Serializes the SearchExperiments into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter is not None: - body["filter"] = self.filter + body["{filter}"] = self.filter if self.max_results is not None: - body["max_results"] = self.max_results + body["{max_results}"] = self.max_results if self.order_by: - body["order_by"] = [v for v in self.order_by] + body["{order_by}"] = [v for v in self.order_by] if self.page_token is not None: - body["page_token"] = self.page_token + body["{page_token}"] = self.page_token if self.view_type is not None: - body["view_type"] = self.view_type.value + body["{view_type}"] = self.view_type.value return body def as_shallow_dict(self) -> dict: """Serializes the SearchExperiments into a shallow dictionary of its immediate attributes.""" body = {} if self.filter is not None: - body["filter"] = self.filter + body["{filter}"] = self.filter if self.max_results is not None: - body["max_results"] = self.max_results + body["{max_results}"] = self.max_results if self.order_by: - body["order_by"] = self.order_by + body["{order_by}"] = self.order_by if self.page_token is not None: - body["page_token"] = self.page_token + body["{page_token}"] = self.page_token if self.view_type is not None: - body["view_type"] = self.view_type + body["{view_type}"] = self.view_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchExperiments: """Deserializes the SearchExperiments from a dictionary.""" return cls( - filter=d.get("filter", None), - max_results=d.get("max_results", None), - order_by=d.get("order_by", None), - page_token=d.get("page_token", None), - view_type=_enum(d, "view_type", ViewType), + filter=d.get("{filter}", None), + max_results=d.get("{max_results}", None), + order_by=d.get("{order_by}", None), + page_token=d.get("{page_token}", None), + view_type=_enum(d, "{view_type}", ViewType), ) @@ -4841,25 +4840,25 @@ def as_dict(self) -> dict: """Serializes the SearchExperimentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiments: - body["experiments"] = [v.as_dict() for v in self.experiments] + body["{experiments}"] = [v.as_dict() for v in self.experiments] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the SearchExperimentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiments: - body["experiments"] = self.experiments + body["{experiments}"] = self.experiments if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchExperimentsResponse: """Deserializes the SearchExperimentsResponse from a dictionary.""" return cls( - experiments=_repeated_dict(d, "experiments", Experiment), next_page_token=d.get("next_page_token", None) + experiments=_repeated_dict(d, "{experiments}", Experiment), next_page_token=d.get("{next_page_token}", None) ) @@ -4875,26 +4874,26 @@ def as_dict(self) -> dict: """Serializes the SearchModelVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_versions: - body["model_versions"] = [v.as_dict() for v in self.model_versions] + body["{model_versions}"] = [v.as_dict() for v in self.model_versions] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the SearchModelVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_versions: - body["model_versions"] = self.model_versions + body["{model_versions}"] = self.model_versions if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchModelVersionsResponse: """Deserializes the SearchModelVersionsResponse from a dictionary.""" return cls( - model_versions=_repeated_dict(d, "model_versions", ModelVersion), - next_page_token=d.get("next_page_token", None), + model_versions=_repeated_dict(d, "{model_versions}", ModelVersion), + next_page_token=d.get("{next_page_token}", None), ) @@ -4910,26 +4909,26 @@ def as_dict(self) -> dict: """Serializes the SearchModelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.registered_models: - body["registered_models"] = [v.as_dict() for v in self.registered_models] + body["{registered_models}"] = [v.as_dict() for v in self.registered_models] return body def as_shallow_dict(self) -> dict: """Serializes the SearchModelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.registered_models: - body["registered_models"] = self.registered_models + body["{registered_models}"] = self.registered_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchModelsResponse: """Deserializes the SearchModelsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - registered_models=_repeated_dict(d, "registered_models", Model), + next_page_token=d.get("{next_page_token}", None), + registered_models=_repeated_dict(d, "{registered_models}", Model), ) @@ -4970,46 +4969,46 @@ def as_dict(self) -> dict: """Serializes the SearchRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_ids: - body["experiment_ids"] = [v for v in self.experiment_ids] + body["{experiment_ids}"] = [v for v in self.experiment_ids] if self.filter is not None: - body["filter"] = self.filter + body["{filter}"] = self.filter if self.max_results is not None: - body["max_results"] = self.max_results + body["{max_results}"] = self.max_results if self.order_by: - body["order_by"] = [v for v in self.order_by] + body["{order_by}"] = [v for v in self.order_by] if self.page_token is not None: - body["page_token"] = self.page_token + body["{page_token}"] = self.page_token if self.run_view_type is not None: - body["run_view_type"] = self.run_view_type.value + body["{run_view_type}"] = self.run_view_type.value return body def as_shallow_dict(self) -> dict: """Serializes the SearchRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_ids: - body["experiment_ids"] = self.experiment_ids + body["{experiment_ids}"] = self.experiment_ids if self.filter is not None: - body["filter"] = self.filter + body["{filter}"] = self.filter if self.max_results is not None: - body["max_results"] = self.max_results + body["{max_results}"] = self.max_results if self.order_by: - body["order_by"] = self.order_by + body["{order_by}"] = self.order_by if self.page_token is not None: - body["page_token"] = self.page_token + body["{page_token}"] = self.page_token if self.run_view_type is not None: - body["run_view_type"] = self.run_view_type + body["{run_view_type}"] = self.run_view_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchRuns: """Deserializes the SearchRuns from a dictionary.""" return cls( - experiment_ids=d.get("experiment_ids", None), - filter=d.get("filter", None), - max_results=d.get("max_results", None), - order_by=d.get("order_by", None), - page_token=d.get("page_token", None), - run_view_type=_enum(d, "run_view_type", ViewType), + experiment_ids=d.get("{experiment_ids}", None), + filter=d.get("{filter}", None), + max_results=d.get("{max_results}", None), + order_by=d.get("{order_by}", None), + page_token=d.get("{page_token}", None), + run_view_type=_enum(d, "{run_view_type}", ViewType), ) @@ -5025,24 +5024,24 @@ def as_dict(self) -> dict: """Serializes the SearchRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.runs: - body["runs"] = [v.as_dict() for v in self.runs] + body["{runs}"] = [v.as_dict() for v in self.runs] return body def as_shallow_dict(self) -> dict: """Serializes the SearchRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.runs: - body["runs"] = self.runs + body["{runs}"] = self.runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchRunsResponse: """Deserializes the SearchRunsResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), runs=_repeated_dict(d, "runs", Run)) + return cls(next_page_token=d.get("{next_page_token}", None), runs=_repeated_dict(d, "{runs}", Run)) @dataclass @@ -5060,28 +5059,28 @@ def as_dict(self) -> dict: """Serializes the SetExperimentTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the SetExperimentTag into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetExperimentTag: """Deserializes the SetExperimentTag from a dictionary.""" - return cls(experiment_id=d.get("experiment_id", None), key=d.get("key", None), value=d.get("value", None)) + return cls(experiment_id=d.get("{experiment_id}", None), key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -5120,28 +5119,28 @@ def as_dict(self) -> dict: """Serializes the SetModelTagRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the SetModelTagRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetModelTagRequest: """Deserializes the SetModelTagRequest from a dictionary.""" - return cls(key=d.get("key", None), name=d.get("name", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), name=d.get("{name}", None), value=d.get("{value}", None)) @dataclass @@ -5183,33 +5182,36 @@ def as_dict(self) -> dict: """Serializes the SetModelVersionTagRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the SetModelVersionTagRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetModelVersionTagRequest: """Deserializes the SetModelVersionTagRequest from a dictionary.""" return cls( - key=d.get("key", None), name=d.get("name", None), value=d.get("value", None), version=d.get("version", None) + key=d.get("{key}", None), + name=d.get("{name}", None), + value=d.get("{value}", None), + version=d.get("{version}", None), ) @@ -5250,36 +5252,36 @@ def as_dict(self) -> dict: """Serializes the SetTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the SetTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetTag: """Deserializes the SetTag from a dictionary.""" return cls( - key=d.get("key", None), - run_id=d.get("run_id", None), - run_uuid=d.get("run_uuid", None), - value=d.get("value", None), + key=d.get("{key}", None), + run_id=d.get("{run_id}", None), + run_uuid=d.get("{run_uuid}", None), + value=d.get("{value}", None), ) @@ -5345,24 +5347,24 @@ def as_dict(self) -> dict: """Serializes the TestRegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.body is not None: - body["body"] = self.body + body["{body}"] = self.body if self.status_code is not None: - body["status_code"] = self.status_code + body["{status_code}"] = self.status_code return body def as_shallow_dict(self) -> dict: """Serializes the TestRegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.body is not None: - body["body"] = self.body + body["{body}"] = self.body if self.status_code is not None: - body["status_code"] = self.status_code + body["{status_code}"] = self.status_code return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhook: """Deserializes the TestRegistryWebhook from a dictionary.""" - return cls(body=d.get("body", None), status_code=d.get("status_code", None)) + return cls(body=d.get("{body}", None), status_code=d.get("{status_code}", None)) @dataclass @@ -5378,24 +5380,24 @@ def as_dict(self) -> dict: """Serializes the TestRegistryWebhookRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.event is not None: - body["event"] = self.event.value + body["{event}"] = self.event.value if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the TestRegistryWebhookRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.event is not None: - body["event"] = self.event + body["{event}"] = self.event if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookRequest: """Deserializes the TestRegistryWebhookRequest from a dictionary.""" - return cls(event=_enum(d, "event", RegistryWebhookEvent), id=d.get("id", None)) + return cls(event=_enum(d, "{event}", RegistryWebhookEvent), id=d.get("{id}", None)) @dataclass @@ -5407,20 +5409,20 @@ def as_dict(self) -> dict: """Serializes the TestRegistryWebhookResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.webhook: - body["webhook"] = self.webhook.as_dict() + body["{webhook}"] = self.webhook.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TestRegistryWebhookResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.webhook: - body["webhook"] = self.webhook + body["{webhook}"] = self.webhook return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookResponse: """Deserializes the TestRegistryWebhookResponse from a dictionary.""" - return cls(webhook=_from_dict(d, "webhook", TestRegistryWebhook)) + return cls(webhook=_from_dict(d, "{webhook}", TestRegistryWebhook)) @dataclass @@ -5452,41 +5454,41 @@ def as_dict(self) -> dict: """Serializes the TransitionModelVersionStageDatabricks into a dictionary suitable for use as a JSON request body.""" body = {} if self.archive_existing_versions is not None: - body["archive_existing_versions"] = self.archive_existing_versions + body["{archive_existing_versions}"] = self.archive_existing_versions if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage.value + body["{stage}"] = self.stage.value if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the TransitionModelVersionStageDatabricks into a shallow dictionary of its immediate attributes.""" body = {} if self.archive_existing_versions is not None: - body["archive_existing_versions"] = self.archive_existing_versions + body["{archive_existing_versions}"] = self.archive_existing_versions if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.stage is not None: - body["stage"] = self.stage + body["{stage}"] = self.stage if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransitionModelVersionStageDatabricks: """Deserializes the TransitionModelVersionStageDatabricks from a dictionary.""" return cls( - archive_existing_versions=d.get("archive_existing_versions", None), - comment=d.get("comment", None), - name=d.get("name", None), - stage=_enum(d, "stage", Stage), - version=d.get("version", None), + archive_existing_versions=d.get("{archive_existing_versions}", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + stage=_enum(d, "{stage}", Stage), + version=d.get("{version}", None), ) @@ -5521,41 +5523,41 @@ def as_dict(self) -> dict: """Serializes the TransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.available_actions: - body["available_actions"] = [v.value for v in self.available_actions] + body["{available_actions}"] = [v.value for v in self.available_actions] if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.to_stage is not None: - body["to_stage"] = self.to_stage.value + body["{to_stage}"] = self.to_stage.value if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the TransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.available_actions: - body["available_actions"] = self.available_actions + body["{available_actions}"] = self.available_actions if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.to_stage is not None: - body["to_stage"] = self.to_stage + body["{to_stage}"] = self.to_stage if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransitionRequest: """Deserializes the TransitionRequest from a dictionary.""" return cls( - available_actions=_repeated_enum(d, "available_actions", ActivityAction), - comment=d.get("comment", None), - creation_timestamp=d.get("creation_timestamp", None), - to_stage=_enum(d, "to_stage", Stage), - user_id=d.get("user_id", None), + available_actions=_repeated_enum(d, "{available_actions}", ActivityAction), + comment=d.get("{comment}", None), + creation_timestamp=d.get("{creation_timestamp}", None), + to_stage=_enum(d, "{to_stage}", Stage), + user_id=d.get("{user_id}", None), ) @@ -5567,20 +5569,20 @@ def as_dict(self) -> dict: """Serializes the TransitionStageResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_version: - body["model_version"] = self.model_version.as_dict() + body["{model_version}"] = self.model_version.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TransitionStageResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_version: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransitionStageResponse: """Deserializes the TransitionStageResponse from a dictionary.""" - return cls(model_version=_from_dict(d, "model_version", ModelVersionDatabricks)) + return cls(model_version=_from_dict(d, "{model_version}", ModelVersionDatabricks)) @dataclass @@ -5595,24 +5597,24 @@ def as_dict(self) -> dict: """Serializes the UpdateComment into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateComment into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateComment: """Deserializes the UpdateComment from a dictionary.""" - return cls(comment=d.get("comment", None), id=d.get("id", None)) + return cls(comment=d.get("{comment}", None), id=d.get("{id}", None)) @dataclass @@ -5624,20 +5626,20 @@ def as_dict(self) -> dict: """Serializes the UpdateCommentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment: - body["comment"] = self.comment.as_dict() + body["{comment}"] = self.comment.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCommentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.comment: - body["comment"] = self.comment + body["{comment}"] = self.comment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCommentResponse: """Deserializes the UpdateCommentResponse from a dictionary.""" - return cls(comment=_from_dict(d, "comment", CommentObject)) + return cls(comment=_from_dict(d, "{comment}", CommentObject)) @dataclass @@ -5652,24 +5654,24 @@ def as_dict(self) -> dict: """Serializes the UpdateExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name return body def as_shallow_dict(self) -> dict: """Serializes the UpdateExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["experiment_id"] = self.experiment_id + body["{experiment_id}"] = self.experiment_id if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExperiment: """Deserializes the UpdateExperiment from a dictionary.""" - return cls(experiment_id=d.get("experiment_id", None), new_name=d.get("new_name", None)) + return cls(experiment_id=d.get("{experiment_id}", None), new_name=d.get("{new_name}", None)) @dataclass @@ -5702,24 +5704,24 @@ def as_dict(self) -> dict: """Serializes the UpdateModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the UpdateModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateModelRequest: """Deserializes the UpdateModelRequest from a dictionary.""" - return cls(description=d.get("description", None), name=d.get("name", None)) + return cls(description=d.get("{description}", None), name=d.get("{name}", None)) @dataclass @@ -5755,28 +5757,30 @@ def as_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body def as_shallow_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.version is not None: - body["version"] = self.version + body["{version}"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionRequest: """Deserializes the UpdateModelVersionRequest from a dictionary.""" - return cls(description=d.get("description", None), name=d.get("name", None), version=d.get("version", None)) + return cls( + description=d.get("{description}", None), name=d.get("{name}", None), version=d.get("{version}", None) + ) @dataclass @@ -5852,46 +5856,46 @@ def as_dict(self) -> dict: """Serializes the UpdateRegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.events: - body["events"] = [v.value for v in self.events] + body["{events}"] = [v.value for v in self.events] if self.http_url_spec: - body["http_url_spec"] = self.http_url_spec.as_dict() + body["{http_url_spec}"] = self.http_url_spec.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.job_spec: - body["job_spec"] = self.job_spec.as_dict() + body["{job_spec}"] = self.job_spec.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.events: - body["events"] = self.events + body["{events}"] = self.events if self.http_url_spec: - body["http_url_spec"] = self.http_url_spec + body["{http_url_spec}"] = self.http_url_spec if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.job_spec: - body["job_spec"] = self.job_spec + body["{job_spec}"] = self.job_spec if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRegistryWebhook: """Deserializes the UpdateRegistryWebhook from a dictionary.""" return cls( - description=d.get("description", None), - events=_repeated_enum(d, "events", RegistryWebhookEvent), - http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec), - id=d.get("id", None), - job_spec=_from_dict(d, "job_spec", JobSpec), - status=_enum(d, "status", RegistryWebhookStatus), + description=d.get("{description}", None), + events=_repeated_enum(d, "{events}", RegistryWebhookEvent), + http_url_spec=_from_dict(d, "{http_url_spec}", HttpUrlSpec), + id=d.get("{id}", None), + job_spec=_from_dict(d, "{job_spec}", JobSpec), + status=_enum(d, "{status}", RegistryWebhookStatus), ) @@ -5917,41 +5921,41 @@ def as_dict(self) -> dict: """Serializes the UpdateRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRun into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time is not None: - body["end_time"] = self.end_time + body["{end_time}"] = self.end_time if self.run_id is not None: - body["run_id"] = self.run_id + body["{run_id}"] = self.run_id if self.run_name is not None: - body["run_name"] = self.run_name + body["{run_name}"] = self.run_name if self.run_uuid is not None: - body["run_uuid"] = self.run_uuid + body["{run_uuid}"] = self.run_uuid if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRun: """Deserializes the UpdateRun from a dictionary.""" return cls( - end_time=d.get("end_time", None), - run_id=d.get("run_id", None), - run_name=d.get("run_name", None), - run_uuid=d.get("run_uuid", None), - status=_enum(d, "status", UpdateRunStatus), + end_time=d.get("{end_time}", None), + run_id=d.get("{run_id}", None), + run_name=d.get("{run_name}", None), + run_uuid=d.get("{run_uuid}", None), + status=_enum(d, "{status}", UpdateRunStatus), ) @@ -5964,20 +5968,20 @@ def as_dict(self) -> dict: """Serializes the UpdateRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_info: - body["run_info"] = self.run_info.as_dict() + body["{run_info}"] = self.run_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run_info: - body["run_info"] = self.run_info + body["{run_info}"] = self.run_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRunResponse: """Deserializes the UpdateRunResponse from a dictionary.""" - return cls(run_info=_from_dict(d, "run_info", RunInfo)) + return cls(run_info=_from_dict(d, "{run_info}", RunInfo)) class UpdateRunStatus(Enum): @@ -6053,14 +6057,14 @@ def create_experiment( """ body = {} if artifact_location is not None: - body["artifact_location"] = artifact_location + body["{artifact_location}"] = artifact_location if name is not None: - body["name"] = name + body["{name}"] = name if tags is not None: - body["tags"] = [v.as_dict() for v in tags] + body["{tags}"] = [v.as_dict() for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/experiments/create", body=body, headers=headers) @@ -6097,18 +6101,18 @@ def create_run( """ body = {} if experiment_id is not None: - body["experiment_id"] = experiment_id + body["{experiment_id}"] = experiment_id if run_name is not None: - body["run_name"] = run_name + body["{run_name}"] = run_name if start_time is not None: - body["start_time"] = start_time + body["{start_time}"] = start_time if tags is not None: - body["tags"] = [v.as_dict() for v in tags] + body["{tags}"] = [v.as_dict() for v in tags] if user_id is not None: - body["user_id"] = user_id + body["{user_id}"] = user_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/runs/create", body=body, headers=headers) @@ -6127,10 +6131,10 @@ def delete_experiment(self, experiment_id: str): """ body = {} if experiment_id is not None: - body["experiment_id"] = experiment_id + body["{experiment_id}"] = experiment_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/experiments/delete", body=body, headers=headers) @@ -6147,10 +6151,10 @@ def delete_run(self, run_id: str): """ body = {} if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/delete", body=body, headers=headers) @@ -6177,14 +6181,14 @@ def delete_runs( """ body = {} if experiment_id is not None: - body["experiment_id"] = experiment_id + body["{experiment_id}"] = experiment_id if max_runs is not None: - body["max_runs"] = max_runs + body["{max_runs}"] = max_runs if max_timestamp_millis is not None: - body["max_timestamp_millis"] = max_timestamp_millis + body["{max_timestamp_millis}"] = max_timestamp_millis headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/databricks/runs/delete-runs", body=body, headers=headers) @@ -6205,12 +6209,12 @@ def delete_tag(self, run_id: str, key: str): """ body = {} if key is not None: - body["key"] = key + body["{key}"] = key if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/delete-tag", body=body, headers=headers) @@ -6234,9 +6238,9 @@ def get_by_name(self, experiment_name: str) -> GetExperimentByNameResponse: query = {} if experiment_name is not None: - query["experiment_name"] = experiment_name + query["{experiment_name}"] = experiment_name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/mlflow/experiments/get-by-name", query=query, headers=headers) @@ -6255,9 +6259,9 @@ def get_experiment(self, experiment_id: str) -> GetExperimentResponse: query = {} if experiment_id is not None: - query["experiment_id"] = experiment_id + query["{experiment_id}"] = experiment_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/mlflow/experiments/get", query=query, headers=headers) @@ -6294,27 +6298,27 @@ def get_history( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if metric_key is not None: - query["metric_key"] = metric_key + query["{metric_key}"] = metric_key if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if run_id is not None: - query["run_id"] = run_id + query["{run_id}"] = run_id if run_uuid is not None: - query["run_uuid"] = run_uuid + query["{run_uuid}"] = run_uuid headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/metrics/get-history", query=query, headers=headers) - if "metrics" in json: - for v in json["metrics"]: + if "{metrics}" in json: + for v in json["{metrics}"]: yield Metric.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLevelsResponse: """Get experiment permission levels. @@ -6328,7 +6332,7 @@ def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLe """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/experiments/{experiment_id}/permissionLevels", headers=headers) @@ -6346,7 +6350,7 @@ def get_permissions(self, experiment_id: str) -> ExperimentPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/experiments/{experiment_id}", headers=headers) @@ -6371,11 +6375,11 @@ def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunRespo query = {} if run_id is not None: - query["run_id"] = run_id + query["{run_id}"] = run_id if run_uuid is not None: - query["run_uuid"] = run_uuid + query["{run_uuid}"] = run_uuid headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/mlflow/runs/get", query=query, headers=headers) @@ -6416,25 +6420,25 @@ def list_artifacts( query = {} if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if path is not None: - query["path"] = path + query["{path}"] = path if run_id is not None: - query["run_id"] = run_id + query["{run_id}"] = run_id if run_uuid is not None: - query["run_uuid"] = run_uuid + query["{run_uuid}"] = run_uuid headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/artifacts/list", query=query, headers=headers) - if "files" in json: - for v in json["files"]: + if "{files}" in json: + for v in json["{files}"]: yield FileInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_experiments( self, @@ -6461,23 +6465,23 @@ def list_experiments( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if view_type is not None: - query["view_type"] = view_type.value + query["{view_type}"] = view_type.value headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/experiments/list", query=query, headers=headers) - if "experiments" in json: - for v in json["experiments"]: + if "{experiments}" in json: + for v in json["{experiments}"]: yield Experiment.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def log_batch( self, @@ -6546,16 +6550,16 @@ def log_batch( """ body = {} if metrics is not None: - body["metrics"] = [v.as_dict() for v in metrics] + body["{metrics}"] = [v.as_dict() for v in metrics] if params is not None: - body["params"] = [v.as_dict() for v in params] + body["{params}"] = [v.as_dict() for v in params] if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id if tags is not None: - body["tags"] = [v.as_dict() for v in tags] + body["{tags}"] = [v.as_dict() for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/log-batch", body=body, headers=headers) @@ -6580,14 +6584,14 @@ def log_inputs( """ body = {} if datasets is not None: - body["datasets"] = [v.as_dict() for v in datasets] + body["{datasets}"] = [v.as_dict() for v in datasets] if models is not None: - body["models"] = [v.as_dict() for v in models] + body["{models}"] = [v.as_dict() for v in models] if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/log-inputs", body=body, headers=headers) @@ -6637,26 +6641,26 @@ def log_metric( """ body = {} if dataset_digest is not None: - body["dataset_digest"] = dataset_digest + body["{dataset_digest}"] = dataset_digest if dataset_name is not None: - body["dataset_name"] = dataset_name + body["{dataset_name}"] = dataset_name if key is not None: - body["key"] = key + body["{key}"] = key if model_id is not None: - body["model_id"] = model_id + body["{model_id}"] = model_id if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id if run_uuid is not None: - body["run_uuid"] = run_uuid + body["{run_uuid}"] = run_uuid if step is not None: - body["step"] = step + body["{step}"] = step if timestamp is not None: - body["timestamp"] = timestamp + body["{timestamp}"] = timestamp if value is not None: - body["value"] = value + body["{value}"] = value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/log-metric", body=body, headers=headers) @@ -6675,12 +6679,12 @@ def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = """ body = {} if model_json is not None: - body["model_json"] = model_json + body["{model_json}"] = model_json if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/log-model", body=body, headers=headers) @@ -6706,16 +6710,16 @@ def log_param(self, key: str, value: str, *, run_id: Optional[str] = None, run_u """ body = {} if key is not None: - body["key"] = key + body["{key}"] = key if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id if run_uuid is not None: - body["run_uuid"] = run_uuid + body["{run_uuid}"] = run_uuid if value is not None: - body["value"] = value + body["{value}"] = value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/log-parameter", body=body, headers=headers) @@ -6736,10 +6740,10 @@ def restore_experiment(self, experiment_id: str): """ body = {} if experiment_id is not None: - body["experiment_id"] = experiment_id + body["{experiment_id}"] = experiment_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/experiments/restore", body=body, headers=headers) @@ -6758,10 +6762,10 @@ def restore_run(self, run_id: str): """ body = {} if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/restore", body=body, headers=headers) @@ -6788,14 +6792,14 @@ def restore_runs( """ body = {} if experiment_id is not None: - body["experiment_id"] = experiment_id + body["{experiment_id}"] = experiment_id if max_runs is not None: - body["max_runs"] = max_runs + body["{max_runs}"] = max_runs if min_timestamp_millis is not None: - body["min_timestamp_millis"] = min_timestamp_millis + body["{min_timestamp_millis}"] = min_timestamp_millis headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/databricks/runs/restore-runs", body=body, headers=headers) @@ -6831,28 +6835,28 @@ def search_experiments( """ body = {} if filter is not None: - body["filter"] = filter + body["{filter}"] = filter if max_results is not None: - body["max_results"] = max_results + body["{max_results}"] = max_results if order_by is not None: - body["order_by"] = [v for v in order_by] + body["{order_by}"] = [v for v in order_by] if page_token is not None: - body["page_token"] = page_token + body["{page_token}"] = page_token if view_type is not None: - body["view_type"] = view_type.value + body["{view_type}"] = view_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } while True: json = self._api.do("POST", "/api/2.0/mlflow/experiments/search", body=body, headers=headers) - if "experiments" in json: - for v in json["experiments"]: + if "{experiments}" in json: + for v in json["{experiments}"]: yield Experiment.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - body["page_token"] = json["next_page_token"] + body["{page_token}"] = json["{next_page_token}"] def search_runs( self, @@ -6900,30 +6904,30 @@ def search_runs( """ body = {} if experiment_ids is not None: - body["experiment_ids"] = [v for v in experiment_ids] + body["{experiment_ids}"] = [v for v in experiment_ids] if filter is not None: - body["filter"] = filter + body["{filter}"] = filter if max_results is not None: - body["max_results"] = max_results + body["{max_results}"] = max_results if order_by is not None: - body["order_by"] = [v for v in order_by] + body["{order_by}"] = [v for v in order_by] if page_token is not None: - body["page_token"] = page_token + body["{page_token}"] = page_token if run_view_type is not None: - body["run_view_type"] = run_view_type.value + body["{run_view_type}"] = run_view_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } while True: json = self._api.do("POST", "/api/2.0/mlflow/runs/search", body=body, headers=headers) - if "runs" in json: - for v in json["runs"]: + if "{runs}" in json: + for v in json["{runs}"]: yield Run.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - body["page_token"] = json["next_page_token"] + body["{page_token}"] = json["{next_page_token}"] def set_experiment_tag(self, experiment_id: str, key: str, value: str): """Set a tag for an experiment. @@ -6941,14 +6945,14 @@ def set_experiment_tag(self, experiment_id: str, key: str, value: str): """ body = {} if experiment_id is not None: - body["experiment_id"] = experiment_id + body["{experiment_id}"] = experiment_id if key is not None: - body["key"] = key + body["{key}"] = key if value is not None: - body["value"] = value + body["{value}"] = value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/experiments/set-experiment-tag", body=body, headers=headers) @@ -6969,10 +6973,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/experiments/{experiment_id}", body=body, headers=headers) @@ -6997,16 +7001,16 @@ def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uui """ body = {} if key is not None: - body["key"] = key + body["{key}"] = key if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id if run_uuid is not None: - body["run_uuid"] = run_uuid + body["{run_uuid}"] = run_uuid if value is not None: - body["value"] = value + body["{value}"] = value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/runs/set-tag", body=body, headers=headers) @@ -7025,12 +7029,12 @@ def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = Non """ body = {} if experiment_id is not None: - body["experiment_id"] = experiment_id + body["{experiment_id}"] = experiment_id if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/experiments/update", body=body, headers=headers) @@ -7050,10 +7054,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/permissions/experiments/{experiment_id}", body=body, headers=headers) @@ -7088,18 +7092,18 @@ def update_run( """ body = {} if end_time is not None: - body["end_time"] = end_time + body["{end_time}"] = end_time if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id if run_name is not None: - body["run_name"] = run_name + body["{run_name}"] = run_name if run_uuid is not None: - body["run_uuid"] = run_uuid + body["{run_uuid}"] = run_uuid if status is not None: - body["status"] = status.value + body["{status}"] = status.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/runs/update", body=body, headers=headers) @@ -7112,41 +7116,6 @@ class ForecastingAPI: def __init__(self, api_client): self._api = api_client - def wait_get_experiment_forecasting_succeeded( - self, - experiment_id: str, - timeout=timedelta(minutes=120), - callback: Optional[Callable[[ForecastingExperiment], None]] = None, - ) -> ForecastingExperiment: - deadline = time.time() + timeout.total_seconds() - target_states = (ForecastingExperimentState.SUCCEEDED,) - failure_states = ( - ForecastingExperimentState.FAILED, - ForecastingExperimentState.CANCELLED, - ) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get_experiment(experiment_id=experiment_id) - status = poll.state - status_message = f"current status: {status}" - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach SUCCEEDED, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"experiment_id={experiment_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create_experiment( self, train_data_path: str, @@ -7213,49 +7182,49 @@ def create_experiment( :returns: Long-running operation waiter for :class:`ForecastingExperiment`. - See :method:wait_get_experiment_forecasting_succeeded for more details. + See :method:WaitGetExperimentForecastingSucceeded for more details. """ body = {} if custom_weights_column is not None: - body["custom_weights_column"] = custom_weights_column + body["{custom_weights_column}"] = custom_weights_column if experiment_path is not None: - body["experiment_path"] = experiment_path + body["{experiment_path}"] = experiment_path if forecast_granularity is not None: - body["forecast_granularity"] = forecast_granularity + body["{forecast_granularity}"] = forecast_granularity if forecast_horizon is not None: - body["forecast_horizon"] = forecast_horizon + body["{forecast_horizon}"] = forecast_horizon if holiday_regions is not None: - body["holiday_regions"] = [v for v in holiday_regions] + body["{holiday_regions}"] = [v for v in holiday_regions] if max_runtime is not None: - body["max_runtime"] = max_runtime + body["{max_runtime}"] = max_runtime if prediction_data_path is not None: - body["prediction_data_path"] = prediction_data_path + body["{prediction_data_path}"] = prediction_data_path if primary_metric is not None: - body["primary_metric"] = primary_metric + body["{primary_metric}"] = primary_metric if register_to is not None: - body["register_to"] = register_to + body["{register_to}"] = register_to if split_column is not None: - body["split_column"] = split_column + body["{split_column}"] = split_column if target_column is not None: - body["target_column"] = target_column + body["{target_column}"] = target_column if time_column is not None: - body["time_column"] = time_column + body["{time_column}"] = time_column if timeseries_identifier_columns is not None: - body["timeseries_identifier_columns"] = [v for v in timeseries_identifier_columns] + body["{timeseries_identifier_columns}"] = [v for v in timeseries_identifier_columns] if train_data_path is not None: - body["train_data_path"] = train_data_path + body["{train_data_path}"] = train_data_path if training_frameworks is not None: - body["training_frameworks"] = [v for v in training_frameworks] + body["{training_frameworks}"] = [v for v in training_frameworks] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.0/automl/create-forecasting-experiment", body=body, headers=headers) return Wait( - self.wait_get_experiment_forecasting_succeeded, + self.WaitGetExperimentForecastingSucceeded, response=CreateForecastingExperimentResponse.from_dict(op_response), - experiment_id=op_response["experiment_id"], + experiment_id=op_response["{experiment_id}"], ) def create_experiment_and_wait( @@ -7308,7 +7277,7 @@ def get_experiment(self, experiment_id: str) -> ForecastingExperiment: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/automl/get-forecasting-experiment/{experiment_id}", headers=headers) @@ -7357,18 +7326,18 @@ def approve_transition_request( """ body = {} if archive_existing_versions is not None: - body["archive_existing_versions"] = archive_existing_versions + body["{archive_existing_versions}"] = archive_existing_versions if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if stage is not None: - body["stage"] = stage.value + body["{stage}"] = stage.value if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/approve", body=body, headers=headers) @@ -7391,14 +7360,14 @@ def create_comment(self, name: str, version: str, comment: str) -> CreateComment """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/comments/create", body=body, headers=headers) @@ -7424,14 +7393,14 @@ def create_model( """ body = {} if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name if tags is not None: - body["tags"] = [v.as_dict() for v in tags] + body["{tags}"] = [v.as_dict() for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/registered-models/create", body=body, headers=headers) @@ -7470,20 +7439,20 @@ def create_model_version( """ body = {} if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name if run_id is not None: - body["run_id"] = run_id + body["{run_id}"] = run_id if run_link is not None: - body["run_link"] = run_link + body["{run_link}"] = run_link if source is not None: - body["source"] = source + body["{source}"] = source if tags is not None: - body["tags"] = [v.as_dict() for v in tags] + body["{tags}"] = [v.as_dict() for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/model-versions/create", body=body, headers=headers) @@ -7517,16 +7486,16 @@ def create_transition_request( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if stage is not None: - body["stage"] = stage.value + body["{stage}"] = stage.value if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/create", body=body, headers=headers) @@ -7596,20 +7565,20 @@ def create_webhook( """ body = {} if description is not None: - body["description"] = description + body["{description}"] = description if events is not None: - body["events"] = [v.value for v in events] + body["{events}"] = [v.value for v in events] if http_url_spec is not None: - body["http_url_spec"] = http_url_spec.as_dict() + body["{http_url_spec}"] = http_url_spec.as_dict() if job_spec is not None: - body["job_spec"] = job_spec.as_dict() + body["{job_spec}"] = job_spec.as_dict() if model_name is not None: - body["model_name"] = model_name + body["{model_name}"] = model_name if status is not None: - body["status"] = status.value + body["{status}"] = status.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/registry-webhooks/create", body=body, headers=headers) @@ -7627,9 +7596,9 @@ def delete_comment(self, id: str): query = {} if id is not None: - query["id"] = id + query["{id}"] = id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", "/api/2.0/mlflow/comments/delete", query=query, headers=headers) @@ -7647,9 +7616,9 @@ def delete_model(self, name: str): query = {} if name is not None: - query["name"] = name + query["{name}"] = name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete", query=query, headers=headers) @@ -7670,11 +7639,11 @@ def delete_model_tag(self, name: str, key: str): query = {} if key is not None: - query["key"] = key + query["{key}"] = key if name is not None: - query["name"] = name + query["{name}"] = name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete-tag", query=query, headers=headers) @@ -7694,11 +7663,11 @@ def delete_model_version(self, name: str, version: str): query = {} if name is not None: - query["name"] = name + query["{name}"] = name if version is not None: - query["version"] = version + query["{version}"] = version headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete", query=query, headers=headers) @@ -7721,13 +7690,13 @@ def delete_model_version_tag(self, name: str, version: str, key: str): query = {} if key is not None: - query["key"] = key + query["{key}"] = key if name is not None: - query["name"] = name + query["{name}"] = name if version is not None: - query["version"] = version + query["{version}"] = version headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete-tag", query=query, headers=headers) @@ -7770,17 +7739,17 @@ def delete_transition_request( query = {} if comment is not None: - query["comment"] = comment + query["{comment}"] = comment if creator is not None: - query["creator"] = creator + query["{creator}"] = creator if name is not None: - query["name"] = name + query["{name}"] = name if stage is not None: - query["stage"] = stage.value + query["{stage}"] = stage.value if version is not None: - query["version"] = version + query["{version}"] = version headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", "/api/2.0/mlflow/transition-requests/delete", query=query, headers=headers) @@ -7800,9 +7769,9 @@ def delete_webhook(self, *, id: Optional[str] = None): query = {} if id is not None: - query["id"] = id + query["{id}"] = id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", "/api/2.0/mlflow/registry-webhooks/delete", query=query, headers=headers) @@ -7821,12 +7790,12 @@ def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if stages is not None: - body["stages"] = [v for v in stages] + body["{stages}"] = [v for v in stages] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } json = self._api.do("POST", "/api/2.0/mlflow/registered-models/get-latest-versions", body=body, headers=headers) @@ -7850,9 +7819,9 @@ def get_model(self, name: str) -> GetModelResponse: query = {} if name is not None: - query["name"] = name + query["{name}"] = name headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/mlflow/databricks/registered-models/get", query=query, headers=headers) @@ -7873,11 +7842,11 @@ def get_model_version(self, name: str, version: str) -> GetModelVersionResponse: query = {} if name is not None: - query["name"] = name + query["{name}"] = name if version is not None: - query["version"] = version + query["{version}"] = version headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/mlflow/model-versions/get", query=query, headers=headers) @@ -7898,11 +7867,11 @@ def get_model_version_download_uri(self, name: str, version: str) -> GetModelVer query = {} if name is not None: - query["name"] = name + query["{name}"] = name if version is not None: - query["version"] = version + query["{version}"] = version headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/mlflow/model-versions/get-download-uri", query=query, headers=headers) @@ -7920,7 +7889,7 @@ def get_permission_levels(self, registered_model_id: str) -> GetRegisteredModelP """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -7941,7 +7910,7 @@ def get_permissions(self, registered_model_id: str) -> RegisteredModelPermission """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/registered-models/{registered_model_id}", headers=headers) @@ -7962,21 +7931,21 @@ def list_models(self, *, max_results: Optional[int] = None, page_token: Optional query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/registered-models/list", query=query, headers=headers) - if "registered_models" in json: - for v in json["registered_models"]: + if "{registered_models}" in json: + for v in json["{registered_models}"]: yield Model.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_transition_requests(self, name: str, version: str) -> Iterator[Activity]: """List transition requests. @@ -7993,11 +7962,11 @@ def list_transition_requests(self, name: str, version: str) -> Iterator[Activity query = {} if name is not None: - query["name"] = name + query["{name}"] = name if version is not None: - query["version"] = version + query["{version}"] = version headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/mlflow/transition-requests/list", query=query, headers=headers) @@ -8031,23 +8000,23 @@ def list_webhooks( query = {} if events is not None: - query["events"] = [v.value for v in events] + query["{events}"] = [v.value for v in events] if model_name is not None: - query["model_name"] = model_name + query["{model_name}"] = model_name if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/registry-webhooks/list", query=query, headers=headers) - if "webhooks" in json: - for v in json["webhooks"]: + if "{webhooks}" in json: + for v in json["{webhooks}"]: yield RegistryWebhook.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def reject_transition_request( self, name: str, version: str, stage: Stage, *, comment: Optional[str] = None @@ -8077,16 +8046,16 @@ def reject_transition_request( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if stage is not None: - body["stage"] = stage.value + body["{stage}"] = stage.value if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/reject", body=body, headers=headers) @@ -8106,12 +8075,12 @@ def rename_model(self, name: str, *, new_name: Optional[str] = None) -> RenameMo """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/registered-models/rename", body=body, headers=headers) @@ -8146,25 +8115,25 @@ def search_model_versions( query = {} if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if order_by is not None: - query["order_by"] = [v for v in order_by] + query["{order_by}"] = [v for v in order_by] if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/model-versions/search", query=query, headers=headers) - if "model_versions" in json: - for v in json["model_versions"]: + if "{model_versions}" in json: + for v in json["{model_versions}"]: yield ModelVersion.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def search_models( self, @@ -8196,25 +8165,25 @@ def search_models( query = {} if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if order_by is not None: - query["order_by"] = [v for v in order_by] + query["{order_by}"] = [v for v in order_by] if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/registered-models/search", query=query, headers=headers) - if "registered_models" in json: - for v in json["registered_models"]: + if "{registered_models}" in json: + for v in json["{registered_models}"]: yield Model.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def set_model_tag(self, name: str, key: str, value: str): """Set a tag. @@ -8235,14 +8204,14 @@ def set_model_tag(self, name: str, key: str, value: str): """ body = {} if key is not None: - body["key"] = key + body["{key}"] = key if name is not None: - body["name"] = name + body["{name}"] = name if value is not None: - body["value"] = value + body["{value}"] = value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/registered-models/set-tag", body=body, headers=headers) @@ -8268,16 +8237,16 @@ def set_model_version_tag(self, name: str, version: str, key: str, value: str): """ body = {} if key is not None: - body["key"] = key + body["{key}"] = key if name is not None: - body["name"] = name + body["{name}"] = name if value is not None: - body["value"] = value + body["{value}"] = value if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/mlflow/model-versions/set-tag", body=body, headers=headers) @@ -8301,10 +8270,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -8331,12 +8300,12 @@ def test_registry_webhook( """ body = {} if event is not None: - body["event"] = event.value + body["{event}"] = event.value if id is not None: - body["id"] = id + body["{id}"] = id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/mlflow/registry-webhooks/test", body=body, headers=headers) @@ -8375,18 +8344,18 @@ def transition_stage( """ body = {} if archive_existing_versions is not None: - body["archive_existing_versions"] = archive_existing_versions + body["{archive_existing_versions}"] = archive_existing_versions if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if stage is not None: - body["stage"] = stage.value + body["{stage}"] = stage.value if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -8408,12 +8377,12 @@ def update_comment(self, id: str, comment: str) -> UpdateCommentResponse: """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if id is not None: - body["id"] = id + body["{id}"] = id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", "/api/2.0/mlflow/comments/update", body=body, headers=headers) @@ -8433,12 +8402,12 @@ def update_model(self, name: str, *, description: Optional[str] = None): """ body = {} if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", "/api/2.0/mlflow/registered-models/update", body=body, headers=headers) @@ -8459,14 +8428,14 @@ def update_model_version(self, name: str, version: str, *, description: Optional """ body = {} if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name if version is not None: - body["version"] = version + body["{version}"] = version headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers) @@ -8490,10 +8459,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -8565,20 +8534,20 @@ def update_webhook( """ body = {} if description is not None: - body["description"] = description + body["{description}"] = description if events is not None: - body["events"] = [v.value for v in events] + body["{events}"] = [v.value for v in events] if http_url_spec is not None: - body["http_url_spec"] = http_url_spec.as_dict() + body["{http_url_spec}"] = http_url_spec.as_dict() if id is not None: - body["id"] = id + body["{id}"] = id if job_spec is not None: - body["job_spec"] = job_spec.as_dict() + body["{job_spec}"] = job_spec.as_dict() if status is not None: - body["status"] = status.value + body["{status}"] = status.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", "/api/2.0/mlflow/registry-webhooks/update", body=body, headers=headers) diff --git a/databricks/sdk/service/oauth2.py b/databricks/sdk/oauth2/v2/impl.py similarity index 77% rename from databricks/sdk/service/oauth2.py rename to databricks/sdk/oauth2/v2/impl.py index 366f282f4..37b93d62e 100755 --- a/databricks/sdk/service/oauth2.py +++ b/databricks/sdk/oauth2/v2/impl.py @@ -6,11 +6,10 @@ from dataclasses import dataclass from typing import Any, Dict, Iterator, List, Optional -from ._internal import _from_dict, _repeated_dict +from ...service._internal import _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -40,46 +39,46 @@ def as_dict(self) -> dict: """Serializes the CreateCustomAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.confidential is not None: - body["confidential"] = self.confidential + body["{confidential}"] = self.confidential if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.redirect_urls: - body["redirect_urls"] = [v for v in self.redirect_urls] + body["{redirect_urls}"] = [v for v in self.redirect_urls] if self.scopes: - body["scopes"] = [v for v in self.scopes] + body["{scopes}"] = [v for v in self.scopes] if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy.as_dict() + body["{token_access_policy}"] = self.token_access_policy.as_dict() if self.user_authorized_scopes: - body["user_authorized_scopes"] = [v for v in self.user_authorized_scopes] + body["{user_authorized_scopes}"] = [v for v in self.user_authorized_scopes] return body def as_shallow_dict(self) -> dict: """Serializes the CreateCustomAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.confidential is not None: - body["confidential"] = self.confidential + body["{confidential}"] = self.confidential if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.redirect_urls: - body["redirect_urls"] = self.redirect_urls + body["{redirect_urls}"] = self.redirect_urls if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy + body["{token_access_policy}"] = self.token_access_policy if self.user_authorized_scopes: - body["user_authorized_scopes"] = self.user_authorized_scopes + body["{user_authorized_scopes}"] = self.user_authorized_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCustomAppIntegration: """Deserializes the CreateCustomAppIntegration from a dictionary.""" return cls( - confidential=d.get("confidential", None), - name=d.get("name", None), - redirect_urls=d.get("redirect_urls", None), - scopes=d.get("scopes", None), - token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), - user_authorized_scopes=d.get("user_authorized_scopes", None), + confidential=d.get("{confidential}", None), + name=d.get("{name}", None), + redirect_urls=d.get("{redirect_urls}", None), + scopes=d.get("{scopes}", None), + token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), + user_authorized_scopes=d.get("{user_authorized_scopes}", None), ) @@ -99,31 +98,31 @@ def as_dict(self) -> dict: """Serializes the CreateCustomAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.client_id is not None: - body["client_id"] = self.client_id + body["{client_id}"] = self.client_id if self.client_secret is not None: - body["client_secret"] = self.client_secret + body["{client_secret}"] = self.client_secret if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateCustomAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.client_id is not None: - body["client_id"] = self.client_id + body["{client_id}"] = self.client_id if self.client_secret is not None: - body["client_secret"] = self.client_secret + body["{client_secret}"] = self.client_secret if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCustomAppIntegrationOutput: """Deserializes the CreateCustomAppIntegrationOutput from a dictionary.""" return cls( - client_id=d.get("client_id", None), - client_secret=d.get("client_secret", None), - integration_id=d.get("integration_id", None), + client_id=d.get("{client_id}", None), + client_secret=d.get("{client_secret}", None), + integration_id=d.get("{integration_id}", None), ) @@ -139,25 +138,26 @@ def as_dict(self) -> dict: """Serializes the CreatePublishedAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_id is not None: - body["app_id"] = self.app_id + body["{app_id}"] = self.app_id if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy.as_dict() + body["{token_access_policy}"] = self.token_access_policy.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreatePublishedAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.app_id is not None: - body["app_id"] = self.app_id + body["{app_id}"] = self.app_id if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy + body["{token_access_policy}"] = self.token_access_policy return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePublishedAppIntegration: """Deserializes the CreatePublishedAppIntegration from a dictionary.""" return cls( - app_id=d.get("app_id", None), token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy) + app_id=d.get("{app_id}", None), + token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), ) @@ -170,20 +170,20 @@ def as_dict(self) -> dict: """Serializes the CreatePublishedAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id return body def as_shallow_dict(self) -> dict: """Serializes the CreatePublishedAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePublishedAppIntegrationOutput: """Deserializes the CreatePublishedAppIntegrationOutput from a dictionary.""" - return cls(integration_id=d.get("integration_id", None)) + return cls(integration_id=d.get("{integration_id}", None)) @dataclass @@ -199,24 +199,24 @@ def as_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.lifetime is not None: - body["lifetime"] = self.lifetime + body["{lifetime}"] = self.lifetime if self.service_principal_id is not None: - body["service_principal_id"] = self.service_principal_id + body["{service_principal_id}"] = self.service_principal_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.lifetime is not None: - body["lifetime"] = self.lifetime + body["{lifetime}"] = self.lifetime if self.service_principal_id is not None: - body["service_principal_id"] = self.service_principal_id + body["{service_principal_id}"] = self.service_principal_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateServicePrincipalSecretRequest: """Deserializes the CreateServicePrincipalSecretRequest from a dictionary.""" - return cls(lifetime=d.get("lifetime", None), service_principal_id=d.get("service_principal_id", None)) + return cls(lifetime=d.get("{lifetime}", None), service_principal_id=d.get("{service_principal_id}", None)) @dataclass @@ -246,51 +246,51 @@ def as_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.expire_time is not None: - body["expire_time"] = self.expire_time + body["{expire_time}"] = self.expire_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.secret is not None: - body["secret"] = self.secret + body["{secret}"] = self.secret if self.secret_hash is not None: - body["secret_hash"] = self.secret_hash + body["{secret_hash}"] = self.secret_hash if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.expire_time is not None: - body["expire_time"] = self.expire_time + body["{expire_time}"] = self.expire_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.secret is not None: - body["secret"] = self.secret + body["{secret}"] = self.secret if self.secret_hash is not None: - body["secret_hash"] = self.secret_hash + body["{secret_hash}"] = self.secret_hash if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateServicePrincipalSecretResponse: """Deserializes the CreateServicePrincipalSecretResponse from a dictionary.""" return cls( - create_time=d.get("create_time", None), - expire_time=d.get("expire_time", None), - id=d.get("id", None), - secret=d.get("secret", None), - secret_hash=d.get("secret_hash", None), - status=d.get("status", None), - update_time=d.get("update_time", None), + create_time=d.get("{create_time}", None), + expire_time=d.get("{expire_time}", None), + id=d.get("{id}", None), + secret=d.get("{secret}", None), + secret_hash=d.get("{secret_hash}", None), + status=d.get("{status}", None), + update_time=d.get("{update_time}", None), ) @@ -378,46 +378,46 @@ def as_dict(self) -> dict: """Serializes the FederationPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.oidc_policy: - body["oidc_policy"] = self.oidc_policy.as_dict() + body["{oidc_policy}"] = self.oidc_policy.as_dict() if self.uid is not None: - body["uid"] = self.uid + body["{uid}"] = self.uid if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the FederationPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.oidc_policy: - body["oidc_policy"] = self.oidc_policy + body["{oidc_policy}"] = self.oidc_policy if self.uid is not None: - body["uid"] = self.uid + body["{uid}"] = self.uid if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FederationPolicy: """Deserializes the FederationPolicy from a dictionary.""" return cls( - create_time=d.get("create_time", None), - description=d.get("description", None), - name=d.get("name", None), - oidc_policy=_from_dict(d, "oidc_policy", OidcFederationPolicy), - uid=d.get("uid", None), - update_time=d.get("update_time", None), + create_time=d.get("{create_time}", None), + description=d.get("{description}", None), + name=d.get("{name}", None), + oidc_policy=_from_dict(d, "{oidc_policy}", OidcFederationPolicy), + uid=d.get("{uid}", None), + update_time=d.get("{update_time}", None), ) @@ -457,71 +457,71 @@ def as_dict(self) -> dict: """Serializes the GetCustomAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.client_id is not None: - body["client_id"] = self.client_id + body["{client_id}"] = self.client_id if self.confidential is not None: - body["confidential"] = self.confidential + body["{confidential}"] = self.confidential if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.creator_username is not None: - body["creator_username"] = self.creator_username + body["{creator_username}"] = self.creator_username if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.redirect_urls: - body["redirect_urls"] = [v for v in self.redirect_urls] + body["{redirect_urls}"] = [v for v in self.redirect_urls] if self.scopes: - body["scopes"] = [v for v in self.scopes] + body["{scopes}"] = [v for v in self.scopes] if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy.as_dict() + body["{token_access_policy}"] = self.token_access_policy.as_dict() if self.user_authorized_scopes: - body["user_authorized_scopes"] = [v for v in self.user_authorized_scopes] + body["{user_authorized_scopes}"] = [v for v in self.user_authorized_scopes] return body def as_shallow_dict(self) -> dict: """Serializes the GetCustomAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.client_id is not None: - body["client_id"] = self.client_id + body["{client_id}"] = self.client_id if self.confidential is not None: - body["confidential"] = self.confidential + body["{confidential}"] = self.confidential if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.creator_username is not None: - body["creator_username"] = self.creator_username + body["{creator_username}"] = self.creator_username if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.redirect_urls: - body["redirect_urls"] = self.redirect_urls + body["{redirect_urls}"] = self.redirect_urls if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy + body["{token_access_policy}"] = self.token_access_policy if self.user_authorized_scopes: - body["user_authorized_scopes"] = self.user_authorized_scopes + body["{user_authorized_scopes}"] = self.user_authorized_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetCustomAppIntegrationOutput: """Deserializes the GetCustomAppIntegrationOutput from a dictionary.""" return cls( - client_id=d.get("client_id", None), - confidential=d.get("confidential", None), - create_time=d.get("create_time", None), - created_by=d.get("created_by", None), - creator_username=d.get("creator_username", None), - integration_id=d.get("integration_id", None), - name=d.get("name", None), - redirect_urls=d.get("redirect_urls", None), - scopes=d.get("scopes", None), - token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), - user_authorized_scopes=d.get("user_authorized_scopes", None), + client_id=d.get("{client_id}", None), + confidential=d.get("{confidential}", None), + create_time=d.get("{create_time}", None), + created_by=d.get("{created_by}", None), + creator_username=d.get("{creator_username}", None), + integration_id=d.get("{integration_id}", None), + name=d.get("{name}", None), + redirect_urls=d.get("{redirect_urls}", None), + scopes=d.get("{scopes}", None), + token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), + user_authorized_scopes=d.get("{user_authorized_scopes}", None), ) @@ -536,26 +536,26 @@ def as_dict(self) -> dict: """Serializes the GetCustomAppIntegrationsOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["apps"] = [v.as_dict() for v in self.apps] + body["{apps}"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the GetCustomAppIntegrationsOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["apps"] = self.apps + body["{apps}"] = self.apps if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetCustomAppIntegrationsOutput: """Deserializes the GetCustomAppIntegrationsOutput from a dictionary.""" return cls( - apps=_repeated_dict(d, "apps", GetCustomAppIntegrationOutput), - next_page_token=d.get("next_page_token", None), + apps=_repeated_dict(d, "{apps}", GetCustomAppIntegrationOutput), + next_page_token=d.get("{next_page_token}", None), ) @@ -581,46 +581,46 @@ def as_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_id is not None: - body["app_id"] = self.app_id + body["{app_id}"] = self.app_id if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy.as_dict() + body["{token_access_policy}"] = self.token_access_policy.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.app_id is not None: - body["app_id"] = self.app_id + body["{app_id}"] = self.app_id if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy + body["{token_access_policy}"] = self.token_access_policy return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPublishedAppIntegrationOutput: """Deserializes the GetPublishedAppIntegrationOutput from a dictionary.""" return cls( - app_id=d.get("app_id", None), - create_time=d.get("create_time", None), - created_by=d.get("created_by", None), - integration_id=d.get("integration_id", None), - name=d.get("name", None), - token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), + app_id=d.get("{app_id}", None), + create_time=d.get("{create_time}", None), + created_by=d.get("{created_by}", None), + integration_id=d.get("{integration_id}", None), + name=d.get("{name}", None), + token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), ) @@ -635,26 +635,26 @@ def as_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationsOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["apps"] = [v.as_dict() for v in self.apps] + body["{apps}"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationsOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["apps"] = self.apps + body["{apps}"] = self.apps if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPublishedAppIntegrationsOutput: """Deserializes the GetPublishedAppIntegrationsOutput from a dictionary.""" return cls( - apps=_repeated_dict(d, "apps", GetPublishedAppIntegrationOutput), - next_page_token=d.get("next_page_token", None), + apps=_repeated_dict(d, "{apps}", GetPublishedAppIntegrationOutput), + next_page_token=d.get("{next_page_token}", None), ) @@ -671,24 +671,26 @@ def as_dict(self) -> dict: """Serializes the GetPublishedAppsOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["apps"] = [v.as_dict() for v in self.apps] + body["{apps}"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the GetPublishedAppsOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["apps"] = self.apps + body["{apps}"] = self.apps if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPublishedAppsOutput: """Deserializes the GetPublishedAppsOutput from a dictionary.""" - return cls(apps=_repeated_dict(d, "apps", PublishedAppOutput), next_page_token=d.get("next_page_token", None)) + return cls( + apps=_repeated_dict(d, "{apps}", PublishedAppOutput), next_page_token=d.get("{next_page_token}", None) + ) @dataclass @@ -701,25 +703,25 @@ def as_dict(self) -> dict: """Serializes the ListFederationPoliciesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.policies: - body["policies"] = [v.as_dict() for v in self.policies] + body["{policies}"] = [v.as_dict() for v in self.policies] return body def as_shallow_dict(self) -> dict: """Serializes the ListFederationPoliciesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.policies: - body["policies"] = self.policies + body["{policies}"] = self.policies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFederationPoliciesResponse: """Deserializes the ListFederationPoliciesResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), policies=_repeated_dict(d, "policies", FederationPolicy) + next_page_token=d.get("{next_page_token}", None), policies=_repeated_dict(d, "{policies}", FederationPolicy) ) @@ -735,24 +737,24 @@ def as_dict(self) -> dict: """Serializes the ListServicePrincipalSecretsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.secrets: - body["secrets"] = [v.as_dict() for v in self.secrets] + body["{secrets}"] = [v.as_dict() for v in self.secrets] return body def as_shallow_dict(self) -> dict: """Serializes the ListServicePrincipalSecretsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.secrets: - body["secrets"] = self.secrets + body["{secrets}"] = self.secrets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListServicePrincipalSecretsResponse: """Deserializes the ListServicePrincipalSecretsResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), secrets=_repeated_dict(d, "secrets", SecretInfo)) + return cls(next_page_token=d.get("{next_page_token}", None), secrets=_repeated_dict(d, "{secrets}", SecretInfo)) @dataclass @@ -795,46 +797,46 @@ def as_dict(self) -> dict: """Serializes the OidcFederationPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.audiences: - body["audiences"] = [v for v in self.audiences] + body["{audiences}"] = [v for v in self.audiences] if self.issuer is not None: - body["issuer"] = self.issuer + body["{issuer}"] = self.issuer if self.jwks_json is not None: - body["jwks_json"] = self.jwks_json + body["{jwks_json}"] = self.jwks_json if self.jwks_uri is not None: - body["jwks_uri"] = self.jwks_uri + body["{jwks_uri}"] = self.jwks_uri if self.subject is not None: - body["subject"] = self.subject + body["{subject}"] = self.subject if self.subject_claim is not None: - body["subject_claim"] = self.subject_claim + body["{subject_claim}"] = self.subject_claim return body def as_shallow_dict(self) -> dict: """Serializes the OidcFederationPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.audiences: - body["audiences"] = self.audiences + body["{audiences}"] = self.audiences if self.issuer is not None: - body["issuer"] = self.issuer + body["{issuer}"] = self.issuer if self.jwks_json is not None: - body["jwks_json"] = self.jwks_json + body["{jwks_json}"] = self.jwks_json if self.jwks_uri is not None: - body["jwks_uri"] = self.jwks_uri + body["{jwks_uri}"] = self.jwks_uri if self.subject is not None: - body["subject"] = self.subject + body["{subject}"] = self.subject if self.subject_claim is not None: - body["subject_claim"] = self.subject_claim + body["{subject_claim}"] = self.subject_claim return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OidcFederationPolicy: """Deserializes the OidcFederationPolicy from a dictionary.""" return cls( - audiences=d.get("audiences", None), - issuer=d.get("issuer", None), - jwks_json=d.get("jwks_json", None), - jwks_uri=d.get("jwks_uri", None), - subject=d.get("subject", None), - subject_claim=d.get("subject_claim", None), + audiences=d.get("{audiences}", None), + issuer=d.get("{issuer}", None), + jwks_json=d.get("{jwks_json}", None), + jwks_uri=d.get("{jwks_uri}", None), + subject=d.get("{subject}", None), + subject_claim=d.get("{subject_claim}", None), ) @@ -866,51 +868,51 @@ def as_dict(self) -> dict: """Serializes the PublishedAppOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_id is not None: - body["app_id"] = self.app_id + body["{app_id}"] = self.app_id if self.client_id is not None: - body["client_id"] = self.client_id + body["{client_id}"] = self.client_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.is_confidential_client is not None: - body["is_confidential_client"] = self.is_confidential_client + body["{is_confidential_client}"] = self.is_confidential_client if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.redirect_urls: - body["redirect_urls"] = [v for v in self.redirect_urls] + body["{redirect_urls}"] = [v for v in self.redirect_urls] if self.scopes: - body["scopes"] = [v for v in self.scopes] + body["{scopes}"] = [v for v in self.scopes] return body def as_shallow_dict(self) -> dict: """Serializes the PublishedAppOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.app_id is not None: - body["app_id"] = self.app_id + body["{app_id}"] = self.app_id if self.client_id is not None: - body["client_id"] = self.client_id + body["{client_id}"] = self.client_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.is_confidential_client is not None: - body["is_confidential_client"] = self.is_confidential_client + body["{is_confidential_client}"] = self.is_confidential_client if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.redirect_urls: - body["redirect_urls"] = self.redirect_urls + body["{redirect_urls}"] = self.redirect_urls if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublishedAppOutput: """Deserializes the PublishedAppOutput from a dictionary.""" return cls( - app_id=d.get("app_id", None), - client_id=d.get("client_id", None), - description=d.get("description", None), - is_confidential_client=d.get("is_confidential_client", None), - name=d.get("name", None), - redirect_urls=d.get("redirect_urls", None), - scopes=d.get("scopes", None), + app_id=d.get("{app_id}", None), + client_id=d.get("{client_id}", None), + description=d.get("{description}", None), + is_confidential_client=d.get("{is_confidential_client}", None), + name=d.get("{name}", None), + redirect_urls=d.get("{redirect_urls}", None), + scopes=d.get("{scopes}", None), ) @@ -938,46 +940,46 @@ def as_dict(self) -> dict: """Serializes the SecretInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.expire_time is not None: - body["expire_time"] = self.expire_time + body["{expire_time}"] = self.expire_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.secret_hash is not None: - body["secret_hash"] = self.secret_hash + body["{secret_hash}"] = self.secret_hash if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the SecretInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.expire_time is not None: - body["expire_time"] = self.expire_time + body["{expire_time}"] = self.expire_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.secret_hash is not None: - body["secret_hash"] = self.secret_hash + body["{secret_hash}"] = self.secret_hash if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecretInfo: """Deserializes the SecretInfo from a dictionary.""" return cls( - create_time=d.get("create_time", None), - expire_time=d.get("expire_time", None), - id=d.get("id", None), - secret_hash=d.get("secret_hash", None), - status=d.get("status", None), - update_time=d.get("update_time", None), + create_time=d.get("{create_time}", None), + expire_time=d.get("{expire_time}", None), + id=d.get("{id}", None), + secret_hash=d.get("{secret_hash}", None), + status=d.get("{status}", None), + update_time=d.get("{update_time}", None), ) @@ -993,26 +995,26 @@ def as_dict(self) -> dict: """Serializes the TokenAccessPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_token_ttl_in_minutes is not None: - body["access_token_ttl_in_minutes"] = self.access_token_ttl_in_minutes + body["{access_token_ttl_in_minutes}"] = self.access_token_ttl_in_minutes if self.refresh_token_ttl_in_minutes is not None: - body["refresh_token_ttl_in_minutes"] = self.refresh_token_ttl_in_minutes + body["{refresh_token_ttl_in_minutes}"] = self.refresh_token_ttl_in_minutes return body def as_shallow_dict(self) -> dict: """Serializes the TokenAccessPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.access_token_ttl_in_minutes is not None: - body["access_token_ttl_in_minutes"] = self.access_token_ttl_in_minutes + body["{access_token_ttl_in_minutes}"] = self.access_token_ttl_in_minutes if self.refresh_token_ttl_in_minutes is not None: - body["refresh_token_ttl_in_minutes"] = self.refresh_token_ttl_in_minutes + body["{refresh_token_ttl_in_minutes}"] = self.refresh_token_ttl_in_minutes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenAccessPolicy: """Deserializes the TokenAccessPolicy from a dictionary.""" return cls( - access_token_ttl_in_minutes=d.get("access_token_ttl_in_minutes", None), - refresh_token_ttl_in_minutes=d.get("refresh_token_ttl_in_minutes", None), + access_token_ttl_in_minutes=d.get("{access_token_ttl_in_minutes}", None), + refresh_token_ttl_in_minutes=d.get("{refresh_token_ttl_in_minutes}", None), ) @@ -1038,41 +1040,41 @@ def as_dict(self) -> dict: """Serializes the UpdateCustomAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.redirect_urls: - body["redirect_urls"] = [v for v in self.redirect_urls] + body["{redirect_urls}"] = [v for v in self.redirect_urls] if self.scopes: - body["scopes"] = [v for v in self.scopes] + body["{scopes}"] = [v for v in self.scopes] if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy.as_dict() + body["{token_access_policy}"] = self.token_access_policy.as_dict() if self.user_authorized_scopes: - body["user_authorized_scopes"] = [v for v in self.user_authorized_scopes] + body["{user_authorized_scopes}"] = [v for v in self.user_authorized_scopes] return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCustomAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.redirect_urls: - body["redirect_urls"] = self.redirect_urls + body["{redirect_urls}"] = self.redirect_urls if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy + body["{token_access_policy}"] = self.token_access_policy if self.user_authorized_scopes: - body["user_authorized_scopes"] = self.user_authorized_scopes + body["{user_authorized_scopes}"] = self.user_authorized_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCustomAppIntegration: """Deserializes the UpdateCustomAppIntegration from a dictionary.""" return cls( - integration_id=d.get("integration_id", None), - redirect_urls=d.get("redirect_urls", None), - scopes=d.get("scopes", None), - token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), - user_authorized_scopes=d.get("user_authorized_scopes", None), + integration_id=d.get("{integration_id}", None), + redirect_urls=d.get("{redirect_urls}", None), + scopes=d.get("{scopes}", None), + token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), + user_authorized_scopes=d.get("{user_authorized_scopes}", None), ) @@ -1105,26 +1107,26 @@ def as_dict(self) -> dict: """Serializes the UpdatePublishedAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy.as_dict() + body["{token_access_policy}"] = self.token_access_policy.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdatePublishedAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_id is not None: - body["integration_id"] = self.integration_id + body["{integration_id}"] = self.integration_id if self.token_access_policy: - body["token_access_policy"] = self.token_access_policy + body["{token_access_policy}"] = self.token_access_policy return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePublishedAppIntegration: """Deserializes the UpdatePublishedAppIntegration from a dictionary.""" return cls( - integration_id=d.get("integration_id", None), - token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), + integration_id=d.get("{integration_id}", None), + token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), ) @@ -1204,10 +1206,10 @@ def create(self, *, policy: Optional[FederationPolicy] = None, policy_id: Option body = policy.as_dict() query = {} if policy_id is not None: - query["policy_id"] = policy_id + query["{policy_id}"] = policy_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1229,7 +1231,7 @@ def delete(self, policy_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -1246,7 +1248,7 @@ def get(self, policy_id: str) -> FederationPolicy: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -1265,23 +1267,23 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/federationPolicies", query=query, headers=headers ) - if "policies" in json: - for v in json["policies"]: + if "{policies}" in json: + for v in json["{policies}"]: yield FederationPolicy.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, policy_id: str, *, policy: Optional[FederationPolicy] = None, update_mask: Optional[str] = None @@ -1303,10 +1305,10 @@ def update( body = policy.as_dict() query = {} if update_mask is not None: - query["update_mask"] = update_mask + query["{update_mask}"] = update_mask headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1361,20 +1363,20 @@ def create( """ body = {} if confidential is not None: - body["confidential"] = confidential + body["{confidential}"] = confidential if name is not None: - body["name"] = name + body["{name}"] = name if redirect_urls is not None: - body["redirect_urls"] = [v for v in redirect_urls] + body["{redirect_urls}"] = [v for v in redirect_urls] if scopes is not None: - body["scopes"] = [v for v in scopes] + body["{scopes}"] = [v for v in scopes] if token_access_policy is not None: - body["token_access_policy"] = token_access_policy.as_dict() + body["{token_access_policy}"] = token_access_policy.as_dict() if user_authorized_scopes is not None: - body["user_authorized_scopes"] = [v for v in user_authorized_scopes] + body["{user_authorized_scopes}"] = [v for v in user_authorized_scopes] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1397,7 +1399,7 @@ def delete(self, integration_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -1418,7 +1420,7 @@ def get(self, integration_id: str) -> GetCustomAppIntegrationOutput: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -1448,13 +1450,13 @@ def list( query = {} if include_creator_username is not None: - query["include_creator_username"] = include_creator_username + query["{include_creator_username}"] = include_creator_username if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -1464,12 +1466,12 @@ def list( query=query, headers=headers, ) - if "apps" in json: - for v in json["apps"]: + if "{apps}" in json: + for v in json["{apps}"]: yield GetCustomAppIntegrationOutput.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -1501,16 +1503,16 @@ def update( """ body = {} if redirect_urls is not None: - body["redirect_urls"] = [v for v in redirect_urls] + body["{redirect_urls}"] = [v for v in redirect_urls] if scopes is not None: - body["scopes"] = [v for v in scopes] + body["{scopes}"] = [v for v in scopes] if token_access_policy is not None: - body["token_access_policy"] = token_access_policy.as_dict() + body["{token_access_policy}"] = token_access_policy.as_dict() if user_authorized_scopes is not None: - body["user_authorized_scopes"] = [v for v in user_authorized_scopes] + body["{user_authorized_scopes}"] = [v for v in user_authorized_scopes] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do( @@ -1546,23 +1548,23 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/oauth2/published-apps", query=query, headers=headers ) - if "apps" in json: - for v in json["apps"]: + if "{apps}" in json: + for v in json["{apps}"]: yield PublishedAppOutput.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class PublishedAppIntegrationAPI: @@ -1590,12 +1592,12 @@ def create( """ body = {} if app_id is not None: - body["app_id"] = app_id + body["{app_id}"] = app_id if token_access_policy is not None: - body["token_access_policy"] = token_access_policy.as_dict() + body["{token_access_policy}"] = token_access_policy.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1618,7 +1620,7 @@ def delete(self, integration_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -1638,7 +1640,7 @@ def get(self, integration_id: str) -> GetPublishedAppIntegrationOutput: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -1663,11 +1665,11 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -1677,12 +1679,12 @@ def list( query=query, headers=headers, ) - if "apps" in json: - for v in json["apps"]: + if "{apps}" in json: + for v in json["{apps}"]: yield GetPublishedAppIntegrationOutput.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, integration_id: str, *, token_access_policy: Optional[TokenAccessPolicy] = None): """Updates Published OAuth App Integration. @@ -1698,10 +1700,10 @@ def update(self, integration_id: str, *, token_access_policy: Optional[TokenAcce """ body = {} if token_access_policy is not None: - body["token_access_policy"] = token_access_policy.as_dict() + body["{token_access_policy}"] = token_access_policy.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do( @@ -1774,10 +1776,10 @@ def create( body = policy.as_dict() query = {} if policy_id is not None: - query["policy_id"] = policy_id + query["{policy_id}"] = policy_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1801,7 +1803,7 @@ def delete(self, service_principal_id: int, policy_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -1822,7 +1824,7 @@ def get(self, service_principal_id: int, policy_id: str) -> FederationPolicy: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -1847,11 +1849,11 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -1861,12 +1863,12 @@ def list( query=query, headers=headers, ) - if "policies" in json: - for v in json["policies"]: + if "{policies}" in json: + for v in json["{policies}"]: yield FederationPolicy.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -1895,10 +1897,10 @@ def update( body = policy.as_dict() query = {} if update_mask is not None: - query["update_mask"] = update_mask + query["{update_mask}"] = update_mask headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1945,10 +1947,10 @@ def create( """ body = {} if lifetime is not None: - body["lifetime"] = lifetime + body["{lifetime}"] = lifetime headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2001,9 +2003,9 @@ def list(self, service_principal_id: int, *, page_token: Optional[str] = None) - query = {} if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -2013,9 +2015,9 @@ def list(self, service_principal_id: int, *, page_token: Optional[str] = None) - query=query, headers=headers, ) - if "secrets" in json: - for v in json["secrets"]: + if "{secrets}" in json: + for v in json["{secrets}"]: yield SecretInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] diff --git a/databricks/sdk/service/pipelines.py b/databricks/sdk/pipelines/v2/impl.py similarity index 70% rename from databricks/sdk/service/pipelines.py rename to databricks/sdk/pipelines/v2/impl.py index beeb365c2..4d35d9a28 100755 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/pipelines/v2/impl.py @@ -3,19 +3,16 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -31,20 +28,20 @@ def as_dict(self) -> dict: """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: """Deserializes the Adlsgen2Info from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -131,66 +128,66 @@ def as_dict(self) -> dict: """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count + body["{ebs_volume_count}"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops + body["{ebs_volume_iops}"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size + body["{ebs_volume_size}"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput + body["{ebs_volume_throughput}"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type.value + body["{ebs_volume_type}"] = self.ebs_volume_type.value if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count + body["{ebs_volume_count}"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops + body["{ebs_volume_iops}"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size + body["{ebs_volume_size}"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput + body["{ebs_volume_throughput}"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type + body["{ebs_volume_type}"] = self.ebs_volume_type if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent + body["{spot_bid_price_percent}"] = self.spot_bid_price_percent if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: """Deserializes the AwsAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", AwsAvailability), - ebs_volume_count=d.get("ebs_volume_count", None), - ebs_volume_iops=d.get("ebs_volume_iops", None), - ebs_volume_size=d.get("ebs_volume_size", None), - ebs_volume_throughput=d.get("ebs_volume_throughput", None), - ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), - first_on_demand=d.get("first_on_demand", None), - instance_profile_arn=d.get("instance_profile_arn", None), - spot_bid_price_percent=d.get("spot_bid_price_percent", None), - zone_id=d.get("zone_id", None), + availability=_enum(d, "{availability}", AwsAvailability), + ebs_volume_count=d.get("{ebs_volume_count}", None), + ebs_volume_iops=d.get("{ebs_volume_iops}", None), + ebs_volume_size=d.get("{ebs_volume_size}", None), + ebs_volume_throughput=d.get("{ebs_volume_throughput}", None), + ebs_volume_type=_enum(d, "{ebs_volume_type}", EbsVolumeType), + first_on_demand=d.get("{first_on_demand}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), + zone_id=d.get("{zone_id}", None), ) @@ -234,36 +231,36 @@ def as_dict(self) -> dict: """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info.as_dict() + body["{log_analytics_info}"] = self.log_analytics_info.as_dict() if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body def as_shallow_dict(self) -> dict: """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand + body["{first_on_demand}"] = self.first_on_demand if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info + body["{log_analytics_info}"] = self.log_analytics_info if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price + body["{spot_bid_max_price}"] = self.spot_bid_max_price return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: """Deserializes the AzureAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", AzureAvailability), - first_on_demand=d.get("first_on_demand", None), - log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), - spot_bid_max_price=d.get("spot_bid_max_price", None), + availability=_enum(d, "{availability}", AzureAvailability), + first_on_demand=d.get("{first_on_demand}", None), + log_analytics_info=_from_dict(d, "{log_analytics_info}", LogAnalyticsInfo), + spot_bid_max_price=d.get("{spot_bid_max_price}", None), ) @@ -298,31 +295,31 @@ def as_dict(self) -> dict: """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() + body["{dbfs}"] = self.dbfs.as_dict() if self.s3: - body["s3"] = self.s3.as_dict() + body["{s3}"] = self.s3.as_dict() if self.volumes: - body["volumes"] = self.volumes.as_dict() + body["{volumes}"] = self.volumes.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" body = {} if self.dbfs: - body["dbfs"] = self.dbfs + body["{dbfs}"] = self.dbfs if self.s3: - body["s3"] = self.s3 + body["{s3}"] = self.s3 if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: """Deserializes the ClusterLogConf from a dictionary.""" return cls( - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), + dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), + s3=_from_dict(d, "{s3}", S3StorageInfo), + volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), ) @@ -423,151 +420,151 @@ def as_dict(self) -> dict: """Serializes the CreatePipeline into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_duplicate_names is not None: - body["allow_duplicate_names"] = self.allow_duplicate_names + body["{allow_duplicate_names}"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.channel is not None: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.clusters: - body["clusters"] = [v.as_dict() for v in self.clusters] + body["{clusters}"] = [v.as_dict() for v in self.clusters] if self.configuration: - body["configuration"] = self.configuration + body["{configuration}"] = self.configuration if self.continuous is not None: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment.as_dict() + body["{deployment}"] = self.deployment.as_dict() if self.development is not None: - body["development"] = self.development + body["{development}"] = self.development if self.dry_run is not None: - body["dry_run"] = self.dry_run + body["{dry_run}"] = self.dry_run if self.edition is not None: - body["edition"] = self.edition + body["{edition}"] = self.edition if self.event_log: - body["event_log"] = self.event_log.as_dict() + body["{event_log}"] = self.event_log.as_dict() if self.filters: - body["filters"] = self.filters.as_dict() + body["{filters}"] = self.filters.as_dict() if self.gateway_definition: - body["gateway_definition"] = self.gateway_definition.as_dict() + body["{gateway_definition}"] = self.gateway_definition.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.ingestion_definition: - body["ingestion_definition"] = self.ingestion_definition.as_dict() + body["{ingestion_definition}"] = self.ingestion_definition.as_dict() if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notifications: - body["notifications"] = [v.as_dict() for v in self.notifications] + body["{notifications}"] = [v.as_dict() for v in self.notifications] if self.photon is not None: - body["photon"] = self.photon + body["{photon}"] = self.photon if self.restart_window: - body["restart_window"] = self.restart_window.as_dict() + body["{restart_window}"] = self.restart_window.as_dict() if self.run_as: - body["run_as"] = self.run_as.as_dict() + body["{run_as}"] = self.run_as.as_dict() if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.serverless is not None: - body["serverless"] = self.serverless + body["{serverless}"] = self.serverless if self.storage is not None: - body["storage"] = self.storage + body["{storage}"] = self.storage if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target if self.trigger: - body["trigger"] = self.trigger.as_dict() + body["{trigger}"] = self.trigger.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreatePipeline into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_duplicate_names is not None: - body["allow_duplicate_names"] = self.allow_duplicate_names + body["{allow_duplicate_names}"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.channel is not None: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.clusters: - body["clusters"] = self.clusters + body["{clusters}"] = self.clusters if self.configuration: - body["configuration"] = self.configuration + body["{configuration}"] = self.configuration if self.continuous is not None: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment + body["{deployment}"] = self.deployment if self.development is not None: - body["development"] = self.development + body["{development}"] = self.development if self.dry_run is not None: - body["dry_run"] = self.dry_run + body["{dry_run}"] = self.dry_run if self.edition is not None: - body["edition"] = self.edition + body["{edition}"] = self.edition if self.event_log: - body["event_log"] = self.event_log + body["{event_log}"] = self.event_log if self.filters: - body["filters"] = self.filters + body["{filters}"] = self.filters if self.gateway_definition: - body["gateway_definition"] = self.gateway_definition + body["{gateway_definition}"] = self.gateway_definition if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.ingestion_definition: - body["ingestion_definition"] = self.ingestion_definition + body["{ingestion_definition}"] = self.ingestion_definition if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notifications: - body["notifications"] = self.notifications + body["{notifications}"] = self.notifications if self.photon is not None: - body["photon"] = self.photon + body["{photon}"] = self.photon if self.restart_window: - body["restart_window"] = self.restart_window + body["{restart_window}"] = self.restart_window if self.run_as: - body["run_as"] = self.run_as + body["{run_as}"] = self.run_as if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.serverless is not None: - body["serverless"] = self.serverless + body["{serverless}"] = self.serverless if self.storage is not None: - body["storage"] = self.storage + body["{storage}"] = self.storage if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target if self.trigger: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePipeline: """Deserializes the CreatePipeline from a dictionary.""" return cls( - allow_duplicate_names=d.get("allow_duplicate_names", None), - budget_policy_id=d.get("budget_policy_id", None), - catalog=d.get("catalog", None), - channel=d.get("channel", None), - clusters=_repeated_dict(d, "clusters", PipelineCluster), - configuration=d.get("configuration", None), - continuous=d.get("continuous", None), - deployment=_from_dict(d, "deployment", PipelineDeployment), - development=d.get("development", None), - dry_run=d.get("dry_run", None), - edition=d.get("edition", None), - event_log=_from_dict(d, "event_log", EventLogSpec), - filters=_from_dict(d, "filters", Filters), - gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), - id=d.get("id", None), - ingestion_definition=_from_dict(d, "ingestion_definition", IngestionPipelineDefinition), - libraries=_repeated_dict(d, "libraries", PipelineLibrary), - name=d.get("name", None), - notifications=_repeated_dict(d, "notifications", Notifications), - photon=d.get("photon", None), - restart_window=_from_dict(d, "restart_window", RestartWindow), - run_as=_from_dict(d, "run_as", RunAs), - schema=d.get("schema", None), - serverless=d.get("serverless", None), - storage=d.get("storage", None), - target=d.get("target", None), - trigger=_from_dict(d, "trigger", PipelineTrigger), + allow_duplicate_names=d.get("{allow_duplicate_names}", None), + budget_policy_id=d.get("{budget_policy_id}", None), + catalog=d.get("{catalog}", None), + channel=d.get("{channel}", None), + clusters=_repeated_dict(d, "{clusters}", PipelineCluster), + configuration=d.get("{configuration}", None), + continuous=d.get("{continuous}", None), + deployment=_from_dict(d, "{deployment}", PipelineDeployment), + development=d.get("{development}", None), + dry_run=d.get("{dry_run}", None), + edition=d.get("{edition}", None), + event_log=_from_dict(d, "{event_log}", EventLogSpec), + filters=_from_dict(d, "{filters}", Filters), + gateway_definition=_from_dict(d, "{gateway_definition}", IngestionGatewayPipelineDefinition), + id=d.get("{id}", None), + ingestion_definition=_from_dict(d, "{ingestion_definition}", IngestionPipelineDefinition), + libraries=_repeated_dict(d, "{libraries}", PipelineLibrary), + name=d.get("{name}", None), + notifications=_repeated_dict(d, "{notifications}", Notifications), + photon=d.get("{photon}", None), + restart_window=_from_dict(d, "{restart_window}", RestartWindow), + run_as=_from_dict(d, "{run_as}", RunAs), + schema=d.get("{schema}", None), + serverless=d.get("{serverless}", None), + storage=d.get("{storage}", None), + target=d.get("{target}", None), + trigger=_from_dict(d, "{trigger}", PipelineTrigger), ) @@ -583,25 +580,26 @@ def as_dict(self) -> dict: """Serializes the CreatePipelineResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.effective_settings: - body["effective_settings"] = self.effective_settings.as_dict() + body["{effective_settings}"] = self.effective_settings.as_dict() if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id return body def as_shallow_dict(self) -> dict: """Serializes the CreatePipelineResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.effective_settings: - body["effective_settings"] = self.effective_settings + body["{effective_settings}"] = self.effective_settings if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePipelineResponse: """Deserializes the CreatePipelineResponse from a dictionary.""" return cls( - effective_settings=_from_dict(d, "effective_settings", PipelineSpec), pipeline_id=d.get("pipeline_id", None) + effective_settings=_from_dict(d, "{effective_settings}", PipelineSpec), + pipeline_id=d.get("{pipeline_id}", None), ) @@ -615,24 +613,24 @@ def as_dict(self) -> dict: """Serializes the CronTrigger into a dictionary suitable for use as a JSON request body.""" body = {} if self.quartz_cron_schedule is not None: - body["quartz_cron_schedule"] = self.quartz_cron_schedule + body["{quartz_cron_schedule}"] = self.quartz_cron_schedule if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body def as_shallow_dict(self) -> dict: """Serializes the CronTrigger into a shallow dictionary of its immediate attributes.""" body = {} if self.quartz_cron_schedule is not None: - body["quartz_cron_schedule"] = self.quartz_cron_schedule + body["{quartz_cron_schedule}"] = self.quartz_cron_schedule if self.timezone_id is not None: - body["timezone_id"] = self.timezone_id + body["{timezone_id}"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CronTrigger: """Deserializes the CronTrigger from a dictionary.""" - return cls(quartz_cron_schedule=d.get("quartz_cron_schedule", None), timezone_id=d.get("timezone_id", None)) + return cls(quartz_cron_schedule=d.get("{quartz_cron_schedule}", None), timezone_id=d.get("{timezone_id}", None)) @dataclass @@ -647,24 +645,24 @@ def as_dict(self) -> dict: """Serializes the DataPlaneId into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance is not None: - body["instance"] = self.instance + body["{instance}"] = self.instance if self.seq_no is not None: - body["seq_no"] = self.seq_no + body["{seq_no}"] = self.seq_no return body def as_shallow_dict(self) -> dict: """Serializes the DataPlaneId into a shallow dictionary of its immediate attributes.""" body = {} if self.instance is not None: - body["instance"] = self.instance + body["{instance}"] = self.instance if self.seq_no is not None: - body["seq_no"] = self.seq_no + body["{seq_no}"] = self.seq_no return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataPlaneId: """Deserializes the DataPlaneId from a dictionary.""" - return cls(instance=d.get("instance", None), seq_no=d.get("seq_no", None)) + return cls(instance=d.get("{instance}", None), seq_no=d.get("{seq_no}", None)) class DayOfWeek(Enum): @@ -691,20 +689,20 @@ def as_dict(self) -> dict: """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: """Deserializes the DbfsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -842,156 +840,156 @@ def as_dict(self) -> dict: """Serializes the EditPipeline into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_duplicate_names is not None: - body["allow_duplicate_names"] = self.allow_duplicate_names + body["{allow_duplicate_names}"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.channel is not None: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.clusters: - body["clusters"] = [v.as_dict() for v in self.clusters] + body["{clusters}"] = [v.as_dict() for v in self.clusters] if self.configuration: - body["configuration"] = self.configuration + body["{configuration}"] = self.configuration if self.continuous is not None: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment.as_dict() + body["{deployment}"] = self.deployment.as_dict() if self.development is not None: - body["development"] = self.development + body["{development}"] = self.development if self.edition is not None: - body["edition"] = self.edition + body["{edition}"] = self.edition if self.event_log: - body["event_log"] = self.event_log.as_dict() + body["{event_log}"] = self.event_log.as_dict() if self.expected_last_modified is not None: - body["expected_last_modified"] = self.expected_last_modified + body["{expected_last_modified}"] = self.expected_last_modified if self.filters: - body["filters"] = self.filters.as_dict() + body["{filters}"] = self.filters.as_dict() if self.gateway_definition: - body["gateway_definition"] = self.gateway_definition.as_dict() + body["{gateway_definition}"] = self.gateway_definition.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.ingestion_definition: - body["ingestion_definition"] = self.ingestion_definition.as_dict() + body["{ingestion_definition}"] = self.ingestion_definition.as_dict() if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notifications: - body["notifications"] = [v.as_dict() for v in self.notifications] + body["{notifications}"] = [v.as_dict() for v in self.notifications] if self.photon is not None: - body["photon"] = self.photon + body["{photon}"] = self.photon if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.restart_window: - body["restart_window"] = self.restart_window.as_dict() + body["{restart_window}"] = self.restart_window.as_dict() if self.run_as: - body["run_as"] = self.run_as.as_dict() + body["{run_as}"] = self.run_as.as_dict() if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.serverless is not None: - body["serverless"] = self.serverless + body["{serverless}"] = self.serverless if self.storage is not None: - body["storage"] = self.storage + body["{storage}"] = self.storage if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target if self.trigger: - body["trigger"] = self.trigger.as_dict() + body["{trigger}"] = self.trigger.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EditPipeline into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_duplicate_names is not None: - body["allow_duplicate_names"] = self.allow_duplicate_names + body["{allow_duplicate_names}"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.channel is not None: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.clusters: - body["clusters"] = self.clusters + body["{clusters}"] = self.clusters if self.configuration: - body["configuration"] = self.configuration + body["{configuration}"] = self.configuration if self.continuous is not None: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment + body["{deployment}"] = self.deployment if self.development is not None: - body["development"] = self.development + body["{development}"] = self.development if self.edition is not None: - body["edition"] = self.edition + body["{edition}"] = self.edition if self.event_log: - body["event_log"] = self.event_log + body["{event_log}"] = self.event_log if self.expected_last_modified is not None: - body["expected_last_modified"] = self.expected_last_modified + body["{expected_last_modified}"] = self.expected_last_modified if self.filters: - body["filters"] = self.filters + body["{filters}"] = self.filters if self.gateway_definition: - body["gateway_definition"] = self.gateway_definition + body["{gateway_definition}"] = self.gateway_definition if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.ingestion_definition: - body["ingestion_definition"] = self.ingestion_definition + body["{ingestion_definition}"] = self.ingestion_definition if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notifications: - body["notifications"] = self.notifications + body["{notifications}"] = self.notifications if self.photon is not None: - body["photon"] = self.photon + body["{photon}"] = self.photon if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.restart_window: - body["restart_window"] = self.restart_window + body["{restart_window}"] = self.restart_window if self.run_as: - body["run_as"] = self.run_as + body["{run_as}"] = self.run_as if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.serverless is not None: - body["serverless"] = self.serverless + body["{serverless}"] = self.serverless if self.storage is not None: - body["storage"] = self.storage + body["{storage}"] = self.storage if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target if self.trigger: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditPipeline: """Deserializes the EditPipeline from a dictionary.""" return cls( - allow_duplicate_names=d.get("allow_duplicate_names", None), - budget_policy_id=d.get("budget_policy_id", None), - catalog=d.get("catalog", None), - channel=d.get("channel", None), - clusters=_repeated_dict(d, "clusters", PipelineCluster), - configuration=d.get("configuration", None), - continuous=d.get("continuous", None), - deployment=_from_dict(d, "deployment", PipelineDeployment), - development=d.get("development", None), - edition=d.get("edition", None), - event_log=_from_dict(d, "event_log", EventLogSpec), - expected_last_modified=d.get("expected_last_modified", None), - filters=_from_dict(d, "filters", Filters), - gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), - id=d.get("id", None), - ingestion_definition=_from_dict(d, "ingestion_definition", IngestionPipelineDefinition), - libraries=_repeated_dict(d, "libraries", PipelineLibrary), - name=d.get("name", None), - notifications=_repeated_dict(d, "notifications", Notifications), - photon=d.get("photon", None), - pipeline_id=d.get("pipeline_id", None), - restart_window=_from_dict(d, "restart_window", RestartWindow), - run_as=_from_dict(d, "run_as", RunAs), - schema=d.get("schema", None), - serverless=d.get("serverless", None), - storage=d.get("storage", None), - target=d.get("target", None), - trigger=_from_dict(d, "trigger", PipelineTrigger), + allow_duplicate_names=d.get("{allow_duplicate_names}", None), + budget_policy_id=d.get("{budget_policy_id}", None), + catalog=d.get("{catalog}", None), + channel=d.get("{channel}", None), + clusters=_repeated_dict(d, "{clusters}", PipelineCluster), + configuration=d.get("{configuration}", None), + continuous=d.get("{continuous}", None), + deployment=_from_dict(d, "{deployment}", PipelineDeployment), + development=d.get("{development}", None), + edition=d.get("{edition}", None), + event_log=_from_dict(d, "{event_log}", EventLogSpec), + expected_last_modified=d.get("{expected_last_modified}", None), + filters=_from_dict(d, "{filters}", Filters), + gateway_definition=_from_dict(d, "{gateway_definition}", IngestionGatewayPipelineDefinition), + id=d.get("{id}", None), + ingestion_definition=_from_dict(d, "{ingestion_definition}", IngestionPipelineDefinition), + libraries=_repeated_dict(d, "{libraries}", PipelineLibrary), + name=d.get("{name}", None), + notifications=_repeated_dict(d, "{notifications}", Notifications), + photon=d.get("{photon}", None), + pipeline_id=d.get("{pipeline_id}", None), + restart_window=_from_dict(d, "{restart_window}", RestartWindow), + run_as=_from_dict(d, "{run_as}", RunAs), + schema=d.get("{schema}", None), + serverless=d.get("{serverless}", None), + storage=d.get("{storage}", None), + target=d.get("{target}", None), + trigger=_from_dict(d, "{trigger}", PipelineTrigger), ) @@ -1025,24 +1023,24 @@ def as_dict(self) -> dict: """Serializes the ErrorDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.exceptions: - body["exceptions"] = [v.as_dict() for v in self.exceptions] + body["{exceptions}"] = [v.as_dict() for v in self.exceptions] if self.fatal is not None: - body["fatal"] = self.fatal + body["{fatal}"] = self.fatal return body def as_shallow_dict(self) -> dict: """Serializes the ErrorDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.exceptions: - body["exceptions"] = self.exceptions + body["{exceptions}"] = self.exceptions if self.fatal is not None: - body["fatal"] = self.fatal + body["{fatal}"] = self.fatal return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ErrorDetail: """Deserializes the ErrorDetail from a dictionary.""" - return cls(exceptions=_repeated_dict(d, "exceptions", SerializedException), fatal=d.get("fatal", None)) + return cls(exceptions=_repeated_dict(d, "{exceptions}", SerializedException), fatal=d.get("{fatal}", None)) class EventLevel(Enum): @@ -1071,28 +1069,28 @@ def as_dict(self) -> dict: """Serializes the EventLogSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema return body def as_shallow_dict(self) -> dict: """Serializes the EventLogSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EventLogSpec: """Deserializes the EventLogSpec from a dictionary.""" - return cls(catalog=d.get("catalog", None), name=d.get("name", None), schema=d.get("schema", None)) + return cls(catalog=d.get("{catalog}", None), name=d.get("{name}", None), schema=d.get("{schema}", None)) @dataclass @@ -1104,20 +1102,20 @@ def as_dict(self) -> dict: """Serializes the FileLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the FileLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileLibrary: """Deserializes the FileLibrary from a dictionary.""" - return cls(path=d.get("path", None)) + return cls(path=d.get("{path}", None)) @dataclass @@ -1132,24 +1130,24 @@ def as_dict(self) -> dict: """Serializes the Filters into a dictionary suitable for use as a JSON request body.""" body = {} if self.exclude: - body["exclude"] = [v for v in self.exclude] + body["{exclude}"] = [v for v in self.exclude] if self.include: - body["include"] = [v for v in self.include] + body["{include}"] = [v for v in self.include] return body def as_shallow_dict(self) -> dict: """Serializes the Filters into a shallow dictionary of its immediate attributes.""" body = {} if self.exclude: - body["exclude"] = self.exclude + body["{exclude}"] = self.exclude if self.include: - body["include"] = self.include + body["{include}"] = self.include return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Filters: """Deserializes the Filters from a dictionary.""" - return cls(exclude=d.get("exclude", None), include=d.get("include", None)) + return cls(exclude=d.get("{exclude}", None), include=d.get("{include}", None)) @dataclass @@ -1191,46 +1189,46 @@ def as_dict(self) -> dict: """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["availability"] = self.availability.value + body["{availability}"] = self.availability.value if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size + body["{boot_disk_size}"] = self.boot_disk_size if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors + body["{use_preemptible_executors}"] = self.use_preemptible_executors if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body def as_shallow_dict(self) -> dict: """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["availability"] = self.availability + body["{availability}"] = self.availability if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size + body["{boot_disk_size}"] = self.boot_disk_size if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count + body["{local_ssd_count}"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors + body["{use_preemptible_executors}"] = self.use_preemptible_executors if self.zone_id is not None: - body["zone_id"] = self.zone_id + body["{zone_id}"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: """Deserializes the GcpAttributes from a dictionary.""" return cls( - availability=_enum(d, "availability", GcpAvailability), - boot_disk_size=d.get("boot_disk_size", None), - google_service_account=d.get("google_service_account", None), - local_ssd_count=d.get("local_ssd_count", None), - use_preemptible_executors=d.get("use_preemptible_executors", None), - zone_id=d.get("zone_id", None), + availability=_enum(d, "{availability}", GcpAvailability), + boot_disk_size=d.get("{boot_disk_size}", None), + google_service_account=d.get("{google_service_account}", None), + local_ssd_count=d.get("{local_ssd_count}", None), + use_preemptible_executors=d.get("{use_preemptible_executors}", None), + zone_id=d.get("{zone_id}", None), ) @@ -1254,20 +1252,20 @@ def as_dict(self) -> dict: """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: """Deserializes the GcsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -1279,20 +1277,20 @@ def as_dict(self) -> dict: """Serializes the GetPipelinePermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetPipelinePermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPipelinePermissionLevelsResponse: """Deserializes the GetPipelinePermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", PipelinePermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", PipelinePermissionsDescription)) @dataclass @@ -1337,76 +1335,76 @@ def as_dict(self) -> dict: """Serializes the GetPipelineResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["cause"] = self.cause + body["{cause}"] = self.cause if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.health is not None: - body["health"] = self.health.value + body["{health}"] = self.health.value if self.last_modified is not None: - body["last_modified"] = self.last_modified + body["{last_modified}"] = self.last_modified if self.latest_updates: - body["latest_updates"] = [v.as_dict() for v in self.latest_updates] + body["{latest_updates}"] = [v.as_dict() for v in self.latest_updates] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.run_as_user_name is not None: - body["run_as_user_name"] = self.run_as_user_name + body["{run_as_user_name}"] = self.run_as_user_name if self.spec: - body["spec"] = self.spec.as_dict() + body["{spec}"] = self.spec.as_dict() if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the GetPipelineResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["cause"] = self.cause + body["{cause}"] = self.cause if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["effective_budget_policy_id"] = self.effective_budget_policy_id + body["{effective_budget_policy_id}"] = self.effective_budget_policy_id if self.health is not None: - body["health"] = self.health + body["{health}"] = self.health if self.last_modified is not None: - body["last_modified"] = self.last_modified + body["{last_modified}"] = self.last_modified if self.latest_updates: - body["latest_updates"] = self.latest_updates + body["{latest_updates}"] = self.latest_updates if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.run_as_user_name is not None: - body["run_as_user_name"] = self.run_as_user_name + body["{run_as_user_name}"] = self.run_as_user_name if self.spec: - body["spec"] = self.spec + body["{spec}"] = self.spec if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPipelineResponse: """Deserializes the GetPipelineResponse from a dictionary.""" return cls( - cause=d.get("cause", None), - cluster_id=d.get("cluster_id", None), - creator_user_name=d.get("creator_user_name", None), - effective_budget_policy_id=d.get("effective_budget_policy_id", None), - health=_enum(d, "health", GetPipelineResponseHealth), - last_modified=d.get("last_modified", None), - latest_updates=_repeated_dict(d, "latest_updates", UpdateStateInfo), - name=d.get("name", None), - pipeline_id=d.get("pipeline_id", None), - run_as_user_name=d.get("run_as_user_name", None), - spec=_from_dict(d, "spec", PipelineSpec), - state=_enum(d, "state", PipelineState), + cause=d.get("{cause}", None), + cluster_id=d.get("{cluster_id}", None), + creator_user_name=d.get("{creator_user_name}", None), + effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), + health=_enum(d, "{health}", GetPipelineResponseHealth), + last_modified=d.get("{last_modified}", None), + latest_updates=_repeated_dict(d, "{latest_updates}", UpdateStateInfo), + name=d.get("{name}", None), + pipeline_id=d.get("{pipeline_id}", None), + run_as_user_name=d.get("{run_as_user_name}", None), + spec=_from_dict(d, "{spec}", PipelineSpec), + state=_enum(d, "{state}", PipelineState), ) @@ -1426,20 +1424,20 @@ def as_dict(self) -> dict: """Serializes the GetUpdateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.update: - body["update"] = self.update.as_dict() + body["{update}"] = self.update.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetUpdateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.update: - body["update"] = self.update + body["{update}"] = self.update return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetUpdateResponse: """Deserializes the GetUpdateResponse from a dictionary.""" - return cls(update=_from_dict(d, "update", UpdateInfo)) + return cls(update=_from_dict(d, "{update}", UpdateInfo)) @dataclass @@ -1457,31 +1455,31 @@ def as_dict(self) -> dict: """Serializes the IngestionConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.report: - body["report"] = self.report.as_dict() + body["{report}"] = self.report.as_dict() if self.schema: - body["schema"] = self.schema.as_dict() + body["{schema}"] = self.schema.as_dict() if self.table: - body["table"] = self.table.as_dict() + body["{table}"] = self.table.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the IngestionConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.report: - body["report"] = self.report + body["{report}"] = self.report if self.schema: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.table: - body["table"] = self.table + body["{table}"] = self.table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IngestionConfig: """Deserializes the IngestionConfig from a dictionary.""" return cls( - report=_from_dict(d, "report", ReportSpec), - schema=_from_dict(d, "schema", SchemaSpec), - table=_from_dict(d, "table", TableSpec), + report=_from_dict(d, "{report}", ReportSpec), + schema=_from_dict(d, "{schema}", SchemaSpec), + table=_from_dict(d, "{table}", TableSpec), ) @@ -1510,41 +1508,41 @@ def as_dict(self) -> dict: """Serializes the IngestionGatewayPipelineDefinition into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_id is not None: - body["connection_id"] = self.connection_id + body["{connection_id}"] = self.connection_id if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.gateway_storage_catalog is not None: - body["gateway_storage_catalog"] = self.gateway_storage_catalog + body["{gateway_storage_catalog}"] = self.gateway_storage_catalog if self.gateway_storage_name is not None: - body["gateway_storage_name"] = self.gateway_storage_name + body["{gateway_storage_name}"] = self.gateway_storage_name if self.gateway_storage_schema is not None: - body["gateway_storage_schema"] = self.gateway_storage_schema + body["{gateway_storage_schema}"] = self.gateway_storage_schema return body def as_shallow_dict(self) -> dict: """Serializes the IngestionGatewayPipelineDefinition into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_id is not None: - body["connection_id"] = self.connection_id + body["{connection_id}"] = self.connection_id if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.gateway_storage_catalog is not None: - body["gateway_storage_catalog"] = self.gateway_storage_catalog + body["{gateway_storage_catalog}"] = self.gateway_storage_catalog if self.gateway_storage_name is not None: - body["gateway_storage_name"] = self.gateway_storage_name + body["{gateway_storage_name}"] = self.gateway_storage_name if self.gateway_storage_schema is not None: - body["gateway_storage_schema"] = self.gateway_storage_schema + body["{gateway_storage_schema}"] = self.gateway_storage_schema return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IngestionGatewayPipelineDefinition: """Deserializes the IngestionGatewayPipelineDefinition from a dictionary.""" return cls( - connection_id=d.get("connection_id", None), - connection_name=d.get("connection_name", None), - gateway_storage_catalog=d.get("gateway_storage_catalog", None), - gateway_storage_name=d.get("gateway_storage_name", None), - gateway_storage_schema=d.get("gateway_storage_schema", None), + connection_id=d.get("{connection_id}", None), + connection_name=d.get("{connection_name}", None), + gateway_storage_catalog=d.get("{gateway_storage_catalog}", None), + gateway_storage_name=d.get("{gateway_storage_name}", None), + gateway_storage_schema=d.get("{gateway_storage_schema}", None), ) @@ -1569,36 +1567,36 @@ def as_dict(self) -> dict: """Serializes the IngestionPipelineDefinition into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.ingestion_gateway_id is not None: - body["ingestion_gateway_id"] = self.ingestion_gateway_id + body["{ingestion_gateway_id}"] = self.ingestion_gateway_id if self.objects: - body["objects"] = [v.as_dict() for v in self.objects] + body["{objects}"] = [v.as_dict() for v in self.objects] if self.table_configuration: - body["table_configuration"] = self.table_configuration.as_dict() + body["{table_configuration}"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the IngestionPipelineDefinition into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.ingestion_gateway_id is not None: - body["ingestion_gateway_id"] = self.ingestion_gateway_id + body["{ingestion_gateway_id}"] = self.ingestion_gateway_id if self.objects: - body["objects"] = self.objects + body["{objects}"] = self.objects if self.table_configuration: - body["table_configuration"] = self.table_configuration + body["{table_configuration}"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IngestionPipelineDefinition: """Deserializes the IngestionPipelineDefinition from a dictionary.""" return cls( - connection_name=d.get("connection_name", None), - ingestion_gateway_id=d.get("ingestion_gateway_id", None), - objects=_repeated_dict(d, "objects", IngestionConfig), - table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), + connection_name=d.get("{connection_name}", None), + ingestion_gateway_id=d.get("{ingestion_gateway_id}", None), + objects=_repeated_dict(d, "{objects}", IngestionConfig), + table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), ) @@ -1638,51 +1636,51 @@ def as_dict(self) -> dict: """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.abfss: - body["abfss"] = self.abfss.as_dict() + body["{abfss}"] = self.abfss.as_dict() if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() + body["{dbfs}"] = self.dbfs.as_dict() if self.file: - body["file"] = self.file.as_dict() + body["{file}"] = self.file.as_dict() if self.gcs: - body["gcs"] = self.gcs.as_dict() + body["{gcs}"] = self.gcs.as_dict() if self.s3: - body["s3"] = self.s3.as_dict() + body["{s3}"] = self.s3.as_dict() if self.volumes: - body["volumes"] = self.volumes.as_dict() + body["{volumes}"] = self.volumes.as_dict() if self.workspace: - body["workspace"] = self.workspace.as_dict() + body["{workspace}"] = self.workspace.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.abfss: - body["abfss"] = self.abfss + body["{abfss}"] = self.abfss if self.dbfs: - body["dbfs"] = self.dbfs + body["{dbfs}"] = self.dbfs if self.file: - body["file"] = self.file + body["{file}"] = self.file if self.gcs: - body["gcs"] = self.gcs + body["{gcs}"] = self.gcs if self.s3: - body["s3"] = self.s3 + body["{s3}"] = self.s3 if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes if self.workspace: - body["workspace"] = self.workspace + body["{workspace}"] = self.workspace return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: """Deserializes the InitScriptInfo from a dictionary.""" return cls( - abfss=_from_dict(d, "abfss", Adlsgen2Info), - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - file=_from_dict(d, "file", LocalFileInfo), - gcs=_from_dict(d, "gcs", GcsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), - workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), + abfss=_from_dict(d, "{abfss}", Adlsgen2Info), + dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), + file=_from_dict(d, "{file}", LocalFileInfo), + gcs=_from_dict(d, "{gcs}", GcsStorageInfo), + s3=_from_dict(d, "{s3}", S3StorageInfo), + volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), + workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), ) @@ -1701,31 +1699,31 @@ def as_dict(self) -> dict: """Serializes the ListPipelineEventsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.events: - body["events"] = [v.as_dict() for v in self.events] + body["{events}"] = [v.as_dict() for v in self.events] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListPipelineEventsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.events: - body["events"] = self.events + body["{events}"] = self.events if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPipelineEventsResponse: """Deserializes the ListPipelineEventsResponse from a dictionary.""" return cls( - events=_repeated_dict(d, "events", PipelineEvent), - next_page_token=d.get("next_page_token", None), - prev_page_token=d.get("prev_page_token", None), + events=_repeated_dict(d, "{events}", PipelineEvent), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), ) @@ -1741,25 +1739,26 @@ def as_dict(self) -> dict: """Serializes the ListPipelinesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.statuses: - body["statuses"] = [v.as_dict() for v in self.statuses] + body["{statuses}"] = [v.as_dict() for v in self.statuses] return body def as_shallow_dict(self) -> dict: """Serializes the ListPipelinesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.statuses: - body["statuses"] = self.statuses + body["{statuses}"] = self.statuses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPipelinesResponse: """Deserializes the ListPipelinesResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), statuses=_repeated_dict(d, "statuses", PipelineStateInfo) + next_page_token=d.get("{next_page_token}", None), + statuses=_repeated_dict(d, "{statuses}", PipelineStateInfo), ) @@ -1778,31 +1777,31 @@ def as_dict(self) -> dict: """Serializes the ListUpdatesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token if self.updates: - body["updates"] = [v.as_dict() for v in self.updates] + body["{updates}"] = [v.as_dict() for v in self.updates] return body def as_shallow_dict(self) -> dict: """Serializes the ListUpdatesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.prev_page_token is not None: - body["prev_page_token"] = self.prev_page_token + body["{prev_page_token}"] = self.prev_page_token if self.updates: - body["updates"] = self.updates + body["{updates}"] = self.updates return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListUpdatesResponse: """Deserializes the ListUpdatesResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - prev_page_token=d.get("prev_page_token", None), - updates=_repeated_dict(d, "updates", UpdateInfo), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), + updates=_repeated_dict(d, "{updates}", UpdateInfo), ) @@ -1815,20 +1814,20 @@ def as_dict(self) -> dict: """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: """Deserializes the LocalFileInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -1841,26 +1840,26 @@ def as_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key + body["{log_analytics_primary_key}"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key + body["{log_analytics_primary_key}"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: """Deserializes the LogAnalyticsInfo from a dictionary.""" return cls( - log_analytics_primary_key=d.get("log_analytics_primary_key", None), - log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), + log_analytics_primary_key=d.get("{log_analytics_primary_key}", None), + log_analytics_workspace_id=d.get("{log_analytics_workspace_id}", None), ) @@ -1909,29 +1908,29 @@ def as_dict(self) -> dict: """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.coordinates is not None: - body["coordinates"] = self.coordinates + body["{coordinates}"] = self.coordinates if self.exclusions: - body["exclusions"] = [v for v in self.exclusions] + body["{exclusions}"] = [v for v in self.exclusions] if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body def as_shallow_dict(self) -> dict: """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.coordinates is not None: - body["coordinates"] = self.coordinates + body["{coordinates}"] = self.coordinates if self.exclusions: - body["exclusions"] = self.exclusions + body["{exclusions}"] = self.exclusions if self.repo is not None: - body["repo"] = self.repo + body["{repo}"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: """Deserializes the MavenLibrary from a dictionary.""" return cls( - coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) + coordinates=d.get("{coordinates}", None), exclusions=d.get("{exclusions}", None), repo=d.get("{repo}", None) ) @@ -1944,20 +1943,20 @@ def as_dict(self) -> dict: """Serializes the NotebookLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the NotebookLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookLibrary: """Deserializes the NotebookLibrary from a dictionary.""" - return cls(path=d.get("path", None)) + return cls(path=d.get("{path}", None)) @dataclass @@ -1977,24 +1976,24 @@ def as_dict(self) -> dict: """Serializes the Notifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.alerts: - body["alerts"] = [v for v in self.alerts] + body["{alerts}"] = [v for v in self.alerts] if self.email_recipients: - body["email_recipients"] = [v for v in self.email_recipients] + body["{email_recipients}"] = [v for v in self.email_recipients] return body def as_shallow_dict(self) -> dict: """Serializes the Notifications into a shallow dictionary of its immediate attributes.""" body = {} if self.alerts: - body["alerts"] = self.alerts + body["{alerts}"] = self.alerts if self.email_recipients: - body["email_recipients"] = self.email_recipients + body["{email_recipients}"] = self.email_recipients return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Notifications: """Deserializes the Notifications from a dictionary.""" - return cls(alerts=d.get("alerts", None), email_recipients=d.get("email_recipients", None)) + return cls(alerts=d.get("{alerts}", None), email_recipients=d.get("{email_recipients}", None)) @dataclass @@ -2055,101 +2054,101 @@ def as_dict(self) -> dict: """Serializes the Origin into a dictionary suitable for use as a JSON request body.""" body = {} if self.batch_id is not None: - body["batch_id"] = self.batch_id + body["{batch_id}"] = self.batch_id if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.dataset_name is not None: - body["dataset_name"] = self.dataset_name + body["{dataset_name}"] = self.dataset_name if self.flow_id is not None: - body["flow_id"] = self.flow_id + body["{flow_id}"] = self.flow_id if self.flow_name is not None: - body["flow_name"] = self.flow_name + body["{flow_name}"] = self.flow_name if self.host is not None: - body["host"] = self.host + body["{host}"] = self.host if self.maintenance_id is not None: - body["maintenance_id"] = self.maintenance_id + body["{maintenance_id}"] = self.maintenance_id if self.materialization_name is not None: - body["materialization_name"] = self.materialization_name + body["{materialization_name}"] = self.materialization_name if self.org_id is not None: - body["org_id"] = self.org_id + body["{org_id}"] = self.org_id if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.pipeline_name is not None: - body["pipeline_name"] = self.pipeline_name + body["{pipeline_name}"] = self.pipeline_name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.request_id is not None: - body["request_id"] = self.request_id + body["{request_id}"] = self.request_id if self.table_id is not None: - body["table_id"] = self.table_id + body["{table_id}"] = self.table_id if self.uc_resource_id is not None: - body["uc_resource_id"] = self.uc_resource_id + body["{uc_resource_id}"] = self.uc_resource_id if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id return body def as_shallow_dict(self) -> dict: """Serializes the Origin into a shallow dictionary of its immediate attributes.""" body = {} if self.batch_id is not None: - body["batch_id"] = self.batch_id + body["{batch_id}"] = self.batch_id if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.dataset_name is not None: - body["dataset_name"] = self.dataset_name + body["{dataset_name}"] = self.dataset_name if self.flow_id is not None: - body["flow_id"] = self.flow_id + body["{flow_id}"] = self.flow_id if self.flow_name is not None: - body["flow_name"] = self.flow_name + body["{flow_name}"] = self.flow_name if self.host is not None: - body["host"] = self.host + body["{host}"] = self.host if self.maintenance_id is not None: - body["maintenance_id"] = self.maintenance_id + body["{maintenance_id}"] = self.maintenance_id if self.materialization_name is not None: - body["materialization_name"] = self.materialization_name + body["{materialization_name}"] = self.materialization_name if self.org_id is not None: - body["org_id"] = self.org_id + body["{org_id}"] = self.org_id if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.pipeline_name is not None: - body["pipeline_name"] = self.pipeline_name + body["{pipeline_name}"] = self.pipeline_name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.request_id is not None: - body["request_id"] = self.request_id + body["{request_id}"] = self.request_id if self.table_id is not None: - body["table_id"] = self.table_id + body["{table_id}"] = self.table_id if self.uc_resource_id is not None: - body["uc_resource_id"] = self.uc_resource_id + body["{uc_resource_id}"] = self.uc_resource_id if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Origin: """Deserializes the Origin from a dictionary.""" return cls( - batch_id=d.get("batch_id", None), - cloud=d.get("cloud", None), - cluster_id=d.get("cluster_id", None), - dataset_name=d.get("dataset_name", None), - flow_id=d.get("flow_id", None), - flow_name=d.get("flow_name", None), - host=d.get("host", None), - maintenance_id=d.get("maintenance_id", None), - materialization_name=d.get("materialization_name", None), - org_id=d.get("org_id", None), - pipeline_id=d.get("pipeline_id", None), - pipeline_name=d.get("pipeline_name", None), - region=d.get("region", None), - request_id=d.get("request_id", None), - table_id=d.get("table_id", None), - uc_resource_id=d.get("uc_resource_id", None), - update_id=d.get("update_id", None), + batch_id=d.get("{batch_id}", None), + cloud=d.get("{cloud}", None), + cluster_id=d.get("{cluster_id}", None), + dataset_name=d.get("{dataset_name}", None), + flow_id=d.get("{flow_id}", None), + flow_name=d.get("{flow_name}", None), + host=d.get("{host}", None), + maintenance_id=d.get("{maintenance_id}", None), + materialization_name=d.get("{materialization_name}", None), + org_id=d.get("{org_id}", None), + pipeline_id=d.get("{pipeline_id}", None), + pipeline_name=d.get("{pipeline_name}", None), + region=d.get("{region}", None), + request_id=d.get("{request_id}", None), + table_id=d.get("{table_id}", None), + uc_resource_id=d.get("{uc_resource_id}", None), + update_id=d.get("{update_id}", None), ) @@ -2171,36 +2170,36 @@ def as_dict(self) -> dict: """Serializes the PipelineAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the PipelineAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineAccessControlRequest: """Deserializes the PipelineAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", PipelinePermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", PipelinePermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -2225,41 +2224,41 @@ def as_dict(self) -> dict: """Serializes the PipelineAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the PipelineAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineAccessControlResponse: """Deserializes the PipelineAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", PipelinePermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", PipelinePermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -2369,111 +2368,111 @@ def as_dict(self) -> dict: """Serializes the PipelineCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() + body["{autoscale}"] = self.autoscale.as_dict() if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() + body["{aws_attributes}"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() + body["{azure_attributes}"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() + body["{gcp_attributes}"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] return body def as_shallow_dict(self) -> dict: """Serializes the PipelineCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values + body["{apply_policy_default_values}"] = self.apply_policy_default_values if self.autoscale: - body["autoscale"] = self.autoscale + body["{autoscale}"] = self.autoscale if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes + body["{aws_attributes}"] = self.aws_attributes if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes + body["{azure_attributes}"] = self.azure_attributes if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf + body["{cluster_log_conf}"] = self.cluster_log_conf if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id + body["{driver_instance_pool_id}"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id + body["{driver_node_type_id}"] = self.driver_node_type_id if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes + body["{gcp_attributes}"] = self.gcp_attributes if self.init_scripts: - body["init_scripts"] = self.init_scripts + body["{init_scripts}"] = self.init_scripts if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id + body["{instance_pool_id}"] = self.instance_pool_id if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id + body["{node_type_id}"] = self.node_type_id if self.num_workers is not None: - body["num_workers"] = self.num_workers + body["{num_workers}"] = self.num_workers if self.policy_id is not None: - body["policy_id"] = self.policy_id + body["{policy_id}"] = self.policy_id if self.spark_conf: - body["spark_conf"] = self.spark_conf + body["{spark_conf}"] = self.spark_conf if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars + body["{spark_env_vars}"] = self.spark_env_vars if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys + body["{ssh_public_keys}"] = self.ssh_public_keys return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineCluster: """Deserializes the PipelineCluster from a dictionary.""" return cls( - apply_policy_default_values=d.get("apply_policy_default_values", None), - autoscale=_from_dict(d, "autoscale", PipelineClusterAutoscale), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - custom_tags=d.get("custom_tags", None), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - label=d.get("label", None), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - ssh_public_keys=d.get("ssh_public_keys", None), + apply_policy_default_values=d.get("{apply_policy_default_values}", None), + autoscale=_from_dict(d, "{autoscale}", PipelineClusterAutoscale), + aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), + azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), + cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), + custom_tags=d.get("{custom_tags}", None), + driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), + driver_node_type_id=d.get("{driver_node_type_id}", None), + enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), + gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), + init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), + instance_pool_id=d.get("{instance_pool_id}", None), + label=d.get("{label}", None), + node_type_id=d.get("{node_type_id}", None), + num_workers=d.get("{num_workers}", None), + policy_id=d.get("{policy_id}", None), + spark_conf=d.get("{spark_conf}", None), + spark_env_vars=d.get("{spark_env_vars}", None), + ssh_public_keys=d.get("{ssh_public_keys}", None), ) @@ -2497,31 +2496,31 @@ def as_dict(self) -> dict: """Serializes the PipelineClusterAutoscale into a dictionary suitable for use as a JSON request body.""" body = {} if self.max_workers is not None: - body["max_workers"] = self.max_workers + body["{max_workers}"] = self.max_workers if self.min_workers is not None: - body["min_workers"] = self.min_workers + body["{min_workers}"] = self.min_workers if self.mode is not None: - body["mode"] = self.mode.value + body["{mode}"] = self.mode.value return body def as_shallow_dict(self) -> dict: """Serializes the PipelineClusterAutoscale into a shallow dictionary of its immediate attributes.""" body = {} if self.max_workers is not None: - body["max_workers"] = self.max_workers + body["{max_workers}"] = self.max_workers if self.min_workers is not None: - body["min_workers"] = self.min_workers + body["{min_workers}"] = self.min_workers if self.mode is not None: - body["mode"] = self.mode + body["{mode}"] = self.mode return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineClusterAutoscale: """Deserializes the PipelineClusterAutoscale from a dictionary.""" return cls( - max_workers=d.get("max_workers", None), - min_workers=d.get("min_workers", None), - mode=_enum(d, "mode", PipelineClusterAutoscaleMode), + max_workers=d.get("{max_workers}", None), + min_workers=d.get("{min_workers}", None), + mode=_enum(d, "{mode}", PipelineClusterAutoscaleMode), ) @@ -2547,24 +2546,24 @@ def as_dict(self) -> dict: """Serializes the PipelineDeployment into a dictionary suitable for use as a JSON request body.""" body = {} if self.kind is not None: - body["kind"] = self.kind.value + body["{kind}"] = self.kind.value if self.metadata_file_path is not None: - body["metadata_file_path"] = self.metadata_file_path + body["{metadata_file_path}"] = self.metadata_file_path return body def as_shallow_dict(self) -> dict: """Serializes the PipelineDeployment into a shallow dictionary of its immediate attributes.""" body = {} if self.kind is not None: - body["kind"] = self.kind + body["{kind}"] = self.kind if self.metadata_file_path is not None: - body["metadata_file_path"] = self.metadata_file_path + body["{metadata_file_path}"] = self.metadata_file_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineDeployment: """Deserializes the PipelineDeployment from a dictionary.""" - return cls(kind=_enum(d, "kind", DeploymentKind), metadata_file_path=d.get("metadata_file_path", None)) + return cls(kind=_enum(d, "{kind}", DeploymentKind), metadata_file_path=d.get("{metadata_file_path}", None)) @dataclass @@ -2600,61 +2599,61 @@ def as_dict(self) -> dict: """Serializes the PipelineEvent into a dictionary suitable for use as a JSON request body.""" body = {} if self.error: - body["error"] = self.error.as_dict() + body["{error}"] = self.error.as_dict() if self.event_type is not None: - body["event_type"] = self.event_type + body["{event_type}"] = self.event_type if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.level is not None: - body["level"] = self.level.value + body["{level}"] = self.level.value if self.maturity_level is not None: - body["maturity_level"] = self.maturity_level.value + body["{maturity_level}"] = self.maturity_level.value if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.origin: - body["origin"] = self.origin.as_dict() + body["{origin}"] = self.origin.as_dict() if self.sequence: - body["sequence"] = self.sequence.as_dict() + body["{sequence}"] = self.sequence.as_dict() if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body def as_shallow_dict(self) -> dict: """Serializes the PipelineEvent into a shallow dictionary of its immediate attributes.""" body = {} if self.error: - body["error"] = self.error + body["{error}"] = self.error if self.event_type is not None: - body["event_type"] = self.event_type + body["{event_type}"] = self.event_type if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.level is not None: - body["level"] = self.level + body["{level}"] = self.level if self.maturity_level is not None: - body["maturity_level"] = self.maturity_level + body["{maturity_level}"] = self.maturity_level if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.origin: - body["origin"] = self.origin + body["{origin}"] = self.origin if self.sequence: - body["sequence"] = self.sequence + body["{sequence}"] = self.sequence if self.timestamp is not None: - body["timestamp"] = self.timestamp + body["{timestamp}"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineEvent: """Deserializes the PipelineEvent from a dictionary.""" return cls( - error=_from_dict(d, "error", ErrorDetail), - event_type=d.get("event_type", None), - id=d.get("id", None), - level=_enum(d, "level", EventLevel), - maturity_level=_enum(d, "maturity_level", MaturityLevel), - message=d.get("message", None), - origin=_from_dict(d, "origin", Origin), - sequence=_from_dict(d, "sequence", Sequencing), - timestamp=d.get("timestamp", None), + error=_from_dict(d, "{error}", ErrorDetail), + event_type=d.get("{event_type}", None), + id=d.get("{id}", None), + level=_enum(d, "{level}", EventLevel), + maturity_level=_enum(d, "{maturity_level}", MaturityLevel), + message=d.get("{message}", None), + origin=_from_dict(d, "{origin}", Origin), + sequence=_from_dict(d, "{sequence}", Sequencing), + timestamp=d.get("{timestamp}", None), ) @@ -2679,41 +2678,41 @@ def as_dict(self) -> dict: """Serializes the PipelineLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.file: - body["file"] = self.file.as_dict() + body["{file}"] = self.file.as_dict() if self.jar is not None: - body["jar"] = self.jar + body["{jar}"] = self.jar if self.maven: - body["maven"] = self.maven.as_dict() + body["{maven}"] = self.maven.as_dict() if self.notebook: - body["notebook"] = self.notebook.as_dict() + body["{notebook}"] = self.notebook.as_dict() if self.whl is not None: - body["whl"] = self.whl + body["{whl}"] = self.whl return body def as_shallow_dict(self) -> dict: """Serializes the PipelineLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.file: - body["file"] = self.file + body["{file}"] = self.file if self.jar is not None: - body["jar"] = self.jar + body["{jar}"] = self.jar if self.maven: - body["maven"] = self.maven + body["{maven}"] = self.maven if self.notebook: - body["notebook"] = self.notebook + body["{notebook}"] = self.notebook if self.whl is not None: - body["whl"] = self.whl + body["{whl}"] = self.whl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineLibrary: """Deserializes the PipelineLibrary from a dictionary.""" return cls( - file=_from_dict(d, "file", FileLibrary), - jar=d.get("jar", None), - maven=_from_dict(d, "maven", MavenLibrary), - notebook=_from_dict(d, "notebook", NotebookLibrary), - whl=d.get("whl", None), + file=_from_dict(d, "{file}", FileLibrary), + jar=d.get("{jar}", None), + maven=_from_dict(d, "{maven}", MavenLibrary), + notebook=_from_dict(d, "{notebook}", NotebookLibrary), + whl=d.get("{whl}", None), ) @@ -2730,31 +2729,31 @@ def as_dict(self) -> dict: """Serializes the PipelinePermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the PipelinePermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermission: """Deserializes the PipelinePermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", PipelinePermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", PipelinePermissionLevel), ) @@ -2779,31 +2778,31 @@ def as_dict(self) -> dict: """Serializes the PipelinePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the PipelinePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissions: """Deserializes the PipelinePermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", PipelineAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", PipelineAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -2818,26 +2817,26 @@ def as_dict(self) -> dict: """Serializes the PipelinePermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the PipelinePermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissionsDescription: """Deserializes the PipelinePermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", PipelinePermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", PipelinePermissionLevel), ) @@ -2852,26 +2851,26 @@ def as_dict(self) -> dict: """Serializes the PipelinePermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id return body def as_shallow_dict(self) -> dict: """Serializes the PipelinePermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissionsRequest: """Deserializes the PipelinePermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", PipelineAccessControlRequest), - pipeline_id=d.get("pipeline_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", PipelineAccessControlRequest), + pipeline_id=d.get("{pipeline_id}", None), ) @@ -2959,136 +2958,136 @@ def as_dict(self) -> dict: """Serializes the PipelineSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.channel is not None: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.clusters: - body["clusters"] = [v.as_dict() for v in self.clusters] + body["{clusters}"] = [v.as_dict() for v in self.clusters] if self.configuration: - body["configuration"] = self.configuration + body["{configuration}"] = self.configuration if self.continuous is not None: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment.as_dict() + body["{deployment}"] = self.deployment.as_dict() if self.development is not None: - body["development"] = self.development + body["{development}"] = self.development if self.edition is not None: - body["edition"] = self.edition + body["{edition}"] = self.edition if self.event_log: - body["event_log"] = self.event_log.as_dict() + body["{event_log}"] = self.event_log.as_dict() if self.filters: - body["filters"] = self.filters.as_dict() + body["{filters}"] = self.filters.as_dict() if self.gateway_definition: - body["gateway_definition"] = self.gateway_definition.as_dict() + body["{gateway_definition}"] = self.gateway_definition.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.ingestion_definition: - body["ingestion_definition"] = self.ingestion_definition.as_dict() + body["{ingestion_definition}"] = self.ingestion_definition.as_dict() if self.libraries: - body["libraries"] = [v.as_dict() for v in self.libraries] + body["{libraries}"] = [v.as_dict() for v in self.libraries] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notifications: - body["notifications"] = [v.as_dict() for v in self.notifications] + body["{notifications}"] = [v.as_dict() for v in self.notifications] if self.photon is not None: - body["photon"] = self.photon + body["{photon}"] = self.photon if self.restart_window: - body["restart_window"] = self.restart_window.as_dict() + body["{restart_window}"] = self.restart_window.as_dict() if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.serverless is not None: - body["serverless"] = self.serverless + body["{serverless}"] = self.serverless if self.storage is not None: - body["storage"] = self.storage + body["{storage}"] = self.storage if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target if self.trigger: - body["trigger"] = self.trigger.as_dict() + body["{trigger}"] = self.trigger.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the PipelineSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.channel is not None: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.clusters: - body["clusters"] = self.clusters + body["{clusters}"] = self.clusters if self.configuration: - body["configuration"] = self.configuration + body["{configuration}"] = self.configuration if self.continuous is not None: - body["continuous"] = self.continuous + body["{continuous}"] = self.continuous if self.deployment: - body["deployment"] = self.deployment + body["{deployment}"] = self.deployment if self.development is not None: - body["development"] = self.development + body["{development}"] = self.development if self.edition is not None: - body["edition"] = self.edition + body["{edition}"] = self.edition if self.event_log: - body["event_log"] = self.event_log + body["{event_log}"] = self.event_log if self.filters: - body["filters"] = self.filters + body["{filters}"] = self.filters if self.gateway_definition: - body["gateway_definition"] = self.gateway_definition + body["{gateway_definition}"] = self.gateway_definition if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.ingestion_definition: - body["ingestion_definition"] = self.ingestion_definition + body["{ingestion_definition}"] = self.ingestion_definition if self.libraries: - body["libraries"] = self.libraries + body["{libraries}"] = self.libraries if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.notifications: - body["notifications"] = self.notifications + body["{notifications}"] = self.notifications if self.photon is not None: - body["photon"] = self.photon + body["{photon}"] = self.photon if self.restart_window: - body["restart_window"] = self.restart_window + body["{restart_window}"] = self.restart_window if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.serverless is not None: - body["serverless"] = self.serverless + body["{serverless}"] = self.serverless if self.storage is not None: - body["storage"] = self.storage + body["{storage}"] = self.storage if self.target is not None: - body["target"] = self.target + body["{target}"] = self.target if self.trigger: - body["trigger"] = self.trigger + body["{trigger}"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineSpec: """Deserializes the PipelineSpec from a dictionary.""" return cls( - budget_policy_id=d.get("budget_policy_id", None), - catalog=d.get("catalog", None), - channel=d.get("channel", None), - clusters=_repeated_dict(d, "clusters", PipelineCluster), - configuration=d.get("configuration", None), - continuous=d.get("continuous", None), - deployment=_from_dict(d, "deployment", PipelineDeployment), - development=d.get("development", None), - edition=d.get("edition", None), - event_log=_from_dict(d, "event_log", EventLogSpec), - filters=_from_dict(d, "filters", Filters), - gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), - id=d.get("id", None), - ingestion_definition=_from_dict(d, "ingestion_definition", IngestionPipelineDefinition), - libraries=_repeated_dict(d, "libraries", PipelineLibrary), - name=d.get("name", None), - notifications=_repeated_dict(d, "notifications", Notifications), - photon=d.get("photon", None), - restart_window=_from_dict(d, "restart_window", RestartWindow), - schema=d.get("schema", None), - serverless=d.get("serverless", None), - storage=d.get("storage", None), - target=d.get("target", None), - trigger=_from_dict(d, "trigger", PipelineTrigger), + budget_policy_id=d.get("{budget_policy_id}", None), + catalog=d.get("{catalog}", None), + channel=d.get("{channel}", None), + clusters=_repeated_dict(d, "{clusters}", PipelineCluster), + configuration=d.get("{configuration}", None), + continuous=d.get("{continuous}", None), + deployment=_from_dict(d, "{deployment}", PipelineDeployment), + development=d.get("{development}", None), + edition=d.get("{edition}", None), + event_log=_from_dict(d, "{event_log}", EventLogSpec), + filters=_from_dict(d, "{filters}", Filters), + gateway_definition=_from_dict(d, "{gateway_definition}", IngestionGatewayPipelineDefinition), + id=d.get("{id}", None), + ingestion_definition=_from_dict(d, "{ingestion_definition}", IngestionPipelineDefinition), + libraries=_repeated_dict(d, "{libraries}", PipelineLibrary), + name=d.get("{name}", None), + notifications=_repeated_dict(d, "{notifications}", Notifications), + photon=d.get("{photon}", None), + restart_window=_from_dict(d, "{restart_window}", RestartWindow), + schema=d.get("{schema}", None), + serverless=d.get("{serverless}", None), + storage=d.get("{storage}", None), + target=d.get("{target}", None), + trigger=_from_dict(d, "{trigger}", PipelineTrigger), ) @@ -3137,56 +3136,56 @@ def as_dict(self) -> dict: """Serializes the PipelineStateInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.health is not None: - body["health"] = self.health.value + body["{health}"] = self.health.value if self.latest_updates: - body["latest_updates"] = [v.as_dict() for v in self.latest_updates] + body["{latest_updates}"] = [v.as_dict() for v in self.latest_updates] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.run_as_user_name is not None: - body["run_as_user_name"] = self.run_as_user_name + body["{run_as_user_name}"] = self.run_as_user_name if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the PipelineStateInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.creator_user_name is not None: - body["creator_user_name"] = self.creator_user_name + body["{creator_user_name}"] = self.creator_user_name if self.health is not None: - body["health"] = self.health + body["{health}"] = self.health if self.latest_updates: - body["latest_updates"] = self.latest_updates + body["{latest_updates}"] = self.latest_updates if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.run_as_user_name is not None: - body["run_as_user_name"] = self.run_as_user_name + body["{run_as_user_name}"] = self.run_as_user_name if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineStateInfo: """Deserializes the PipelineStateInfo from a dictionary.""" return cls( - cluster_id=d.get("cluster_id", None), - creator_user_name=d.get("creator_user_name", None), - health=_enum(d, "health", PipelineStateInfoHealth), - latest_updates=_repeated_dict(d, "latest_updates", UpdateStateInfo), - name=d.get("name", None), - pipeline_id=d.get("pipeline_id", None), - run_as_user_name=d.get("run_as_user_name", None), - state=_enum(d, "state", PipelineState), + cluster_id=d.get("{cluster_id}", None), + creator_user_name=d.get("{creator_user_name}", None), + health=_enum(d, "{health}", PipelineStateInfoHealth), + latest_updates=_repeated_dict(d, "{latest_updates}", UpdateStateInfo), + name=d.get("{name}", None), + pipeline_id=d.get("{pipeline_id}", None), + run_as_user_name=d.get("{run_as_user_name}", None), + state=_enum(d, "{state}", PipelineState), ) @@ -3207,24 +3206,24 @@ def as_dict(self) -> dict: """Serializes the PipelineTrigger into a dictionary suitable for use as a JSON request body.""" body = {} if self.cron: - body["cron"] = self.cron.as_dict() + body["{cron}"] = self.cron.as_dict() if self.manual: - body["manual"] = self.manual.as_dict() + body["{manual}"] = self.manual.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the PipelineTrigger into a shallow dictionary of its immediate attributes.""" body = {} if self.cron: - body["cron"] = self.cron + body["{cron}"] = self.cron if self.manual: - body["manual"] = self.manual + body["{manual}"] = self.manual return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineTrigger: """Deserializes the PipelineTrigger from a dictionary.""" - return cls(cron=_from_dict(d, "cron", CronTrigger), manual=_from_dict(d, "manual", ManualTrigger)) + return cls(cron=_from_dict(d, "{cron}", CronTrigger), manual=_from_dict(d, "{manual}", ManualTrigger)) @dataclass @@ -3249,41 +3248,41 @@ def as_dict(self) -> dict: """Serializes the ReportSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_catalog is not None: - body["destination_catalog"] = self.destination_catalog + body["{destination_catalog}"] = self.destination_catalog if self.destination_schema is not None: - body["destination_schema"] = self.destination_schema + body["{destination_schema}"] = self.destination_schema if self.destination_table is not None: - body["destination_table"] = self.destination_table + body["{destination_table}"] = self.destination_table if self.source_url is not None: - body["source_url"] = self.source_url + body["{source_url}"] = self.source_url if self.table_configuration: - body["table_configuration"] = self.table_configuration.as_dict() + body["{table_configuration}"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ReportSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_catalog is not None: - body["destination_catalog"] = self.destination_catalog + body["{destination_catalog}"] = self.destination_catalog if self.destination_schema is not None: - body["destination_schema"] = self.destination_schema + body["{destination_schema}"] = self.destination_schema if self.destination_table is not None: - body["destination_table"] = self.destination_table + body["{destination_table}"] = self.destination_table if self.source_url is not None: - body["source_url"] = self.source_url + body["{source_url}"] = self.source_url if self.table_configuration: - body["table_configuration"] = self.table_configuration + body["{table_configuration}"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ReportSpec: """Deserializes the ReportSpec from a dictionary.""" return cls( - destination_catalog=d.get("destination_catalog", None), - destination_schema=d.get("destination_schema", None), - destination_table=d.get("destination_table", None), - source_url=d.get("source_url", None), - table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), + destination_catalog=d.get("{destination_catalog}", None), + destination_schema=d.get("{destination_schema}", None), + destination_table=d.get("{destination_table}", None), + source_url=d.get("{source_url}", None), + table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), ) @@ -3306,31 +3305,31 @@ def as_dict(self) -> dict: """Serializes the RestartWindow into a dictionary suitable for use as a JSON request body.""" body = {} if self.days_of_week: - body["days_of_week"] = [v.value for v in self.days_of_week] + body["{days_of_week}"] = [v.value for v in self.days_of_week] if self.start_hour is not None: - body["start_hour"] = self.start_hour + body["{start_hour}"] = self.start_hour if self.time_zone_id is not None: - body["time_zone_id"] = self.time_zone_id + body["{time_zone_id}"] = self.time_zone_id return body def as_shallow_dict(self) -> dict: """Serializes the RestartWindow into a shallow dictionary of its immediate attributes.""" body = {} if self.days_of_week: - body["days_of_week"] = self.days_of_week + body["{days_of_week}"] = self.days_of_week if self.start_hour is not None: - body["start_hour"] = self.start_hour + body["{start_hour}"] = self.start_hour if self.time_zone_id is not None: - body["time_zone_id"] = self.time_zone_id + body["{time_zone_id}"] = self.time_zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestartWindow: """Deserializes the RestartWindow from a dictionary.""" return cls( - days_of_week=_repeated_enum(d, "days_of_week", DayOfWeek), - start_hour=d.get("start_hour", None), - time_zone_id=d.get("time_zone_id", None), + days_of_week=_repeated_enum(d, "{days_of_week}", DayOfWeek), + start_hour=d.get("{start_hour}", None), + time_zone_id=d.get("{time_zone_id}", None), ) @@ -3354,24 +3353,24 @@ def as_dict(self) -> dict: """Serializes the RunAs into a dictionary suitable for use as a JSON request body.""" body = {} if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the RunAs into a shallow dictionary of its immediate attributes.""" body = {} if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunAs: """Deserializes the RunAs from a dictionary.""" - return cls(service_principal_name=d.get("service_principal_name", None), user_name=d.get("user_name", None)) + return cls(service_principal_name=d.get("{service_principal_name}", None), user_name=d.get("{user_name}", None)) @dataclass @@ -3415,51 +3414,51 @@ def as_dict(self) -> dict: """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl + body["{canned_acl}"] = self.canned_acl if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption + body["{enable_encryption}"] = self.enable_encryption if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type + body["{encryption_type}"] = self.encryption_type if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.kms_key is not None: - body["kms_key"] = self.kms_key + body["{kms_key}"] = self.kms_key if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl + body["{canned_acl}"] = self.canned_acl if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption + body["{enable_encryption}"] = self.enable_encryption if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type + body["{encryption_type}"] = self.encryption_type if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.kms_key is not None: - body["kms_key"] = self.kms_key + body["{kms_key}"] = self.kms_key if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: """Deserializes the S3StorageInfo from a dictionary.""" return cls( - canned_acl=d.get("canned_acl", None), - destination=d.get("destination", None), - enable_encryption=d.get("enable_encryption", None), - encryption_type=d.get("encryption_type", None), - endpoint=d.get("endpoint", None), - kms_key=d.get("kms_key", None), - region=d.get("region", None), + canned_acl=d.get("{canned_acl}", None), + destination=d.get("{destination}", None), + enable_encryption=d.get("{enable_encryption}", None), + encryption_type=d.get("{encryption_type}", None), + endpoint=d.get("{endpoint}", None), + kms_key=d.get("{kms_key}", None), + region=d.get("{region}", None), ) @@ -3488,41 +3487,41 @@ def as_dict(self) -> dict: """Serializes the SchemaSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_catalog is not None: - body["destination_catalog"] = self.destination_catalog + body["{destination_catalog}"] = self.destination_catalog if self.destination_schema is not None: - body["destination_schema"] = self.destination_schema + body["{destination_schema}"] = self.destination_schema if self.source_catalog is not None: - body["source_catalog"] = self.source_catalog + body["{source_catalog}"] = self.source_catalog if self.source_schema is not None: - body["source_schema"] = self.source_schema + body["{source_schema}"] = self.source_schema if self.table_configuration: - body["table_configuration"] = self.table_configuration.as_dict() + body["{table_configuration}"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the SchemaSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_catalog is not None: - body["destination_catalog"] = self.destination_catalog + body["{destination_catalog}"] = self.destination_catalog if self.destination_schema is not None: - body["destination_schema"] = self.destination_schema + body["{destination_schema}"] = self.destination_schema if self.source_catalog is not None: - body["source_catalog"] = self.source_catalog + body["{source_catalog}"] = self.source_catalog if self.source_schema is not None: - body["source_schema"] = self.source_schema + body["{source_schema}"] = self.source_schema if self.table_configuration: - body["table_configuration"] = self.table_configuration + body["{table_configuration}"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SchemaSpec: """Deserializes the SchemaSpec from a dictionary.""" return cls( - destination_catalog=d.get("destination_catalog", None), - destination_schema=d.get("destination_schema", None), - source_catalog=d.get("source_catalog", None), - source_schema=d.get("source_schema", None), - table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), + destination_catalog=d.get("{destination_catalog}", None), + destination_schema=d.get("{destination_schema}", None), + source_catalog=d.get("{source_catalog}", None), + source_schema=d.get("{source_schema}", None), + table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), ) @@ -3538,26 +3537,26 @@ def as_dict(self) -> dict: """Serializes the Sequencing into a dictionary suitable for use as a JSON request body.""" body = {} if self.control_plane_seq_no is not None: - body["control_plane_seq_no"] = self.control_plane_seq_no + body["{control_plane_seq_no}"] = self.control_plane_seq_no if self.data_plane_id: - body["data_plane_id"] = self.data_plane_id.as_dict() + body["{data_plane_id}"] = self.data_plane_id.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Sequencing into a shallow dictionary of its immediate attributes.""" body = {} if self.control_plane_seq_no is not None: - body["control_plane_seq_no"] = self.control_plane_seq_no + body["{control_plane_seq_no}"] = self.control_plane_seq_no if self.data_plane_id: - body["data_plane_id"] = self.data_plane_id + body["{data_plane_id}"] = self.data_plane_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Sequencing: """Deserializes the Sequencing from a dictionary.""" return cls( - control_plane_seq_no=d.get("control_plane_seq_no", None), - data_plane_id=_from_dict(d, "data_plane_id", DataPlaneId), + control_plane_seq_no=d.get("{control_plane_seq_no}", None), + data_plane_id=_from_dict(d, "{data_plane_id}", DataPlaneId), ) @@ -3576,31 +3575,31 @@ def as_dict(self) -> dict: """Serializes the SerializedException into a dictionary suitable for use as a JSON request body.""" body = {} if self.class_name is not None: - body["class_name"] = self.class_name + body["{class_name}"] = self.class_name if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.stack: - body["stack"] = [v.as_dict() for v in self.stack] + body["{stack}"] = [v.as_dict() for v in self.stack] return body def as_shallow_dict(self) -> dict: """Serializes the SerializedException into a shallow dictionary of its immediate attributes.""" body = {} if self.class_name is not None: - body["class_name"] = self.class_name + body["{class_name}"] = self.class_name if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.stack: - body["stack"] = self.stack + body["{stack}"] = self.stack return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SerializedException: """Deserializes the SerializedException from a dictionary.""" return cls( - class_name=d.get("class_name", None), - message=d.get("message", None), - stack=_repeated_dict(d, "stack", StackFrame), + class_name=d.get("{class_name}", None), + message=d.get("{message}", None), + stack=_repeated_dict(d, "{stack}", StackFrame), ) @@ -3622,36 +3621,36 @@ def as_dict(self) -> dict: """Serializes the StackFrame into a dictionary suitable for use as a JSON request body.""" body = {} if self.declaring_class is not None: - body["declaring_class"] = self.declaring_class + body["{declaring_class}"] = self.declaring_class if self.file_name is not None: - body["file_name"] = self.file_name + body["{file_name}"] = self.file_name if self.line_number is not None: - body["line_number"] = self.line_number + body["{line_number}"] = self.line_number if self.method_name is not None: - body["method_name"] = self.method_name + body["{method_name}"] = self.method_name return body def as_shallow_dict(self) -> dict: """Serializes the StackFrame into a shallow dictionary of its immediate attributes.""" body = {} if self.declaring_class is not None: - body["declaring_class"] = self.declaring_class + body["{declaring_class}"] = self.declaring_class if self.file_name is not None: - body["file_name"] = self.file_name + body["{file_name}"] = self.file_name if self.line_number is not None: - body["line_number"] = self.line_number + body["{line_number}"] = self.line_number if self.method_name is not None: - body["method_name"] = self.method_name + body["{method_name}"] = self.method_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StackFrame: """Deserializes the StackFrame from a dictionary.""" return cls( - declaring_class=d.get("declaring_class", None), - file_name=d.get("file_name", None), - line_number=d.get("line_number", None), - method_name=d.get("method_name", None), + declaring_class=d.get("{declaring_class}", None), + file_name=d.get("{file_name}", None), + line_number=d.get("{line_number}", None), + method_name=d.get("{method_name}", None), ) @@ -3682,46 +3681,46 @@ def as_dict(self) -> dict: """Serializes the StartUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["cause"] = self.cause.value + body["{cause}"] = self.cause.value if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh if self.full_refresh_selection: - body["full_refresh_selection"] = [v for v in self.full_refresh_selection] + body["{full_refresh_selection}"] = [v for v in self.full_refresh_selection] if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.refresh_selection: - body["refresh_selection"] = [v for v in self.refresh_selection] + body["{refresh_selection}"] = [v for v in self.refresh_selection] if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body def as_shallow_dict(self) -> dict: """Serializes the StartUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["cause"] = self.cause + body["{cause}"] = self.cause if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh if self.full_refresh_selection: - body["full_refresh_selection"] = self.full_refresh_selection + body["{full_refresh_selection}"] = self.full_refresh_selection if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.refresh_selection: - body["refresh_selection"] = self.refresh_selection + body["{refresh_selection}"] = self.refresh_selection if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StartUpdate: """Deserializes the StartUpdate from a dictionary.""" return cls( - cause=_enum(d, "cause", StartUpdateCause), - full_refresh=d.get("full_refresh", None), - full_refresh_selection=d.get("full_refresh_selection", None), - pipeline_id=d.get("pipeline_id", None), - refresh_selection=d.get("refresh_selection", None), - validate_only=d.get("validate_only", None), + cause=_enum(d, "{cause}", StartUpdateCause), + full_refresh=d.get("{full_refresh}", None), + full_refresh_selection=d.get("{full_refresh_selection}", None), + pipeline_id=d.get("{pipeline_id}", None), + refresh_selection=d.get("{refresh_selection}", None), + validate_only=d.get("{validate_only}", None), ) @@ -3743,20 +3742,20 @@ def as_dict(self) -> dict: """Serializes the StartUpdateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id return body def as_shallow_dict(self) -> dict: """Serializes the StartUpdateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StartUpdateResponse: """Deserializes the StartUpdateResponse from a dictionary.""" - return cls(update_id=d.get("update_id", None)) + return cls(update_id=d.get("{update_id}", None)) @dataclass @@ -3806,51 +3805,51 @@ def as_dict(self) -> dict: """Serializes the TableSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_catalog is not None: - body["destination_catalog"] = self.destination_catalog + body["{destination_catalog}"] = self.destination_catalog if self.destination_schema is not None: - body["destination_schema"] = self.destination_schema + body["{destination_schema}"] = self.destination_schema if self.destination_table is not None: - body["destination_table"] = self.destination_table + body["{destination_table}"] = self.destination_table if self.source_catalog is not None: - body["source_catalog"] = self.source_catalog + body["{source_catalog}"] = self.source_catalog if self.source_schema is not None: - body["source_schema"] = self.source_schema + body["{source_schema}"] = self.source_schema if self.source_table is not None: - body["source_table"] = self.source_table + body["{source_table}"] = self.source_table if self.table_configuration: - body["table_configuration"] = self.table_configuration.as_dict() + body["{table_configuration}"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the TableSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_catalog is not None: - body["destination_catalog"] = self.destination_catalog + body["{destination_catalog}"] = self.destination_catalog if self.destination_schema is not None: - body["destination_schema"] = self.destination_schema + body["{destination_schema}"] = self.destination_schema if self.destination_table is not None: - body["destination_table"] = self.destination_table + body["{destination_table}"] = self.destination_table if self.source_catalog is not None: - body["source_catalog"] = self.source_catalog + body["{source_catalog}"] = self.source_catalog if self.source_schema is not None: - body["source_schema"] = self.source_schema + body["{source_schema}"] = self.source_schema if self.source_table is not None: - body["source_table"] = self.source_table + body["{source_table}"] = self.source_table if self.table_configuration: - body["table_configuration"] = self.table_configuration + body["{table_configuration}"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableSpec: """Deserializes the TableSpec from a dictionary.""" return cls( - destination_catalog=d.get("destination_catalog", None), - destination_schema=d.get("destination_schema", None), - destination_table=d.get("destination_table", None), - source_catalog=d.get("source_catalog", None), - source_schema=d.get("source_schema", None), - source_table=d.get("source_table", None), - table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), + destination_catalog=d.get("{destination_catalog}", None), + destination_schema=d.get("{destination_schema}", None), + destination_table=d.get("{destination_table}", None), + source_catalog=d.get("{source_catalog}", None), + source_schema=d.get("{source_schema}", None), + source_table=d.get("{source_table}", None), + table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), ) @@ -3874,36 +3873,36 @@ def as_dict(self) -> dict: """Serializes the TableSpecificConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.primary_keys: - body["primary_keys"] = [v for v in self.primary_keys] + body["{primary_keys}"] = [v for v in self.primary_keys] if self.salesforce_include_formula_fields is not None: - body["salesforce_include_formula_fields"] = self.salesforce_include_formula_fields + body["{salesforce_include_formula_fields}"] = self.salesforce_include_formula_fields if self.scd_type is not None: - body["scd_type"] = self.scd_type.value + body["{scd_type}"] = self.scd_type.value if self.sequence_by: - body["sequence_by"] = [v for v in self.sequence_by] + body["{sequence_by}"] = [v for v in self.sequence_by] return body def as_shallow_dict(self) -> dict: """Serializes the TableSpecificConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.primary_keys: - body["primary_keys"] = self.primary_keys + body["{primary_keys}"] = self.primary_keys if self.salesforce_include_formula_fields is not None: - body["salesforce_include_formula_fields"] = self.salesforce_include_formula_fields + body["{salesforce_include_formula_fields}"] = self.salesforce_include_formula_fields if self.scd_type is not None: - body["scd_type"] = self.scd_type + body["{scd_type}"] = self.scd_type if self.sequence_by: - body["sequence_by"] = self.sequence_by + body["{sequence_by}"] = self.sequence_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableSpecificConfig: """Deserializes the TableSpecificConfig from a dictionary.""" return cls( - primary_keys=d.get("primary_keys", None), - salesforce_include_formula_fields=d.get("salesforce_include_formula_fields", None), - scd_type=_enum(d, "scd_type", TableSpecificConfigScdType), - sequence_by=d.get("sequence_by", None), + primary_keys=d.get("{primary_keys}", None), + salesforce_include_formula_fields=d.get("{salesforce_include_formula_fields}", None), + scd_type=_enum(d, "{scd_type}", TableSpecificConfigScdType), + sequence_by=d.get("{sequence_by}", None), ) @@ -3959,71 +3958,71 @@ def as_dict(self) -> dict: """Serializes the UpdateInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["cause"] = self.cause.value + body["{cause}"] = self.cause.value if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.config: - body["config"] = self.config.as_dict() + body["{config}"] = self.config.as_dict() if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh if self.full_refresh_selection: - body["full_refresh_selection"] = [v for v in self.full_refresh_selection] + body["{full_refresh_selection}"] = [v for v in self.full_refresh_selection] if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.refresh_selection: - body["refresh_selection"] = [v for v in self.refresh_selection] + body["{refresh_selection}"] = [v for v in self.refresh_selection] if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body def as_shallow_dict(self) -> dict: """Serializes the UpdateInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["cause"] = self.cause + body["{cause}"] = self.cause if self.cluster_id is not None: - body["cluster_id"] = self.cluster_id + body["{cluster_id}"] = self.cluster_id if self.config: - body["config"] = self.config + body["{config}"] = self.config if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.full_refresh is not None: - body["full_refresh"] = self.full_refresh + body["{full_refresh}"] = self.full_refresh if self.full_refresh_selection: - body["full_refresh_selection"] = self.full_refresh_selection + body["{full_refresh_selection}"] = self.full_refresh_selection if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.refresh_selection: - body["refresh_selection"] = self.refresh_selection + body["{refresh_selection}"] = self.refresh_selection if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id if self.validate_only is not None: - body["validate_only"] = self.validate_only + body["{validate_only}"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateInfo: """Deserializes the UpdateInfo from a dictionary.""" return cls( - cause=_enum(d, "cause", UpdateInfoCause), - cluster_id=d.get("cluster_id", None), - config=_from_dict(d, "config", PipelineSpec), - creation_time=d.get("creation_time", None), - full_refresh=d.get("full_refresh", None), - full_refresh_selection=d.get("full_refresh_selection", None), - pipeline_id=d.get("pipeline_id", None), - refresh_selection=d.get("refresh_selection", None), - state=_enum(d, "state", UpdateInfoState), - update_id=d.get("update_id", None), - validate_only=d.get("validate_only", None), + cause=_enum(d, "{cause}", UpdateInfoCause), + cluster_id=d.get("{cluster_id}", None), + config=_from_dict(d, "{config}", PipelineSpec), + creation_time=d.get("{creation_time}", None), + full_refresh=d.get("{full_refresh}", None), + full_refresh_selection=d.get("{full_refresh_selection}", None), + pipeline_id=d.get("{pipeline_id}", None), + refresh_selection=d.get("{refresh_selection}", None), + state=_enum(d, "{state}", UpdateInfoState), + update_id=d.get("{update_id}", None), + validate_only=d.get("{validate_only}", None), ) @@ -4066,31 +4065,31 @@ def as_dict(self) -> dict: """Serializes the UpdateStateInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateStateInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.update_id is not None: - body["update_id"] = self.update_id + body["{update_id}"] = self.update_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateStateInfo: """Deserializes the UpdateStateInfo from a dictionary.""" return cls( - creation_time=d.get("creation_time", None), - state=_enum(d, "state", UpdateStateInfoState), - update_id=d.get("update_id", None), + creation_time=d.get("{creation_time}", None), + state=_enum(d, "{state}", UpdateStateInfoState), + update_id=d.get("{update_id}", None), ) @@ -4121,20 +4120,20 @@ def as_dict(self) -> dict: """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: """Deserializes the VolumesStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) @dataclass @@ -4148,20 +4147,20 @@ def as_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["destination"] = self.destination + body["{destination}"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: """Deserializes the WorkspaceStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) + return cls(destination=d.get("{destination}", None)) class PipelinesAPI: @@ -4179,70 +4178,6 @@ class PipelinesAPI: def __init__(self, api_client): self._api = api_client - def wait_get_pipeline_running( - self, - pipeline_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[GetPipelineResponse], None]] = None, - ) -> GetPipelineResponse: - deadline = time.time() + timeout.total_seconds() - target_states = (PipelineState.RUNNING,) - failure_states = (PipelineState.FAILED,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(pipeline_id=pipeline_id) - status = poll.state - status_message = poll.cause - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach RUNNING, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"pipeline_id={pipeline_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - - def wait_get_pipeline_idle( - self, - pipeline_id: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[GetPipelineResponse], None]] = None, - ) -> GetPipelineResponse: - deadline = time.time() + timeout.total_seconds() - target_states = (PipelineState.IDLE,) - failure_states = (PipelineState.FAILED,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(pipeline_id=pipeline_id) - status = poll.state - status_message = poll.cause - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach IDLE, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"pipeline_id={pipeline_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create( self, *, @@ -4346,62 +4281,62 @@ def create( """ body = {} if allow_duplicate_names is not None: - body["allow_duplicate_names"] = allow_duplicate_names + body["{allow_duplicate_names}"] = allow_duplicate_names if budget_policy_id is not None: - body["budget_policy_id"] = budget_policy_id + body["{budget_policy_id}"] = budget_policy_id if catalog is not None: - body["catalog"] = catalog + body["{catalog}"] = catalog if channel is not None: - body["channel"] = channel + body["{channel}"] = channel if clusters is not None: - body["clusters"] = [v.as_dict() for v in clusters] + body["{clusters}"] = [v.as_dict() for v in clusters] if configuration is not None: - body["configuration"] = configuration + body["{configuration}"] = configuration if continuous is not None: - body["continuous"] = continuous + body["{continuous}"] = continuous if deployment is not None: - body["deployment"] = deployment.as_dict() + body["{deployment}"] = deployment.as_dict() if development is not None: - body["development"] = development + body["{development}"] = development if dry_run is not None: - body["dry_run"] = dry_run + body["{dry_run}"] = dry_run if edition is not None: - body["edition"] = edition + body["{edition}"] = edition if event_log is not None: - body["event_log"] = event_log.as_dict() + body["{event_log}"] = event_log.as_dict() if filters is not None: - body["filters"] = filters.as_dict() + body["{filters}"] = filters.as_dict() if gateway_definition is not None: - body["gateway_definition"] = gateway_definition.as_dict() + body["{gateway_definition}"] = gateway_definition.as_dict() if id is not None: - body["id"] = id + body["{id}"] = id if ingestion_definition is not None: - body["ingestion_definition"] = ingestion_definition.as_dict() + body["{ingestion_definition}"] = ingestion_definition.as_dict() if libraries is not None: - body["libraries"] = [v.as_dict() for v in libraries] + body["{libraries}"] = [v.as_dict() for v in libraries] if name is not None: - body["name"] = name + body["{name}"] = name if notifications is not None: - body["notifications"] = [v.as_dict() for v in notifications] + body["{notifications}"] = [v.as_dict() for v in notifications] if photon is not None: - body["photon"] = photon + body["{photon}"] = photon if restart_window is not None: - body["restart_window"] = restart_window.as_dict() + body["{restart_window}"] = restart_window.as_dict() if run_as is not None: - body["run_as"] = run_as.as_dict() + body["{run_as}"] = run_as.as_dict() if schema is not None: - body["schema"] = schema + body["{schema}"] = schema if serverless is not None: - body["serverless"] = serverless + body["{serverless}"] = serverless if storage is not None: - body["storage"] = storage + body["{storage}"] = storage if target is not None: - body["target"] = target + body["{target}"] = target if trigger is not None: - body["trigger"] = trigger.as_dict() + body["{trigger}"] = trigger.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/pipelines", body=body, headers=headers) @@ -4418,7 +4353,7 @@ def delete(self, pipeline_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/pipelines/{pipeline_id}", headers=headers) @@ -4432,7 +4367,7 @@ def get(self, pipeline_id: str) -> GetPipelineResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}", headers=headers) @@ -4450,7 +4385,7 @@ def get_permission_levels(self, pipeline_id: str) -> GetPipelinePermissionLevels """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/pipelines/{pipeline_id}/permissionLevels", headers=headers) @@ -4468,7 +4403,7 @@ def get_permissions(self, pipeline_id: str) -> PipelinePermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/pipelines/{pipeline_id}", headers=headers) @@ -4488,7 +4423,7 @@ def get_update(self, pipeline_id: str, update_id: str) -> GetUpdateResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/updates/{update_id}", headers=headers) @@ -4532,25 +4467,25 @@ def list_pipeline_events( query = {} if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if order_by is not None: - query["order_by"] = [v for v in order_by] + query["{order_by}"] = [v for v in order_by] if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/events", query=query, headers=headers) - if "events" in json: - for v in json["events"]: + if "{events}" in json: + for v in json["{events}"]: yield PipelineEvent.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_pipelines( self, @@ -4588,25 +4523,25 @@ def list_pipelines( query = {} if filter is not None: - query["filter"] = filter + query["{filter}"] = filter if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if order_by is not None: - query["order_by"] = [v for v in order_by] + query["{order_by}"] = [v for v in order_by] if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/pipelines", query=query, headers=headers) - if "statuses" in json: - for v in json["statuses"]: + if "{statuses}" in json: + for v in json["{statuses}"]: yield PipelineStateInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_updates( self, @@ -4634,13 +4569,13 @@ def list_updates( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token if until_update_id is not None: - query["until_update_id"] = until_update_id + query["{until_update_id}"] = until_update_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/updates", query=query, headers=headers) @@ -4662,10 +4597,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/pipelines/{pipeline_id}", body=body, headers=headers) @@ -4706,18 +4641,18 @@ def start_update( """ body = {} if cause is not None: - body["cause"] = cause.value + body["{cause}"] = cause.value if full_refresh is not None: - body["full_refresh"] = full_refresh + body["{full_refresh}"] = full_refresh if full_refresh_selection is not None: - body["full_refresh_selection"] = [v for v in full_refresh_selection] + body["{full_refresh_selection}"] = [v for v in full_refresh_selection] if refresh_selection is not None: - body["refresh_selection"] = [v for v in refresh_selection] + body["{refresh_selection}"] = [v for v in refresh_selection] if validate_only is not None: - body["validate_only"] = validate_only + body["{validate_only}"] = validate_only headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/updates", body=body, headers=headers) @@ -4733,16 +4668,16 @@ def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: :returns: Long-running operation waiter for :class:`GetPipelineResponse`. - See :method:wait_get_pipeline_idle for more details. + See :method:WaitGetPipelineIdle for more details. """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } op_response = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/stop", headers=headers) return Wait( - self.wait_get_pipeline_idle, response=StopPipelineResponse.from_dict(op_response), pipeline_id=pipeline_id + self.WaitGetPipelineIdle, response=StopPipelineResponse.from_dict(op_response), pipeline_id=pipeline_id ) def stop_and_wait(self, pipeline_id: str, timeout=timedelta(minutes=20)) -> GetPipelineResponse: @@ -4855,62 +4790,62 @@ def update( """ body = {} if allow_duplicate_names is not None: - body["allow_duplicate_names"] = allow_duplicate_names + body["{allow_duplicate_names}"] = allow_duplicate_names if budget_policy_id is not None: - body["budget_policy_id"] = budget_policy_id + body["{budget_policy_id}"] = budget_policy_id if catalog is not None: - body["catalog"] = catalog + body["{catalog}"] = catalog if channel is not None: - body["channel"] = channel + body["{channel}"] = channel if clusters is not None: - body["clusters"] = [v.as_dict() for v in clusters] + body["{clusters}"] = [v.as_dict() for v in clusters] if configuration is not None: - body["configuration"] = configuration + body["{configuration}"] = configuration if continuous is not None: - body["continuous"] = continuous + body["{continuous}"] = continuous if deployment is not None: - body["deployment"] = deployment.as_dict() + body["{deployment}"] = deployment.as_dict() if development is not None: - body["development"] = development + body["{development}"] = development if edition is not None: - body["edition"] = edition + body["{edition}"] = edition if event_log is not None: - body["event_log"] = event_log.as_dict() + body["{event_log}"] = event_log.as_dict() if expected_last_modified is not None: - body["expected_last_modified"] = expected_last_modified + body["{expected_last_modified}"] = expected_last_modified if filters is not None: - body["filters"] = filters.as_dict() + body["{filters}"] = filters.as_dict() if gateway_definition is not None: - body["gateway_definition"] = gateway_definition.as_dict() + body["{gateway_definition}"] = gateway_definition.as_dict() if id is not None: - body["id"] = id + body["{id}"] = id if ingestion_definition is not None: - body["ingestion_definition"] = ingestion_definition.as_dict() + body["{ingestion_definition}"] = ingestion_definition.as_dict() if libraries is not None: - body["libraries"] = [v.as_dict() for v in libraries] + body["{libraries}"] = [v.as_dict() for v in libraries] if name is not None: - body["name"] = name + body["{name}"] = name if notifications is not None: - body["notifications"] = [v.as_dict() for v in notifications] + body["{notifications}"] = [v.as_dict() for v in notifications] if photon is not None: - body["photon"] = photon + body["{photon}"] = photon if restart_window is not None: - body["restart_window"] = restart_window.as_dict() + body["{restart_window}"] = restart_window.as_dict() if run_as is not None: - body["run_as"] = run_as.as_dict() + body["{run_as}"] = run_as.as_dict() if schema is not None: - body["schema"] = schema + body["{schema}"] = schema if serverless is not None: - body["serverless"] = serverless + body["{serverless}"] = serverless if storage is not None: - body["storage"] = storage + body["{storage}"] = storage if target is not None: - body["target"] = target + body["{target}"] = target if trigger is not None: - body["trigger"] = trigger.as_dict() + body["{trigger}"] = trigger.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/pipelines/{pipeline_id}", body=body, headers=headers) @@ -4930,10 +4865,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/permissions/pipelines/{pipeline_id}", body=body, headers=headers) diff --git a/databricks/sdk/service/provisioning.py b/databricks/sdk/provisioning/v2/impl.py similarity index 77% rename from databricks/sdk/service/provisioning.py rename to databricks/sdk/provisioning/v2/impl.py index d98c44b17..29a45c284 100755 --- a/databricks/sdk/service/provisioning.py +++ b/databricks/sdk/provisioning/v2/impl.py @@ -3,19 +3,16 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -27,20 +24,20 @@ def as_dict(self) -> dict: """Serializes the AwsCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.sts_role: - body["sts_role"] = self.sts_role.as_dict() + body["{sts_role}"] = self.sts_role.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AwsCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.sts_role: - body["sts_role"] = self.sts_role + body["{sts_role}"] = self.sts_role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsCredentials: """Deserializes the AwsCredentials from a dictionary.""" - return cls(sts_role=_from_dict(d, "sts_role", StsRole)) + return cls(sts_role=_from_dict(d, "{sts_role}", StsRole)) @dataclass @@ -63,36 +60,36 @@ def as_dict(self) -> dict: """Serializes the AwsKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.key_alias is not None: - body["key_alias"] = self.key_alias + body["{key_alias}"] = self.key_alias if self.key_arn is not None: - body["key_arn"] = self.key_arn + body["{key_arn}"] = self.key_arn if self.key_region is not None: - body["key_region"] = self.key_region + body["{key_region}"] = self.key_region if self.reuse_key_for_cluster_volumes is not None: - body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes + body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes return body def as_shallow_dict(self) -> dict: """Serializes the AwsKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.key_alias is not None: - body["key_alias"] = self.key_alias + body["{key_alias}"] = self.key_alias if self.key_arn is not None: - body["key_arn"] = self.key_arn + body["{key_arn}"] = self.key_arn if self.key_region is not None: - body["key_region"] = self.key_region + body["{key_region}"] = self.key_region if self.reuse_key_for_cluster_volumes is not None: - body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes + body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsKeyInfo: """Deserializes the AwsKeyInfo from a dictionary.""" return cls( - key_alias=d.get("key_alias", None), - key_arn=d.get("key_arn", None), - key_region=d.get("key_region", None), - reuse_key_for_cluster_volumes=d.get("reuse_key_for_cluster_volumes", None), + key_alias=d.get("{key_alias}", None), + key_arn=d.get("{key_arn}", None), + key_region=d.get("{key_region}", None), + reuse_key_for_cluster_volumes=d.get("{reuse_key_for_cluster_volumes}", None), ) @@ -108,24 +105,24 @@ def as_dict(self) -> dict: """Serializes the AzureWorkspaceInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.resource_group is not None: - body["resource_group"] = self.resource_group + body["{resource_group}"] = self.resource_group if self.subscription_id is not None: - body["subscription_id"] = self.subscription_id + body["{subscription_id}"] = self.subscription_id return body def as_shallow_dict(self) -> dict: """Serializes the AzureWorkspaceInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.resource_group is not None: - body["resource_group"] = self.resource_group + body["{resource_group}"] = self.resource_group if self.subscription_id is not None: - body["subscription_id"] = self.subscription_id + body["{subscription_id}"] = self.subscription_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureWorkspaceInfo: """Deserializes the AzureWorkspaceInfo from a dictionary.""" - return cls(resource_group=d.get("resource_group", None), subscription_id=d.get("subscription_id", None)) + return cls(resource_group=d.get("{resource_group}", None), subscription_id=d.get("{subscription_id}", None)) @dataclass @@ -139,20 +136,20 @@ def as_dict(self) -> dict: """Serializes the CloudResourceContainer into a dictionary suitable for use as a JSON request body.""" body = {} if self.gcp: - body["gcp"] = self.gcp.as_dict() + body["{gcp}"] = self.gcp.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CloudResourceContainer into a shallow dictionary of its immediate attributes.""" body = {} if self.gcp: - body["gcp"] = self.gcp + body["{gcp}"] = self.gcp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloudResourceContainer: """Deserializes the CloudResourceContainer from a dictionary.""" - return cls(gcp=_from_dict(d, "gcp", CustomerFacingGcpCloudResourceContainer)) + return cls(gcp=_from_dict(d, "{gcp}", CustomerFacingGcpCloudResourceContainer)) @dataclass @@ -173,31 +170,31 @@ def as_dict(self) -> dict: """Serializes the CreateAwsKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.key_alias is not None: - body["key_alias"] = self.key_alias + body["{key_alias}"] = self.key_alias if self.key_arn is not None: - body["key_arn"] = self.key_arn + body["{key_arn}"] = self.key_arn if self.reuse_key_for_cluster_volumes is not None: - body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes + body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes return body def as_shallow_dict(self) -> dict: """Serializes the CreateAwsKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.key_alias is not None: - body["key_alias"] = self.key_alias + body["{key_alias}"] = self.key_alias if self.key_arn is not None: - body["key_arn"] = self.key_arn + body["{key_arn}"] = self.key_arn if self.reuse_key_for_cluster_volumes is not None: - body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes + body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAwsKeyInfo: """Deserializes the CreateAwsKeyInfo from a dictionary.""" return cls( - key_alias=d.get("key_alias", None), - key_arn=d.get("key_arn", None), - reuse_key_for_cluster_volumes=d.get("reuse_key_for_cluster_volumes", None), + key_alias=d.get("{key_alias}", None), + key_arn=d.get("{key_arn}", None), + reuse_key_for_cluster_volumes=d.get("{reuse_key_for_cluster_volumes}", None), ) @@ -209,20 +206,20 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialAwsCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.sts_role: - body["sts_role"] = self.sts_role.as_dict() + body["{sts_role}"] = self.sts_role.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialAwsCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.sts_role: - body["sts_role"] = self.sts_role + body["{sts_role}"] = self.sts_role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialAwsCredentials: """Deserializes the CreateCredentialAwsCredentials from a dictionary.""" - return cls(sts_role=_from_dict(d, "sts_role", CreateCredentialStsRole)) + return cls(sts_role=_from_dict(d, "{sts_role}", CreateCredentialStsRole)) @dataclass @@ -236,26 +233,26 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_credentials: - body["aws_credentials"] = self.aws_credentials.as_dict() + body["{aws_credentials}"] = self.aws_credentials.as_dict() if self.credentials_name is not None: - body["credentials_name"] = self.credentials_name + body["{credentials_name}"] = self.credentials_name return body def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_credentials: - body["aws_credentials"] = self.aws_credentials + body["{aws_credentials}"] = self.aws_credentials if self.credentials_name is not None: - body["credentials_name"] = self.credentials_name + body["{credentials_name}"] = self.credentials_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialRequest: """Deserializes the CreateCredentialRequest from a dictionary.""" return cls( - aws_credentials=_from_dict(d, "aws_credentials", CreateCredentialAwsCredentials), - credentials_name=d.get("credentials_name", None), + aws_credentials=_from_dict(d, "{aws_credentials}", CreateCredentialAwsCredentials), + credentials_name=d.get("{credentials_name}", None), ) @@ -268,20 +265,20 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialStsRole into a dictionary suitable for use as a JSON request body.""" body = {} if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn return body def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialStsRole into a shallow dictionary of its immediate attributes.""" body = {} if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialStsRole: """Deserializes the CreateCredentialStsRole from a dictionary.""" - return cls(role_arn=d.get("role_arn", None)) + return cls(role_arn=d.get("{role_arn}", None)) @dataclass @@ -297,31 +294,31 @@ def as_dict(self) -> dict: """Serializes the CreateCustomerManagedKeyRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_key_info: - body["aws_key_info"] = self.aws_key_info.as_dict() + body["{aws_key_info}"] = self.aws_key_info.as_dict() if self.gcp_key_info: - body["gcp_key_info"] = self.gcp_key_info.as_dict() + body["{gcp_key_info}"] = self.gcp_key_info.as_dict() if self.use_cases: - body["use_cases"] = [v.value for v in self.use_cases] + body["{use_cases}"] = [v.value for v in self.use_cases] return body def as_shallow_dict(self) -> dict: """Serializes the CreateCustomerManagedKeyRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_key_info: - body["aws_key_info"] = self.aws_key_info + body["{aws_key_info}"] = self.aws_key_info if self.gcp_key_info: - body["gcp_key_info"] = self.gcp_key_info + body["{gcp_key_info}"] = self.gcp_key_info if self.use_cases: - body["use_cases"] = self.use_cases + body["{use_cases}"] = self.use_cases return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCustomerManagedKeyRequest: """Deserializes the CreateCustomerManagedKeyRequest from a dictionary.""" return cls( - aws_key_info=_from_dict(d, "aws_key_info", CreateAwsKeyInfo), - gcp_key_info=_from_dict(d, "gcp_key_info", CreateGcpKeyInfo), - use_cases=_repeated_enum(d, "use_cases", KeyUseCase), + aws_key_info=_from_dict(d, "{aws_key_info}", CreateAwsKeyInfo), + gcp_key_info=_from_dict(d, "{gcp_key_info}", CreateGcpKeyInfo), + use_cases=_repeated_enum(d, "{use_cases}", KeyUseCase), ) @@ -334,20 +331,20 @@ def as_dict(self) -> dict: """Serializes the CreateGcpKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.kms_key_id is not None: - body["kms_key_id"] = self.kms_key_id + body["{kms_key_id}"] = self.kms_key_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateGcpKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.kms_key_id is not None: - body["kms_key_id"] = self.kms_key_id + body["{kms_key_id}"] = self.kms_key_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateGcpKeyInfo: """Deserializes the CreateGcpKeyInfo from a dictionary.""" - return cls(kms_key_id=d.get("kms_key_id", None)) + return cls(kms_key_id=d.get("{kms_key_id}", None)) @dataclass @@ -381,46 +378,46 @@ def as_dict(self) -> dict: """Serializes the CreateNetworkRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.gcp_network_info: - body["gcp_network_info"] = self.gcp_network_info.as_dict() + body["{gcp_network_info}"] = self.gcp_network_info.as_dict() if self.network_name is not None: - body["network_name"] = self.network_name + body["{network_name}"] = self.network_name if self.security_group_ids: - body["security_group_ids"] = [v for v in self.security_group_ids] + body["{security_group_ids}"] = [v for v in self.security_group_ids] if self.subnet_ids: - body["subnet_ids"] = [v for v in self.subnet_ids] + body["{subnet_ids}"] = [v for v in self.subnet_ids] if self.vpc_endpoints: - body["vpc_endpoints"] = self.vpc_endpoints.as_dict() + body["{vpc_endpoints}"] = self.vpc_endpoints.as_dict() if self.vpc_id is not None: - body["vpc_id"] = self.vpc_id + body["{vpc_id}"] = self.vpc_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateNetworkRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.gcp_network_info: - body["gcp_network_info"] = self.gcp_network_info + body["{gcp_network_info}"] = self.gcp_network_info if self.network_name is not None: - body["network_name"] = self.network_name + body["{network_name}"] = self.network_name if self.security_group_ids: - body["security_group_ids"] = self.security_group_ids + body["{security_group_ids}"] = self.security_group_ids if self.subnet_ids: - body["subnet_ids"] = self.subnet_ids + body["{subnet_ids}"] = self.subnet_ids if self.vpc_endpoints: - body["vpc_endpoints"] = self.vpc_endpoints + body["{vpc_endpoints}"] = self.vpc_endpoints if self.vpc_id is not None: - body["vpc_id"] = self.vpc_id + body["{vpc_id}"] = self.vpc_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateNetworkRequest: """Deserializes the CreateNetworkRequest from a dictionary.""" return cls( - gcp_network_info=_from_dict(d, "gcp_network_info", GcpNetworkInfo), - network_name=d.get("network_name", None), - security_group_ids=d.get("security_group_ids", None), - subnet_ids=d.get("subnet_ids", None), - vpc_endpoints=_from_dict(d, "vpc_endpoints", NetworkVpcEndpoints), - vpc_id=d.get("vpc_id", None), + gcp_network_info=_from_dict(d, "{gcp_network_info}", GcpNetworkInfo), + network_name=d.get("{network_name}", None), + security_group_ids=d.get("{security_group_ids}", None), + subnet_ids=d.get("{subnet_ids}", None), + vpc_endpoints=_from_dict(d, "{vpc_endpoints}", NetworkVpcEndpoints), + vpc_id=d.get("{vpc_id}", None), ) @@ -436,26 +433,26 @@ def as_dict(self) -> dict: """Serializes the CreateStorageConfigurationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.root_bucket_info: - body["root_bucket_info"] = self.root_bucket_info.as_dict() + body["{root_bucket_info}"] = self.root_bucket_info.as_dict() if self.storage_configuration_name is not None: - body["storage_configuration_name"] = self.storage_configuration_name + body["{storage_configuration_name}"] = self.storage_configuration_name return body def as_shallow_dict(self) -> dict: """Serializes the CreateStorageConfigurationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.root_bucket_info: - body["root_bucket_info"] = self.root_bucket_info + body["{root_bucket_info}"] = self.root_bucket_info if self.storage_configuration_name is not None: - body["storage_configuration_name"] = self.storage_configuration_name + body["{storage_configuration_name}"] = self.storage_configuration_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateStorageConfigurationRequest: """Deserializes the CreateStorageConfigurationRequest from a dictionary.""" return cls( - root_bucket_info=_from_dict(d, "root_bucket_info", RootBucketInfo), - storage_configuration_name=d.get("storage_configuration_name", None), + root_bucket_info=_from_dict(d, "{root_bucket_info}", RootBucketInfo), + storage_configuration_name=d.get("{storage_configuration_name}", None), ) @@ -477,36 +474,36 @@ def as_dict(self) -> dict: """Serializes the CreateVpcEndpointRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_vpc_endpoint_id is not None: - body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id + body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info.as_dict() + body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info.as_dict() if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.vpc_endpoint_name is not None: - body["vpc_endpoint_name"] = self.vpc_endpoint_name + body["{vpc_endpoint_name}"] = self.vpc_endpoint_name return body def as_shallow_dict(self) -> dict: """Serializes the CreateVpcEndpointRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_vpc_endpoint_id is not None: - body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id + body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info + body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.vpc_endpoint_name is not None: - body["vpc_endpoint_name"] = self.vpc_endpoint_name + body["{vpc_endpoint_name}"] = self.vpc_endpoint_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVpcEndpointRequest: """Deserializes the CreateVpcEndpointRequest from a dictionary.""" return cls( - aws_vpc_endpoint_id=d.get("aws_vpc_endpoint_id", None), - gcp_vpc_endpoint_info=_from_dict(d, "gcp_vpc_endpoint_info", GcpVpcEndpointInfo), - region=d.get("region", None), - vpc_endpoint_name=d.get("vpc_endpoint_name", None), + aws_vpc_endpoint_id=d.get("{aws_vpc_endpoint_id}", None), + gcp_vpc_endpoint_info=_from_dict(d, "{gcp_vpc_endpoint_info}", GcpVpcEndpointInfo), + region=d.get("{region}", None), + vpc_endpoint_name=d.get("{vpc_endpoint_name}", None), ) @@ -623,101 +620,101 @@ def as_dict(self) -> dict: """Serializes the CreateWorkspaceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.cloud_resource_container: - body["cloud_resource_container"] = self.cloud_resource_container.as_dict() + body["{cloud_resource_container}"] = self.cloud_resource_container.as_dict() if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.deployment_name is not None: - body["deployment_name"] = self.deployment_name + body["{deployment_name}"] = self.deployment_name if self.gcp_managed_network_config: - body["gcp_managed_network_config"] = self.gcp_managed_network_config.as_dict() + body["{gcp_managed_network_config}"] = self.gcp_managed_network_config.as_dict() if self.gke_config: - body["gke_config"] = self.gke_config.as_dict() + body["{gke_config}"] = self.gke_config.as_dict() if self.is_no_public_ip_enabled is not None: - body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled + body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled if self.location is not None: - body["location"] = self.location + body["{location}"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.pricing_tier is not None: - body["pricing_tier"] = self.pricing_tier.value + body["{pricing_tier}"] = self.pricing_tier.value if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id if self.workspace_name is not None: - body["workspace_name"] = self.workspace_name + body["{workspace_name}"] = self.workspace_name return body def as_shallow_dict(self) -> dict: """Serializes the CreateWorkspaceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.cloud_resource_container: - body["cloud_resource_container"] = self.cloud_resource_container + body["{cloud_resource_container}"] = self.cloud_resource_container if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.deployment_name is not None: - body["deployment_name"] = self.deployment_name + body["{deployment_name}"] = self.deployment_name if self.gcp_managed_network_config: - body["gcp_managed_network_config"] = self.gcp_managed_network_config + body["{gcp_managed_network_config}"] = self.gcp_managed_network_config if self.gke_config: - body["gke_config"] = self.gke_config + body["{gke_config}"] = self.gke_config if self.is_no_public_ip_enabled is not None: - body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled + body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled if self.location is not None: - body["location"] = self.location + body["{location}"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.pricing_tier is not None: - body["pricing_tier"] = self.pricing_tier + body["{pricing_tier}"] = self.pricing_tier if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id if self.workspace_name is not None: - body["workspace_name"] = self.workspace_name + body["{workspace_name}"] = self.workspace_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWorkspaceRequest: """Deserializes the CreateWorkspaceRequest from a dictionary.""" return cls( - aws_region=d.get("aws_region", None), - cloud=d.get("cloud", None), - cloud_resource_container=_from_dict(d, "cloud_resource_container", CloudResourceContainer), - credentials_id=d.get("credentials_id", None), - custom_tags=d.get("custom_tags", None), - deployment_name=d.get("deployment_name", None), - gcp_managed_network_config=_from_dict(d, "gcp_managed_network_config", GcpManagedNetworkConfig), - gke_config=_from_dict(d, "gke_config", GkeConfig), - is_no_public_ip_enabled=d.get("is_no_public_ip_enabled", None), - location=d.get("location", None), - managed_services_customer_managed_key_id=d.get("managed_services_customer_managed_key_id", None), - network_id=d.get("network_id", None), - pricing_tier=_enum(d, "pricing_tier", PricingTier), - private_access_settings_id=d.get("private_access_settings_id", None), - storage_configuration_id=d.get("storage_configuration_id", None), - storage_customer_managed_key_id=d.get("storage_customer_managed_key_id", None), - workspace_name=d.get("workspace_name", None), + aws_region=d.get("{aws_region}", None), + cloud=d.get("{cloud}", None), + cloud_resource_container=_from_dict(d, "{cloud_resource_container}", CloudResourceContainer), + credentials_id=d.get("{credentials_id}", None), + custom_tags=d.get("{custom_tags}", None), + deployment_name=d.get("{deployment_name}", None), + gcp_managed_network_config=_from_dict(d, "{gcp_managed_network_config}", GcpManagedNetworkConfig), + gke_config=_from_dict(d, "{gke_config}", GkeConfig), + is_no_public_ip_enabled=d.get("{is_no_public_ip_enabled}", None), + location=d.get("{location}", None), + managed_services_customer_managed_key_id=d.get("{managed_services_customer_managed_key_id}", None), + network_id=d.get("{network_id}", None), + pricing_tier=_enum(d, "{pricing_tier}", PricingTier), + private_access_settings_id=d.get("{private_access_settings_id}", None), + storage_configuration_id=d.get("{storage_configuration_id}", None), + storage_customer_managed_key_id=d.get("{storage_customer_managed_key_id}", None), + workspace_name=d.get("{workspace_name}", None), ) @@ -741,41 +738,41 @@ def as_dict(self) -> dict: """Serializes the Credential into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_credentials: - body["aws_credentials"] = self.aws_credentials.as_dict() + body["{aws_credentials}"] = self.aws_credentials.as_dict() if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.credentials_name is not None: - body["credentials_name"] = self.credentials_name + body["{credentials_name}"] = self.credentials_name return body def as_shallow_dict(self) -> dict: """Serializes the Credential into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_credentials: - body["aws_credentials"] = self.aws_credentials + body["{aws_credentials}"] = self.aws_credentials if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.credentials_name is not None: - body["credentials_name"] = self.credentials_name + body["{credentials_name}"] = self.credentials_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Credential: """Deserializes the Credential from a dictionary.""" return cls( - account_id=d.get("account_id", None), - aws_credentials=_from_dict(d, "aws_credentials", AwsCredentials), - creation_time=d.get("creation_time", None), - credentials_id=d.get("credentials_id", None), - credentials_name=d.get("credentials_name", None), + account_id=d.get("{account_id}", None), + aws_credentials=_from_dict(d, "{aws_credentials}", AwsCredentials), + creation_time=d.get("{creation_time}", None), + credentials_id=d.get("{credentials_id}", None), + credentials_name=d.get("{credentials_name}", None), ) @@ -794,20 +791,20 @@ def as_dict(self) -> dict: """Serializes the CustomerFacingGcpCloudResourceContainer into a dictionary suitable for use as a JSON request body.""" body = {} if self.project_id is not None: - body["project_id"] = self.project_id + body["{project_id}"] = self.project_id return body def as_shallow_dict(self) -> dict: """Serializes the CustomerFacingGcpCloudResourceContainer into a shallow dictionary of its immediate attributes.""" body = {} if self.project_id is not None: - body["project_id"] = self.project_id + body["{project_id}"] = self.project_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomerFacingGcpCloudResourceContainer: """Deserializes the CustomerFacingGcpCloudResourceContainer from a dictionary.""" - return cls(project_id=d.get("project_id", None)) + return cls(project_id=d.get("{project_id}", None)) @dataclass @@ -832,46 +829,46 @@ def as_dict(self) -> dict: """Serializes the CustomerManagedKey into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_key_info: - body["aws_key_info"] = self.aws_key_info.as_dict() + body["{aws_key_info}"] = self.aws_key_info.as_dict() if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.customer_managed_key_id is not None: - body["customer_managed_key_id"] = self.customer_managed_key_id + body["{customer_managed_key_id}"] = self.customer_managed_key_id if self.gcp_key_info: - body["gcp_key_info"] = self.gcp_key_info.as_dict() + body["{gcp_key_info}"] = self.gcp_key_info.as_dict() if self.use_cases: - body["use_cases"] = [v.value for v in self.use_cases] + body["{use_cases}"] = [v.value for v in self.use_cases] return body def as_shallow_dict(self) -> dict: """Serializes the CustomerManagedKey into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_key_info: - body["aws_key_info"] = self.aws_key_info + body["{aws_key_info}"] = self.aws_key_info if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.customer_managed_key_id is not None: - body["customer_managed_key_id"] = self.customer_managed_key_id + body["{customer_managed_key_id}"] = self.customer_managed_key_id if self.gcp_key_info: - body["gcp_key_info"] = self.gcp_key_info + body["{gcp_key_info}"] = self.gcp_key_info if self.use_cases: - body["use_cases"] = self.use_cases + body["{use_cases}"] = self.use_cases return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomerManagedKey: """Deserializes the CustomerManagedKey from a dictionary.""" return cls( - account_id=d.get("account_id", None), - aws_key_info=_from_dict(d, "aws_key_info", AwsKeyInfo), - creation_time=d.get("creation_time", None), - customer_managed_key_id=d.get("customer_managed_key_id", None), - gcp_key_info=_from_dict(d, "gcp_key_info", GcpKeyInfo), - use_cases=_repeated_enum(d, "use_cases", KeyUseCase), + account_id=d.get("{account_id}", None), + aws_key_info=_from_dict(d, "{aws_key_info}", AwsKeyInfo), + creation_time=d.get("{creation_time}", None), + customer_managed_key_id=d.get("{customer_managed_key_id}", None), + gcp_key_info=_from_dict(d, "{gcp_key_info}", GcpKeyInfo), + use_cases=_repeated_enum(d, "{use_cases}", KeyUseCase), ) @@ -929,31 +926,31 @@ def as_dict(self) -> dict: """Serializes the ExternalCustomerInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.authoritative_user_email is not None: - body["authoritative_user_email"] = self.authoritative_user_email + body["{authoritative_user_email}"] = self.authoritative_user_email if self.authoritative_user_full_name is not None: - body["authoritative_user_full_name"] = self.authoritative_user_full_name + body["{authoritative_user_full_name}"] = self.authoritative_user_full_name if self.customer_name is not None: - body["customer_name"] = self.customer_name + body["{customer_name}"] = self.customer_name return body def as_shallow_dict(self) -> dict: """Serializes the ExternalCustomerInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.authoritative_user_email is not None: - body["authoritative_user_email"] = self.authoritative_user_email + body["{authoritative_user_email}"] = self.authoritative_user_email if self.authoritative_user_full_name is not None: - body["authoritative_user_full_name"] = self.authoritative_user_full_name + body["{authoritative_user_full_name}"] = self.authoritative_user_full_name if self.customer_name is not None: - body["customer_name"] = self.customer_name + body["{customer_name}"] = self.customer_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalCustomerInfo: """Deserializes the ExternalCustomerInfo from a dictionary.""" return cls( - authoritative_user_email=d.get("authoritative_user_email", None), - authoritative_user_full_name=d.get("authoritative_user_full_name", None), - customer_name=d.get("customer_name", None), + authoritative_user_email=d.get("{authoritative_user_email}", None), + authoritative_user_full_name=d.get("{authoritative_user_full_name}", None), + customer_name=d.get("{customer_name}", None), ) @@ -966,20 +963,20 @@ def as_dict(self) -> dict: """Serializes the GcpKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.kms_key_id is not None: - body["kms_key_id"] = self.kms_key_id + body["{kms_key_id}"] = self.kms_key_id return body def as_shallow_dict(self) -> dict: """Serializes the GcpKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.kms_key_id is not None: - body["kms_key_id"] = self.kms_key_id + body["{kms_key_id}"] = self.kms_key_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpKeyInfo: """Deserializes the GcpKeyInfo from a dictionary.""" - return cls(kms_key_id=d.get("kms_key_id", None)) + return cls(kms_key_id=d.get("{kms_key_id}", None)) @dataclass @@ -1020,31 +1017,31 @@ def as_dict(self) -> dict: """Serializes the GcpManagedNetworkConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.gke_cluster_pod_ip_range is not None: - body["gke_cluster_pod_ip_range"] = self.gke_cluster_pod_ip_range + body["{gke_cluster_pod_ip_range}"] = self.gke_cluster_pod_ip_range if self.gke_cluster_service_ip_range is not None: - body["gke_cluster_service_ip_range"] = self.gke_cluster_service_ip_range + body["{gke_cluster_service_ip_range}"] = self.gke_cluster_service_ip_range if self.subnet_cidr is not None: - body["subnet_cidr"] = self.subnet_cidr + body["{subnet_cidr}"] = self.subnet_cidr return body def as_shallow_dict(self) -> dict: """Serializes the GcpManagedNetworkConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.gke_cluster_pod_ip_range is not None: - body["gke_cluster_pod_ip_range"] = self.gke_cluster_pod_ip_range + body["{gke_cluster_pod_ip_range}"] = self.gke_cluster_pod_ip_range if self.gke_cluster_service_ip_range is not None: - body["gke_cluster_service_ip_range"] = self.gke_cluster_service_ip_range + body["{gke_cluster_service_ip_range}"] = self.gke_cluster_service_ip_range if self.subnet_cidr is not None: - body["subnet_cidr"] = self.subnet_cidr + body["{subnet_cidr}"] = self.subnet_cidr return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpManagedNetworkConfig: """Deserializes the GcpManagedNetworkConfig from a dictionary.""" return cls( - gke_cluster_pod_ip_range=d.get("gke_cluster_pod_ip_range", None), - gke_cluster_service_ip_range=d.get("gke_cluster_service_ip_range", None), - subnet_cidr=d.get("subnet_cidr", None), + gke_cluster_pod_ip_range=d.get("{gke_cluster_pod_ip_range}", None), + gke_cluster_service_ip_range=d.get("{gke_cluster_service_ip_range}", None), + subnet_cidr=d.get("{subnet_cidr}", None), ) @@ -1078,46 +1075,46 @@ def as_dict(self) -> dict: """Serializes the GcpNetworkInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.network_project_id is not None: - body["network_project_id"] = self.network_project_id + body["{network_project_id}"] = self.network_project_id if self.pod_ip_range_name is not None: - body["pod_ip_range_name"] = self.pod_ip_range_name + body["{pod_ip_range_name}"] = self.pod_ip_range_name if self.service_ip_range_name is not None: - body["service_ip_range_name"] = self.service_ip_range_name + body["{service_ip_range_name}"] = self.service_ip_range_name if self.subnet_id is not None: - body["subnet_id"] = self.subnet_id + body["{subnet_id}"] = self.subnet_id if self.subnet_region is not None: - body["subnet_region"] = self.subnet_region + body["{subnet_region}"] = self.subnet_region if self.vpc_id is not None: - body["vpc_id"] = self.vpc_id + body["{vpc_id}"] = self.vpc_id return body def as_shallow_dict(self) -> dict: """Serializes the GcpNetworkInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.network_project_id is not None: - body["network_project_id"] = self.network_project_id + body["{network_project_id}"] = self.network_project_id if self.pod_ip_range_name is not None: - body["pod_ip_range_name"] = self.pod_ip_range_name + body["{pod_ip_range_name}"] = self.pod_ip_range_name if self.service_ip_range_name is not None: - body["service_ip_range_name"] = self.service_ip_range_name + body["{service_ip_range_name}"] = self.service_ip_range_name if self.subnet_id is not None: - body["subnet_id"] = self.subnet_id + body["{subnet_id}"] = self.subnet_id if self.subnet_region is not None: - body["subnet_region"] = self.subnet_region + body["{subnet_region}"] = self.subnet_region if self.vpc_id is not None: - body["vpc_id"] = self.vpc_id + body["{vpc_id}"] = self.vpc_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpNetworkInfo: """Deserializes the GcpNetworkInfo from a dictionary.""" return cls( - network_project_id=d.get("network_project_id", None), - pod_ip_range_name=d.get("pod_ip_range_name", None), - service_ip_range_name=d.get("service_ip_range_name", None), - subnet_id=d.get("subnet_id", None), - subnet_region=d.get("subnet_region", None), - vpc_id=d.get("vpc_id", None), + network_project_id=d.get("{network_project_id}", None), + pod_ip_range_name=d.get("{pod_ip_range_name}", None), + service_ip_range_name=d.get("{service_ip_range_name}", None), + subnet_id=d.get("{subnet_id}", None), + subnet_region=d.get("{subnet_region}", None), + vpc_id=d.get("{vpc_id}", None), ) @@ -1144,41 +1141,41 @@ def as_dict(self) -> dict: """Serializes the GcpVpcEndpointInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_region is not None: - body["endpoint_region"] = self.endpoint_region + body["{endpoint_region}"] = self.endpoint_region if self.project_id is not None: - body["project_id"] = self.project_id + body["{project_id}"] = self.project_id if self.psc_connection_id is not None: - body["psc_connection_id"] = self.psc_connection_id + body["{psc_connection_id}"] = self.psc_connection_id if self.psc_endpoint_name is not None: - body["psc_endpoint_name"] = self.psc_endpoint_name + body["{psc_endpoint_name}"] = self.psc_endpoint_name if self.service_attachment_id is not None: - body["service_attachment_id"] = self.service_attachment_id + body["{service_attachment_id}"] = self.service_attachment_id return body def as_shallow_dict(self) -> dict: """Serializes the GcpVpcEndpointInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_region is not None: - body["endpoint_region"] = self.endpoint_region + body["{endpoint_region}"] = self.endpoint_region if self.project_id is not None: - body["project_id"] = self.project_id + body["{project_id}"] = self.project_id if self.psc_connection_id is not None: - body["psc_connection_id"] = self.psc_connection_id + body["{psc_connection_id}"] = self.psc_connection_id if self.psc_endpoint_name is not None: - body["psc_endpoint_name"] = self.psc_endpoint_name + body["{psc_endpoint_name}"] = self.psc_endpoint_name if self.service_attachment_id is not None: - body["service_attachment_id"] = self.service_attachment_id + body["{service_attachment_id}"] = self.service_attachment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpVpcEndpointInfo: """Deserializes the GcpVpcEndpointInfo from a dictionary.""" return cls( - endpoint_region=d.get("endpoint_region", None), - project_id=d.get("project_id", None), - psc_connection_id=d.get("psc_connection_id", None), - psc_endpoint_name=d.get("psc_endpoint_name", None), - service_attachment_id=d.get("service_attachment_id", None), + endpoint_region=d.get("{endpoint_region}", None), + project_id=d.get("{project_id}", None), + psc_connection_id=d.get("{psc_connection_id}", None), + psc_endpoint_name=d.get("{psc_endpoint_name}", None), + service_attachment_id=d.get("{service_attachment_id}", None), ) @@ -1205,26 +1202,26 @@ def as_dict(self) -> dict: """Serializes the GkeConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.connectivity_type is not None: - body["connectivity_type"] = self.connectivity_type.value + body["{connectivity_type}"] = self.connectivity_type.value if self.master_ip_range is not None: - body["master_ip_range"] = self.master_ip_range + body["{master_ip_range}"] = self.master_ip_range return body def as_shallow_dict(self) -> dict: """Serializes the GkeConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.connectivity_type is not None: - body["connectivity_type"] = self.connectivity_type + body["{connectivity_type}"] = self.connectivity_type if self.master_ip_range is not None: - body["master_ip_range"] = self.master_ip_range + body["{master_ip_range}"] = self.master_ip_range return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GkeConfig: """Deserializes the GkeConfig from a dictionary.""" return cls( - connectivity_type=_enum(d, "connectivity_type", GkeConfigConnectivityType), - master_ip_range=d.get("master_ip_range", None), + connectivity_type=_enum(d, "{connectivity_type}", GkeConfigConnectivityType), + master_ip_range=d.get("{master_ip_range}", None), ) @@ -1299,81 +1296,81 @@ def as_dict(self) -> dict: """Serializes the Network into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.error_messages: - body["error_messages"] = [v.as_dict() for v in self.error_messages] + body["{error_messages}"] = [v.as_dict() for v in self.error_messages] if self.gcp_network_info: - body["gcp_network_info"] = self.gcp_network_info.as_dict() + body["{gcp_network_info}"] = self.gcp_network_info.as_dict() if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.network_name is not None: - body["network_name"] = self.network_name + body["{network_name}"] = self.network_name if self.security_group_ids: - body["security_group_ids"] = [v for v in self.security_group_ids] + body["{security_group_ids}"] = [v for v in self.security_group_ids] if self.subnet_ids: - body["subnet_ids"] = [v for v in self.subnet_ids] + body["{subnet_ids}"] = [v for v in self.subnet_ids] if self.vpc_endpoints: - body["vpc_endpoints"] = self.vpc_endpoints.as_dict() + body["{vpc_endpoints}"] = self.vpc_endpoints.as_dict() if self.vpc_id is not None: - body["vpc_id"] = self.vpc_id + body["{vpc_id}"] = self.vpc_id if self.vpc_status is not None: - body["vpc_status"] = self.vpc_status.value + body["{vpc_status}"] = self.vpc_status.value if self.warning_messages: - body["warning_messages"] = [v.as_dict() for v in self.warning_messages] + body["{warning_messages}"] = [v.as_dict() for v in self.warning_messages] if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the Network into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.error_messages: - body["error_messages"] = self.error_messages + body["{error_messages}"] = self.error_messages if self.gcp_network_info: - body["gcp_network_info"] = self.gcp_network_info + body["{gcp_network_info}"] = self.gcp_network_info if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.network_name is not None: - body["network_name"] = self.network_name + body["{network_name}"] = self.network_name if self.security_group_ids: - body["security_group_ids"] = self.security_group_ids + body["{security_group_ids}"] = self.security_group_ids if self.subnet_ids: - body["subnet_ids"] = self.subnet_ids + body["{subnet_ids}"] = self.subnet_ids if self.vpc_endpoints: - body["vpc_endpoints"] = self.vpc_endpoints + body["{vpc_endpoints}"] = self.vpc_endpoints if self.vpc_id is not None: - body["vpc_id"] = self.vpc_id + body["{vpc_id}"] = self.vpc_id if self.vpc_status is not None: - body["vpc_status"] = self.vpc_status + body["{vpc_status}"] = self.vpc_status if self.warning_messages: - body["warning_messages"] = self.warning_messages + body["{warning_messages}"] = self.warning_messages if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Network: """Deserializes the Network from a dictionary.""" return cls( - account_id=d.get("account_id", None), - creation_time=d.get("creation_time", None), - error_messages=_repeated_dict(d, "error_messages", NetworkHealth), - gcp_network_info=_from_dict(d, "gcp_network_info", GcpNetworkInfo), - network_id=d.get("network_id", None), - network_name=d.get("network_name", None), - security_group_ids=d.get("security_group_ids", None), - subnet_ids=d.get("subnet_ids", None), - vpc_endpoints=_from_dict(d, "vpc_endpoints", NetworkVpcEndpoints), - vpc_id=d.get("vpc_id", None), - vpc_status=_enum(d, "vpc_status", VpcStatus), - warning_messages=_repeated_dict(d, "warning_messages", NetworkWarning), - workspace_id=d.get("workspace_id", None), + account_id=d.get("{account_id}", None), + creation_time=d.get("{creation_time}", None), + error_messages=_repeated_dict(d, "{error_messages}", NetworkHealth), + gcp_network_info=_from_dict(d, "{gcp_network_info}", GcpNetworkInfo), + network_id=d.get("{network_id}", None), + network_name=d.get("{network_name}", None), + security_group_ids=d.get("{security_group_ids}", None), + subnet_ids=d.get("{subnet_ids}", None), + vpc_endpoints=_from_dict(d, "{vpc_endpoints}", NetworkVpcEndpoints), + vpc_id=d.get("{vpc_id}", None), + vpc_status=_enum(d, "{vpc_status}", VpcStatus), + warning_messages=_repeated_dict(d, "{warning_messages}", NetworkWarning), + workspace_id=d.get("{workspace_id}", None), ) @@ -1390,24 +1387,24 @@ def as_dict(self) -> dict: """Serializes the NetworkHealth into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.error_type is not None: - body["error_type"] = self.error_type.value + body["{error_type}"] = self.error_type.value return body def as_shallow_dict(self) -> dict: """Serializes the NetworkHealth into a shallow dictionary of its immediate attributes.""" body = {} if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.error_type is not None: - body["error_type"] = self.error_type + body["{error_type}"] = self.error_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkHealth: """Deserializes the NetworkHealth from a dictionary.""" - return cls(error_message=d.get("error_message", None), error_type=_enum(d, "error_type", ErrorType)) + return cls(error_message=d.get("{error_message}", None), error_type=_enum(d, "{error_type}", ErrorType)) @dataclass @@ -1428,24 +1425,24 @@ def as_dict(self) -> dict: """Serializes the NetworkVpcEndpoints into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataplane_relay: - body["dataplane_relay"] = [v for v in self.dataplane_relay] + body["{dataplane_relay}"] = [v for v in self.dataplane_relay] if self.rest_api: - body["rest_api"] = [v for v in self.rest_api] + body["{rest_api}"] = [v for v in self.rest_api] return body def as_shallow_dict(self) -> dict: """Serializes the NetworkVpcEndpoints into a shallow dictionary of its immediate attributes.""" body = {} if self.dataplane_relay: - body["dataplane_relay"] = self.dataplane_relay + body["{dataplane_relay}"] = self.dataplane_relay if self.rest_api: - body["rest_api"] = self.rest_api + body["{rest_api}"] = self.rest_api return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkVpcEndpoints: """Deserializes the NetworkVpcEndpoints from a dictionary.""" - return cls(dataplane_relay=d.get("dataplane_relay", None), rest_api=d.get("rest_api", None)) + return cls(dataplane_relay=d.get("{dataplane_relay}", None), rest_api=d.get("{rest_api}", None)) @dataclass @@ -1460,24 +1457,26 @@ def as_dict(self) -> dict: """Serializes the NetworkWarning into a dictionary suitable for use as a JSON request body.""" body = {} if self.warning_message is not None: - body["warning_message"] = self.warning_message + body["{warning_message}"] = self.warning_message if self.warning_type is not None: - body["warning_type"] = self.warning_type.value + body["{warning_type}"] = self.warning_type.value return body def as_shallow_dict(self) -> dict: """Serializes the NetworkWarning into a shallow dictionary of its immediate attributes.""" body = {} if self.warning_message is not None: - body["warning_message"] = self.warning_message + body["{warning_message}"] = self.warning_message if self.warning_type is not None: - body["warning_type"] = self.warning_type + body["{warning_type}"] = self.warning_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkWarning: """Deserializes the NetworkWarning from a dictionary.""" - return cls(warning_message=d.get("warning_message", None), warning_type=_enum(d, "warning_type", WarningType)) + return cls( + warning_message=d.get("{warning_message}", None), warning_type=_enum(d, "{warning_type}", WarningType) + ) class PricingTier(Enum): @@ -1538,51 +1537,51 @@ def as_dict(self) -> dict: """Serializes the PrivateAccessSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.allowed_vpc_endpoint_ids: - body["allowed_vpc_endpoint_ids"] = [v for v in self.allowed_vpc_endpoint_ids] + body["{allowed_vpc_endpoint_ids}"] = [v for v in self.allowed_vpc_endpoint_ids] if self.private_access_level is not None: - body["private_access_level"] = self.private_access_level.value + body["{private_access_level}"] = self.private_access_level.value if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["private_access_settings_name"] = self.private_access_settings_name + body["{private_access_settings_name}"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["public_access_enabled"] = self.public_access_enabled + body["{public_access_enabled}"] = self.public_access_enabled if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the PrivateAccessSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.allowed_vpc_endpoint_ids: - body["allowed_vpc_endpoint_ids"] = self.allowed_vpc_endpoint_ids + body["{allowed_vpc_endpoint_ids}"] = self.allowed_vpc_endpoint_ids if self.private_access_level is not None: - body["private_access_level"] = self.private_access_level + body["{private_access_level}"] = self.private_access_level if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["private_access_settings_name"] = self.private_access_settings_name + body["{private_access_settings_name}"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["public_access_enabled"] = self.public_access_enabled + body["{public_access_enabled}"] = self.public_access_enabled if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrivateAccessSettings: """Deserializes the PrivateAccessSettings from a dictionary.""" return cls( - account_id=d.get("account_id", None), - allowed_vpc_endpoint_ids=d.get("allowed_vpc_endpoint_ids", None), - private_access_level=_enum(d, "private_access_level", PrivateAccessLevel), - private_access_settings_id=d.get("private_access_settings_id", None), - private_access_settings_name=d.get("private_access_settings_name", None), - public_access_enabled=d.get("public_access_enabled", None), - region=d.get("region", None), + account_id=d.get("{account_id}", None), + allowed_vpc_endpoint_ids=d.get("{allowed_vpc_endpoint_ids}", None), + private_access_level=_enum(d, "{private_access_level}", PrivateAccessLevel), + private_access_settings_id=d.get("{private_access_settings_id}", None), + private_access_settings_name=d.get("{private_access_settings_name}", None), + public_access_enabled=d.get("{public_access_enabled}", None), + region=d.get("{region}", None), ) @@ -1615,20 +1614,20 @@ def as_dict(self) -> dict: """Serializes the RootBucketInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.bucket_name is not None: - body["bucket_name"] = self.bucket_name + body["{bucket_name}"] = self.bucket_name return body def as_shallow_dict(self) -> dict: """Serializes the RootBucketInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.bucket_name is not None: - body["bucket_name"] = self.bucket_name + body["{bucket_name}"] = self.bucket_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RootBucketInfo: """Deserializes the RootBucketInfo from a dictionary.""" - return cls(bucket_name=d.get("bucket_name", None)) + return cls(bucket_name=d.get("{bucket_name}", None)) @dataclass @@ -1652,41 +1651,41 @@ def as_dict(self) -> dict: """Serializes the StorageConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.root_bucket_info: - body["root_bucket_info"] = self.root_bucket_info.as_dict() + body["{root_bucket_info}"] = self.root_bucket_info.as_dict() if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_configuration_name is not None: - body["storage_configuration_name"] = self.storage_configuration_name + body["{storage_configuration_name}"] = self.storage_configuration_name return body def as_shallow_dict(self) -> dict: """Serializes the StorageConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.root_bucket_info: - body["root_bucket_info"] = self.root_bucket_info + body["{root_bucket_info}"] = self.root_bucket_info if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_configuration_name is not None: - body["storage_configuration_name"] = self.storage_configuration_name + body["{storage_configuration_name}"] = self.storage_configuration_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StorageConfiguration: """Deserializes the StorageConfiguration from a dictionary.""" return cls( - account_id=d.get("account_id", None), - creation_time=d.get("creation_time", None), - root_bucket_info=_from_dict(d, "root_bucket_info", RootBucketInfo), - storage_configuration_id=d.get("storage_configuration_id", None), - storage_configuration_name=d.get("storage_configuration_name", None), + account_id=d.get("{account_id}", None), + creation_time=d.get("{creation_time}", None), + root_bucket_info=_from_dict(d, "{root_bucket_info}", RootBucketInfo), + storage_configuration_id=d.get("{storage_configuration_id}", None), + storage_configuration_name=d.get("{storage_configuration_name}", None), ) @@ -1703,24 +1702,24 @@ def as_dict(self) -> dict: """Serializes the StsRole into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_id is not None: - body["external_id"] = self.external_id + body["{external_id}"] = self.external_id if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn return body def as_shallow_dict(self) -> dict: """Serializes the StsRole into a shallow dictionary of its immediate attributes.""" body = {} if self.external_id is not None: - body["external_id"] = self.external_id + body["{external_id}"] = self.external_id if self.role_arn is not None: - body["role_arn"] = self.role_arn + body["{role_arn}"] = self.role_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StsRole: """Deserializes the StsRole from a dictionary.""" - return cls(external_id=d.get("external_id", None), role_arn=d.get("role_arn", None)) + return cls(external_id=d.get("{external_id}", None), role_arn=d.get("{role_arn}", None)) @dataclass @@ -1786,66 +1785,66 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceRequest: """Deserializes the UpdateWorkspaceRequest from a dictionary.""" return cls( - aws_region=d.get("aws_region", None), - credentials_id=d.get("credentials_id", None), - custom_tags=d.get("custom_tags", None), - managed_services_customer_managed_key_id=d.get("managed_services_customer_managed_key_id", None), - network_connectivity_config_id=d.get("network_connectivity_config_id", None), - network_id=d.get("network_id", None), - private_access_settings_id=d.get("private_access_settings_id", None), - storage_configuration_id=d.get("storage_configuration_id", None), - storage_customer_managed_key_id=d.get("storage_customer_managed_key_id", None), - workspace_id=d.get("workspace_id", None), + aws_region=d.get("{aws_region}", None), + credentials_id=d.get("{credentials_id}", None), + custom_tags=d.get("{custom_tags}", None), + managed_services_customer_managed_key_id=d.get("{managed_services_customer_managed_key_id}", None), + network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), + network_id=d.get("{network_id}", None), + private_access_settings_id=d.get("{private_access_settings_id}", None), + storage_configuration_id=d.get("{storage_configuration_id}", None), + storage_customer_managed_key_id=d.get("{storage_customer_managed_key_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -1891,46 +1890,46 @@ def as_dict(self) -> dict: """Serializes the UpsertPrivateAccessSettingsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_vpc_endpoint_ids: - body["allowed_vpc_endpoint_ids"] = [v for v in self.allowed_vpc_endpoint_ids] + body["{allowed_vpc_endpoint_ids}"] = [v for v in self.allowed_vpc_endpoint_ids] if self.private_access_level is not None: - body["private_access_level"] = self.private_access_level.value + body["{private_access_level}"] = self.private_access_level.value if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["private_access_settings_name"] = self.private_access_settings_name + body["{private_access_settings_name}"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["public_access_enabled"] = self.public_access_enabled + body["{public_access_enabled}"] = self.public_access_enabled if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the UpsertPrivateAccessSettingsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_vpc_endpoint_ids: - body["allowed_vpc_endpoint_ids"] = self.allowed_vpc_endpoint_ids + body["{allowed_vpc_endpoint_ids}"] = self.allowed_vpc_endpoint_ids if self.private_access_level is not None: - body["private_access_level"] = self.private_access_level + body["{private_access_level}"] = self.private_access_level if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["private_access_settings_name"] = self.private_access_settings_name + body["{private_access_settings_name}"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["public_access_enabled"] = self.public_access_enabled + body["{public_access_enabled}"] = self.public_access_enabled if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertPrivateAccessSettingsRequest: """Deserializes the UpsertPrivateAccessSettingsRequest from a dictionary.""" return cls( - allowed_vpc_endpoint_ids=d.get("allowed_vpc_endpoint_ids", None), - private_access_level=_enum(d, "private_access_level", PrivateAccessLevel), - private_access_settings_id=d.get("private_access_settings_id", None), - private_access_settings_name=d.get("private_access_settings_name", None), - public_access_enabled=d.get("public_access_enabled", None), - region=d.get("region", None), + allowed_vpc_endpoint_ids=d.get("{allowed_vpc_endpoint_ids}", None), + private_access_level=_enum(d, "{private_access_level}", PrivateAccessLevel), + private_access_settings_id=d.get("{private_access_settings_id}", None), + private_access_settings_name=d.get("{private_access_settings_name}", None), + public_access_enabled=d.get("{public_access_enabled}", None), + region=d.get("{region}", None), ) @@ -1982,66 +1981,66 @@ def as_dict(self) -> dict: """Serializes the VpcEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_account_id is not None: - body["aws_account_id"] = self.aws_account_id + body["{aws_account_id}"] = self.aws_account_id if self.aws_endpoint_service_id is not None: - body["aws_endpoint_service_id"] = self.aws_endpoint_service_id + body["{aws_endpoint_service_id}"] = self.aws_endpoint_service_id if self.aws_vpc_endpoint_id is not None: - body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id + body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info.as_dict() + body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info.as_dict() if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.use_case is not None: - body["use_case"] = self.use_case.value + body["{use_case}"] = self.use_case.value if self.vpc_endpoint_id is not None: - body["vpc_endpoint_id"] = self.vpc_endpoint_id + body["{vpc_endpoint_id}"] = self.vpc_endpoint_id if self.vpc_endpoint_name is not None: - body["vpc_endpoint_name"] = self.vpc_endpoint_name + body["{vpc_endpoint_name}"] = self.vpc_endpoint_name return body def as_shallow_dict(self) -> dict: """Serializes the VpcEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_account_id is not None: - body["aws_account_id"] = self.aws_account_id + body["{aws_account_id}"] = self.aws_account_id if self.aws_endpoint_service_id is not None: - body["aws_endpoint_service_id"] = self.aws_endpoint_service_id + body["{aws_endpoint_service_id}"] = self.aws_endpoint_service_id if self.aws_vpc_endpoint_id is not None: - body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id + body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info + body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.use_case is not None: - body["use_case"] = self.use_case + body["{use_case}"] = self.use_case if self.vpc_endpoint_id is not None: - body["vpc_endpoint_id"] = self.vpc_endpoint_id + body["{vpc_endpoint_id}"] = self.vpc_endpoint_id if self.vpc_endpoint_name is not None: - body["vpc_endpoint_name"] = self.vpc_endpoint_name + body["{vpc_endpoint_name}"] = self.vpc_endpoint_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VpcEndpoint: """Deserializes the VpcEndpoint from a dictionary.""" return cls( - account_id=d.get("account_id", None), - aws_account_id=d.get("aws_account_id", None), - aws_endpoint_service_id=d.get("aws_endpoint_service_id", None), - aws_vpc_endpoint_id=d.get("aws_vpc_endpoint_id", None), - gcp_vpc_endpoint_info=_from_dict(d, "gcp_vpc_endpoint_info", GcpVpcEndpointInfo), - region=d.get("region", None), - state=d.get("state", None), - use_case=_enum(d, "use_case", EndpointUseCase), - vpc_endpoint_id=d.get("vpc_endpoint_id", None), - vpc_endpoint_name=d.get("vpc_endpoint_name", None), + account_id=d.get("{account_id}", None), + aws_account_id=d.get("{aws_account_id}", None), + aws_endpoint_service_id=d.get("{aws_endpoint_service_id}", None), + aws_vpc_endpoint_id=d.get("{aws_vpc_endpoint_id}", None), + gcp_vpc_endpoint_info=_from_dict(d, "{gcp_vpc_endpoint_info}", GcpVpcEndpointInfo), + region=d.get("{region}", None), + state=d.get("{state}", None), + use_case=_enum(d, "{use_case}", EndpointUseCase), + vpc_endpoint_id=d.get("{vpc_endpoint_id}", None), + vpc_endpoint_name=d.get("{vpc_endpoint_name}", None), ) @@ -2174,136 +2173,136 @@ def as_dict(self) -> dict: """Serializes the Workspace into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.azure_workspace_info: - body["azure_workspace_info"] = self.azure_workspace_info.as_dict() + body["{azure_workspace_info}"] = self.azure_workspace_info.as_dict() if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.cloud_resource_container: - body["cloud_resource_container"] = self.cloud_resource_container.as_dict() + body["{cloud_resource_container}"] = self.cloud_resource_container.as_dict() if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.deployment_name is not None: - body["deployment_name"] = self.deployment_name + body["{deployment_name}"] = self.deployment_name if self.external_customer_info: - body["external_customer_info"] = self.external_customer_info.as_dict() + body["{external_customer_info}"] = self.external_customer_info.as_dict() if self.gcp_managed_network_config: - body["gcp_managed_network_config"] = self.gcp_managed_network_config.as_dict() + body["{gcp_managed_network_config}"] = self.gcp_managed_network_config.as_dict() if self.gke_config: - body["gke_config"] = self.gke_config.as_dict() + body["{gke_config}"] = self.gke_config.as_dict() if self.is_no_public_ip_enabled is not None: - body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled + body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled if self.location is not None: - body["location"] = self.location + body["{location}"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.pricing_tier is not None: - body["pricing_tier"] = self.pricing_tier.value + body["{pricing_tier}"] = self.pricing_tier.value if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id if self.workspace_name is not None: - body["workspace_name"] = self.workspace_name + body["{workspace_name}"] = self.workspace_name if self.workspace_status is not None: - body["workspace_status"] = self.workspace_status.value + body["{workspace_status}"] = self.workspace_status.value if self.workspace_status_message is not None: - body["workspace_status_message"] = self.workspace_status_message + body["{workspace_status_message}"] = self.workspace_status_message return body def as_shallow_dict(self) -> dict: """Serializes the Workspace into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.azure_workspace_info: - body["azure_workspace_info"] = self.azure_workspace_info + body["{azure_workspace_info}"] = self.azure_workspace_info if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.cloud_resource_container: - body["cloud_resource_container"] = self.cloud_resource_container + body["{cloud_resource_container}"] = self.cloud_resource_container if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.credentials_id is not None: - body["credentials_id"] = self.credentials_id + body["{credentials_id}"] = self.credentials_id if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags if self.deployment_name is not None: - body["deployment_name"] = self.deployment_name + body["{deployment_name}"] = self.deployment_name if self.external_customer_info: - body["external_customer_info"] = self.external_customer_info + body["{external_customer_info}"] = self.external_customer_info if self.gcp_managed_network_config: - body["gcp_managed_network_config"] = self.gcp_managed_network_config + body["{gcp_managed_network_config}"] = self.gcp_managed_network_config if self.gke_config: - body["gke_config"] = self.gke_config + body["{gke_config}"] = self.gke_config if self.is_no_public_ip_enabled is not None: - body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled + body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled if self.location is not None: - body["location"] = self.location + body["{location}"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["network_id"] = self.network_id + body["{network_id}"] = self.network_id if self.pricing_tier is not None: - body["pricing_tier"] = self.pricing_tier + body["{pricing_tier}"] = self.pricing_tier if self.private_access_settings_id is not None: - body["private_access_settings_id"] = self.private_access_settings_id + body["{private_access_settings_id}"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["storage_configuration_id"] = self.storage_configuration_id + body["{storage_configuration_id}"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id if self.workspace_name is not None: - body["workspace_name"] = self.workspace_name + body["{workspace_name}"] = self.workspace_name if self.workspace_status is not None: - body["workspace_status"] = self.workspace_status + body["{workspace_status}"] = self.workspace_status if self.workspace_status_message is not None: - body["workspace_status_message"] = self.workspace_status_message + body["{workspace_status_message}"] = self.workspace_status_message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Workspace: """Deserializes the Workspace from a dictionary.""" return cls( - account_id=d.get("account_id", None), - aws_region=d.get("aws_region", None), - azure_workspace_info=_from_dict(d, "azure_workspace_info", AzureWorkspaceInfo), - cloud=d.get("cloud", None), - cloud_resource_container=_from_dict(d, "cloud_resource_container", CloudResourceContainer), - creation_time=d.get("creation_time", None), - credentials_id=d.get("credentials_id", None), - custom_tags=d.get("custom_tags", None), - deployment_name=d.get("deployment_name", None), - external_customer_info=_from_dict(d, "external_customer_info", ExternalCustomerInfo), - gcp_managed_network_config=_from_dict(d, "gcp_managed_network_config", GcpManagedNetworkConfig), - gke_config=_from_dict(d, "gke_config", GkeConfig), - is_no_public_ip_enabled=d.get("is_no_public_ip_enabled", None), - location=d.get("location", None), - managed_services_customer_managed_key_id=d.get("managed_services_customer_managed_key_id", None), - network_id=d.get("network_id", None), - pricing_tier=_enum(d, "pricing_tier", PricingTier), - private_access_settings_id=d.get("private_access_settings_id", None), - storage_configuration_id=d.get("storage_configuration_id", None), - storage_customer_managed_key_id=d.get("storage_customer_managed_key_id", None), - workspace_id=d.get("workspace_id", None), - workspace_name=d.get("workspace_name", None), - workspace_status=_enum(d, "workspace_status", WorkspaceStatus), - workspace_status_message=d.get("workspace_status_message", None), + account_id=d.get("{account_id}", None), + aws_region=d.get("{aws_region}", None), + azure_workspace_info=_from_dict(d, "{azure_workspace_info}", AzureWorkspaceInfo), + cloud=d.get("{cloud}", None), + cloud_resource_container=_from_dict(d, "{cloud_resource_container}", CloudResourceContainer), + creation_time=d.get("{creation_time}", None), + credentials_id=d.get("{credentials_id}", None), + custom_tags=d.get("{custom_tags}", None), + deployment_name=d.get("{deployment_name}", None), + external_customer_info=_from_dict(d, "{external_customer_info}", ExternalCustomerInfo), + gcp_managed_network_config=_from_dict(d, "{gcp_managed_network_config}", GcpManagedNetworkConfig), + gke_config=_from_dict(d, "{gke_config}", GkeConfig), + is_no_public_ip_enabled=d.get("{is_no_public_ip_enabled}", None), + location=d.get("{location}", None), + managed_services_customer_managed_key_id=d.get("{managed_services_customer_managed_key_id}", None), + network_id=d.get("{network_id}", None), + pricing_tier=_enum(d, "{pricing_tier}", PricingTier), + private_access_settings_id=d.get("{private_access_settings_id}", None), + storage_configuration_id=d.get("{storage_configuration_id}", None), + storage_customer_managed_key_id=d.get("{storage_customer_managed_key_id}", None), + workspace_id=d.get("{workspace_id}", None), + workspace_name=d.get("{workspace_name}", None), + workspace_status=_enum(d, "{workspace_status}", WorkspaceStatus), + workspace_status_message=d.get("{workspace_status_message}", None), ) @@ -2352,12 +2351,12 @@ def create(self, credentials_name: str, aws_credentials: CreateCredentialAwsCred """ body = {} if aws_credentials is not None: - body["aws_credentials"] = aws_credentials.as_dict() + body["{aws_credentials}"] = aws_credentials.as_dict() if credentials_name is not None: - body["credentials_name"] = credentials_name + body["{credentials_name}"] = credentials_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/credentials", body=body, headers=headers) @@ -2376,7 +2375,7 @@ def delete(self, credentials_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -2395,7 +2394,7 @@ def get(self, credentials_id: str) -> Credential: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2412,7 +2411,7 @@ def list(self) -> Iterator[Credential]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/credentials", headers=headers) @@ -2469,14 +2468,14 @@ def create( """ body = {} if aws_key_info is not None: - body["aws_key_info"] = aws_key_info.as_dict() + body["{aws_key_info}"] = aws_key_info.as_dict() if gcp_key_info is not None: - body["gcp_key_info"] = gcp_key_info.as_dict() + body["{gcp_key_info}"] = gcp_key_info.as_dict() if use_cases is not None: - body["use_cases"] = [v.value for v in use_cases] + body["{use_cases}"] = [v.value for v in use_cases] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2497,7 +2496,7 @@ def delete(self, customer_managed_key_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -2529,7 +2528,7 @@ def get(self, customer_managed_key_id: str) -> CustomerManagedKey: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2557,7 +2556,7 @@ def list(self) -> Iterator[CustomerManagedKey]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/customer-managed-keys", headers=headers) @@ -2610,20 +2609,20 @@ def create( """ body = {} if gcp_network_info is not None: - body["gcp_network_info"] = gcp_network_info.as_dict() + body["{gcp_network_info}"] = gcp_network_info.as_dict() if network_name is not None: - body["network_name"] = network_name + body["{network_name}"] = network_name if security_group_ids is not None: - body["security_group_ids"] = [v for v in security_group_ids] + body["{security_group_ids}"] = [v for v in security_group_ids] if subnet_ids is not None: - body["subnet_ids"] = [v for v in subnet_ids] + body["{subnet_ids}"] = [v for v in subnet_ids] if vpc_endpoints is not None: - body["vpc_endpoints"] = vpc_endpoints.as_dict() + body["{vpc_endpoints}"] = vpc_endpoints.as_dict() if vpc_id is not None: - body["vpc_id"] = vpc_id + body["{vpc_id}"] = vpc_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/networks", body=body, headers=headers) @@ -2644,7 +2643,7 @@ def delete(self, network_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/accounts/{self._api.account_id}/networks/{network_id}", headers=headers) @@ -2661,7 +2660,7 @@ def get(self, network_id: str) -> Network: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/networks/{network_id}", headers=headers) @@ -2678,7 +2677,7 @@ def list(self) -> Iterator[Network]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/networks", headers=headers) @@ -2747,18 +2746,18 @@ def create( """ body = {} if allowed_vpc_endpoint_ids is not None: - body["allowed_vpc_endpoint_ids"] = [v for v in allowed_vpc_endpoint_ids] + body["{allowed_vpc_endpoint_ids}"] = [v for v in allowed_vpc_endpoint_ids] if private_access_level is not None: - body["private_access_level"] = private_access_level.value + body["{private_access_level}"] = private_access_level.value if private_access_settings_name is not None: - body["private_access_settings_name"] = private_access_settings_name + body["{private_access_settings_name}"] = private_access_settings_name if public_access_enabled is not None: - body["public_access_enabled"] = public_access_enabled + body["{public_access_enabled}"] = public_access_enabled if region is not None: - body["region"] = region + body["{region}"] = region headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2784,7 +2783,7 @@ def delete(self, private_access_settings_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -2811,7 +2810,7 @@ def get(self, private_access_settings_id: str) -> PrivateAccessSettings: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -2830,7 +2829,7 @@ def list(self) -> Iterator[PrivateAccessSettings]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/private-access-settings", headers=headers) @@ -2900,18 +2899,18 @@ def replace( """ body = {} if allowed_vpc_endpoint_ids is not None: - body["allowed_vpc_endpoint_ids"] = [v for v in allowed_vpc_endpoint_ids] + body["{allowed_vpc_endpoint_ids}"] = [v for v in allowed_vpc_endpoint_ids] if private_access_level is not None: - body["private_access_level"] = private_access_level.value + body["{private_access_level}"] = private_access_level.value if private_access_settings_name is not None: - body["private_access_settings_name"] = private_access_settings_name + body["{private_access_settings_name}"] = private_access_settings_name if public_access_enabled is not None: - body["public_access_enabled"] = public_access_enabled + body["{public_access_enabled}"] = public_access_enabled if region is not None: - body["region"] = region + body["{region}"] = region headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do( @@ -2953,12 +2952,12 @@ def create(self, storage_configuration_name: str, root_bucket_info: RootBucketIn """ body = {} if root_bucket_info is not None: - body["root_bucket_info"] = root_bucket_info.as_dict() + body["{root_bucket_info}"] = root_bucket_info.as_dict() if storage_configuration_name is not None: - body["storage_configuration_name"] = storage_configuration_name + body["{storage_configuration_name}"] = storage_configuration_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2979,7 +2978,7 @@ def delete(self, storage_configuration_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -3000,7 +2999,7 @@ def get(self, storage_configuration_id: str) -> StorageConfiguration: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3019,7 +3018,7 @@ def list(self) -> Iterator[StorageConfiguration]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/storage-configurations", headers=headers) @@ -3068,16 +3067,16 @@ def create( """ body = {} if aws_vpc_endpoint_id is not None: - body["aws_vpc_endpoint_id"] = aws_vpc_endpoint_id + body["{aws_vpc_endpoint_id}"] = aws_vpc_endpoint_id if gcp_vpc_endpoint_info is not None: - body["gcp_vpc_endpoint_info"] = gcp_vpc_endpoint_info.as_dict() + body["{gcp_vpc_endpoint_info}"] = gcp_vpc_endpoint_info.as_dict() if region is not None: - body["region"] = region + body["{region}"] = region if vpc_endpoint_name is not None: - body["vpc_endpoint_name"] = vpc_endpoint_name + body["{vpc_endpoint_name}"] = vpc_endpoint_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3104,7 +3103,7 @@ def delete(self, vpc_endpoint_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -3127,7 +3126,7 @@ def get(self, vpc_endpoint_id: str) -> VpcEndpoint: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3148,7 +3147,7 @@ def list(self) -> Iterator[VpcEndpoint]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/vpc-endpoints", headers=headers) @@ -3166,38 +3165,6 @@ class WorkspacesAPI: def __init__(self, api_client): self._api = api_client - def wait_get_workspace_running( - self, workspace_id: int, timeout=timedelta(minutes=20), callback: Optional[Callable[[Workspace], None]] = None - ) -> Workspace: - deadline = time.time() + timeout.total_seconds() - target_states = (WorkspaceStatus.RUNNING,) - failure_states = ( - WorkspaceStatus.BANNED, - WorkspaceStatus.FAILED, - ) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(workspace_id=workspace_id) - status = poll.workspace_status - status_message = poll.workspace_status_message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach RUNNING, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"workspace_id={workspace_id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create( self, workspace_name: str, @@ -3321,55 +3288,55 @@ def create( :returns: Long-running operation waiter for :class:`Workspace`. - See :method:wait_get_workspace_running for more details. + See :method:WaitGetWorkspaceRunning for more details. """ body = {} if aws_region is not None: - body["aws_region"] = aws_region + body["{aws_region}"] = aws_region if cloud is not None: - body["cloud"] = cloud + body["{cloud}"] = cloud if cloud_resource_container is not None: - body["cloud_resource_container"] = cloud_resource_container.as_dict() + body["{cloud_resource_container}"] = cloud_resource_container.as_dict() if credentials_id is not None: - body["credentials_id"] = credentials_id + body["{credentials_id}"] = credentials_id if custom_tags is not None: - body["custom_tags"] = custom_tags + body["{custom_tags}"] = custom_tags if deployment_name is not None: - body["deployment_name"] = deployment_name + body["{deployment_name}"] = deployment_name if gcp_managed_network_config is not None: - body["gcp_managed_network_config"] = gcp_managed_network_config.as_dict() + body["{gcp_managed_network_config}"] = gcp_managed_network_config.as_dict() if gke_config is not None: - body["gke_config"] = gke_config.as_dict() + body["{gke_config}"] = gke_config.as_dict() if is_no_public_ip_enabled is not None: - body["is_no_public_ip_enabled"] = is_no_public_ip_enabled + body["{is_no_public_ip_enabled}"] = is_no_public_ip_enabled if location is not None: - body["location"] = location + body["{location}"] = location if managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = managed_services_customer_managed_key_id if network_id is not None: - body["network_id"] = network_id + body["{network_id}"] = network_id if pricing_tier is not None: - body["pricing_tier"] = pricing_tier.value + body["{pricing_tier}"] = pricing_tier.value if private_access_settings_id is not None: - body["private_access_settings_id"] = private_access_settings_id + body["{private_access_settings_id}"] = private_access_settings_id if storage_configuration_id is not None: - body["storage_configuration_id"] = storage_configuration_id + body["{storage_configuration_id}"] = storage_configuration_id if storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = storage_customer_managed_key_id if workspace_name is not None: - body["workspace_name"] = workspace_name + body["{workspace_name}"] = workspace_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do( "POST", f"/api/2.0/accounts/{self._api.account_id}/workspaces", body=body, headers=headers ) return Wait( - self.wait_get_workspace_running, + self.WaitGetWorkspaceRunning, response=Workspace.from_dict(op_response), - workspace_id=op_response["workspace_id"], + workspace_id=op_response["{workspace_id}"], ) def create_and_wait( @@ -3431,7 +3398,7 @@ def delete(self, workspace_id: int): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}", headers=headers) @@ -3459,7 +3426,7 @@ def get(self, workspace_id: int) -> Workspace: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3479,7 +3446,7 @@ def list(self) -> Iterator[Workspace]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/workspaces", headers=headers) @@ -3627,37 +3594,37 @@ def update( :returns: Long-running operation waiter for :class:`Workspace`. - See :method:wait_get_workspace_running for more details. + See :method:WaitGetWorkspaceRunning for more details. """ body = {} if aws_region is not None: - body["aws_region"] = aws_region + body["{aws_region}"] = aws_region if credentials_id is not None: - body["credentials_id"] = credentials_id + body["{credentials_id}"] = credentials_id if custom_tags is not None: - body["custom_tags"] = custom_tags + body["{custom_tags}"] = custom_tags if managed_services_customer_managed_key_id is not None: - body["managed_services_customer_managed_key_id"] = managed_services_customer_managed_key_id + body["{managed_services_customer_managed_key_id}"] = managed_services_customer_managed_key_id if network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = network_connectivity_config_id + body["{network_connectivity_config_id}"] = network_connectivity_config_id if network_id is not None: - body["network_id"] = network_id + body["{network_id}"] = network_id if private_access_settings_id is not None: - body["private_access_settings_id"] = private_access_settings_id + body["{private_access_settings_id}"] = private_access_settings_id if storage_configuration_id is not None: - body["storage_configuration_id"] = storage_configuration_id + body["{storage_configuration_id}"] = storage_configuration_id if storage_customer_managed_key_id is not None: - body["storage_customer_managed_key_id"] = storage_customer_managed_key_id + body["{storage_customer_managed_key_id}"] = storage_customer_managed_key_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do( "PATCH", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}", body=body, headers=headers ) return Wait( - self.wait_get_workspace_running, response=UpdateResponse.from_dict(op_response), workspace_id=workspace_id + self.WaitGetWorkspaceRunning, response=UpdateResponse.from_dict(op_response), workspace_id=workspace_id ) def update_and_wait( diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/serving/v2/impl.py similarity index 71% rename from databricks/sdk/service/serving.py rename to databricks/sdk/serving/v2/impl.py index eb8056b69..2c17b28ca 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/serving/v2/impl.py @@ -3,22 +3,15 @@ from __future__ import annotations import logging -import random -import threading -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, BinaryIO, Callable, Dict, Iterator, List, Optional +from typing import Any, BinaryIO, Dict, Iterator, List, Optional -import requests - -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import Wait, _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -38,26 +31,26 @@ def as_dict(self) -> dict: """Serializes the Ai21LabsConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai21labs_api_key is not None: - body["ai21labs_api_key"] = self.ai21labs_api_key + body["{ai21labs_api_key}"] = self.ai21labs_api_key if self.ai21labs_api_key_plaintext is not None: - body["ai21labs_api_key_plaintext"] = self.ai21labs_api_key_plaintext + body["{ai21labs_api_key_plaintext}"] = self.ai21labs_api_key_plaintext return body def as_shallow_dict(self) -> dict: """Serializes the Ai21LabsConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.ai21labs_api_key is not None: - body["ai21labs_api_key"] = self.ai21labs_api_key + body["{ai21labs_api_key}"] = self.ai21labs_api_key if self.ai21labs_api_key_plaintext is not None: - body["ai21labs_api_key_plaintext"] = self.ai21labs_api_key_plaintext + body["{ai21labs_api_key_plaintext}"] = self.ai21labs_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Ai21LabsConfig: """Deserializes the Ai21LabsConfig from a dictionary.""" return cls( - ai21labs_api_key=d.get("ai21labs_api_key", None), - ai21labs_api_key_plaintext=d.get("ai21labs_api_key_plaintext", None), + ai21labs_api_key=d.get("{ai21labs_api_key}", None), + ai21labs_api_key_plaintext=d.get("{ai21labs_api_key_plaintext}", None), ) @@ -86,41 +79,41 @@ def as_dict(self) -> dict: """Serializes the AiGatewayConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.fallback_config: - body["fallback_config"] = self.fallback_config.as_dict() + body["{fallback_config}"] = self.fallback_config.as_dict() if self.guardrails: - body["guardrails"] = self.guardrails.as_dict() + body["{guardrails}"] = self.guardrails.as_dict() if self.inference_table_config: - body["inference_table_config"] = self.inference_table_config.as_dict() + body["{inference_table_config}"] = self.inference_table_config.as_dict() if self.rate_limits: - body["rate_limits"] = [v.as_dict() for v in self.rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] if self.usage_tracking_config: - body["usage_tracking_config"] = self.usage_tracking_config.as_dict() + body["{usage_tracking_config}"] = self.usage_tracking_config.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AiGatewayConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.fallback_config: - body["fallback_config"] = self.fallback_config + body["{fallback_config}"] = self.fallback_config if self.guardrails: - body["guardrails"] = self.guardrails + body["{guardrails}"] = self.guardrails if self.inference_table_config: - body["inference_table_config"] = self.inference_table_config + body["{inference_table_config}"] = self.inference_table_config if self.rate_limits: - body["rate_limits"] = self.rate_limits + body["{rate_limits}"] = self.rate_limits if self.usage_tracking_config: - body["usage_tracking_config"] = self.usage_tracking_config + body["{usage_tracking_config}"] = self.usage_tracking_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayConfig: """Deserializes the AiGatewayConfig from a dictionary.""" return cls( - fallback_config=_from_dict(d, "fallback_config", FallbackConfig), - guardrails=_from_dict(d, "guardrails", AiGatewayGuardrails), - inference_table_config=_from_dict(d, "inference_table_config", AiGatewayInferenceTableConfig), - rate_limits=_repeated_dict(d, "rate_limits", AiGatewayRateLimit), - usage_tracking_config=_from_dict(d, "usage_tracking_config", AiGatewayUsageTrackingConfig), + fallback_config=_from_dict(d, "{fallback_config}", FallbackConfig), + guardrails=_from_dict(d, "{guardrails}", AiGatewayGuardrails), + inference_table_config=_from_dict(d, "{inference_table_config}", AiGatewayInferenceTableConfig), + rate_limits=_repeated_dict(d, "{rate_limits}", AiGatewayRateLimit), + usage_tracking_config=_from_dict(d, "{usage_tracking_config}", AiGatewayUsageTrackingConfig), ) @@ -144,36 +137,36 @@ def as_dict(self) -> dict: """Serializes the AiGatewayGuardrailParameters into a dictionary suitable for use as a JSON request body.""" body = {} if self.invalid_keywords: - body["invalid_keywords"] = [v for v in self.invalid_keywords] + body["{invalid_keywords}"] = [v for v in self.invalid_keywords] if self.pii: - body["pii"] = self.pii.as_dict() + body["{pii}"] = self.pii.as_dict() if self.safety is not None: - body["safety"] = self.safety + body["{safety}"] = self.safety if self.valid_topics: - body["valid_topics"] = [v for v in self.valid_topics] + body["{valid_topics}"] = [v for v in self.valid_topics] return body def as_shallow_dict(self) -> dict: """Serializes the AiGatewayGuardrailParameters into a shallow dictionary of its immediate attributes.""" body = {} if self.invalid_keywords: - body["invalid_keywords"] = self.invalid_keywords + body["{invalid_keywords}"] = self.invalid_keywords if self.pii: - body["pii"] = self.pii + body["{pii}"] = self.pii if self.safety is not None: - body["safety"] = self.safety + body["{safety}"] = self.safety if self.valid_topics: - body["valid_topics"] = self.valid_topics + body["{valid_topics}"] = self.valid_topics return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayGuardrailParameters: """Deserializes the AiGatewayGuardrailParameters from a dictionary.""" return cls( - invalid_keywords=d.get("invalid_keywords", None), - pii=_from_dict(d, "pii", AiGatewayGuardrailPiiBehavior), - safety=d.get("safety", None), - valid_topics=d.get("valid_topics", None), + invalid_keywords=d.get("{invalid_keywords}", None), + pii=_from_dict(d, "{pii}", AiGatewayGuardrailPiiBehavior), + safety=d.get("{safety}", None), + valid_topics=d.get("{valid_topics}", None), ) @@ -186,20 +179,20 @@ def as_dict(self) -> dict: """Serializes the AiGatewayGuardrailPiiBehavior into a dictionary suitable for use as a JSON request body.""" body = {} if self.behavior is not None: - body["behavior"] = self.behavior.value + body["{behavior}"] = self.behavior.value return body def as_shallow_dict(self) -> dict: """Serializes the AiGatewayGuardrailPiiBehavior into a shallow dictionary of its immediate attributes.""" body = {} if self.behavior is not None: - body["behavior"] = self.behavior + body["{behavior}"] = self.behavior return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayGuardrailPiiBehavior: """Deserializes the AiGatewayGuardrailPiiBehavior from a dictionary.""" - return cls(behavior=_enum(d, "behavior", AiGatewayGuardrailPiiBehaviorBehavior)) + return cls(behavior=_enum(d, "{behavior}", AiGatewayGuardrailPiiBehaviorBehavior)) class AiGatewayGuardrailPiiBehaviorBehavior(Enum): @@ -220,26 +213,26 @@ def as_dict(self) -> dict: """Serializes the AiGatewayGuardrails into a dictionary suitable for use as a JSON request body.""" body = {} if self.input: - body["input"] = self.input.as_dict() + body["{input}"] = self.input.as_dict() if self.output: - body["output"] = self.output.as_dict() + body["{output}"] = self.output.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AiGatewayGuardrails into a shallow dictionary of its immediate attributes.""" body = {} if self.input: - body["input"] = self.input + body["{input}"] = self.input if self.output: - body["output"] = self.output + body["{output}"] = self.output return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayGuardrails: """Deserializes the AiGatewayGuardrails from a dictionary.""" return cls( - input=_from_dict(d, "input", AiGatewayGuardrailParameters), - output=_from_dict(d, "output", AiGatewayGuardrailParameters), + input=_from_dict(d, "{input}", AiGatewayGuardrailParameters), + output=_from_dict(d, "{output}", AiGatewayGuardrailParameters), ) @@ -264,36 +257,36 @@ def as_dict(self) -> dict: """Serializes the AiGatewayInferenceTableConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.table_name_prefix is not None: - body["table_name_prefix"] = self.table_name_prefix + body["{table_name_prefix}"] = self.table_name_prefix return body def as_shallow_dict(self) -> dict: """Serializes the AiGatewayInferenceTableConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.table_name_prefix is not None: - body["table_name_prefix"] = self.table_name_prefix + body["{table_name_prefix}"] = self.table_name_prefix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayInferenceTableConfig: """Deserializes the AiGatewayInferenceTableConfig from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - enabled=d.get("enabled", None), - schema_name=d.get("schema_name", None), - table_name_prefix=d.get("table_name_prefix", None), + catalog_name=d.get("{catalog_name}", None), + enabled=d.get("{enabled}", None), + schema_name=d.get("{schema_name}", None), + table_name_prefix=d.get("{table_name_prefix}", None), ) @@ -313,31 +306,31 @@ def as_dict(self) -> dict: """Serializes the AiGatewayRateLimit into a dictionary suitable for use as a JSON request body.""" body = {} if self.calls is not None: - body["calls"] = self.calls + body["{calls}"] = self.calls if self.key is not None: - body["key"] = self.key.value + body["{key}"] = self.key.value if self.renewal_period is not None: - body["renewal_period"] = self.renewal_period.value + body["{renewal_period}"] = self.renewal_period.value return body def as_shallow_dict(self) -> dict: """Serializes the AiGatewayRateLimit into a shallow dictionary of its immediate attributes.""" body = {} if self.calls is not None: - body["calls"] = self.calls + body["{calls}"] = self.calls if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.renewal_period is not None: - body["renewal_period"] = self.renewal_period + body["{renewal_period}"] = self.renewal_period return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayRateLimit: """Deserializes the AiGatewayRateLimit from a dictionary.""" return cls( - calls=d.get("calls", None), - key=_enum(d, "key", AiGatewayRateLimitKey), - renewal_period=_enum(d, "renewal_period", AiGatewayRateLimitRenewalPeriod), + calls=d.get("{calls}", None), + key=_enum(d, "{key}", AiGatewayRateLimitKey), + renewal_period=_enum(d, "{renewal_period}", AiGatewayRateLimitRenewalPeriod), ) @@ -361,20 +354,20 @@ def as_dict(self) -> dict: """Serializes the AiGatewayUsageTrackingConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body def as_shallow_dict(self) -> dict: """Serializes the AiGatewayUsageTrackingConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayUsageTrackingConfig: """Deserializes the AiGatewayUsageTrackingConfig from a dictionary.""" - return cls(enabled=d.get("enabled", None)) + return cls(enabled=d.get("{enabled}", None)) @dataclass @@ -420,51 +413,51 @@ def as_dict(self) -> dict: """Serializes the AmazonBedrockConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_access_key_id is not None: - body["aws_access_key_id"] = self.aws_access_key_id + body["{aws_access_key_id}"] = self.aws_access_key_id if self.aws_access_key_id_plaintext is not None: - body["aws_access_key_id_plaintext"] = self.aws_access_key_id_plaintext + body["{aws_access_key_id_plaintext}"] = self.aws_access_key_id_plaintext if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.aws_secret_access_key is not None: - body["aws_secret_access_key"] = self.aws_secret_access_key + body["{aws_secret_access_key}"] = self.aws_secret_access_key if self.aws_secret_access_key_plaintext is not None: - body["aws_secret_access_key_plaintext"] = self.aws_secret_access_key_plaintext + body["{aws_secret_access_key_plaintext}"] = self.aws_secret_access_key_plaintext if self.bedrock_provider is not None: - body["bedrock_provider"] = self.bedrock_provider.value + body["{bedrock_provider}"] = self.bedrock_provider.value if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn return body def as_shallow_dict(self) -> dict: """Serializes the AmazonBedrockConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_access_key_id is not None: - body["aws_access_key_id"] = self.aws_access_key_id + body["{aws_access_key_id}"] = self.aws_access_key_id if self.aws_access_key_id_plaintext is not None: - body["aws_access_key_id_plaintext"] = self.aws_access_key_id_plaintext + body["{aws_access_key_id_plaintext}"] = self.aws_access_key_id_plaintext if self.aws_region is not None: - body["aws_region"] = self.aws_region + body["{aws_region}"] = self.aws_region if self.aws_secret_access_key is not None: - body["aws_secret_access_key"] = self.aws_secret_access_key + body["{aws_secret_access_key}"] = self.aws_secret_access_key if self.aws_secret_access_key_plaintext is not None: - body["aws_secret_access_key_plaintext"] = self.aws_secret_access_key_plaintext + body["{aws_secret_access_key_plaintext}"] = self.aws_secret_access_key_plaintext if self.bedrock_provider is not None: - body["bedrock_provider"] = self.bedrock_provider + body["{bedrock_provider}"] = self.bedrock_provider if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AmazonBedrockConfig: """Deserializes the AmazonBedrockConfig from a dictionary.""" return cls( - aws_access_key_id=d.get("aws_access_key_id", None), - aws_access_key_id_plaintext=d.get("aws_access_key_id_plaintext", None), - aws_region=d.get("aws_region", None), - aws_secret_access_key=d.get("aws_secret_access_key", None), - aws_secret_access_key_plaintext=d.get("aws_secret_access_key_plaintext", None), - bedrock_provider=_enum(d, "bedrock_provider", AmazonBedrockConfigBedrockProvider), - instance_profile_arn=d.get("instance_profile_arn", None), + aws_access_key_id=d.get("{aws_access_key_id}", None), + aws_access_key_id_plaintext=d.get("{aws_access_key_id_plaintext}", None), + aws_region=d.get("{aws_region}", None), + aws_secret_access_key=d.get("{aws_secret_access_key}", None), + aws_secret_access_key_plaintext=d.get("{aws_secret_access_key_plaintext}", None), + bedrock_provider=_enum(d, "{bedrock_provider}", AmazonBedrockConfigBedrockProvider), + instance_profile_arn=d.get("{instance_profile_arn}", None), ) @@ -492,26 +485,26 @@ def as_dict(self) -> dict: """Serializes the AnthropicConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.anthropic_api_key is not None: - body["anthropic_api_key"] = self.anthropic_api_key + body["{anthropic_api_key}"] = self.anthropic_api_key if self.anthropic_api_key_plaintext is not None: - body["anthropic_api_key_plaintext"] = self.anthropic_api_key_plaintext + body["{anthropic_api_key_plaintext}"] = self.anthropic_api_key_plaintext return body def as_shallow_dict(self) -> dict: """Serializes the AnthropicConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.anthropic_api_key is not None: - body["anthropic_api_key"] = self.anthropic_api_key + body["{anthropic_api_key}"] = self.anthropic_api_key if self.anthropic_api_key_plaintext is not None: - body["anthropic_api_key_plaintext"] = self.anthropic_api_key_plaintext + body["{anthropic_api_key_plaintext}"] = self.anthropic_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AnthropicConfig: """Deserializes the AnthropicConfig from a dictionary.""" return cls( - anthropic_api_key=d.get("anthropic_api_key", None), - anthropic_api_key_plaintext=d.get("anthropic_api_key_plaintext", None), + anthropic_api_key=d.get("{anthropic_api_key}", None), + anthropic_api_key_plaintext=d.get("{anthropic_api_key_plaintext}", None), ) @@ -532,28 +525,30 @@ def as_dict(self) -> dict: """Serializes the ApiKeyAuth into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value if self.value_plaintext is not None: - body["value_plaintext"] = self.value_plaintext + body["{value_plaintext}"] = self.value_plaintext return body def as_shallow_dict(self) -> dict: """Serializes the ApiKeyAuth into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value if self.value_plaintext is not None: - body["value_plaintext"] = self.value_plaintext + body["{value_plaintext}"] = self.value_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApiKeyAuth: """Deserializes the ApiKeyAuth from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None), value_plaintext=d.get("value_plaintext", None)) + return cls( + key=d.get("{key}", None), value=d.get("{value}", None), value_plaintext=d.get("{value_plaintext}", None) + ) @dataclass @@ -577,36 +572,36 @@ def as_dict(self) -> dict: """Serializes the AutoCaptureConfigInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.table_name_prefix is not None: - body["table_name_prefix"] = self.table_name_prefix + body["{table_name_prefix}"] = self.table_name_prefix return body def as_shallow_dict(self) -> dict: """Serializes the AutoCaptureConfigInput into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.table_name_prefix is not None: - body["table_name_prefix"] = self.table_name_prefix + body["{table_name_prefix}"] = self.table_name_prefix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoCaptureConfigInput: """Deserializes the AutoCaptureConfigInput from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - enabled=d.get("enabled", None), - schema_name=d.get("schema_name", None), - table_name_prefix=d.get("table_name_prefix", None), + catalog_name=d.get("{catalog_name}", None), + enabled=d.get("{enabled}", None), + schema_name=d.get("{schema_name}", None), + table_name_prefix=d.get("{table_name_prefix}", None), ) @@ -633,41 +628,41 @@ def as_dict(self) -> dict: """Serializes the AutoCaptureConfigOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.table_name_prefix is not None: - body["table_name_prefix"] = self.table_name_prefix + body["{table_name_prefix}"] = self.table_name_prefix return body def as_shallow_dict(self) -> dict: """Serializes the AutoCaptureConfigOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["catalog_name"] = self.catalog_name + body["{catalog_name}"] = self.catalog_name if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.table_name_prefix is not None: - body["table_name_prefix"] = self.table_name_prefix + body["{table_name_prefix}"] = self.table_name_prefix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoCaptureConfigOutput: """Deserializes the AutoCaptureConfigOutput from a dictionary.""" return cls( - catalog_name=d.get("catalog_name", None), - enabled=d.get("enabled", None), - schema_name=d.get("schema_name", None), - state=_from_dict(d, "state", AutoCaptureState), - table_name_prefix=d.get("table_name_prefix", None), + catalog_name=d.get("{catalog_name}", None), + enabled=d.get("{enabled}", None), + schema_name=d.get("{schema_name}", None), + state=_from_dict(d, "{state}", AutoCaptureState), + table_name_prefix=d.get("{table_name_prefix}", None), ) @@ -679,20 +674,20 @@ def as_dict(self) -> dict: """Serializes the AutoCaptureState into a dictionary suitable for use as a JSON request body.""" body = {} if self.payload_table: - body["payload_table"] = self.payload_table.as_dict() + body["{payload_table}"] = self.payload_table.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AutoCaptureState into a shallow dictionary of its immediate attributes.""" body = {} if self.payload_table: - body["payload_table"] = self.payload_table + body["{payload_table}"] = self.payload_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoCaptureState: """Deserializes the AutoCaptureState from a dictionary.""" - return cls(payload_table=_from_dict(d, "payload_table", PayloadTable)) + return cls(payload_table=_from_dict(d, "{payload_table}", PayloadTable)) @dataclass @@ -709,24 +704,24 @@ def as_dict(self) -> dict: """Serializes the BearerTokenAuth into a dictionary suitable for use as a JSON request body.""" body = {} if self.token is not None: - body["token"] = self.token + body["{token}"] = self.token if self.token_plaintext is not None: - body["token_plaintext"] = self.token_plaintext + body["{token_plaintext}"] = self.token_plaintext return body def as_shallow_dict(self) -> dict: """Serializes the BearerTokenAuth into a shallow dictionary of its immediate attributes.""" body = {} if self.token is not None: - body["token"] = self.token + body["{token}"] = self.token if self.token_plaintext is not None: - body["token_plaintext"] = self.token_plaintext + body["{token_plaintext}"] = self.token_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BearerTokenAuth: """Deserializes the BearerTokenAuth from a dictionary.""" - return cls(token=d.get("token", None), token_plaintext=d.get("token_plaintext", None)) + return cls(token=d.get("{token}", None), token_plaintext=d.get("{token_plaintext}", None)) @dataclass @@ -738,20 +733,20 @@ def as_dict(self) -> dict: """Serializes the BuildLogsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.logs is not None: - body["logs"] = self.logs + body["{logs}"] = self.logs return body def as_shallow_dict(self) -> dict: """Serializes the BuildLogsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.logs is not None: - body["logs"] = self.logs + body["{logs}"] = self.logs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BuildLogsResponse: """Deserializes the BuildLogsResponse from a dictionary.""" - return cls(logs=d.get("logs", None)) + return cls(logs=d.get("{logs}", None)) @dataclass @@ -766,24 +761,24 @@ def as_dict(self) -> dict: """Serializes the ChatMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.role is not None: - body["role"] = self.role.value + body["{role}"] = self.role.value return body def as_shallow_dict(self) -> dict: """Serializes the ChatMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.role is not None: - body["role"] = self.role + body["{role}"] = self.role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ChatMessage: """Deserializes the ChatMessage from a dictionary.""" - return cls(content=d.get("content", None), role=_enum(d, "role", ChatMessageRole)) + return cls(content=d.get("{content}", None), role=_enum(d, "{role}", ChatMessageRole)) class ChatMessageRole(Enum): @@ -814,31 +809,31 @@ def as_dict(self) -> dict: """Serializes the CohereConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.cohere_api_base is not None: - body["cohere_api_base"] = self.cohere_api_base + body["{cohere_api_base}"] = self.cohere_api_base if self.cohere_api_key is not None: - body["cohere_api_key"] = self.cohere_api_key + body["{cohere_api_key}"] = self.cohere_api_key if self.cohere_api_key_plaintext is not None: - body["cohere_api_key_plaintext"] = self.cohere_api_key_plaintext + body["{cohere_api_key_plaintext}"] = self.cohere_api_key_plaintext return body def as_shallow_dict(self) -> dict: """Serializes the CohereConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.cohere_api_base is not None: - body["cohere_api_base"] = self.cohere_api_base + body["{cohere_api_base}"] = self.cohere_api_base if self.cohere_api_key is not None: - body["cohere_api_key"] = self.cohere_api_key + body["{cohere_api_key}"] = self.cohere_api_key if self.cohere_api_key_plaintext is not None: - body["cohere_api_key_plaintext"] = self.cohere_api_key_plaintext + body["{cohere_api_key_plaintext}"] = self.cohere_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CohereConfig: """Deserializes the CohereConfig from a dictionary.""" return cls( - cohere_api_base=d.get("cohere_api_base", None), - cohere_api_key=d.get("cohere_api_key", None), - cohere_api_key_plaintext=d.get("cohere_api_key_plaintext", None), + cohere_api_base=d.get("{cohere_api_base}", None), + cohere_api_key=d.get("{cohere_api_key}", None), + cohere_api_key_plaintext=d.get("{cohere_api_key_plaintext}", None), ) @@ -872,51 +867,51 @@ def as_dict(self) -> dict: """Serializes the CreateServingEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai_gateway: - body["ai_gateway"] = self.ai_gateway.as_dict() + body["{ai_gateway}"] = self.ai_gateway.as_dict() if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.config: - body["config"] = self.config.as_dict() + body["{config}"] = self.config.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rate_limits: - body["rate_limits"] = [v.as_dict() for v in self.rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] if self.route_optimized is not None: - body["route_optimized"] = self.route_optimized + body["{route_optimized}"] = self.route_optimized if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the CreateServingEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.ai_gateway: - body["ai_gateway"] = self.ai_gateway + body["{ai_gateway}"] = self.ai_gateway if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.config: - body["config"] = self.config + body["{config}"] = self.config if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rate_limits: - body["rate_limits"] = self.rate_limits + body["{rate_limits}"] = self.rate_limits if self.route_optimized is not None: - body["route_optimized"] = self.route_optimized + body["{route_optimized}"] = self.route_optimized if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateServingEndpoint: """Deserializes the CreateServingEndpoint from a dictionary.""" return cls( - ai_gateway=_from_dict(d, "ai_gateway", AiGatewayConfig), - budget_policy_id=d.get("budget_policy_id", None), - config=_from_dict(d, "config", EndpointCoreConfigInput), - name=d.get("name", None), - rate_limits=_repeated_dict(d, "rate_limits", RateLimit), - route_optimized=d.get("route_optimized", None), - tags=_repeated_dict(d, "tags", EndpointTag), + ai_gateway=_from_dict(d, "{ai_gateway}", AiGatewayConfig), + budget_policy_id=d.get("{budget_policy_id}", None), + config=_from_dict(d, "{config}", EndpointCoreConfigInput), + name=d.get("{name}", None), + rate_limits=_repeated_dict(d, "{rate_limits}", RateLimit), + route_optimized=d.get("{route_optimized}", None), + tags=_repeated_dict(d, "{tags}", EndpointTag), ) @@ -939,31 +934,31 @@ def as_dict(self) -> dict: """Serializes the CustomProviderConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.api_key_auth: - body["api_key_auth"] = self.api_key_auth.as_dict() + body["{api_key_auth}"] = self.api_key_auth.as_dict() if self.bearer_token_auth: - body["bearer_token_auth"] = self.bearer_token_auth.as_dict() + body["{bearer_token_auth}"] = self.bearer_token_auth.as_dict() if self.custom_provider_url is not None: - body["custom_provider_url"] = self.custom_provider_url + body["{custom_provider_url}"] = self.custom_provider_url return body def as_shallow_dict(self) -> dict: """Serializes the CustomProviderConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.api_key_auth: - body["api_key_auth"] = self.api_key_auth + body["{api_key_auth}"] = self.api_key_auth if self.bearer_token_auth: - body["bearer_token_auth"] = self.bearer_token_auth + body["{bearer_token_auth}"] = self.bearer_token_auth if self.custom_provider_url is not None: - body["custom_provider_url"] = self.custom_provider_url + body["{custom_provider_url}"] = self.custom_provider_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomProviderConfig: """Deserializes the CustomProviderConfig from a dictionary.""" return cls( - api_key_auth=_from_dict(d, "api_key_auth", ApiKeyAuth), - bearer_token_auth=_from_dict(d, "bearer_token_auth", BearerTokenAuth), - custom_provider_url=d.get("custom_provider_url", None), + api_key_auth=_from_dict(d, "{api_key_auth}", ApiKeyAuth), + bearer_token_auth=_from_dict(d, "{bearer_token_auth}", BearerTokenAuth), + custom_provider_url=d.get("{custom_provider_url}", None), ) @@ -981,24 +976,26 @@ def as_dict(self) -> dict: """Serializes the DataPlaneInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.authorization_details is not None: - body["authorization_details"] = self.authorization_details + body["{authorization_details}"] = self.authorization_details if self.endpoint_url is not None: - body["endpoint_url"] = self.endpoint_url + body["{endpoint_url}"] = self.endpoint_url return body def as_shallow_dict(self) -> dict: """Serializes the DataPlaneInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.authorization_details is not None: - body["authorization_details"] = self.authorization_details + body["{authorization_details}"] = self.authorization_details if self.endpoint_url is not None: - body["endpoint_url"] = self.endpoint_url + body["{endpoint_url}"] = self.endpoint_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataPlaneInfo: """Deserializes the DataPlaneInfo from a dictionary.""" - return cls(authorization_details=d.get("authorization_details", None), endpoint_url=d.get("endpoint_url", None)) + return cls( + authorization_details=d.get("{authorization_details}", None), endpoint_url=d.get("{endpoint_url}", None) + ) @dataclass @@ -1025,31 +1022,31 @@ def as_dict(self) -> dict: """Serializes the DatabricksModelServingConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.databricks_api_token is not None: - body["databricks_api_token"] = self.databricks_api_token + body["{databricks_api_token}"] = self.databricks_api_token if self.databricks_api_token_plaintext is not None: - body["databricks_api_token_plaintext"] = self.databricks_api_token_plaintext + body["{databricks_api_token_plaintext}"] = self.databricks_api_token_plaintext if self.databricks_workspace_url is not None: - body["databricks_workspace_url"] = self.databricks_workspace_url + body["{databricks_workspace_url}"] = self.databricks_workspace_url return body def as_shallow_dict(self) -> dict: """Serializes the DatabricksModelServingConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.databricks_api_token is not None: - body["databricks_api_token"] = self.databricks_api_token + body["{databricks_api_token}"] = self.databricks_api_token if self.databricks_api_token_plaintext is not None: - body["databricks_api_token_plaintext"] = self.databricks_api_token_plaintext + body["{databricks_api_token_plaintext}"] = self.databricks_api_token_plaintext if self.databricks_workspace_url is not None: - body["databricks_workspace_url"] = self.databricks_workspace_url + body["{databricks_workspace_url}"] = self.databricks_workspace_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatabricksModelServingConfig: """Deserializes the DatabricksModelServingConfig from a dictionary.""" return cls( - databricks_api_token=d.get("databricks_api_token", None), - databricks_api_token_plaintext=d.get("databricks_api_token_plaintext", None), - databricks_workspace_url=d.get("databricks_workspace_url", None), + databricks_api_token=d.get("{databricks_api_token}", None), + databricks_api_token_plaintext=d.get("{databricks_api_token_plaintext}", None), + databricks_workspace_url=d.get("{databricks_workspace_url}", None), ) @@ -1065,28 +1062,28 @@ def as_dict(self) -> dict: """Serializes the DataframeSplitInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["columns"] = [v for v in self.columns] + body["{columns}"] = [v for v in self.columns] if self.data: - body["data"] = [v for v in self.data] + body["{data}"] = [v for v in self.data] if self.index: - body["index"] = [v for v in self.index] + body["{index}"] = [v for v in self.index] return body def as_shallow_dict(self) -> dict: """Serializes the DataframeSplitInput into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns if self.data: - body["data"] = self.data + body["{data}"] = self.data if self.index: - body["index"] = self.index + body["{index}"] = self.index return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataframeSplitInput: """Deserializes the DataframeSplitInput from a dictionary.""" - return cls(columns=d.get("columns", None), data=d.get("data", None), index=d.get("index", None)) + return cls(columns=d.get("{columns}", None), data=d.get("{data}", None), index=d.get("{index}", None)) @dataclass @@ -1121,31 +1118,31 @@ def as_dict(self) -> dict: """Serializes the EmbeddingsV1ResponseEmbeddingElement into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding: - body["embedding"] = [v for v in self.embedding] + body["{embedding}"] = [v for v in self.embedding] if self.index is not None: - body["index"] = self.index + body["{index}"] = self.index if self.object is not None: - body["object"] = self.object.value + body["{object}"] = self.object.value return body def as_shallow_dict(self) -> dict: """Serializes the EmbeddingsV1ResponseEmbeddingElement into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding: - body["embedding"] = self.embedding + body["{embedding}"] = self.embedding if self.index is not None: - body["index"] = self.index + body["{index}"] = self.index if self.object is not None: - body["object"] = self.object + body["{object}"] = self.object return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmbeddingsV1ResponseEmbeddingElement: """Deserializes the EmbeddingsV1ResponseEmbeddingElement from a dictionary.""" return cls( - embedding=d.get("embedding", None), - index=d.get("index", None), - object=_enum(d, "object", EmbeddingsV1ResponseEmbeddingElementObject), + embedding=d.get("{embedding}", None), + index=d.get("{index}", None), + object=_enum(d, "{object}", EmbeddingsV1ResponseEmbeddingElementObject), ) @@ -1180,41 +1177,41 @@ def as_dict(self) -> dict: """Serializes the EndpointCoreConfigInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_capture_config: - body["auto_capture_config"] = self.auto_capture_config.as_dict() + body["{auto_capture_config}"] = self.auto_capture_config.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.served_entities: - body["served_entities"] = [v.as_dict() for v in self.served_entities] + body["{served_entities}"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["served_models"] = [v.as_dict() for v in self.served_models] + body["{served_models}"] = [v.as_dict() for v in self.served_models] if self.traffic_config: - body["traffic_config"] = self.traffic_config.as_dict() + body["{traffic_config}"] = self.traffic_config.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EndpointCoreConfigInput into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_capture_config: - body["auto_capture_config"] = self.auto_capture_config + body["{auto_capture_config}"] = self.auto_capture_config if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.served_entities: - body["served_entities"] = self.served_entities + body["{served_entities}"] = self.served_entities if self.served_models: - body["served_models"] = self.served_models + body["{served_models}"] = self.served_models if self.traffic_config: - body["traffic_config"] = self.traffic_config + body["{traffic_config}"] = self.traffic_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointCoreConfigInput: """Deserializes the EndpointCoreConfigInput from a dictionary.""" return cls( - auto_capture_config=_from_dict(d, "auto_capture_config", AutoCaptureConfigInput), - name=d.get("name", None), - served_entities=_repeated_dict(d, "served_entities", ServedEntityInput), - served_models=_repeated_dict(d, "served_models", ServedModelInput), - traffic_config=_from_dict(d, "traffic_config", TrafficConfig), + auto_capture_config=_from_dict(d, "{auto_capture_config}", AutoCaptureConfigInput), + name=d.get("{name}", None), + served_entities=_repeated_dict(d, "{served_entities}", ServedEntityInput), + served_models=_repeated_dict(d, "{served_models}", ServedModelInput), + traffic_config=_from_dict(d, "{traffic_config}", TrafficConfig), ) @@ -1243,41 +1240,41 @@ def as_dict(self) -> dict: """Serializes the EndpointCoreConfigOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_capture_config: - body["auto_capture_config"] = self.auto_capture_config.as_dict() + body["{auto_capture_config}"] = self.auto_capture_config.as_dict() if self.config_version is not None: - body["config_version"] = self.config_version + body["{config_version}"] = self.config_version if self.served_entities: - body["served_entities"] = [v.as_dict() for v in self.served_entities] + body["{served_entities}"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["served_models"] = [v.as_dict() for v in self.served_models] + body["{served_models}"] = [v.as_dict() for v in self.served_models] if self.traffic_config: - body["traffic_config"] = self.traffic_config.as_dict() + body["{traffic_config}"] = self.traffic_config.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EndpointCoreConfigOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_capture_config: - body["auto_capture_config"] = self.auto_capture_config + body["{auto_capture_config}"] = self.auto_capture_config if self.config_version is not None: - body["config_version"] = self.config_version + body["{config_version}"] = self.config_version if self.served_entities: - body["served_entities"] = self.served_entities + body["{served_entities}"] = self.served_entities if self.served_models: - body["served_models"] = self.served_models + body["{served_models}"] = self.served_models if self.traffic_config: - body["traffic_config"] = self.traffic_config + body["{traffic_config}"] = self.traffic_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointCoreConfigOutput: """Deserializes the EndpointCoreConfigOutput from a dictionary.""" return cls( - auto_capture_config=_from_dict(d, "auto_capture_config", AutoCaptureConfigOutput), - config_version=d.get("config_version", None), - served_entities=_repeated_dict(d, "served_entities", ServedEntityOutput), - served_models=_repeated_dict(d, "served_models", ServedModelOutput), - traffic_config=_from_dict(d, "traffic_config", TrafficConfig), + auto_capture_config=_from_dict(d, "{auto_capture_config}", AutoCaptureConfigOutput), + config_version=d.get("{config_version}", None), + served_entities=_repeated_dict(d, "{served_entities}", ServedEntityOutput), + served_models=_repeated_dict(d, "{served_models}", ServedModelOutput), + traffic_config=_from_dict(d, "{traffic_config}", TrafficConfig), ) @@ -1294,26 +1291,26 @@ def as_dict(self) -> dict: """Serializes the EndpointCoreConfigSummary into a dictionary suitable for use as a JSON request body.""" body = {} if self.served_entities: - body["served_entities"] = [v.as_dict() for v in self.served_entities] + body["{served_entities}"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["served_models"] = [v.as_dict() for v in self.served_models] + body["{served_models}"] = [v.as_dict() for v in self.served_models] return body def as_shallow_dict(self) -> dict: """Serializes the EndpointCoreConfigSummary into a shallow dictionary of its immediate attributes.""" body = {} if self.served_entities: - body["served_entities"] = self.served_entities + body["{served_entities}"] = self.served_entities if self.served_models: - body["served_models"] = self.served_models + body["{served_models}"] = self.served_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointCoreConfigSummary: """Deserializes the EndpointCoreConfigSummary from a dictionary.""" return cls( - served_entities=_repeated_dict(d, "served_entities", ServedEntitySpec), - served_models=_repeated_dict(d, "served_models", ServedModelSpec), + served_entities=_repeated_dict(d, "{served_entities}", ServedEntitySpec), + served_models=_repeated_dict(d, "{served_models}", ServedModelSpec), ) @@ -1345,46 +1342,46 @@ def as_dict(self) -> dict: """Serializes the EndpointPendingConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_capture_config: - body["auto_capture_config"] = self.auto_capture_config.as_dict() + body["{auto_capture_config}"] = self.auto_capture_config.as_dict() if self.config_version is not None: - body["config_version"] = self.config_version + body["{config_version}"] = self.config_version if self.served_entities: - body["served_entities"] = [v.as_dict() for v in self.served_entities] + body["{served_entities}"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["served_models"] = [v.as_dict() for v in self.served_models] + body["{served_models}"] = [v.as_dict() for v in self.served_models] if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.traffic_config: - body["traffic_config"] = self.traffic_config.as_dict() + body["{traffic_config}"] = self.traffic_config.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the EndpointPendingConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_capture_config: - body["auto_capture_config"] = self.auto_capture_config + body["{auto_capture_config}"] = self.auto_capture_config if self.config_version is not None: - body["config_version"] = self.config_version + body["{config_version}"] = self.config_version if self.served_entities: - body["served_entities"] = self.served_entities + body["{served_entities}"] = self.served_entities if self.served_models: - body["served_models"] = self.served_models + body["{served_models}"] = self.served_models if self.start_time is not None: - body["start_time"] = self.start_time + body["{start_time}"] = self.start_time if self.traffic_config: - body["traffic_config"] = self.traffic_config + body["{traffic_config}"] = self.traffic_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointPendingConfig: """Deserializes the EndpointPendingConfig from a dictionary.""" return cls( - auto_capture_config=_from_dict(d, "auto_capture_config", AutoCaptureConfigOutput), - config_version=d.get("config_version", None), - served_entities=_repeated_dict(d, "served_entities", ServedEntityOutput), - served_models=_repeated_dict(d, "served_models", ServedModelOutput), - start_time=d.get("start_time", None), - traffic_config=_from_dict(d, "traffic_config", TrafficConfig), + auto_capture_config=_from_dict(d, "{auto_capture_config}", AutoCaptureConfigOutput), + config_version=d.get("{config_version}", None), + served_entities=_repeated_dict(d, "{served_entities}", ServedEntityOutput), + served_models=_repeated_dict(d, "{served_models}", ServedModelOutput), + start_time=d.get("{start_time}", None), + traffic_config=_from_dict(d, "{traffic_config}", TrafficConfig), ) @@ -1405,26 +1402,26 @@ def as_dict(self) -> dict: """Serializes the EndpointState into a dictionary suitable for use as a JSON request body.""" body = {} if self.config_update is not None: - body["config_update"] = self.config_update.value + body["{config_update}"] = self.config_update.value if self.ready is not None: - body["ready"] = self.ready.value + body["{ready}"] = self.ready.value return body def as_shallow_dict(self) -> dict: """Serializes the EndpointState into a shallow dictionary of its immediate attributes.""" body = {} if self.config_update is not None: - body["config_update"] = self.config_update + body["{config_update}"] = self.config_update if self.ready is not None: - body["ready"] = self.ready + body["{ready}"] = self.ready return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointState: """Deserializes the EndpointState from a dictionary.""" return cls( - config_update=_enum(d, "config_update", EndpointStateConfigUpdate), - ready=_enum(d, "ready", EndpointStateReady), + config_update=_enum(d, "{config_update}", EndpointStateConfigUpdate), + ready=_enum(d, "{ready}", EndpointStateReady), ) @@ -1454,24 +1451,24 @@ def as_dict(self) -> dict: """Serializes the EndpointTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the EndpointTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTag: """Deserializes the EndpointTag from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -1482,20 +1479,20 @@ def as_dict(self) -> dict: """Serializes the EndpointTags into a dictionary suitable for use as a JSON request body.""" body = {} if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the EndpointTags into a shallow dictionary of its immediate attributes.""" body = {} if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTags: """Deserializes the EndpointTags from a dictionary.""" - return cls(tags=_repeated_dict(d, "tags", EndpointTag)) + return cls(tags=_repeated_dict(d, "{tags}", EndpointTag)) @dataclass @@ -1506,20 +1503,20 @@ def as_dict(self) -> dict: """Serializes the ExportMetricsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body def as_shallow_dict(self) -> dict: """Serializes the ExportMetricsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExportMetricsResponse: """Deserializes the ExportMetricsResponse from a dictionary.""" - return cls(contents=d.get("contents", None)) + return cls(contents=d.get("{contents}", None)) @dataclass @@ -1549,46 +1546,46 @@ def as_dict(self) -> dict: """Serializes the ExternalFunctionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.headers is not None: - body["headers"] = self.headers + body["{headers}"] = self.headers if self.json is not None: - body["json"] = self.json + body["{json}"] = self.json if self.method is not None: - body["method"] = self.method.value + body["{method}"] = self.method.value if self.params is not None: - body["params"] = self.params + body["{params}"] = self.params if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the ExternalFunctionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_name is not None: - body["connection_name"] = self.connection_name + body["{connection_name}"] = self.connection_name if self.headers is not None: - body["headers"] = self.headers + body["{headers}"] = self.headers if self.json is not None: - body["json"] = self.json + body["{json}"] = self.json if self.method is not None: - body["method"] = self.method + body["{method}"] = self.method if self.params is not None: - body["params"] = self.params + body["{params}"] = self.params if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalFunctionRequest: """Deserializes the ExternalFunctionRequest from a dictionary.""" return cls( - connection_name=d.get("connection_name", None), - headers=d.get("headers", None), - json=d.get("json", None), - method=_enum(d, "method", ExternalFunctionRequestHttpMethod), - params=d.get("params", None), - path=d.get("path", None), + connection_name=d.get("{connection_name}", None), + headers=d.get("{headers}", None), + json=d.get("{json}", None), + method=_enum(d, "{method}", ExternalFunctionRequestHttpMethod), + params=d.get("{params}", None), + path=d.get("{path}", None), ) @@ -1645,78 +1642,78 @@ def as_dict(self) -> dict: """Serializes the ExternalModel into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai21labs_config: - body["ai21labs_config"] = self.ai21labs_config.as_dict() + body["{ai21labs_config}"] = self.ai21labs_config.as_dict() if self.amazon_bedrock_config: - body["amazon_bedrock_config"] = self.amazon_bedrock_config.as_dict() + body["{amazon_bedrock_config}"] = self.amazon_bedrock_config.as_dict() if self.anthropic_config: - body["anthropic_config"] = self.anthropic_config.as_dict() + body["{anthropic_config}"] = self.anthropic_config.as_dict() if self.cohere_config: - body["cohere_config"] = self.cohere_config.as_dict() + body["{cohere_config}"] = self.cohere_config.as_dict() if self.custom_provider_config: - body["custom_provider_config"] = self.custom_provider_config.as_dict() + body["{custom_provider_config}"] = self.custom_provider_config.as_dict() if self.databricks_model_serving_config: - body["databricks_model_serving_config"] = self.databricks_model_serving_config.as_dict() + body["{databricks_model_serving_config}"] = self.databricks_model_serving_config.as_dict() if self.google_cloud_vertex_ai_config: - body["google_cloud_vertex_ai_config"] = self.google_cloud_vertex_ai_config.as_dict() + body["{google_cloud_vertex_ai_config}"] = self.google_cloud_vertex_ai_config.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.openai_config: - body["openai_config"] = self.openai_config.as_dict() + body["{openai_config}"] = self.openai_config.as_dict() if self.palm_config: - body["palm_config"] = self.palm_config.as_dict() + body["{palm_config}"] = self.palm_config.as_dict() if self.provider is not None: - body["provider"] = self.provider.value + body["{provider}"] = self.provider.value if self.task is not None: - body["task"] = self.task + body["{task}"] = self.task return body def as_shallow_dict(self) -> dict: """Serializes the ExternalModel into a shallow dictionary of its immediate attributes.""" body = {} if self.ai21labs_config: - body["ai21labs_config"] = self.ai21labs_config + body["{ai21labs_config}"] = self.ai21labs_config if self.amazon_bedrock_config: - body["amazon_bedrock_config"] = self.amazon_bedrock_config + body["{amazon_bedrock_config}"] = self.amazon_bedrock_config if self.anthropic_config: - body["anthropic_config"] = self.anthropic_config + body["{anthropic_config}"] = self.anthropic_config if self.cohere_config: - body["cohere_config"] = self.cohere_config + body["{cohere_config}"] = self.cohere_config if self.custom_provider_config: - body["custom_provider_config"] = self.custom_provider_config + body["{custom_provider_config}"] = self.custom_provider_config if self.databricks_model_serving_config: - body["databricks_model_serving_config"] = self.databricks_model_serving_config + body["{databricks_model_serving_config}"] = self.databricks_model_serving_config if self.google_cloud_vertex_ai_config: - body["google_cloud_vertex_ai_config"] = self.google_cloud_vertex_ai_config + body["{google_cloud_vertex_ai_config}"] = self.google_cloud_vertex_ai_config if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.openai_config: - body["openai_config"] = self.openai_config + body["{openai_config}"] = self.openai_config if self.palm_config: - body["palm_config"] = self.palm_config + body["{palm_config}"] = self.palm_config if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.task is not None: - body["task"] = self.task + body["{task}"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalModel: """Deserializes the ExternalModel from a dictionary.""" return cls( - ai21labs_config=_from_dict(d, "ai21labs_config", Ai21LabsConfig), - amazon_bedrock_config=_from_dict(d, "amazon_bedrock_config", AmazonBedrockConfig), - anthropic_config=_from_dict(d, "anthropic_config", AnthropicConfig), - cohere_config=_from_dict(d, "cohere_config", CohereConfig), - custom_provider_config=_from_dict(d, "custom_provider_config", CustomProviderConfig), + ai21labs_config=_from_dict(d, "{ai21labs_config}", Ai21LabsConfig), + amazon_bedrock_config=_from_dict(d, "{amazon_bedrock_config}", AmazonBedrockConfig), + anthropic_config=_from_dict(d, "{anthropic_config}", AnthropicConfig), + cohere_config=_from_dict(d, "{cohere_config}", CohereConfig), + custom_provider_config=_from_dict(d, "{custom_provider_config}", CustomProviderConfig), databricks_model_serving_config=_from_dict( - d, "databricks_model_serving_config", DatabricksModelServingConfig + d, "{databricks_model_serving_config}", DatabricksModelServingConfig ), - google_cloud_vertex_ai_config=_from_dict(d, "google_cloud_vertex_ai_config", GoogleCloudVertexAiConfig), - name=d.get("name", None), - openai_config=_from_dict(d, "openai_config", OpenAiConfig), - palm_config=_from_dict(d, "palm_config", PaLmConfig), - provider=_enum(d, "provider", ExternalModelProvider), - task=d.get("task", None), + google_cloud_vertex_ai_config=_from_dict(d, "{google_cloud_vertex_ai_config}", GoogleCloudVertexAiConfig), + name=d.get("{name}", None), + openai_config=_from_dict(d, "{openai_config}", OpenAiConfig), + palm_config=_from_dict(d, "{palm_config}", PaLmConfig), + provider=_enum(d, "{provider}", ExternalModelProvider), + task=d.get("{task}", None), ) @@ -1748,31 +1745,31 @@ def as_dict(self) -> dict: """Serializes the ExternalModelUsageElement into a dictionary suitable for use as a JSON request body.""" body = {} if self.completion_tokens is not None: - body["completion_tokens"] = self.completion_tokens + body["{completion_tokens}"] = self.completion_tokens if self.prompt_tokens is not None: - body["prompt_tokens"] = self.prompt_tokens + body["{prompt_tokens}"] = self.prompt_tokens if self.total_tokens is not None: - body["total_tokens"] = self.total_tokens + body["{total_tokens}"] = self.total_tokens return body def as_shallow_dict(self) -> dict: """Serializes the ExternalModelUsageElement into a shallow dictionary of its immediate attributes.""" body = {} if self.completion_tokens is not None: - body["completion_tokens"] = self.completion_tokens + body["{completion_tokens}"] = self.completion_tokens if self.prompt_tokens is not None: - body["prompt_tokens"] = self.prompt_tokens + body["{prompt_tokens}"] = self.prompt_tokens if self.total_tokens is not None: - body["total_tokens"] = self.total_tokens + body["{total_tokens}"] = self.total_tokens return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalModelUsageElement: """Deserializes the ExternalModelUsageElement from a dictionary.""" return cls( - completion_tokens=d.get("completion_tokens", None), - prompt_tokens=d.get("prompt_tokens", None), - total_tokens=d.get("total_tokens", None), + completion_tokens=d.get("{completion_tokens}", None), + prompt_tokens=d.get("{prompt_tokens}", None), + total_tokens=d.get("{total_tokens}", None), ) @@ -1789,20 +1786,20 @@ def as_dict(self) -> dict: """Serializes the FallbackConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body def as_shallow_dict(self) -> dict: """Serializes the FallbackConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FallbackConfig: """Deserializes the FallbackConfig from a dictionary.""" - return cls(enabled=d.get("enabled", None)) + return cls(enabled=d.get("{enabled}", None)) @dataclass @@ -1822,36 +1819,36 @@ def as_dict(self) -> dict: """Serializes the FoundationModel into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.docs is not None: - body["docs"] = self.docs + body["{docs}"] = self.docs if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the FoundationModel into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.docs is not None: - body["docs"] = self.docs + body["{docs}"] = self.docs if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FoundationModel: """Deserializes the FoundationModel from a dictionary.""" return cls( - description=d.get("description", None), - display_name=d.get("display_name", None), - docs=d.get("docs", None), - name=d.get("name", None), + description=d.get("{description}", None), + display_name=d.get("{display_name}", None), + docs=d.get("{docs}", None), + name=d.get("{name}", None), ) @@ -1863,20 +1860,20 @@ def as_dict(self) -> dict: """Serializes the GetOpenApiResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body def as_shallow_dict(self) -> dict: """Serializes the GetOpenApiResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetOpenApiResponse: """Deserializes the GetOpenApiResponse from a dictionary.""" - return cls(contents=d.get("contents", None)) + return cls(contents=d.get("{contents}", None)) @dataclass @@ -1888,20 +1885,20 @@ def as_dict(self) -> dict: """Serializes the GetServingEndpointPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetServingEndpointPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetServingEndpointPermissionLevelsResponse: """Deserializes the GetServingEndpointPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", ServingEndpointPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ServingEndpointPermissionsDescription)) @dataclass @@ -1937,36 +1934,36 @@ def as_dict(self) -> dict: """Serializes the GoogleCloudVertexAiConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.private_key is not None: - body["private_key"] = self.private_key + body["{private_key}"] = self.private_key if self.private_key_plaintext is not None: - body["private_key_plaintext"] = self.private_key_plaintext + body["{private_key_plaintext}"] = self.private_key_plaintext if self.project_id is not None: - body["project_id"] = self.project_id + body["{project_id}"] = self.project_id if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the GoogleCloudVertexAiConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.private_key is not None: - body["private_key"] = self.private_key + body["{private_key}"] = self.private_key if self.private_key_plaintext is not None: - body["private_key_plaintext"] = self.private_key_plaintext + body["{private_key_plaintext}"] = self.private_key_plaintext if self.project_id is not None: - body["project_id"] = self.project_id + body["{project_id}"] = self.project_id if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GoogleCloudVertexAiConfig: """Deserializes the GoogleCloudVertexAiConfig from a dictionary.""" return cls( - private_key=d.get("private_key", None), - private_key_plaintext=d.get("private_key_plaintext", None), - project_id=d.get("project_id", None), - region=d.get("region", None), + private_key=d.get("{private_key}", None), + private_key_plaintext=d.get("{private_key_plaintext}", None), + project_id=d.get("{project_id}", None), + region=d.get("{region}", None), ) @@ -1978,20 +1975,20 @@ def as_dict(self) -> dict: """Serializes the HttpRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body def as_shallow_dict(self) -> dict: """Serializes the HttpRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["contents"] = self.contents + body["{contents}"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> HttpRequestResponse: """Deserializes the HttpRequestResponse from a dictionary.""" - return cls(contents=d.get("contents", None)) + return cls(contents=d.get("{contents}", None)) @dataclass @@ -2003,20 +2000,20 @@ def as_dict(self) -> dict: """Serializes the ListEndpointsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoints: - body["endpoints"] = [v.as_dict() for v in self.endpoints] + body["{endpoints}"] = [v.as_dict() for v in self.endpoints] return body def as_shallow_dict(self) -> dict: """Serializes the ListEndpointsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoints: - body["endpoints"] = self.endpoints + body["{endpoints}"] = self.endpoints return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListEndpointsResponse: """Deserializes the ListEndpointsResponse from a dictionary.""" - return cls(endpoints=_repeated_dict(d, "endpoints", ServingEndpoint)) + return cls(endpoints=_repeated_dict(d, "{endpoints}", ServingEndpoint)) @dataclass @@ -2031,20 +2028,20 @@ def as_dict(self) -> dict: """Serializes the ModelDataPlaneInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.query_info: - body["query_info"] = self.query_info.as_dict() + body["{query_info}"] = self.query_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ModelDataPlaneInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.query_info: - body["query_info"] = self.query_info + body["{query_info}"] = self.query_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelDataPlaneInfo: """Deserializes the ModelDataPlaneInfo from a dictionary.""" - return cls(query_info=_from_dict(d, "query_info", DataPlaneInfo)) + return cls(query_info=_from_dict(d, "{query_info}", DataPlaneInfo)) @dataclass @@ -2106,71 +2103,71 @@ def as_dict(self) -> dict: """Serializes the OpenAiConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.microsoft_entra_client_id is not None: - body["microsoft_entra_client_id"] = self.microsoft_entra_client_id + body["{microsoft_entra_client_id}"] = self.microsoft_entra_client_id if self.microsoft_entra_client_secret is not None: - body["microsoft_entra_client_secret"] = self.microsoft_entra_client_secret + body["{microsoft_entra_client_secret}"] = self.microsoft_entra_client_secret if self.microsoft_entra_client_secret_plaintext is not None: - body["microsoft_entra_client_secret_plaintext"] = self.microsoft_entra_client_secret_plaintext + body["{microsoft_entra_client_secret_plaintext}"] = self.microsoft_entra_client_secret_plaintext if self.microsoft_entra_tenant_id is not None: - body["microsoft_entra_tenant_id"] = self.microsoft_entra_tenant_id + body["{microsoft_entra_tenant_id}"] = self.microsoft_entra_tenant_id if self.openai_api_base is not None: - body["openai_api_base"] = self.openai_api_base + body["{openai_api_base}"] = self.openai_api_base if self.openai_api_key is not None: - body["openai_api_key"] = self.openai_api_key + body["{openai_api_key}"] = self.openai_api_key if self.openai_api_key_plaintext is not None: - body["openai_api_key_plaintext"] = self.openai_api_key_plaintext + body["{openai_api_key_plaintext}"] = self.openai_api_key_plaintext if self.openai_api_type is not None: - body["openai_api_type"] = self.openai_api_type + body["{openai_api_type}"] = self.openai_api_type if self.openai_api_version is not None: - body["openai_api_version"] = self.openai_api_version + body["{openai_api_version}"] = self.openai_api_version if self.openai_deployment_name is not None: - body["openai_deployment_name"] = self.openai_deployment_name + body["{openai_deployment_name}"] = self.openai_deployment_name if self.openai_organization is not None: - body["openai_organization"] = self.openai_organization + body["{openai_organization}"] = self.openai_organization return body def as_shallow_dict(self) -> dict: """Serializes the OpenAiConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.microsoft_entra_client_id is not None: - body["microsoft_entra_client_id"] = self.microsoft_entra_client_id + body["{microsoft_entra_client_id}"] = self.microsoft_entra_client_id if self.microsoft_entra_client_secret is not None: - body["microsoft_entra_client_secret"] = self.microsoft_entra_client_secret + body["{microsoft_entra_client_secret}"] = self.microsoft_entra_client_secret if self.microsoft_entra_client_secret_plaintext is not None: - body["microsoft_entra_client_secret_plaintext"] = self.microsoft_entra_client_secret_plaintext + body["{microsoft_entra_client_secret_plaintext}"] = self.microsoft_entra_client_secret_plaintext if self.microsoft_entra_tenant_id is not None: - body["microsoft_entra_tenant_id"] = self.microsoft_entra_tenant_id + body["{microsoft_entra_tenant_id}"] = self.microsoft_entra_tenant_id if self.openai_api_base is not None: - body["openai_api_base"] = self.openai_api_base + body["{openai_api_base}"] = self.openai_api_base if self.openai_api_key is not None: - body["openai_api_key"] = self.openai_api_key + body["{openai_api_key}"] = self.openai_api_key if self.openai_api_key_plaintext is not None: - body["openai_api_key_plaintext"] = self.openai_api_key_plaintext + body["{openai_api_key_plaintext}"] = self.openai_api_key_plaintext if self.openai_api_type is not None: - body["openai_api_type"] = self.openai_api_type + body["{openai_api_type}"] = self.openai_api_type if self.openai_api_version is not None: - body["openai_api_version"] = self.openai_api_version + body["{openai_api_version}"] = self.openai_api_version if self.openai_deployment_name is not None: - body["openai_deployment_name"] = self.openai_deployment_name + body["{openai_deployment_name}"] = self.openai_deployment_name if self.openai_organization is not None: - body["openai_organization"] = self.openai_organization + body["{openai_organization}"] = self.openai_organization return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OpenAiConfig: """Deserializes the OpenAiConfig from a dictionary.""" return cls( - microsoft_entra_client_id=d.get("microsoft_entra_client_id", None), - microsoft_entra_client_secret=d.get("microsoft_entra_client_secret", None), - microsoft_entra_client_secret_plaintext=d.get("microsoft_entra_client_secret_plaintext", None), - microsoft_entra_tenant_id=d.get("microsoft_entra_tenant_id", None), - openai_api_base=d.get("openai_api_base", None), - openai_api_key=d.get("openai_api_key", None), - openai_api_key_plaintext=d.get("openai_api_key_plaintext", None), - openai_api_type=d.get("openai_api_type", None), - openai_api_version=d.get("openai_api_version", None), - openai_deployment_name=d.get("openai_deployment_name", None), - openai_organization=d.get("openai_organization", None), + microsoft_entra_client_id=d.get("{microsoft_entra_client_id}", None), + microsoft_entra_client_secret=d.get("{microsoft_entra_client_secret}", None), + microsoft_entra_client_secret_plaintext=d.get("{microsoft_entra_client_secret_plaintext}", None), + microsoft_entra_tenant_id=d.get("{microsoft_entra_tenant_id}", None), + openai_api_base=d.get("{openai_api_base}", None), + openai_api_key=d.get("{openai_api_key}", None), + openai_api_key_plaintext=d.get("{openai_api_key_plaintext}", None), + openai_api_type=d.get("{openai_api_type}", None), + openai_api_version=d.get("{openai_api_version}", None), + openai_deployment_name=d.get("{openai_deployment_name}", None), + openai_organization=d.get("{openai_organization}", None), ) @@ -2190,25 +2187,25 @@ def as_dict(self) -> dict: """Serializes the PaLmConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.palm_api_key is not None: - body["palm_api_key"] = self.palm_api_key + body["{palm_api_key}"] = self.palm_api_key if self.palm_api_key_plaintext is not None: - body["palm_api_key_plaintext"] = self.palm_api_key_plaintext + body["{palm_api_key_plaintext}"] = self.palm_api_key_plaintext return body def as_shallow_dict(self) -> dict: """Serializes the PaLmConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.palm_api_key is not None: - body["palm_api_key"] = self.palm_api_key + body["{palm_api_key}"] = self.palm_api_key if self.palm_api_key_plaintext is not None: - body["palm_api_key_plaintext"] = self.palm_api_key_plaintext + body["{palm_api_key_plaintext}"] = self.palm_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PaLmConfig: """Deserializes the PaLmConfig from a dictionary.""" return cls( - palm_api_key=d.get("palm_api_key", None), palm_api_key_plaintext=d.get("palm_api_key_plaintext", None) + palm_api_key=d.get("{palm_api_key}", None), palm_api_key_plaintext=d.get("{palm_api_key_plaintext}", None) ) @@ -2227,31 +2224,31 @@ def as_dict(self) -> dict: """Serializes the PatchServingEndpointTags into a dictionary suitable for use as a JSON request body.""" body = {} if self.add_tags: - body["add_tags"] = [v.as_dict() for v in self.add_tags] + body["{add_tags}"] = [v.as_dict() for v in self.add_tags] if self.delete_tags: - body["delete_tags"] = [v for v in self.delete_tags] + body["{delete_tags}"] = [v for v in self.delete_tags] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the PatchServingEndpointTags into a shallow dictionary of its immediate attributes.""" body = {} if self.add_tags: - body["add_tags"] = self.add_tags + body["{add_tags}"] = self.add_tags if self.delete_tags: - body["delete_tags"] = self.delete_tags + body["{delete_tags}"] = self.delete_tags if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PatchServingEndpointTags: """Deserializes the PatchServingEndpointTags from a dictionary.""" return cls( - add_tags=_repeated_dict(d, "add_tags", EndpointTag), - delete_tags=d.get("delete_tags", None), - name=d.get("name", None), + add_tags=_repeated_dict(d, "{add_tags}", EndpointTag), + delete_tags=d.get("{delete_tags}", None), + name=d.get("{name}", None), ) @@ -2267,28 +2264,30 @@ def as_dict(self) -> dict: """Serializes the PayloadTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message return body def as_shallow_dict(self) -> dict: """Serializes the PayloadTable into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.status_message is not None: - body["status_message"] = self.status_message + body["{status_message}"] = self.status_message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PayloadTable: """Deserializes the PayloadTable from a dictionary.""" - return cls(name=d.get("name", None), status=d.get("status", None), status_message=d.get("status_message", None)) + return cls( + name=d.get("{name}", None), status=d.get("{status}", None), status_message=d.get("{status_message}", None) + ) @dataclass @@ -2319,46 +2318,46 @@ def as_dict(self) -> dict: """Serializes the PutAiGatewayRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.fallback_config: - body["fallback_config"] = self.fallback_config.as_dict() + body["{fallback_config}"] = self.fallback_config.as_dict() if self.guardrails: - body["guardrails"] = self.guardrails.as_dict() + body["{guardrails}"] = self.guardrails.as_dict() if self.inference_table_config: - body["inference_table_config"] = self.inference_table_config.as_dict() + body["{inference_table_config}"] = self.inference_table_config.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rate_limits: - body["rate_limits"] = [v.as_dict() for v in self.rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] if self.usage_tracking_config: - body["usage_tracking_config"] = self.usage_tracking_config.as_dict() + body["{usage_tracking_config}"] = self.usage_tracking_config.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the PutAiGatewayRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.fallback_config: - body["fallback_config"] = self.fallback_config + body["{fallback_config}"] = self.fallback_config if self.guardrails: - body["guardrails"] = self.guardrails + body["{guardrails}"] = self.guardrails if self.inference_table_config: - body["inference_table_config"] = self.inference_table_config + body["{inference_table_config}"] = self.inference_table_config if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rate_limits: - body["rate_limits"] = self.rate_limits + body["{rate_limits}"] = self.rate_limits if self.usage_tracking_config: - body["usage_tracking_config"] = self.usage_tracking_config + body["{usage_tracking_config}"] = self.usage_tracking_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutAiGatewayRequest: """Deserializes the PutAiGatewayRequest from a dictionary.""" return cls( - fallback_config=_from_dict(d, "fallback_config", FallbackConfig), - guardrails=_from_dict(d, "guardrails", AiGatewayGuardrails), - inference_table_config=_from_dict(d, "inference_table_config", AiGatewayInferenceTableConfig), - name=d.get("name", None), - rate_limits=_repeated_dict(d, "rate_limits", AiGatewayRateLimit), - usage_tracking_config=_from_dict(d, "usage_tracking_config", AiGatewayUsageTrackingConfig), + fallback_config=_from_dict(d, "{fallback_config}", FallbackConfig), + guardrails=_from_dict(d, "{guardrails}", AiGatewayGuardrails), + inference_table_config=_from_dict(d, "{inference_table_config}", AiGatewayInferenceTableConfig), + name=d.get("{name}", None), + rate_limits=_repeated_dict(d, "{rate_limits}", AiGatewayRateLimit), + usage_tracking_config=_from_dict(d, "{usage_tracking_config}", AiGatewayUsageTrackingConfig), ) @@ -2387,41 +2386,41 @@ def as_dict(self) -> dict: """Serializes the PutAiGatewayResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.fallback_config: - body["fallback_config"] = self.fallback_config.as_dict() + body["{fallback_config}"] = self.fallback_config.as_dict() if self.guardrails: - body["guardrails"] = self.guardrails.as_dict() + body["{guardrails}"] = self.guardrails.as_dict() if self.inference_table_config: - body["inference_table_config"] = self.inference_table_config.as_dict() + body["{inference_table_config}"] = self.inference_table_config.as_dict() if self.rate_limits: - body["rate_limits"] = [v.as_dict() for v in self.rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] if self.usage_tracking_config: - body["usage_tracking_config"] = self.usage_tracking_config.as_dict() + body["{usage_tracking_config}"] = self.usage_tracking_config.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the PutAiGatewayResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.fallback_config: - body["fallback_config"] = self.fallback_config + body["{fallback_config}"] = self.fallback_config if self.guardrails: - body["guardrails"] = self.guardrails + body["{guardrails}"] = self.guardrails if self.inference_table_config: - body["inference_table_config"] = self.inference_table_config + body["{inference_table_config}"] = self.inference_table_config if self.rate_limits: - body["rate_limits"] = self.rate_limits + body["{rate_limits}"] = self.rate_limits if self.usage_tracking_config: - body["usage_tracking_config"] = self.usage_tracking_config + body["{usage_tracking_config}"] = self.usage_tracking_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutAiGatewayResponse: """Deserializes the PutAiGatewayResponse from a dictionary.""" return cls( - fallback_config=_from_dict(d, "fallback_config", FallbackConfig), - guardrails=_from_dict(d, "guardrails", AiGatewayGuardrails), - inference_table_config=_from_dict(d, "inference_table_config", AiGatewayInferenceTableConfig), - rate_limits=_repeated_dict(d, "rate_limits", AiGatewayRateLimit), - usage_tracking_config=_from_dict(d, "usage_tracking_config", AiGatewayUsageTrackingConfig), + fallback_config=_from_dict(d, "{fallback_config}", FallbackConfig), + guardrails=_from_dict(d, "{guardrails}", AiGatewayGuardrails), + inference_table_config=_from_dict(d, "{inference_table_config}", AiGatewayInferenceTableConfig), + rate_limits=_repeated_dict(d, "{rate_limits}", AiGatewayRateLimit), + usage_tracking_config=_from_dict(d, "{usage_tracking_config}", AiGatewayUsageTrackingConfig), ) @@ -2437,24 +2436,24 @@ def as_dict(self) -> dict: """Serializes the PutRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rate_limits: - body["rate_limits"] = [v.as_dict() for v in self.rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] return body def as_shallow_dict(self) -> dict: """Serializes the PutRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.rate_limits: - body["rate_limits"] = self.rate_limits + body["{rate_limits}"] = self.rate_limits return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutRequest: """Deserializes the PutRequest from a dictionary.""" - return cls(name=d.get("name", None), rate_limits=_repeated_dict(d, "rate_limits", RateLimit)) + return cls(name=d.get("{name}", None), rate_limits=_repeated_dict(d, "{rate_limits}", RateLimit)) @dataclass @@ -2466,20 +2465,20 @@ def as_dict(self) -> dict: """Serializes the PutResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.rate_limits: - body["rate_limits"] = [v.as_dict() for v in self.rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] return body def as_shallow_dict(self) -> dict: """Serializes the PutResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.rate_limits: - body["rate_limits"] = self.rate_limits + body["{rate_limits}"] = self.rate_limits return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutResponse: """Deserializes the PutResponse from a dictionary.""" - return cls(rate_limits=_repeated_dict(d, "rate_limits", RateLimit)) + return cls(rate_limits=_repeated_dict(d, "{rate_limits}", RateLimit)) @dataclass @@ -2546,86 +2545,86 @@ def as_dict(self) -> dict: """Serializes the QueryEndpointInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataframe_records: - body["dataframe_records"] = [v for v in self.dataframe_records] + body["{dataframe_records}"] = [v for v in self.dataframe_records] if self.dataframe_split: - body["dataframe_split"] = self.dataframe_split.as_dict() + body["{dataframe_split}"] = self.dataframe_split.as_dict() if self.extra_params: - body["extra_params"] = self.extra_params + body["{extra_params}"] = self.extra_params if self.input: - body["input"] = self.input + body["{input}"] = self.input if self.inputs: - body["inputs"] = self.inputs + body["{inputs}"] = self.inputs if self.instances: - body["instances"] = [v for v in self.instances] + body["{instances}"] = [v for v in self.instances] if self.max_tokens is not None: - body["max_tokens"] = self.max_tokens + body["{max_tokens}"] = self.max_tokens if self.messages: - body["messages"] = [v.as_dict() for v in self.messages] + body["{messages}"] = [v.as_dict() for v in self.messages] if self.n is not None: - body["n"] = self.n + body["{n}"] = self.n if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.prompt: - body["prompt"] = self.prompt + body["{prompt}"] = self.prompt if self.stop: - body["stop"] = [v for v in self.stop] + body["{stop}"] = [v for v in self.stop] if self.stream is not None: - body["stream"] = self.stream + body["{stream}"] = self.stream if self.temperature is not None: - body["temperature"] = self.temperature + body["{temperature}"] = self.temperature return body def as_shallow_dict(self) -> dict: """Serializes the QueryEndpointInput into a shallow dictionary of its immediate attributes.""" body = {} if self.dataframe_records: - body["dataframe_records"] = self.dataframe_records + body["{dataframe_records}"] = self.dataframe_records if self.dataframe_split: - body["dataframe_split"] = self.dataframe_split + body["{dataframe_split}"] = self.dataframe_split if self.extra_params: - body["extra_params"] = self.extra_params + body["{extra_params}"] = self.extra_params if self.input: - body["input"] = self.input + body["{input}"] = self.input if self.inputs: - body["inputs"] = self.inputs + body["{inputs}"] = self.inputs if self.instances: - body["instances"] = self.instances + body["{instances}"] = self.instances if self.max_tokens is not None: - body["max_tokens"] = self.max_tokens + body["{max_tokens}"] = self.max_tokens if self.messages: - body["messages"] = self.messages + body["{messages}"] = self.messages if self.n is not None: - body["n"] = self.n + body["{n}"] = self.n if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.prompt: - body["prompt"] = self.prompt + body["{prompt}"] = self.prompt if self.stop: - body["stop"] = self.stop + body["{stop}"] = self.stop if self.stream is not None: - body["stream"] = self.stream + body["{stream}"] = self.stream if self.temperature is not None: - body["temperature"] = self.temperature + body["{temperature}"] = self.temperature return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryEndpointInput: """Deserializes the QueryEndpointInput from a dictionary.""" return cls( - dataframe_records=d.get("dataframe_records", None), - dataframe_split=_from_dict(d, "dataframe_split", DataframeSplitInput), - extra_params=d.get("extra_params", None), - input=d.get("input", None), - inputs=d.get("inputs", None), - instances=d.get("instances", None), - max_tokens=d.get("max_tokens", None), - messages=_repeated_dict(d, "messages", ChatMessage), - n=d.get("n", None), - name=d.get("name", None), - prompt=d.get("prompt", None), - stop=d.get("stop", None), - stream=d.get("stream", None), - temperature=d.get("temperature", None), + dataframe_records=d.get("{dataframe_records}", None), + dataframe_split=_from_dict(d, "{dataframe_split}", DataframeSplitInput), + extra_params=d.get("{extra_params}", None), + input=d.get("{input}", None), + inputs=d.get("{inputs}", None), + instances=d.get("{instances}", None), + max_tokens=d.get("{max_tokens}", None), + messages=_repeated_dict(d, "{messages}", ChatMessage), + n=d.get("{n}", None), + name=d.get("{name}", None), + prompt=d.get("{prompt}", None), + stop=d.get("{stop}", None), + stream=d.get("{stream}", None), + temperature=d.get("{temperature}", None), ) @@ -2670,61 +2669,61 @@ def as_dict(self) -> dict: """Serializes the QueryEndpointResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.choices: - body["choices"] = [v.as_dict() for v in self.choices] + body["{choices}"] = [v.as_dict() for v in self.choices] if self.created is not None: - body["created"] = self.created + body["{created}"] = self.created if self.data: - body["data"] = [v.as_dict() for v in self.data] + body["{data}"] = [v.as_dict() for v in self.data] if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.model is not None: - body["model"] = self.model + body["{model}"] = self.model if self.object is not None: - body["object"] = self.object.value + body["{object}"] = self.object.value if self.predictions: - body["predictions"] = [v for v in self.predictions] + body["{predictions}"] = [v for v in self.predictions] if self.served_model_name is not None: - body["served-model-name"] = self.served_model_name + body["{served_model_name}"] = self.served_model_name if self.usage: - body["usage"] = self.usage.as_dict() + body["{usage}"] = self.usage.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the QueryEndpointResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.choices: - body["choices"] = self.choices + body["{choices}"] = self.choices if self.created is not None: - body["created"] = self.created + body["{created}"] = self.created if self.data: - body["data"] = self.data + body["{data}"] = self.data if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.model is not None: - body["model"] = self.model + body["{model}"] = self.model if self.object is not None: - body["object"] = self.object + body["{object}"] = self.object if self.predictions: - body["predictions"] = self.predictions + body["{predictions}"] = self.predictions if self.served_model_name is not None: - body["served-model-name"] = self.served_model_name + body["{served_model_name}"] = self.served_model_name if self.usage: - body["usage"] = self.usage + body["{usage}"] = self.usage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryEndpointResponse: """Deserializes the QueryEndpointResponse from a dictionary.""" return cls( - choices=_repeated_dict(d, "choices", V1ResponseChoiceElement), - created=d.get("created", None), - data=_repeated_dict(d, "data", EmbeddingsV1ResponseEmbeddingElement), - id=d.get("id", None), - model=d.get("model", None), - object=_enum(d, "object", QueryEndpointResponseObject), - predictions=d.get("predictions", None), - served_model_name=d.get("served-model-name", None), - usage=_from_dict(d, "usage", ExternalModelUsageElement), + choices=_repeated_dict(d, "{choices}", V1ResponseChoiceElement), + created=d.get("{created}", None), + data=_repeated_dict(d, "{data}", EmbeddingsV1ResponseEmbeddingElement), + id=d.get("{id}", None), + model=d.get("{model}", None), + object=_enum(d, "{object}", QueryEndpointResponseObject), + predictions=d.get("{predictions}", None), + served_model_name=d.get("{served_model_name}", None), + usage=_from_dict(d, "{usage}", ExternalModelUsageElement), ) @@ -2753,31 +2752,31 @@ def as_dict(self) -> dict: """Serializes the RateLimit into a dictionary suitable for use as a JSON request body.""" body = {} if self.calls is not None: - body["calls"] = self.calls + body["{calls}"] = self.calls if self.key is not None: - body["key"] = self.key.value + body["{key}"] = self.key.value if self.renewal_period is not None: - body["renewal_period"] = self.renewal_period.value + body["{renewal_period}"] = self.renewal_period.value return body def as_shallow_dict(self) -> dict: """Serializes the RateLimit into a shallow dictionary of its immediate attributes.""" body = {} if self.calls is not None: - body["calls"] = self.calls + body["{calls}"] = self.calls if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.renewal_period is not None: - body["renewal_period"] = self.renewal_period + body["{renewal_period}"] = self.renewal_period return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RateLimit: """Deserializes the RateLimit from a dictionary.""" return cls( - calls=d.get("calls", None), - key=_enum(d, "key", RateLimitKey), - renewal_period=_enum(d, "renewal_period", RateLimitRenewalPeriod), + calls=d.get("{calls}", None), + key=_enum(d, "{key}", RateLimitKey), + renewal_period=_enum(d, "{renewal_period}", RateLimitRenewalPeriod), ) @@ -2805,25 +2804,25 @@ def as_dict(self) -> dict: """Serializes the Route into a dictionary suitable for use as a JSON request body.""" body = {} if self.served_model_name is not None: - body["served_model_name"] = self.served_model_name + body["{served_model_name}"] = self.served_model_name if self.traffic_percentage is not None: - body["traffic_percentage"] = self.traffic_percentage + body["{traffic_percentage}"] = self.traffic_percentage return body def as_shallow_dict(self) -> dict: """Serializes the Route into a shallow dictionary of its immediate attributes.""" body = {} if self.served_model_name is not None: - body["served_model_name"] = self.served_model_name + body["{served_model_name}"] = self.served_model_name if self.traffic_percentage is not None: - body["traffic_percentage"] = self.traffic_percentage + body["{traffic_percentage}"] = self.traffic_percentage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Route: """Deserializes the Route from a dictionary.""" return cls( - served_model_name=d.get("served_model_name", None), traffic_percentage=d.get("traffic_percentage", None) + served_model_name=d.get("{served_model_name}", None), traffic_percentage=d.get("{traffic_percentage}", None) ) @@ -2889,71 +2888,71 @@ def as_dict(self) -> dict: """Serializes the ServedEntityInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.entity_name is not None: - body["entity_name"] = self.entity_name + body["{entity_name}"] = self.entity_name if self.entity_version is not None: - body["entity_version"] = self.entity_version + body["{entity_version}"] = self.entity_version if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.external_model: - body["external_model"] = self.external_model.as_dict() + body["{external_model}"] = self.external_model.as_dict() if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["max_provisioned_throughput"] = self.max_provisioned_throughput + body["{max_provisioned_throughput}"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["min_provisioned_throughput"] = self.min_provisioned_throughput + body["{min_provisioned_throughput}"] = self.min_provisioned_throughput if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["workload_size"] = self.workload_size + body["{workload_size}"] = self.workload_size if self.workload_type is not None: - body["workload_type"] = self.workload_type.value + body["{workload_type}"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: """Serializes the ServedEntityInput into a shallow dictionary of its immediate attributes.""" body = {} if self.entity_name is not None: - body["entity_name"] = self.entity_name + body["{entity_name}"] = self.entity_name if self.entity_version is not None: - body["entity_version"] = self.entity_version + body["{entity_version}"] = self.entity_version if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.external_model: - body["external_model"] = self.external_model + body["{external_model}"] = self.external_model if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["max_provisioned_throughput"] = self.max_provisioned_throughput + body["{max_provisioned_throughput}"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["min_provisioned_throughput"] = self.min_provisioned_throughput + body["{min_provisioned_throughput}"] = self.min_provisioned_throughput if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["workload_size"] = self.workload_size + body["{workload_size}"] = self.workload_size if self.workload_type is not None: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedEntityInput: """Deserializes the ServedEntityInput from a dictionary.""" return cls( - entity_name=d.get("entity_name", None), - entity_version=d.get("entity_version", None), - environment_vars=d.get("environment_vars", None), - external_model=_from_dict(d, "external_model", ExternalModel), - instance_profile_arn=d.get("instance_profile_arn", None), - max_provisioned_throughput=d.get("max_provisioned_throughput", None), - min_provisioned_throughput=d.get("min_provisioned_throughput", None), - name=d.get("name", None), - scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), - workload_size=d.get("workload_size", None), - workload_type=_enum(d, "workload_type", ServingModelWorkloadType), + entity_name=d.get("{entity_name}", None), + entity_version=d.get("{entity_version}", None), + environment_vars=d.get("{environment_vars}", None), + external_model=_from_dict(d, "{external_model}", ExternalModel), + instance_profile_arn=d.get("{instance_profile_arn}", None), + max_provisioned_throughput=d.get("{max_provisioned_throughput}", None), + min_provisioned_throughput=d.get("{min_provisioned_throughput}", None), + name=d.get("{name}", None), + scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), + workload_size=d.get("{workload_size}", None), + workload_type=_enum(d, "{workload_type}", ServingModelWorkloadType), ) @@ -3029,91 +3028,91 @@ def as_dict(self) -> dict: """Serializes the ServedEntityOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.entity_name is not None: - body["entity_name"] = self.entity_name + body["{entity_name}"] = self.entity_name if self.entity_version is not None: - body["entity_version"] = self.entity_version + body["{entity_version}"] = self.entity_version if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.external_model: - body["external_model"] = self.external_model.as_dict() + body["{external_model}"] = self.external_model.as_dict() if self.foundation_model: - body["foundation_model"] = self.foundation_model.as_dict() + body["{foundation_model}"] = self.foundation_model.as_dict() if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["max_provisioned_throughput"] = self.max_provisioned_throughput + body["{max_provisioned_throughput}"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["min_provisioned_throughput"] = self.min_provisioned_throughput + body["{min_provisioned_throughput}"] = self.min_provisioned_throughput if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.workload_size is not None: - body["workload_size"] = self.workload_size + body["{workload_size}"] = self.workload_size if self.workload_type is not None: - body["workload_type"] = self.workload_type.value + body["{workload_type}"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: """Serializes the ServedEntityOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.entity_name is not None: - body["entity_name"] = self.entity_name + body["{entity_name}"] = self.entity_name if self.entity_version is not None: - body["entity_version"] = self.entity_version + body["{entity_version}"] = self.entity_version if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.external_model: - body["external_model"] = self.external_model + body["{external_model}"] = self.external_model if self.foundation_model: - body["foundation_model"] = self.foundation_model + body["{foundation_model}"] = self.foundation_model if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["max_provisioned_throughput"] = self.max_provisioned_throughput + body["{max_provisioned_throughput}"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["min_provisioned_throughput"] = self.min_provisioned_throughput + body["{min_provisioned_throughput}"] = self.min_provisioned_throughput if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.workload_size is not None: - body["workload_size"] = self.workload_size + body["{workload_size}"] = self.workload_size if self.workload_type is not None: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedEntityOutput: """Deserializes the ServedEntityOutput from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - creator=d.get("creator", None), - entity_name=d.get("entity_name", None), - entity_version=d.get("entity_version", None), - environment_vars=d.get("environment_vars", None), - external_model=_from_dict(d, "external_model", ExternalModel), - foundation_model=_from_dict(d, "foundation_model", FoundationModel), - instance_profile_arn=d.get("instance_profile_arn", None), - max_provisioned_throughput=d.get("max_provisioned_throughput", None), - min_provisioned_throughput=d.get("min_provisioned_throughput", None), - name=d.get("name", None), - scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), - state=_from_dict(d, "state", ServedModelState), - workload_size=d.get("workload_size", None), - workload_type=_enum(d, "workload_type", ServingModelWorkloadType), + creation_timestamp=d.get("{creation_timestamp}", None), + creator=d.get("{creator}", None), + entity_name=d.get("{entity_name}", None), + entity_version=d.get("{entity_version}", None), + environment_vars=d.get("{environment_vars}", None), + external_model=_from_dict(d, "{external_model}", ExternalModel), + foundation_model=_from_dict(d, "{foundation_model}", FoundationModel), + instance_profile_arn=d.get("{instance_profile_arn}", None), + max_provisioned_throughput=d.get("{max_provisioned_throughput}", None), + min_provisioned_throughput=d.get("{min_provisioned_throughput}", None), + name=d.get("{name}", None), + scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), + state=_from_dict(d, "{state}", ServedModelState), + workload_size=d.get("{workload_size}", None), + workload_type=_enum(d, "{workload_type}", ServingModelWorkloadType), ) @@ -3135,41 +3134,41 @@ def as_dict(self) -> dict: """Serializes the ServedEntitySpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.entity_name is not None: - body["entity_name"] = self.entity_name + body["{entity_name}"] = self.entity_name if self.entity_version is not None: - body["entity_version"] = self.entity_version + body["{entity_version}"] = self.entity_version if self.external_model: - body["external_model"] = self.external_model.as_dict() + body["{external_model}"] = self.external_model.as_dict() if self.foundation_model: - body["foundation_model"] = self.foundation_model.as_dict() + body["{foundation_model}"] = self.foundation_model.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the ServedEntitySpec into a shallow dictionary of its immediate attributes.""" body = {} if self.entity_name is not None: - body["entity_name"] = self.entity_name + body["{entity_name}"] = self.entity_name if self.entity_version is not None: - body["entity_version"] = self.entity_version + body["{entity_version}"] = self.entity_version if self.external_model: - body["external_model"] = self.external_model + body["{external_model}"] = self.external_model if self.foundation_model: - body["foundation_model"] = self.foundation_model + body["{foundation_model}"] = self.foundation_model if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedEntitySpec: """Deserializes the ServedEntitySpec from a dictionary.""" return cls( - entity_name=d.get("entity_name", None), - entity_version=d.get("entity_version", None), - external_model=_from_dict(d, "external_model", ExternalModel), - foundation_model=_from_dict(d, "foundation_model", FoundationModel), - name=d.get("name", None), + entity_name=d.get("{entity_name}", None), + entity_version=d.get("{entity_version}", None), + external_model=_from_dict(d, "{external_model}", ExternalModel), + foundation_model=_from_dict(d, "{foundation_model}", FoundationModel), + name=d.get("{name}", None), ) @@ -3223,66 +3222,66 @@ def as_dict(self) -> dict: """Serializes the ServedModelInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["max_provisioned_throughput"] = self.max_provisioned_throughput + body["{max_provisioned_throughput}"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["min_provisioned_throughput"] = self.min_provisioned_throughput + body["{min_provisioned_throughput}"] = self.min_provisioned_throughput if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version is not None: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["workload_size"] = self.workload_size.value + body["{workload_size}"] = self.workload_size.value if self.workload_type is not None: - body["workload_type"] = self.workload_type.value + body["{workload_type}"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: """Serializes the ServedModelInput into a shallow dictionary of its immediate attributes.""" body = {} if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["max_provisioned_throughput"] = self.max_provisioned_throughput + body["{max_provisioned_throughput}"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["min_provisioned_throughput"] = self.min_provisioned_throughput + body["{min_provisioned_throughput}"] = self.min_provisioned_throughput if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version is not None: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["workload_size"] = self.workload_size + body["{workload_size}"] = self.workload_size if self.workload_type is not None: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelInput: """Deserializes the ServedModelInput from a dictionary.""" return cls( - environment_vars=d.get("environment_vars", None), - instance_profile_arn=d.get("instance_profile_arn", None), - max_provisioned_throughput=d.get("max_provisioned_throughput", None), - min_provisioned_throughput=d.get("min_provisioned_throughput", None), - model_name=d.get("model_name", None), - model_version=d.get("model_version", None), - name=d.get("name", None), - scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), - workload_size=_enum(d, "workload_size", ServedModelInputWorkloadSize), - workload_type=_enum(d, "workload_type", ServedModelInputWorkloadType), + environment_vars=d.get("{environment_vars}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + max_provisioned_throughput=d.get("{max_provisioned_throughput}", None), + min_provisioned_throughput=d.get("{min_provisioned_throughput}", None), + model_name=d.get("{model_name}", None), + model_version=d.get("{model_version}", None), + name=d.get("{name}", None), + scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), + workload_size=_enum(d, "{workload_size}", ServedModelInputWorkloadSize), + workload_type=_enum(d, "{workload_type}", ServedModelInputWorkloadType), ) @@ -3353,71 +3352,71 @@ def as_dict(self) -> dict: """Serializes the ServedModelOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version is not None: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.workload_size is not None: - body["workload_size"] = self.workload_size + body["{workload_size}"] = self.workload_size if self.workload_type is not None: - body["workload_type"] = self.workload_type.value + body["{workload_type}"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: """Serializes the ServedModelOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.environment_vars: - body["environment_vars"] = self.environment_vars + body["{environment_vars}"] = self.environment_vars if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version is not None: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.scale_to_zero_enabled is not None: - body["scale_to_zero_enabled"] = self.scale_to_zero_enabled + body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.workload_size is not None: - body["workload_size"] = self.workload_size + body["{workload_size}"] = self.workload_size if self.workload_type is not None: - body["workload_type"] = self.workload_type + body["{workload_type}"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelOutput: """Deserializes the ServedModelOutput from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - creator=d.get("creator", None), - environment_vars=d.get("environment_vars", None), - instance_profile_arn=d.get("instance_profile_arn", None), - model_name=d.get("model_name", None), - model_version=d.get("model_version", None), - name=d.get("name", None), - scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), - state=_from_dict(d, "state", ServedModelState), - workload_size=d.get("workload_size", None), - workload_type=_enum(d, "workload_type", ServingModelWorkloadType), + creation_timestamp=d.get("{creation_timestamp}", None), + creator=d.get("{creator}", None), + environment_vars=d.get("{environment_vars}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + model_name=d.get("{model_name}", None), + model_version=d.get("{model_version}", None), + name=d.get("{name}", None), + scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), + state=_from_dict(d, "{state}", ServedModelState), + workload_size=d.get("{workload_size}", None), + workload_type=_enum(d, "{workload_type}", ServingModelWorkloadType), ) @@ -3435,29 +3434,31 @@ def as_dict(self) -> dict: """Serializes the ServedModelSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version is not None: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the ServedModelSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.model_name is not None: - body["model_name"] = self.model_name + body["{model_name}"] = self.model_name if self.model_version is not None: - body["model_version"] = self.model_version + body["{model_version}"] = self.model_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelSpec: """Deserializes the ServedModelSpec from a dictionary.""" return cls( - model_name=d.get("model_name", None), model_version=d.get("model_version", None), name=d.get("name", None) + model_name=d.get("{model_name}", None), + model_version=d.get("{model_version}", None), + name=d.get("{name}", None), ) @@ -3471,26 +3472,26 @@ def as_dict(self) -> dict: """Serializes the ServedModelState into a dictionary suitable for use as a JSON request body.""" body = {} if self.deployment is not None: - body["deployment"] = self.deployment.value + body["{deployment}"] = self.deployment.value if self.deployment_state_message is not None: - body["deployment_state_message"] = self.deployment_state_message + body["{deployment_state_message}"] = self.deployment_state_message return body def as_shallow_dict(self) -> dict: """Serializes the ServedModelState into a shallow dictionary of its immediate attributes.""" body = {} if self.deployment is not None: - body["deployment"] = self.deployment + body["{deployment}"] = self.deployment if self.deployment_state_message is not None: - body["deployment_state_message"] = self.deployment_state_message + body["{deployment_state_message}"] = self.deployment_state_message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelState: """Deserializes the ServedModelState from a dictionary.""" return cls( - deployment=_enum(d, "deployment", ServedModelStateDeployment), - deployment_state_message=d.get("deployment_state_message", None), + deployment=_enum(d, "{deployment}", ServedModelStateDeployment), + deployment_state_message=d.get("{deployment_state_message}", None), ) @@ -3512,20 +3513,20 @@ def as_dict(self) -> dict: """Serializes the ServerLogsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.logs is not None: - body["logs"] = self.logs + body["{logs}"] = self.logs return body def as_shallow_dict(self) -> dict: """Serializes the ServerLogsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.logs is not None: - body["logs"] = self.logs + body["{logs}"] = self.logs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServerLogsResponse: """Deserializes the ServerLogsResponse from a dictionary.""" - return cls(logs=d.get("logs", None)) + return cls(logs=d.get("{logs}", None)) @dataclass @@ -3568,71 +3569,71 @@ def as_dict(self) -> dict: """Serializes the ServingEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai_gateway: - body["ai_gateway"] = self.ai_gateway.as_dict() + body["{ai_gateway}"] = self.ai_gateway.as_dict() if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.config: - body["config"] = self.config.as_dict() + body["{config}"] = self.config.as_dict() if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.task is not None: - body["task"] = self.task + body["{task}"] = self.task return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.ai_gateway: - body["ai_gateway"] = self.ai_gateway + body["{ai_gateway}"] = self.ai_gateway if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.config: - body["config"] = self.config + body["{config}"] = self.config if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.task is not None: - body["task"] = self.task + body["{task}"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpoint: """Deserializes the ServingEndpoint from a dictionary.""" return cls( - ai_gateway=_from_dict(d, "ai_gateway", AiGatewayConfig), - budget_policy_id=d.get("budget_policy_id", None), - config=_from_dict(d, "config", EndpointCoreConfigSummary), - creation_timestamp=d.get("creation_timestamp", None), - creator=d.get("creator", None), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - name=d.get("name", None), - state=_from_dict(d, "state", EndpointState), - tags=_repeated_dict(d, "tags", EndpointTag), - task=d.get("task", None), + ai_gateway=_from_dict(d, "{ai_gateway}", AiGatewayConfig), + budget_policy_id=d.get("{budget_policy_id}", None), + config=_from_dict(d, "{config}", EndpointCoreConfigSummary), + creation_timestamp=d.get("{creation_timestamp}", None), + creator=d.get("{creator}", None), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + name=d.get("{name}", None), + state=_from_dict(d, "{state}", EndpointState), + tags=_repeated_dict(d, "{tags}", EndpointTag), + task=d.get("{task}", None), ) @@ -3654,36 +3655,36 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointAccessControlRequest: """Deserializes the ServingEndpointAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", ServingEndpointPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3708,41 +3709,41 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointAccessControlResponse: """Deserializes the ServingEndpointAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", ServingEndpointPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", ServingEndpointPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3802,96 +3803,96 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointDetailed into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai_gateway: - body["ai_gateway"] = self.ai_gateway.as_dict() + body["{ai_gateway}"] = self.ai_gateway.as_dict() if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.config: - body["config"] = self.config.as_dict() + body["{config}"] = self.config.as_dict() if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.data_plane_info: - body["data_plane_info"] = self.data_plane_info.as_dict() + body["{data_plane_info}"] = self.data_plane_info.as_dict() if self.endpoint_url is not None: - body["endpoint_url"] = self.endpoint_url + body["{endpoint_url}"] = self.endpoint_url if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pending_config: - body["pending_config"] = self.pending_config.as_dict() + body["{pending_config}"] = self.pending_config.as_dict() if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.route_optimized is not None: - body["route_optimized"] = self.route_optimized + body["{route_optimized}"] = self.route_optimized if self.state: - body["state"] = self.state.as_dict() + body["{state}"] = self.state.as_dict() if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] if self.task is not None: - body["task"] = self.task + body["{task}"] = self.task return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointDetailed into a shallow dictionary of its immediate attributes.""" body = {} if self.ai_gateway: - body["ai_gateway"] = self.ai_gateway + body["{ai_gateway}"] = self.ai_gateway if self.budget_policy_id is not None: - body["budget_policy_id"] = self.budget_policy_id + body["{budget_policy_id}"] = self.budget_policy_id if self.config: - body["config"] = self.config + body["{config}"] = self.config if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.data_plane_info: - body["data_plane_info"] = self.data_plane_info + body["{data_plane_info}"] = self.data_plane_info if self.endpoint_url is not None: - body["endpoint_url"] = self.endpoint_url + body["{endpoint_url}"] = self.endpoint_url if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pending_config: - body["pending_config"] = self.pending_config + body["{pending_config}"] = self.pending_config if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.route_optimized is not None: - body["route_optimized"] = self.route_optimized + body["{route_optimized}"] = self.route_optimized if self.state: - body["state"] = self.state + body["{state}"] = self.state if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.task is not None: - body["task"] = self.task + body["{task}"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointDetailed: """Deserializes the ServingEndpointDetailed from a dictionary.""" return cls( - ai_gateway=_from_dict(d, "ai_gateway", AiGatewayConfig), - budget_policy_id=d.get("budget_policy_id", None), - config=_from_dict(d, "config", EndpointCoreConfigOutput), - creation_timestamp=d.get("creation_timestamp", None), - creator=d.get("creator", None), - data_plane_info=_from_dict(d, "data_plane_info", ModelDataPlaneInfo), - endpoint_url=d.get("endpoint_url", None), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - name=d.get("name", None), - pending_config=_from_dict(d, "pending_config", EndpointPendingConfig), - permission_level=_enum(d, "permission_level", ServingEndpointDetailedPermissionLevel), - route_optimized=d.get("route_optimized", None), - state=_from_dict(d, "state", EndpointState), - tags=_repeated_dict(d, "tags", EndpointTag), - task=d.get("task", None), + ai_gateway=_from_dict(d, "{ai_gateway}", AiGatewayConfig), + budget_policy_id=d.get("{budget_policy_id}", None), + config=_from_dict(d, "{config}", EndpointCoreConfigOutput), + creation_timestamp=d.get("{creation_timestamp}", None), + creator=d.get("{creator}", None), + data_plane_info=_from_dict(d, "{data_plane_info}", ModelDataPlaneInfo), + endpoint_url=d.get("{endpoint_url}", None), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + name=d.get("{name}", None), + pending_config=_from_dict(d, "{pending_config}", EndpointPendingConfig), + permission_level=_enum(d, "{permission_level}", ServingEndpointDetailedPermissionLevel), + route_optimized=d.get("{route_optimized}", None), + state=_from_dict(d, "{state}", EndpointState), + tags=_repeated_dict(d, "{tags}", EndpointTag), + task=d.get("{task}", None), ) @@ -3915,31 +3916,31 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermission: """Deserializes the ServingEndpointPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", ServingEndpointPermissionLevel), ) @@ -3963,31 +3964,31 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissions: """Deserializes the ServingEndpointPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ServingEndpointAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ServingEndpointAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -4002,26 +4003,26 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissionsDescription: """Deserializes the ServingEndpointPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", ServingEndpointPermissionLevel), ) @@ -4036,26 +4037,26 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.serving_endpoint_id is not None: - body["serving_endpoint_id"] = self.serving_endpoint_id + body["{serving_endpoint_id}"] = self.serving_endpoint_id return body def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.serving_endpoint_id is not None: - body["serving_endpoint_id"] = self.serving_endpoint_id + body["{serving_endpoint_id}"] = self.serving_endpoint_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissionsRequest: """Deserializes the ServingEndpointPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", ServingEndpointAccessControlRequest), - serving_endpoint_id=d.get("serving_endpoint_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", ServingEndpointAccessControlRequest), + serving_endpoint_id=d.get("{serving_endpoint_id}", None), ) @@ -4078,20 +4079,20 @@ def as_dict(self) -> dict: """Serializes the TrafficConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.routes: - body["routes"] = [v.as_dict() for v in self.routes] + body["{routes}"] = [v.as_dict() for v in self.routes] return body def as_shallow_dict(self) -> dict: """Serializes the TrafficConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.routes: - body["routes"] = self.routes + body["{routes}"] = self.routes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TrafficConfig: """Deserializes the TrafficConfig from a dictionary.""" - return cls(routes=_repeated_dict(d, "routes", Route)) + return cls(routes=_repeated_dict(d, "{routes}", Route)) @dataclass @@ -4115,41 +4116,41 @@ def as_dict(self) -> dict: """Serializes the V1ResponseChoiceElement into a dictionary suitable for use as a JSON request body.""" body = {} if self.finish_reason is not None: - body["finishReason"] = self.finish_reason + body["{finish_reason}"] = self.finish_reason if self.index is not None: - body["index"] = self.index + body["{index}"] = self.index if self.logprobs is not None: - body["logprobs"] = self.logprobs + body["{logprobs}"] = self.logprobs if self.message: - body["message"] = self.message.as_dict() + body["{message}"] = self.message.as_dict() if self.text is not None: - body["text"] = self.text + body["{text}"] = self.text return body def as_shallow_dict(self) -> dict: """Serializes the V1ResponseChoiceElement into a shallow dictionary of its immediate attributes.""" body = {} if self.finish_reason is not None: - body["finishReason"] = self.finish_reason + body["{finish_reason}"] = self.finish_reason if self.index is not None: - body["index"] = self.index + body["{index}"] = self.index if self.logprobs is not None: - body["logprobs"] = self.logprobs + body["{logprobs}"] = self.logprobs if self.message: - body["message"] = self.message + body["{message}"] = self.message if self.text is not None: - body["text"] = self.text + body["{text}"] = self.text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> V1ResponseChoiceElement: """Deserializes the V1ResponseChoiceElement from a dictionary.""" return cls( - finish_reason=d.get("finishReason", None), - index=d.get("index", None), - logprobs=d.get("logprobs", None), - message=_from_dict(d, "message", ChatMessage), - text=d.get("text", None), + finish_reason=d.get("{finish_reason}", None), + index=d.get("{index}", None), + logprobs=d.get("{logprobs}", None), + message=_from_dict(d, "{message}", ChatMessage), + text=d.get("{text}", None), ) @@ -4168,41 +4169,6 @@ class ServingEndpointsAPI: def __init__(self, api_client): self._api = api_client - def wait_get_serving_endpoint_not_updating( - self, - name: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[ServingEndpointDetailed], None]] = None, - ) -> ServingEndpointDetailed: - deadline = time.time() + timeout.total_seconds() - target_states = (EndpointStateConfigUpdate.NOT_UPDATING,) - failure_states = ( - EndpointStateConfigUpdate.UPDATE_FAILED, - EndpointStateConfigUpdate.UPDATE_CANCELED, - ) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(name=name) - status = poll.state.config_update - status_message = f"current status: {status}" - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach NOT_UPDATING, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"name={name}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def build_logs(self, name: str, served_model_name: str) -> BuildLogsResponse: """Get build logs for a served model. @@ -4217,7 +4183,7 @@ def build_logs(self, name: str, served_model_name: str) -> BuildLogsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -4258,33 +4224,33 @@ def create( :returns: Long-running operation waiter for :class:`ServingEndpointDetailed`. - See :method:wait_get_serving_endpoint_not_updating for more details. + See :method:WaitGetServingEndpointNotUpdating for more details. """ body = {} if ai_gateway is not None: - body["ai_gateway"] = ai_gateway.as_dict() + body["{ai_gateway}"] = ai_gateway.as_dict() if budget_policy_id is not None: - body["budget_policy_id"] = budget_policy_id + body["{budget_policy_id}"] = budget_policy_id if config is not None: - body["config"] = config.as_dict() + body["{config}"] = config.as_dict() if name is not None: - body["name"] = name + body["{name}"] = name if rate_limits is not None: - body["rate_limits"] = [v.as_dict() for v in rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in rate_limits] if route_optimized is not None: - body["route_optimized"] = route_optimized + body["{route_optimized}"] = route_optimized if tags is not None: - body["tags"] = [v.as_dict() for v in tags] + body["{tags}"] = [v.as_dict() for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.0/serving-endpoints", body=body, headers=headers) return Wait( - self.wait_get_serving_endpoint_not_updating, + self.WaitGetServingEndpointNotUpdating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], + name=op_response["{name}"], ) def create_and_wait( @@ -4334,7 +4300,7 @@ def export_metrics(self, name: str) -> ExportMetricsResponse: """ headers = { - "Accept": "text/plain", + "0": "{Accept text/plain}", } res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/metrics", headers=headers, raw=True) @@ -4352,7 +4318,7 @@ def get(self, name: str) -> ServingEndpointDetailed: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}", headers=headers) @@ -4371,7 +4337,7 @@ def get_open_api(self, name: str) -> GetOpenApiResponse: """ headers = { - "Accept": "text/plain", + "0": "{Accept text/plain}", } res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/openapi", headers=headers, raw=True) @@ -4389,7 +4355,7 @@ def get_permission_levels(self, serving_endpoint_id: str) -> GetServingEndpointP """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -4410,7 +4376,7 @@ def get_permissions(self, serving_endpoint_id: str) -> ServingEndpointPermission """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}", headers=headers) @@ -4446,20 +4412,20 @@ def http_request( """ body = {} if connection_name is not None: - body["connection_name"] = connection_name + body["{connection_name}"] = connection_name if headers is not None: - body["headers"] = headers + body["{headers}"] = headers if json is not None: - body["json"] = json + body["{json}"] = json if method is not None: - body["method"] = method.value + body["{method}"] = method.value if params is not None: - body["params"] = params + body["{params}"] = params if path is not None: - body["path"] = path + body["{path}"] = path headers = { - "Accept": "text/plain", - "Content-Type": "application/json", + "0": "{Accept text/plain}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/external-function", body=body, headers=headers, raw=True) @@ -4472,7 +4438,7 @@ def list(self) -> Iterator[ServingEndpoint]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/serving-endpoints", headers=headers) @@ -4493,7 +4459,7 @@ def logs(self, name: str, served_model_name: str) -> ServerLogsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -4519,12 +4485,12 @@ def patch( """ body = {} if add_tags is not None: - body["add_tags"] = [v.as_dict() for v in add_tags] + body["{add_tags}"] = [v.as_dict() for v in add_tags] if delete_tags is not None: - body["delete_tags"] = [v for v in delete_tags] + body["{delete_tags}"] = [v for v in delete_tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/serving-endpoints/{name}/tags", body=body, headers=headers) @@ -4545,10 +4511,10 @@ def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> Pu """ body = {} if rate_limits is not None: - body["rate_limits"] = [v.as_dict() for v in rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in rate_limits] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/rate-limits", body=body, headers=headers) @@ -4589,18 +4555,18 @@ def put_ai_gateway( """ body = {} if fallback_config is not None: - body["fallback_config"] = fallback_config.as_dict() + body["{fallback_config}"] = fallback_config.as_dict() if guardrails is not None: - body["guardrails"] = guardrails.as_dict() + body["{guardrails}"] = guardrails.as_dict() if inference_table_config is not None: - body["inference_table_config"] = inference_table_config.as_dict() + body["{inference_table_config}"] = inference_table_config.as_dict() if rate_limits is not None: - body["rate_limits"] = [v.as_dict() for v in rate_limits] + body["{rate_limits}"] = [v.as_dict() for v in rate_limits] if usage_tracking_config is not None: - body["usage_tracking_config"] = usage_tracking_config.as_dict() + body["{usage_tracking_config}"] = usage_tracking_config.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/ai-gateway", body=body, headers=headers) @@ -4674,37 +4640,37 @@ def query( """ body = {} if dataframe_records is not None: - body["dataframe_records"] = [v for v in dataframe_records] + body["{dataframe_records}"] = [v for v in dataframe_records] if dataframe_split is not None: - body["dataframe_split"] = dataframe_split.as_dict() + body["{dataframe_split}"] = dataframe_split.as_dict() if extra_params is not None: - body["extra_params"] = extra_params + body["{extra_params}"] = extra_params if input is not None: - body["input"] = input + body["{input}"] = input if inputs is not None: - body["inputs"] = inputs + body["{inputs}"] = inputs if instances is not None: - body["instances"] = [v for v in instances] + body["{instances}"] = [v for v in instances] if max_tokens is not None: - body["max_tokens"] = max_tokens + body["{max_tokens}"] = max_tokens if messages is not None: - body["messages"] = [v.as_dict() for v in messages] + body["{messages}"] = [v.as_dict() for v in messages] if n is not None: - body["n"] = n + body["{n}"] = n if prompt is not None: - body["prompt"] = prompt + body["{prompt}"] = prompt if stop is not None: - body["stop"] = [v for v in stop] + body["{stop}"] = [v for v in stop] if stream is not None: - body["stream"] = stream + body["{stream}"] = stream if temperature is not None: - body["temperature"] = temperature + body["{temperature}"] = temperature headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } response_headers = [ - "served-model-name", + "{served_model_name}", ] res = self._api.do( "POST", @@ -4734,10 +4700,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -4777,27 +4743,27 @@ def update_config( :returns: Long-running operation waiter for :class:`ServingEndpointDetailed`. - See :method:wait_get_serving_endpoint_not_updating for more details. + See :method:WaitGetServingEndpointNotUpdating for more details. """ body = {} if auto_capture_config is not None: - body["auto_capture_config"] = auto_capture_config.as_dict() + body["{auto_capture_config}"] = auto_capture_config.as_dict() if served_entities is not None: - body["served_entities"] = [v.as_dict() for v in served_entities] + body["{served_entities}"] = [v.as_dict() for v in served_entities] if served_models is not None: - body["served_models"] = [v.as_dict() for v in served_models] + body["{served_models}"] = [v.as_dict() for v in served_models] if traffic_config is not None: - body["traffic_config"] = traffic_config.as_dict() + body["{traffic_config}"] = traffic_config.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/config", body=body, headers=headers) return Wait( - self.wait_get_serving_endpoint_not_updating, + self.WaitGetServingEndpointNotUpdating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], + name=op_response["{name}"], ) def update_config_and_wait( @@ -4837,10 +4803,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -4853,31 +4819,8 @@ class ServingEndpointsDataPlaneAPI: """Serving endpoints DataPlane provides a set of operations to interact with data plane endpoints for Serving endpoints service.""" - def __init__(self, api_client, control_plane_service, dpts): + def __init__(self, api_client): self._api = api_client - self._lock = threading.Lock() - self._control_plane_service = control_plane_service - self._dpts = dpts - self._data_plane_details = {} - - def _data_plane_info_query(self, name: str) -> DataPlaneInfo: - key = "query" + "/".join( - [ - str(name), - ] - ) - with self._lock: - if key in self._data_plane_details: - return self._data_plane_details[key] - response = self._control_plane_service.get( - name=name, - ) - if response.data_plane_info is None: - raise Exception("Resource does not support direct Data Plane access") - result = response.data_plane_info.query_info - with self._lock: - self._data_plane_details[key] = result - return result def query( self, @@ -4947,54 +4890,43 @@ def query( """ body = {} if dataframe_records is not None: - body["dataframe_records"] = [v for v in dataframe_records] + body["{dataframe_records}"] = [v for v in dataframe_records] if dataframe_split is not None: - body["dataframe_split"] = dataframe_split.as_dict() + body["{dataframe_split}"] = dataframe_split.as_dict() if extra_params is not None: - body["extra_params"] = extra_params + body["{extra_params}"] = extra_params if input is not None: - body["input"] = input + body["{input}"] = input if inputs is not None: - body["inputs"] = inputs + body["{inputs}"] = inputs if instances is not None: - body["instances"] = [v for v in instances] + body["{instances}"] = [v for v in instances] if max_tokens is not None: - body["max_tokens"] = max_tokens + body["{max_tokens}"] = max_tokens if messages is not None: - body["messages"] = [v.as_dict() for v in messages] + body["{messages}"] = [v.as_dict() for v in messages] if n is not None: - body["n"] = n + body["{n}"] = n if prompt is not None: - body["prompt"] = prompt + body["{prompt}"] = prompt if stop is not None: - body["stop"] = [v for v in stop] + body["{stop}"] = [v for v in stop] if stream is not None: - body["stream"] = stream + body["{stream}"] = stream if temperature is not None: - body["temperature"] = temperature - data_plane_info = self._data_plane_info_query( - name=name, - ) - token = self._dpts.token(data_plane_info.endpoint_url, data_plane_info.authorization_details) - - def auth(r: requests.PreparedRequest) -> requests.PreparedRequest: - authorization = f"{token.token_type} {token.access_token}" - r.headers["Authorization"] = authorization - return r - + body["{temperature}"] = temperature headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } response_headers = [ - "served-model-name", + "{served_model_name}", ] res = self._api.do( "POST", - url=data_plane_info.endpoint_url, + f"/serving-endpoints/{name}/invocations", body=body, headers=headers, response_headers=response_headers, - auth=auth, ) return QueryEndpointResponse.from_dict(res) diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/settings/v2/impl.py similarity index 80% rename from databricks/sdk/service/settings.py rename to databricks/sdk/settings/v2/impl.py index 4614b54d4..a0c5e13a9 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/settings/v2/impl.py @@ -7,11 +7,11 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (_enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -37,31 +37,31 @@ def as_dict(self) -> dict: """Serializes the AccountIpAccessEnable into a dictionary suitable for use as a JSON request body.""" body = {} if self.acct_ip_acl_enable: - body["acct_ip_acl_enable"] = self.acct_ip_acl_enable.as_dict() + body["{acct_ip_acl_enable}"] = self.acct_ip_acl_enable.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the AccountIpAccessEnable into a shallow dictionary of its immediate attributes.""" body = {} if self.acct_ip_acl_enable: - body["acct_ip_acl_enable"] = self.acct_ip_acl_enable + body["{acct_ip_acl_enable}"] = self.acct_ip_acl_enable if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountIpAccessEnable: """Deserializes the AccountIpAccessEnable from a dictionary.""" return cls( - acct_ip_acl_enable=_from_dict(d, "acct_ip_acl_enable", BooleanMessage), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + acct_ip_acl_enable=_from_dict(d, "{acct_ip_acl_enable}", BooleanMessage), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -73,21 +73,21 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_policy_type is not None: - body["access_policy_type"] = self.access_policy_type.value + body["{access_policy_type}"] = self.access_policy_type.value return body def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.access_policy_type is not None: - body["access_policy_type"] = self.access_policy_type + body["{access_policy_type}"] = self.access_policy_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingAccessPolicy: """Deserializes the AibiDashboardEmbeddingAccessPolicy from a dictionary.""" return cls( - access_policy_type=_enum(d, "access_policy_type", AibiDashboardEmbeddingAccessPolicyAccessPolicyType) + access_policy_type=_enum(d, "{access_policy_type}", AibiDashboardEmbeddingAccessPolicyAccessPolicyType) ) @@ -120,22 +120,22 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicySetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.aibi_dashboard_embedding_access_policy: - body["aibi_dashboard_embedding_access_policy"] = self.aibi_dashboard_embedding_access_policy.as_dict() + body["{aibi_dashboard_embedding_access_policy}"] = self.aibi_dashboard_embedding_access_policy.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicySetting into a shallow dictionary of its immediate attributes.""" body = {} if self.aibi_dashboard_embedding_access_policy: - body["aibi_dashboard_embedding_access_policy"] = self.aibi_dashboard_embedding_access_policy + body["{aibi_dashboard_embedding_access_policy}"] = self.aibi_dashboard_embedding_access_policy if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod @@ -143,10 +143,10 @@ def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingAccessPolicySetti """Deserializes the AibiDashboardEmbeddingAccessPolicySetting from a dictionary.""" return cls( aibi_dashboard_embedding_access_policy=_from_dict( - d, "aibi_dashboard_embedding_access_policy", AibiDashboardEmbeddingAccessPolicy + d, "{aibi_dashboard_embedding_access_policy}", AibiDashboardEmbeddingAccessPolicy ), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -158,20 +158,20 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomains into a dictionary suitable for use as a JSON request body.""" body = {} if self.approved_domains: - body["approved_domains"] = [v for v in self.approved_domains] + body["{approved_domains}"] = [v for v in self.approved_domains] return body def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomains into a shallow dictionary of its immediate attributes.""" body = {} if self.approved_domains: - body["approved_domains"] = self.approved_domains + body["{approved_domains}"] = self.approved_domains return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingApprovedDomains: """Deserializes the AibiDashboardEmbeddingApprovedDomains from a dictionary.""" - return cls(approved_domains=d.get("approved_domains", None)) + return cls(approved_domains=d.get("{approved_domains}", None)) @dataclass @@ -196,22 +196,24 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomainsSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.aibi_dashboard_embedding_approved_domains: - body["aibi_dashboard_embedding_approved_domains"] = self.aibi_dashboard_embedding_approved_domains.as_dict() + body["{aibi_dashboard_embedding_approved_domains}"] = ( + self.aibi_dashboard_embedding_approved_domains.as_dict() + ) if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomainsSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.aibi_dashboard_embedding_approved_domains: - body["aibi_dashboard_embedding_approved_domains"] = self.aibi_dashboard_embedding_approved_domains + body["{aibi_dashboard_embedding_approved_domains}"] = self.aibi_dashboard_embedding_approved_domains if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod @@ -219,10 +221,10 @@ def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingApprovedDomainsSe """Deserializes the AibiDashboardEmbeddingApprovedDomainsSetting from a dictionary.""" return cls( aibi_dashboard_embedding_approved_domains=_from_dict( - d, "aibi_dashboard_embedding_approved_domains", AibiDashboardEmbeddingApprovedDomains + d, "{aibi_dashboard_embedding_approved_domains}", AibiDashboardEmbeddingApprovedDomains ), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -248,22 +250,22 @@ def as_dict(self) -> dict: """Serializes the AutomaticClusterUpdateSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.automatic_cluster_update_workspace: - body["automatic_cluster_update_workspace"] = self.automatic_cluster_update_workspace.as_dict() + body["{automatic_cluster_update_workspace}"] = self.automatic_cluster_update_workspace.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the AutomaticClusterUpdateSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.automatic_cluster_update_workspace: - body["automatic_cluster_update_workspace"] = self.automatic_cluster_update_workspace + body["{automatic_cluster_update_workspace}"] = self.automatic_cluster_update_workspace if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod @@ -271,10 +273,10 @@ def from_dict(cls, d: Dict[str, Any]) -> AutomaticClusterUpdateSetting: """Deserializes the AutomaticClusterUpdateSetting from a dictionary.""" return cls( automatic_cluster_update_workspace=_from_dict( - d, "automatic_cluster_update_workspace", ClusterAutoRestartMessage + d, "{automatic_cluster_update_workspace}", ClusterAutoRestartMessage ), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -286,20 +288,20 @@ def as_dict(self) -> dict: """Serializes the BooleanMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the BooleanMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BooleanMessage: """Deserializes the BooleanMessage from a dictionary.""" - return cls(value=d.get("value", None)) + return cls(value=d.get("{value}", None)) @dataclass @@ -323,41 +325,41 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.can_toggle is not None: - body["can_toggle"] = self.can_toggle + body["{can_toggle}"] = self.can_toggle if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.enablement_details: - body["enablement_details"] = self.enablement_details.as_dict() + body["{enablement_details}"] = self.enablement_details.as_dict() if self.maintenance_window: - body["maintenance_window"] = self.maintenance_window.as_dict() + body["{maintenance_window}"] = self.maintenance_window.as_dict() if self.restart_even_if_no_updates_available is not None: - body["restart_even_if_no_updates_available"] = self.restart_even_if_no_updates_available + body["{restart_even_if_no_updates_available}"] = self.restart_even_if_no_updates_available return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.can_toggle is not None: - body["can_toggle"] = self.can_toggle + body["{can_toggle}"] = self.can_toggle if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.enablement_details: - body["enablement_details"] = self.enablement_details + body["{enablement_details}"] = self.enablement_details if self.maintenance_window: - body["maintenance_window"] = self.maintenance_window + body["{maintenance_window}"] = self.maintenance_window if self.restart_even_if_no_updates_available is not None: - body["restart_even_if_no_updates_available"] = self.restart_even_if_no_updates_available + body["{restart_even_if_no_updates_available}"] = self.restart_even_if_no_updates_available return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessage: """Deserializes the ClusterAutoRestartMessage from a dictionary.""" return cls( - can_toggle=d.get("can_toggle", None), - enabled=d.get("enabled", None), - enablement_details=_from_dict(d, "enablement_details", ClusterAutoRestartMessageEnablementDetails), - maintenance_window=_from_dict(d, "maintenance_window", ClusterAutoRestartMessageMaintenanceWindow), - restart_even_if_no_updates_available=d.get("restart_even_if_no_updates_available", None), + can_toggle=d.get("{can_toggle}", None), + enabled=d.get("{enabled}", None), + enablement_details=_from_dict(d, "{enablement_details}", ClusterAutoRestartMessageEnablementDetails), + maintenance_window=_from_dict(d, "{maintenance_window}", ClusterAutoRestartMessageMaintenanceWindow), + restart_even_if_no_updates_available=d.get("{restart_even_if_no_updates_available}", None), ) @@ -383,31 +385,31 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageEnablementDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.forced_for_compliance_mode is not None: - body["forced_for_compliance_mode"] = self.forced_for_compliance_mode + body["{forced_for_compliance_mode}"] = self.forced_for_compliance_mode if self.unavailable_for_disabled_entitlement is not None: - body["unavailable_for_disabled_entitlement"] = self.unavailable_for_disabled_entitlement + body["{unavailable_for_disabled_entitlement}"] = self.unavailable_for_disabled_entitlement if self.unavailable_for_non_enterprise_tier is not None: - body["unavailable_for_non_enterprise_tier"] = self.unavailable_for_non_enterprise_tier + body["{unavailable_for_non_enterprise_tier}"] = self.unavailable_for_non_enterprise_tier return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageEnablementDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.forced_for_compliance_mode is not None: - body["forced_for_compliance_mode"] = self.forced_for_compliance_mode + body["{forced_for_compliance_mode}"] = self.forced_for_compliance_mode if self.unavailable_for_disabled_entitlement is not None: - body["unavailable_for_disabled_entitlement"] = self.unavailable_for_disabled_entitlement + body["{unavailable_for_disabled_entitlement}"] = self.unavailable_for_disabled_entitlement if self.unavailable_for_non_enterprise_tier is not None: - body["unavailable_for_non_enterprise_tier"] = self.unavailable_for_non_enterprise_tier + body["{unavailable_for_non_enterprise_tier}"] = self.unavailable_for_non_enterprise_tier return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageEnablementDetails: """Deserializes the ClusterAutoRestartMessageEnablementDetails from a dictionary.""" return cls( - forced_for_compliance_mode=d.get("forced_for_compliance_mode", None), - unavailable_for_disabled_entitlement=d.get("unavailable_for_disabled_entitlement", None), - unavailable_for_non_enterprise_tier=d.get("unavailable_for_non_enterprise_tier", None), + forced_for_compliance_mode=d.get("{forced_for_compliance_mode}", None), + unavailable_for_disabled_entitlement=d.get("{unavailable_for_disabled_entitlement}", None), + unavailable_for_non_enterprise_tier=d.get("{unavailable_for_non_enterprise_tier}", None), ) @@ -419,14 +421,14 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindow into a dictionary suitable for use as a JSON request body.""" body = {} if self.week_day_based_schedule: - body["week_day_based_schedule"] = self.week_day_based_schedule.as_dict() + body["{week_day_based_schedule}"] = self.week_day_based_schedule.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindow into a shallow dictionary of its immediate attributes.""" body = {} if self.week_day_based_schedule: - body["week_day_based_schedule"] = self.week_day_based_schedule + body["{week_day_based_schedule}"] = self.week_day_based_schedule return body @classmethod @@ -434,7 +436,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageMaintenanceWin """Deserializes the ClusterAutoRestartMessageMaintenanceWindow from a dictionary.""" return cls( week_day_based_schedule=_from_dict( - d, "week_day_based_schedule", ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule + d, "{week_day_based_schedule}", ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule ) ) @@ -462,32 +464,32 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.day_of_week is not None: - body["day_of_week"] = self.day_of_week.value + body["{day_of_week}"] = self.day_of_week.value if self.frequency is not None: - body["frequency"] = self.frequency.value + body["{frequency}"] = self.frequency.value if self.window_start_time: - body["window_start_time"] = self.window_start_time.as_dict() + body["{window_start_time}"] = self.window_start_time.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.day_of_week is not None: - body["day_of_week"] = self.day_of_week + body["{day_of_week}"] = self.day_of_week if self.frequency is not None: - body["frequency"] = self.frequency + body["{frequency}"] = self.frequency if self.window_start_time: - body["window_start_time"] = self.window_start_time + body["{window_start_time}"] = self.window_start_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule: """Deserializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule from a dictionary.""" return cls( - day_of_week=_enum(d, "day_of_week", ClusterAutoRestartMessageMaintenanceWindowDayOfWeek), - frequency=_enum(d, "frequency", ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency), + day_of_week=_enum(d, "{day_of_week}", ClusterAutoRestartMessageMaintenanceWindowDayOfWeek), + frequency=_enum(d, "{frequency}", ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency), window_start_time=_from_dict( - d, "window_start_time", ClusterAutoRestartMessageMaintenanceWindowWindowStartTime + d, "{window_start_time}", ClusterAutoRestartMessageMaintenanceWindowWindowStartTime ), ) @@ -513,24 +515,24 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime into a dictionary suitable for use as a JSON request body.""" body = {} if self.hours is not None: - body["hours"] = self.hours + body["{hours}"] = self.hours if self.minutes is not None: - body["minutes"] = self.minutes + body["{minutes}"] = self.minutes return body def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime into a shallow dictionary of its immediate attributes.""" body = {} if self.hours is not None: - body["hours"] = self.hours + body["{hours}"] = self.hours if self.minutes is not None: - body["minutes"] = self.minutes + body["{minutes}"] = self.minutes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageMaintenanceWindowWindowStartTime: """Deserializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime from a dictionary.""" - return cls(hours=d.get("hours", None), minutes=d.get("minutes", None)) + return cls(hours=d.get("{hours}", None), minutes=d.get("{minutes}", None)) @dataclass @@ -546,26 +548,26 @@ def as_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_standards: - body["compliance_standards"] = [v.value for v in self.compliance_standards] + body["{compliance_standards}"] = [v.value for v in self.compliance_standards] if self.is_enabled is not None: - body["is_enabled"] = self.is_enabled + body["{is_enabled}"] = self.is_enabled return body def as_shallow_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_standards: - body["compliance_standards"] = self.compliance_standards + body["{compliance_standards}"] = self.compliance_standards if self.is_enabled is not None: - body["is_enabled"] = self.is_enabled + body["{is_enabled}"] = self.is_enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComplianceSecurityProfile: """Deserializes the ComplianceSecurityProfile from a dictionary.""" return cls( - compliance_standards=_repeated_enum(d, "compliance_standards", ComplianceStandard), - is_enabled=d.get("is_enabled", None), + compliance_standards=_repeated_enum(d, "{compliance_standards}", ComplianceStandard), + is_enabled=d.get("{is_enabled}", None), ) @@ -592,22 +594,22 @@ def as_dict(self) -> dict: """Serializes the ComplianceSecurityProfileSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_security_profile_workspace: - body["compliance_security_profile_workspace"] = self.compliance_security_profile_workspace.as_dict() + body["{compliance_security_profile_workspace}"] = self.compliance_security_profile_workspace.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the ComplianceSecurityProfileSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_security_profile_workspace: - body["compliance_security_profile_workspace"] = self.compliance_security_profile_workspace + body["{compliance_security_profile_workspace}"] = self.compliance_security_profile_workspace if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod @@ -615,10 +617,10 @@ def from_dict(cls, d: Dict[str, Any]) -> ComplianceSecurityProfileSetting: """Deserializes the ComplianceSecurityProfileSetting from a dictionary.""" return cls( compliance_security_profile_workspace=_from_dict( - d, "compliance_security_profile_workspace", ComplianceSecurityProfile + d, "{compliance_security_profile_workspace}", ComplianceSecurityProfile ), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -655,41 +657,41 @@ def as_dict(self) -> dict: """Serializes the Config into a dictionary suitable for use as a JSON request body.""" body = {} if self.email: - body["email"] = self.email.as_dict() + body["{email}"] = self.email.as_dict() if self.generic_webhook: - body["generic_webhook"] = self.generic_webhook.as_dict() + body["{generic_webhook}"] = self.generic_webhook.as_dict() if self.microsoft_teams: - body["microsoft_teams"] = self.microsoft_teams.as_dict() + body["{microsoft_teams}"] = self.microsoft_teams.as_dict() if self.pagerduty: - body["pagerduty"] = self.pagerduty.as_dict() + body["{pagerduty}"] = self.pagerduty.as_dict() if self.slack: - body["slack"] = self.slack.as_dict() + body["{slack}"] = self.slack.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Config into a shallow dictionary of its immediate attributes.""" body = {} if self.email: - body["email"] = self.email + body["{email}"] = self.email if self.generic_webhook: - body["generic_webhook"] = self.generic_webhook + body["{generic_webhook}"] = self.generic_webhook if self.microsoft_teams: - body["microsoft_teams"] = self.microsoft_teams + body["{microsoft_teams}"] = self.microsoft_teams if self.pagerduty: - body["pagerduty"] = self.pagerduty + body["{pagerduty}"] = self.pagerduty if self.slack: - body["slack"] = self.slack + body["{slack}"] = self.slack return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Config: """Deserializes the Config from a dictionary.""" return cls( - email=_from_dict(d, "email", EmailConfig), - generic_webhook=_from_dict(d, "generic_webhook", GenericWebhookConfig), - microsoft_teams=_from_dict(d, "microsoft_teams", MicrosoftTeamsConfig), - pagerduty=_from_dict(d, "pagerduty", PagerdutyConfig), - slack=_from_dict(d, "slack", SlackConfig), + email=_from_dict(d, "{email}", EmailConfig), + generic_webhook=_from_dict(d, "{generic_webhook}", GenericWebhookConfig), + microsoft_teams=_from_dict(d, "{microsoft_teams}", MicrosoftTeamsConfig), + pagerduty=_from_dict(d, "{pagerduty}", PagerdutyConfig), + slack=_from_dict(d, "{slack}", SlackConfig), ) @@ -712,31 +714,31 @@ def as_dict(self) -> dict: """Serializes the CreateIpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_addresses: - body["ip_addresses"] = [v for v in self.ip_addresses] + body["{ip_addresses}"] = [v for v in self.ip_addresses] if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_type is not None: - body["list_type"] = self.list_type.value + body["{list_type}"] = self.list_type.value return body def as_shallow_dict(self) -> dict: """Serializes the CreateIpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_addresses: - body["ip_addresses"] = self.ip_addresses + body["{ip_addresses}"] = self.ip_addresses if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_type is not None: - body["list_type"] = self.list_type + body["{list_type}"] = self.list_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateIpAccessList: """Deserializes the CreateIpAccessList from a dictionary.""" return cls( - ip_addresses=d.get("ip_addresses", None), - label=d.get("label", None), - list_type=_enum(d, "list_type", ListType), + ip_addresses=d.get("{ip_addresses}", None), + label=d.get("{label}", None), + list_type=_enum(d, "{list_type}", ListType), ) @@ -751,20 +753,20 @@ def as_dict(self) -> dict: """Serializes the CreateIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list.as_dict() + body["{ip_access_list}"] = self.ip_access_list.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list + body["{ip_access_list}"] = self.ip_access_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateIpAccessListResponse: """Deserializes the CreateIpAccessListResponse from a dictionary.""" - return cls(ip_access_list=_from_dict(d, "ip_access_list", IpAccessListInfo)) + return cls(ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessListInfo)) @dataclass @@ -782,24 +784,24 @@ def as_dict(self) -> dict: """Serializes the CreateNetworkConnectivityConfigRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body def as_shallow_dict(self) -> dict: """Serializes the CreateNetworkConnectivityConfigRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateNetworkConnectivityConfigRequest: """Deserializes the CreateNetworkConnectivityConfigRequest from a dictionary.""" - return cls(name=d.get("name", None), region=d.get("region", None)) + return cls(name=d.get("{name}", None), region=d.get("{region}", None)) @dataclass @@ -814,24 +816,24 @@ def as_dict(self) -> dict: """Serializes the CreateNotificationDestinationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.config: - body["config"] = self.config.as_dict() + body["{config}"] = self.config.as_dict() if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name return body def as_shallow_dict(self) -> dict: """Serializes the CreateNotificationDestinationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.config: - body["config"] = self.config + body["{config}"] = self.config if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateNotificationDestinationRequest: """Deserializes the CreateNotificationDestinationRequest from a dictionary.""" - return cls(config=_from_dict(d, "config", Config), display_name=d.get("display_name", None)) + return cls(config=_from_dict(d, "{config}", Config), display_name=d.get("{display_name}", None)) @dataclass @@ -851,31 +853,31 @@ def as_dict(self) -> dict: """Serializes the CreateOboTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.application_id is not None: - body["application_id"] = self.application_id + body["{application_id}"] = self.application_id if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.lifetime_seconds is not None: - body["lifetime_seconds"] = self.lifetime_seconds + body["{lifetime_seconds}"] = self.lifetime_seconds return body def as_shallow_dict(self) -> dict: """Serializes the CreateOboTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.application_id is not None: - body["application_id"] = self.application_id + body["{application_id}"] = self.application_id if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.lifetime_seconds is not None: - body["lifetime_seconds"] = self.lifetime_seconds + body["{lifetime_seconds}"] = self.lifetime_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateOboTokenRequest: """Deserializes the CreateOboTokenRequest from a dictionary.""" return cls( - application_id=d.get("application_id", None), - comment=d.get("comment", None), - lifetime_seconds=d.get("lifetime_seconds", None), + application_id=d.get("{application_id}", None), + comment=d.get("{comment}", None), + lifetime_seconds=d.get("{lifetime_seconds}", None), ) @@ -892,24 +894,24 @@ def as_dict(self) -> dict: """Serializes the CreateOboTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_info: - body["token_info"] = self.token_info.as_dict() + body["{token_info}"] = self.token_info.as_dict() if self.token_value is not None: - body["token_value"] = self.token_value + body["{token_value}"] = self.token_value return body def as_shallow_dict(self) -> dict: """Serializes the CreateOboTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_info: - body["token_info"] = self.token_info + body["{token_info}"] = self.token_info if self.token_value is not None: - body["token_value"] = self.token_value + body["{token_value}"] = self.token_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateOboTokenResponse: """Deserializes the CreateOboTokenResponse from a dictionary.""" - return cls(token_info=_from_dict(d, "token_info", TokenInfo), token_value=d.get("token_value", None)) + return cls(token_info=_from_dict(d, "{token_info}", TokenInfo), token_value=d.get("{token_value}", None)) @dataclass @@ -928,31 +930,31 @@ def as_dict(self) -> dict: """Serializes the CreatePrivateEndpointRuleRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_id is not None: - body["group_id"] = self.group_id.value + body["{group_id}"] = self.group_id.value if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id return body def as_shallow_dict(self) -> dict: """Serializes the CreatePrivateEndpointRuleRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_id is not None: - body["group_id"] = self.group_id + body["{group_id}"] = self.group_id if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePrivateEndpointRuleRequest: """Deserializes the CreatePrivateEndpointRuleRequest from a dictionary.""" return cls( - group_id=_enum(d, "group_id", CreatePrivateEndpointRuleRequestGroupId), - network_connectivity_config_id=d.get("network_connectivity_config_id", None), - resource_id=d.get("resource_id", None), + group_id=_enum(d, "{group_id}", CreatePrivateEndpointRuleRequestGroupId), + network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), + resource_id=d.get("{resource_id}", None), ) @@ -980,24 +982,24 @@ def as_dict(self) -> dict: """Serializes the CreateTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.lifetime_seconds is not None: - body["lifetime_seconds"] = self.lifetime_seconds + body["{lifetime_seconds}"] = self.lifetime_seconds return body def as_shallow_dict(self) -> dict: """Serializes the CreateTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.lifetime_seconds is not None: - body["lifetime_seconds"] = self.lifetime_seconds + body["{lifetime_seconds}"] = self.lifetime_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTokenRequest: """Deserializes the CreateTokenRequest from a dictionary.""" - return cls(comment=d.get("comment", None), lifetime_seconds=d.get("lifetime_seconds", None)) + return cls(comment=d.get("{comment}", None), lifetime_seconds=d.get("{lifetime_seconds}", None)) @dataclass @@ -1012,24 +1014,24 @@ def as_dict(self) -> dict: """Serializes the CreateTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_info: - body["token_info"] = self.token_info.as_dict() + body["{token_info}"] = self.token_info.as_dict() if self.token_value is not None: - body["token_value"] = self.token_value + body["{token_value}"] = self.token_value return body def as_shallow_dict(self) -> dict: """Serializes the CreateTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_info: - body["token_info"] = self.token_info + body["{token_info}"] = self.token_info if self.token_value is not None: - body["token_value"] = self.token_value + body["{token_value}"] = self.token_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTokenResponse: """Deserializes the CreateTokenResponse from a dictionary.""" - return cls(token_info=_from_dict(d, "token_info", PublicTokenInfo), token_value=d.get("token_value", None)) + return cls(token_info=_from_dict(d, "{token_info}", PublicTokenInfo), token_value=d.get("{token_value}", None)) @dataclass @@ -1047,26 +1049,26 @@ def as_dict(self) -> dict: """Serializes the CspEnablementAccount into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_standards: - body["compliance_standards"] = [v.value for v in self.compliance_standards] + body["{compliance_standards}"] = [v.value for v in self.compliance_standards] if self.is_enforced is not None: - body["is_enforced"] = self.is_enforced + body["{is_enforced}"] = self.is_enforced return body def as_shallow_dict(self) -> dict: """Serializes the CspEnablementAccount into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_standards: - body["compliance_standards"] = self.compliance_standards + body["{compliance_standards}"] = self.compliance_standards if self.is_enforced is not None: - body["is_enforced"] = self.is_enforced + body["{is_enforced}"] = self.is_enforced return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CspEnablementAccount: """Deserializes the CspEnablementAccount from a dictionary.""" return cls( - compliance_standards=_repeated_enum(d, "compliance_standards", ComplianceStandard), - is_enforced=d.get("is_enforced", None), + compliance_standards=_repeated_enum(d, "{compliance_standards}", ComplianceStandard), + is_enforced=d.get("{is_enforced}", None), ) @@ -1093,31 +1095,31 @@ def as_dict(self) -> dict: """Serializes the CspEnablementAccountSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.csp_enablement_account: - body["csp_enablement_account"] = self.csp_enablement_account.as_dict() + body["{csp_enablement_account}"] = self.csp_enablement_account.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the CspEnablementAccountSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.csp_enablement_account: - body["csp_enablement_account"] = self.csp_enablement_account + body["{csp_enablement_account}"] = self.csp_enablement_account if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CspEnablementAccountSetting: """Deserializes the CspEnablementAccountSetting from a dictionary.""" return cls( - csp_enablement_account=_from_dict(d, "csp_enablement_account", CspEnablementAccount), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + csp_enablement_account=_from_dict(d, "{csp_enablement_account}", CspEnablementAccount), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -1151,31 +1153,31 @@ def as_dict(self) -> dict: """Serializes the DefaultNamespaceSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.namespace: - body["namespace"] = self.namespace.as_dict() + body["{namespace}"] = self.namespace.as_dict() if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the DefaultNamespaceSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.namespace: - body["namespace"] = self.namespace + body["{namespace}"] = self.namespace if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DefaultNamespaceSetting: """Deserializes the DefaultNamespaceSetting from a dictionary.""" return cls( - etag=d.get("etag", None), - namespace=_from_dict(d, "namespace", StringMessage), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + namespace=_from_dict(d, "{namespace}", StringMessage), + setting_name=d.get("{setting_name}", None), ) @@ -1195,20 +1197,20 @@ def as_dict(self) -> dict: """Serializes the DeleteAccountIpAccessEnableResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteAccountIpAccessEnableResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAccountIpAccessEnableResponse: """Deserializes the DeleteAccountIpAccessEnableResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1227,20 +1229,20 @@ def as_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingAccessPolicySettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingAccessPolicySettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAibiDashboardEmbeddingAccessPolicySettingResponse: """Deserializes the DeleteAibiDashboardEmbeddingAccessPolicySettingResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1259,20 +1261,20 @@ def as_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse: """Deserializes the DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1291,20 +1293,20 @@ def as_dict(self) -> dict: """Serializes the DeleteDefaultNamespaceSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteDefaultNamespaceSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDefaultNamespaceSettingResponse: """Deserializes the DeleteDefaultNamespaceSettingResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1323,20 +1325,20 @@ def as_dict(self) -> dict: """Serializes the DeleteDisableLegacyAccessResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteDisableLegacyAccessResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDisableLegacyAccessResponse: """Deserializes the DeleteDisableLegacyAccessResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1355,20 +1357,20 @@ def as_dict(self) -> dict: """Serializes the DeleteDisableLegacyDbfsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteDisableLegacyDbfsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDisableLegacyDbfsResponse: """Deserializes the DeleteDisableLegacyDbfsResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1387,20 +1389,20 @@ def as_dict(self) -> dict: """Serializes the DeleteDisableLegacyFeaturesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteDisableLegacyFeaturesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDisableLegacyFeaturesResponse: """Deserializes the DeleteDisableLegacyFeaturesResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1437,20 +1439,20 @@ def as_dict(self) -> dict: """Serializes the DeletePersonalComputeSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeletePersonalComputeSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeletePersonalComputeSettingResponse: """Deserializes the DeletePersonalComputeSettingResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) @dataclass @@ -1487,20 +1489,20 @@ def as_dict(self) -> dict: """Serializes the DeleteRestrictWorkspaceAdminsSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body def as_shallow_dict(self) -> dict: """Serializes the DeleteRestrictWorkspaceAdminsSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRestrictWorkspaceAdminsSettingResponse: """Deserializes the DeleteRestrictWorkspaceAdminsSettingResponse from a dictionary.""" - return cls(etag=d.get("etag", None)) + return cls(etag=d.get("{etag}", None)) class DestinationType(Enum): @@ -1534,31 +1536,31 @@ def as_dict(self) -> dict: """Serializes the DisableLegacyAccess into a dictionary suitable for use as a JSON request body.""" body = {} if self.disable_legacy_access: - body["disable_legacy_access"] = self.disable_legacy_access.as_dict() + body["{disable_legacy_access}"] = self.disable_legacy_access.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the DisableLegacyAccess into a shallow dictionary of its immediate attributes.""" body = {} if self.disable_legacy_access: - body["disable_legacy_access"] = self.disable_legacy_access + body["{disable_legacy_access}"] = self.disable_legacy_access if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DisableLegacyAccess: """Deserializes the DisableLegacyAccess from a dictionary.""" return cls( - disable_legacy_access=_from_dict(d, "disable_legacy_access", BooleanMessage), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + disable_legacy_access=_from_dict(d, "{disable_legacy_access}", BooleanMessage), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -1584,31 +1586,31 @@ def as_dict(self) -> dict: """Serializes the DisableLegacyDbfs into a dictionary suitable for use as a JSON request body.""" body = {} if self.disable_legacy_dbfs: - body["disable_legacy_dbfs"] = self.disable_legacy_dbfs.as_dict() + body["{disable_legacy_dbfs}"] = self.disable_legacy_dbfs.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the DisableLegacyDbfs into a shallow dictionary of its immediate attributes.""" body = {} if self.disable_legacy_dbfs: - body["disable_legacy_dbfs"] = self.disable_legacy_dbfs + body["{disable_legacy_dbfs}"] = self.disable_legacy_dbfs if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DisableLegacyDbfs: """Deserializes the DisableLegacyDbfs from a dictionary.""" return cls( - disable_legacy_dbfs=_from_dict(d, "disable_legacy_dbfs", BooleanMessage), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + disable_legacy_dbfs=_from_dict(d, "{disable_legacy_dbfs}", BooleanMessage), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -1634,31 +1636,31 @@ def as_dict(self) -> dict: """Serializes the DisableLegacyFeatures into a dictionary suitable for use as a JSON request body.""" body = {} if self.disable_legacy_features: - body["disable_legacy_features"] = self.disable_legacy_features.as_dict() + body["{disable_legacy_features}"] = self.disable_legacy_features.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the DisableLegacyFeatures into a shallow dictionary of its immediate attributes.""" body = {} if self.disable_legacy_features: - body["disable_legacy_features"] = self.disable_legacy_features + body["{disable_legacy_features}"] = self.disable_legacy_features if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DisableLegacyFeatures: """Deserializes the DisableLegacyFeatures from a dictionary.""" return cls( - disable_legacy_features=_from_dict(d, "disable_legacy_features", BooleanMessage), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + disable_legacy_features=_from_dict(d, "{disable_legacy_features}", BooleanMessage), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -1671,20 +1673,20 @@ def as_dict(self) -> dict: """Serializes the EmailConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.addresses: - body["addresses"] = [v for v in self.addresses] + body["{addresses}"] = [v for v in self.addresses] return body def as_shallow_dict(self) -> dict: """Serializes the EmailConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.addresses: - body["addresses"] = self.addresses + body["{addresses}"] = self.addresses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmailConfig: """Deserializes the EmailConfig from a dictionary.""" - return cls(addresses=d.get("addresses", None)) + return cls(addresses=d.get("{addresses}", None)) @dataclass @@ -1715,20 +1717,20 @@ def as_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoring into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_enabled is not None: - body["is_enabled"] = self.is_enabled + body["{is_enabled}"] = self.is_enabled return body def as_shallow_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoring into a shallow dictionary of its immediate attributes.""" body = {} if self.is_enabled is not None: - body["is_enabled"] = self.is_enabled + body["{is_enabled}"] = self.is_enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnhancedSecurityMonitoring: """Deserializes the EnhancedSecurityMonitoring from a dictionary.""" - return cls(is_enabled=d.get("is_enabled", None)) + return cls(is_enabled=d.get("{is_enabled}", None)) @dataclass @@ -1754,22 +1756,22 @@ def as_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoringSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.enhanced_security_monitoring_workspace: - body["enhanced_security_monitoring_workspace"] = self.enhanced_security_monitoring_workspace.as_dict() + body["{enhanced_security_monitoring_workspace}"] = self.enhanced_security_monitoring_workspace.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoringSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.enhanced_security_monitoring_workspace: - body["enhanced_security_monitoring_workspace"] = self.enhanced_security_monitoring_workspace + body["{enhanced_security_monitoring_workspace}"] = self.enhanced_security_monitoring_workspace if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod @@ -1777,10 +1779,10 @@ def from_dict(cls, d: Dict[str, Any]) -> EnhancedSecurityMonitoringSetting: """Deserializes the EnhancedSecurityMonitoringSetting from a dictionary.""" return cls( enhanced_security_monitoring_workspace=_from_dict( - d, "enhanced_security_monitoring_workspace", EnhancedSecurityMonitoring + d, "{enhanced_security_monitoring_workspace}", EnhancedSecurityMonitoring ), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -1794,20 +1796,20 @@ def as_dict(self) -> dict: """Serializes the EsmEnablementAccount into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_enforced is not None: - body["is_enforced"] = self.is_enforced + body["{is_enforced}"] = self.is_enforced return body def as_shallow_dict(self) -> dict: """Serializes the EsmEnablementAccount into a shallow dictionary of its immediate attributes.""" body = {} if self.is_enforced is not None: - body["is_enforced"] = self.is_enforced + body["{is_enforced}"] = self.is_enforced return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EsmEnablementAccount: """Deserializes the EsmEnablementAccount from a dictionary.""" - return cls(is_enforced=d.get("is_enforced", None)) + return cls(is_enforced=d.get("{is_enforced}", None)) @dataclass @@ -1833,31 +1835,31 @@ def as_dict(self) -> dict: """Serializes the EsmEnablementAccountSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.esm_enablement_account: - body["esm_enablement_account"] = self.esm_enablement_account.as_dict() + body["{esm_enablement_account}"] = self.esm_enablement_account.as_dict() if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the EsmEnablementAccountSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.esm_enablement_account: - body["esm_enablement_account"] = self.esm_enablement_account + body["{esm_enablement_account}"] = self.esm_enablement_account if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EsmEnablementAccountSetting: """Deserializes the EsmEnablementAccountSetting from a dictionary.""" return cls( - esm_enablement_account=_from_dict(d, "esm_enablement_account", EsmEnablementAccount), - etag=d.get("etag", None), - setting_name=d.get("setting_name", None), + esm_enablement_account=_from_dict(d, "{esm_enablement_account}", EsmEnablementAccount), + etag=d.get("{etag}", None), + setting_name=d.get("{setting_name}", None), ) @@ -1884,41 +1886,41 @@ def as_dict(self) -> dict: """Serializes the ExchangeToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential is not None: - body["credential"] = self.credential + body["{credential}"] = self.credential if self.credential_eol_time is not None: - body["credentialEolTime"] = self.credential_eol_time + body["{credential_eol_time}"] = self.credential_eol_time if self.owner_id is not None: - body["ownerId"] = self.owner_id + body["{owner_id}"] = self.owner_id if self.scopes: - body["scopes"] = [v for v in self.scopes] + body["{scopes}"] = [v for v in self.scopes] if self.token_type is not None: - body["tokenType"] = self.token_type.value + body["{token_type}"] = self.token_type.value return body def as_shallow_dict(self) -> dict: """Serializes the ExchangeToken into a shallow dictionary of its immediate attributes.""" body = {} if self.credential is not None: - body["credential"] = self.credential + body["{credential}"] = self.credential if self.credential_eol_time is not None: - body["credentialEolTime"] = self.credential_eol_time + body["{credential_eol_time}"] = self.credential_eol_time if self.owner_id is not None: - body["ownerId"] = self.owner_id + body["{owner_id}"] = self.owner_id if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes if self.token_type is not None: - body["tokenType"] = self.token_type + body["{token_type}"] = self.token_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeToken: """Deserializes the ExchangeToken from a dictionary.""" return cls( - credential=d.get("credential", None), - credential_eol_time=d.get("credentialEolTime", None), - owner_id=d.get("ownerId", None), - scopes=d.get("scopes", None), - token_type=_enum(d, "tokenType", TokenType), + credential=d.get("{credential}", None), + credential_eol_time=d.get("{credential_eol_time}", None), + owner_id=d.get("{owner_id}", None), + scopes=d.get("{scopes}", None), + token_type=_enum(d, "{token_type}", TokenType), ) @@ -1939,31 +1941,31 @@ def as_dict(self) -> dict: """Serializes the ExchangeTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.partition_id: - body["partitionId"] = self.partition_id.as_dict() + body["{partition_id}"] = self.partition_id.as_dict() if self.scopes: - body["scopes"] = [v for v in self.scopes] + body["{scopes}"] = [v for v in self.scopes] if self.token_type: - body["tokenType"] = [v.value for v in self.token_type] + body["{token_type}"] = [v.value for v in self.token_type] return body def as_shallow_dict(self) -> dict: """Serializes the ExchangeTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.partition_id: - body["partitionId"] = self.partition_id + body["{partition_id}"] = self.partition_id if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes if self.token_type: - body["tokenType"] = self.token_type + body["{token_type}"] = self.token_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeTokenRequest: """Deserializes the ExchangeTokenRequest from a dictionary.""" return cls( - partition_id=_from_dict(d, "partitionId", PartitionId), - scopes=d.get("scopes", None), - token_type=_repeated_enum(d, "tokenType", TokenType), + partition_id=_from_dict(d, "{partition_id}", PartitionId), + scopes=d.get("{scopes}", None), + token_type=_repeated_enum(d, "{token_type}", TokenType), ) @@ -1977,20 +1979,20 @@ def as_dict(self) -> dict: """Serializes the ExchangeTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["values"] = [v.as_dict() for v in self.values] + body["{values}"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the ExchangeTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeTokenResponse: """Deserializes the ExchangeTokenResponse from a dictionary.""" - return cls(values=_repeated_dict(d, "values", ExchangeToken)) + return cls(values=_repeated_dict(d, "{values}", ExchangeToken)) @dataclass @@ -2004,20 +2006,20 @@ def as_dict(self) -> dict: """Serializes the FetchIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list.as_dict() + body["{ip_access_list}"] = self.ip_access_list.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the FetchIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list + body["{ip_access_list}"] = self.ip_access_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FetchIpAccessListResponse: """Deserializes the FetchIpAccessListResponse from a dictionary.""" - return cls(ip_access_list=_from_dict(d, "ip_access_list", IpAccessListInfo)) + return cls(ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessListInfo)) @dataclass @@ -2044,46 +2046,46 @@ def as_dict(self) -> dict: """Serializes the GenericWebhookConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.password is not None: - body["password"] = self.password + body["{password}"] = self.password if self.password_set is not None: - body["password_set"] = self.password_set + body["{password_set}"] = self.password_set if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.url_set is not None: - body["url_set"] = self.url_set + body["{url_set}"] = self.url_set if self.username is not None: - body["username"] = self.username + body["{username}"] = self.username if self.username_set is not None: - body["username_set"] = self.username_set + body["{username_set}"] = self.username_set return body def as_shallow_dict(self) -> dict: """Serializes the GenericWebhookConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.password is not None: - body["password"] = self.password + body["{password}"] = self.password if self.password_set is not None: - body["password_set"] = self.password_set + body["{password_set}"] = self.password_set if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.url_set is not None: - body["url_set"] = self.url_set + body["{url_set}"] = self.url_set if self.username is not None: - body["username"] = self.username + body["{username}"] = self.username if self.username_set is not None: - body["username_set"] = self.username_set + body["{username_set}"] = self.username_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenericWebhookConfig: """Deserializes the GenericWebhookConfig from a dictionary.""" return cls( - password=d.get("password", None), - password_set=d.get("password_set", None), - url=d.get("url", None), - url_set=d.get("url_set", None), - username=d.get("username", None), - username_set=d.get("username_set", None), + password=d.get("{password}", None), + password_set=d.get("{password_set}", None), + url=d.get("{url}", None), + url_set=d.get("{url_set}", None), + username=d.get("{username}", None), + username_set=d.get("{username_set}", None), ) @@ -2096,20 +2098,20 @@ def as_dict(self) -> dict: """Serializes the GetIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list.as_dict() + body["{ip_access_list}"] = self.ip_access_list.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list + body["{ip_access_list}"] = self.ip_access_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetIpAccessListResponse: """Deserializes the GetIpAccessListResponse from a dictionary.""" - return cls(ip_access_list=_from_dict(d, "ip_access_list", IpAccessListInfo)) + return cls(ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessListInfo)) @dataclass @@ -2122,20 +2124,20 @@ def as_dict(self) -> dict: """Serializes the GetIpAccessListsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_lists: - body["ip_access_lists"] = [v.as_dict() for v in self.ip_access_lists] + body["{ip_access_lists}"] = [v.as_dict() for v in self.ip_access_lists] return body def as_shallow_dict(self) -> dict: """Serializes the GetIpAccessListsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_lists: - body["ip_access_lists"] = self.ip_access_lists + body["{ip_access_lists}"] = self.ip_access_lists return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetIpAccessListsResponse: """Deserializes the GetIpAccessListsResponse from a dictionary.""" - return cls(ip_access_lists=_repeated_dict(d, "ip_access_lists", IpAccessListInfo)) + return cls(ip_access_lists=_repeated_dict(d, "{ip_access_lists}", IpAccessListInfo)) @dataclass @@ -2147,20 +2149,20 @@ def as_dict(self) -> dict: """Serializes the GetTokenPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetTokenPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetTokenPermissionLevelsResponse: """Deserializes the GetTokenPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", TokenPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", TokenPermissionsDescription)) @dataclass @@ -2173,20 +2175,20 @@ def as_dict(self) -> dict: """Serializes the GetTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_info: - body["token_info"] = self.token_info.as_dict() + body["{token_info}"] = self.token_info.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_info: - body["token_info"] = self.token_info + body["{token_info}"] = self.token_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetTokenResponse: """Deserializes the GetTokenResponse from a dictionary.""" - return cls(token_info=_from_dict(d, "token_info", TokenInfo)) + return cls(token_info=_from_dict(d, "{token_info}", TokenInfo)) @dataclass @@ -2229,66 +2231,66 @@ def as_dict(self) -> dict: """Serializes the IpAccessListInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.address_count is not None: - body["address_count"] = self.address_count + body["{address_count}"] = self.address_count if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.ip_addresses: - body["ip_addresses"] = [v for v in self.ip_addresses] + body["{ip_addresses}"] = [v for v in self.ip_addresses] if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_id is not None: - body["list_id"] = self.list_id + body["{list_id}"] = self.list_id if self.list_type is not None: - body["list_type"] = self.list_type.value + body["{list_type}"] = self.list_type.value if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the IpAccessListInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.address_count is not None: - body["address_count"] = self.address_count + body["{address_count}"] = self.address_count if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.ip_addresses: - body["ip_addresses"] = self.ip_addresses + body["{ip_addresses}"] = self.ip_addresses if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_id is not None: - body["list_id"] = self.list_id + body["{list_id}"] = self.list_id if self.list_type is not None: - body["list_type"] = self.list_type + body["{list_type}"] = self.list_type if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IpAccessListInfo: """Deserializes the IpAccessListInfo from a dictionary.""" return cls( - address_count=d.get("address_count", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - enabled=d.get("enabled", None), - ip_addresses=d.get("ip_addresses", None), - label=d.get("label", None), - list_id=d.get("list_id", None), - list_type=_enum(d, "list_type", ListType), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + address_count=d.get("{address_count}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + enabled=d.get("{enabled}", None), + ip_addresses=d.get("{ip_addresses}", None), + label=d.get("{label}", None), + list_id=d.get("{list_id}", None), + list_type=_enum(d, "{list_type}", ListType), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -2302,20 +2304,20 @@ def as_dict(self) -> dict: """Serializes the ListIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_lists: - body["ip_access_lists"] = [v.as_dict() for v in self.ip_access_lists] + body["{ip_access_lists}"] = [v.as_dict() for v in self.ip_access_lists] return body def as_shallow_dict(self) -> dict: """Serializes the ListIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_lists: - body["ip_access_lists"] = self.ip_access_lists + body["{ip_access_lists}"] = self.ip_access_lists return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListIpAccessListResponse: """Deserializes the ListIpAccessListResponse from a dictionary.""" - return cls(ip_access_lists=_repeated_dict(d, "ip_access_lists", IpAccessListInfo)) + return cls(ip_access_lists=_repeated_dict(d, "{ip_access_lists}", IpAccessListInfo)) @dataclass @@ -2330,26 +2332,26 @@ def as_dict(self) -> dict: """Serializes the ListNccAzurePrivateEndpointRulesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items: - body["items"] = [v.as_dict() for v in self.items] + body["{items}"] = [v.as_dict() for v in self.items] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListNccAzurePrivateEndpointRulesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items: - body["items"] = self.items + body["{items}"] = self.items if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNccAzurePrivateEndpointRulesResponse: """Deserializes the ListNccAzurePrivateEndpointRulesResponse from a dictionary.""" return cls( - items=_repeated_dict(d, "items", NccAzurePrivateEndpointRule), - next_page_token=d.get("next_page_token", None), + items=_repeated_dict(d, "{items}", NccAzurePrivateEndpointRule), + next_page_token=d.get("{next_page_token}", None), ) @@ -2365,26 +2367,26 @@ def as_dict(self) -> dict: """Serializes the ListNetworkConnectivityConfigurationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items: - body["items"] = [v.as_dict() for v in self.items] + body["{items}"] = [v.as_dict() for v in self.items] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListNetworkConnectivityConfigurationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items: - body["items"] = self.items + body["{items}"] = self.items if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNetworkConnectivityConfigurationsResponse: """Deserializes the ListNetworkConnectivityConfigurationsResponse from a dictionary.""" return cls( - items=_repeated_dict(d, "items", NetworkConnectivityConfiguration), - next_page_token=d.get("next_page_token", None), + items=_repeated_dict(d, "{items}", NetworkConnectivityConfiguration), + next_page_token=d.get("{next_page_token}", None), ) @@ -2399,26 +2401,26 @@ def as_dict(self) -> dict: """Serializes the ListNotificationDestinationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the ListNotificationDestinationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNotificationDestinationsResponse: """Deserializes the ListNotificationDestinationsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - results=_repeated_dict(d, "results", ListNotificationDestinationsResult), + next_page_token=d.get("{next_page_token}", None), + results=_repeated_dict(d, "{results}", ListNotificationDestinationsResult), ) @@ -2437,31 +2439,31 @@ def as_dict(self) -> dict: """Serializes the ListNotificationDestinationsResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_type is not None: - body["destination_type"] = self.destination_type.value + body["{destination_type}"] = self.destination_type.value if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the ListNotificationDestinationsResult into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_type is not None: - body["destination_type"] = self.destination_type + body["{destination_type}"] = self.destination_type if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNotificationDestinationsResult: """Deserializes the ListNotificationDestinationsResult from a dictionary.""" return cls( - destination_type=_enum(d, "destination_type", DestinationType), - display_name=d.get("display_name", None), - id=d.get("id", None), + destination_type=_enum(d, "{destination_type}", DestinationType), + display_name=d.get("{display_name}", None), + id=d.get("{id}", None), ) @@ -2474,20 +2476,20 @@ def as_dict(self) -> dict: """Serializes the ListPublicTokensResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_infos: - body["token_infos"] = [v.as_dict() for v in self.token_infos] + body["{token_infos}"] = [v.as_dict() for v in self.token_infos] return body def as_shallow_dict(self) -> dict: """Serializes the ListPublicTokensResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_infos: - body["token_infos"] = self.token_infos + body["{token_infos}"] = self.token_infos return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPublicTokensResponse: """Deserializes the ListPublicTokensResponse from a dictionary.""" - return cls(token_infos=_repeated_dict(d, "token_infos", PublicTokenInfo)) + return cls(token_infos=_repeated_dict(d, "{token_infos}", PublicTokenInfo)) @dataclass @@ -2501,20 +2503,20 @@ def as_dict(self) -> dict: """Serializes the ListTokensResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_infos: - body["token_infos"] = [v.as_dict() for v in self.token_infos] + body["{token_infos}"] = [v.as_dict() for v in self.token_infos] return body def as_shallow_dict(self) -> dict: """Serializes the ListTokensResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_infos: - body["token_infos"] = self.token_infos + body["{token_infos}"] = self.token_infos return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTokensResponse: """Deserializes the ListTokensResponse from a dictionary.""" - return cls(token_infos=_repeated_dict(d, "token_infos", TokenInfo)) + return cls(token_infos=_repeated_dict(d, "{token_infos}", TokenInfo)) class ListType(Enum): @@ -2539,24 +2541,24 @@ def as_dict(self) -> dict: """Serializes the MicrosoftTeamsConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.url_set is not None: - body["url_set"] = self.url_set + body["{url_set}"] = self.url_set return body def as_shallow_dict(self) -> dict: """Serializes the MicrosoftTeamsConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.url_set is not None: - body["url_set"] = self.url_set + body["{url_set}"] = self.url_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MicrosoftTeamsConfig: """Deserializes the MicrosoftTeamsConfig from a dictionary.""" - return cls(url=d.get("url", None), url_set=d.get("url_set", None)) + return cls(url=d.get("{url}", None), url_set=d.get("{url_set}", None)) @dataclass @@ -2572,20 +2574,20 @@ def as_dict(self) -> dict: """Serializes the NccAwsStableIpRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.cidr_blocks: - body["cidr_blocks"] = [v for v in self.cidr_blocks] + body["{cidr_blocks}"] = [v for v in self.cidr_blocks] return body def as_shallow_dict(self) -> dict: """Serializes the NccAwsStableIpRule into a shallow dictionary of its immediate attributes.""" body = {} if self.cidr_blocks: - body["cidr_blocks"] = self.cidr_blocks + body["{cidr_blocks}"] = self.cidr_blocks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccAwsStableIpRule: """Deserializes the NccAwsStableIpRule from a dictionary.""" - return cls(cidr_blocks=d.get("cidr_blocks", None)) + return cls(cidr_blocks=d.get("{cidr_blocks}", None)) @dataclass @@ -2635,66 +2637,66 @@ def as_dict(self) -> dict: """Serializes the NccAzurePrivateEndpointRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_state is not None: - body["connection_state"] = self.connection_state.value + body["{connection_state}"] = self.connection_state.value if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.deactivated is not None: - body["deactivated"] = self.deactivated + body["{deactivated}"] = self.deactivated if self.deactivated_at is not None: - body["deactivated_at"] = self.deactivated_at + body["{deactivated_at}"] = self.deactivated_at if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.group_id is not None: - body["group_id"] = self.group_id.value + body["{group_id}"] = self.group_id.value if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id if self.rule_id is not None: - body["rule_id"] = self.rule_id + body["{rule_id}"] = self.rule_id if self.updated_time is not None: - body["updated_time"] = self.updated_time + body["{updated_time}"] = self.updated_time return body def as_shallow_dict(self) -> dict: """Serializes the NccAzurePrivateEndpointRule into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_state is not None: - body["connection_state"] = self.connection_state + body["{connection_state}"] = self.connection_state if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.deactivated is not None: - body["deactivated"] = self.deactivated + body["{deactivated}"] = self.deactivated if self.deactivated_at is not None: - body["deactivated_at"] = self.deactivated_at + body["{deactivated_at}"] = self.deactivated_at if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.group_id is not None: - body["group_id"] = self.group_id + body["{group_id}"] = self.group_id if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id if self.rule_id is not None: - body["rule_id"] = self.rule_id + body["{rule_id}"] = self.rule_id if self.updated_time is not None: - body["updated_time"] = self.updated_time + body["{updated_time}"] = self.updated_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccAzurePrivateEndpointRule: """Deserializes the NccAzurePrivateEndpointRule from a dictionary.""" return cls( - connection_state=_enum(d, "connection_state", NccAzurePrivateEndpointRuleConnectionState), - creation_time=d.get("creation_time", None), - deactivated=d.get("deactivated", None), - deactivated_at=d.get("deactivated_at", None), - endpoint_name=d.get("endpoint_name", None), - group_id=_enum(d, "group_id", NccAzurePrivateEndpointRuleGroupId), - network_connectivity_config_id=d.get("network_connectivity_config_id", None), - resource_id=d.get("resource_id", None), - rule_id=d.get("rule_id", None), - updated_time=d.get("updated_time", None), + connection_state=_enum(d, "{connection_state}", NccAzurePrivateEndpointRuleConnectionState), + creation_time=d.get("{creation_time}", None), + deactivated=d.get("{deactivated}", None), + deactivated_at=d.get("{deactivated_at}", None), + endpoint_name=d.get("{endpoint_name}", None), + group_id=_enum(d, "{group_id}", NccAzurePrivateEndpointRuleGroupId), + network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), + resource_id=d.get("{resource_id}", None), + rule_id=d.get("{rule_id}", None), + updated_time=d.get("{updated_time}", None), ) @@ -2746,31 +2748,31 @@ def as_dict(self) -> dict: """Serializes the NccAzureServiceEndpointRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.subnets: - body["subnets"] = [v for v in self.subnets] + body["{subnets}"] = [v for v in self.subnets] if self.target_region is not None: - body["target_region"] = self.target_region + body["{target_region}"] = self.target_region if self.target_services: - body["target_services"] = [v for v in self.target_services] + body["{target_services}"] = [v for v in self.target_services] return body def as_shallow_dict(self) -> dict: """Serializes the NccAzureServiceEndpointRule into a shallow dictionary of its immediate attributes.""" body = {} if self.subnets: - body["subnets"] = self.subnets + body["{subnets}"] = self.subnets if self.target_region is not None: - body["target_region"] = self.target_region + body["{target_region}"] = self.target_region if self.target_services: - body["target_services"] = self.target_services + body["{target_services}"] = self.target_services return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccAzureServiceEndpointRule: """Deserializes the NccAzureServiceEndpointRule from a dictionary.""" return cls( - subnets=d.get("subnets", None), - target_region=d.get("target_region", None), - target_services=d.get("target_services", None), + subnets=d.get("{subnets}", None), + target_region=d.get("{target_region}", None), + target_services=d.get("{target_services}", None), ) @@ -2792,26 +2794,26 @@ def as_dict(self) -> dict: """Serializes the NccEgressConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_rules: - body["default_rules"] = self.default_rules.as_dict() + body["{default_rules}"] = self.default_rules.as_dict() if self.target_rules: - body["target_rules"] = self.target_rules.as_dict() + body["{target_rules}"] = self.target_rules.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the NccEgressConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.default_rules: - body["default_rules"] = self.default_rules + body["{default_rules}"] = self.default_rules if self.target_rules: - body["target_rules"] = self.target_rules + body["{target_rules}"] = self.target_rules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccEgressConfig: """Deserializes the NccEgressConfig from a dictionary.""" return cls( - default_rules=_from_dict(d, "default_rules", NccEgressDefaultRules), - target_rules=_from_dict(d, "target_rules", NccEgressTargetRules), + default_rules=_from_dict(d, "{default_rules}", NccEgressDefaultRules), + target_rules=_from_dict(d, "{target_rules}", NccEgressTargetRules), ) @@ -2833,26 +2835,26 @@ def as_dict(self) -> dict: """Serializes the NccEgressDefaultRules into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_stable_ip_rule: - body["aws_stable_ip_rule"] = self.aws_stable_ip_rule.as_dict() + body["{aws_stable_ip_rule}"] = self.aws_stable_ip_rule.as_dict() if self.azure_service_endpoint_rule: - body["azure_service_endpoint_rule"] = self.azure_service_endpoint_rule.as_dict() + body["{azure_service_endpoint_rule}"] = self.azure_service_endpoint_rule.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the NccEgressDefaultRules into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_stable_ip_rule: - body["aws_stable_ip_rule"] = self.aws_stable_ip_rule + body["{aws_stable_ip_rule}"] = self.aws_stable_ip_rule if self.azure_service_endpoint_rule: - body["azure_service_endpoint_rule"] = self.azure_service_endpoint_rule + body["{azure_service_endpoint_rule}"] = self.azure_service_endpoint_rule return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccEgressDefaultRules: """Deserializes the NccEgressDefaultRules from a dictionary.""" return cls( - aws_stable_ip_rule=_from_dict(d, "aws_stable_ip_rule", NccAwsStableIpRule), - azure_service_endpoint_rule=_from_dict(d, "azure_service_endpoint_rule", NccAzureServiceEndpointRule), + aws_stable_ip_rule=_from_dict(d, "{aws_stable_ip_rule}", NccAwsStableIpRule), + azure_service_endpoint_rule=_from_dict(d, "{azure_service_endpoint_rule}", NccAzureServiceEndpointRule), ) @@ -2867,21 +2869,23 @@ def as_dict(self) -> dict: """Serializes the NccEgressTargetRules into a dictionary suitable for use as a JSON request body.""" body = {} if self.azure_private_endpoint_rules: - body["azure_private_endpoint_rules"] = [v.as_dict() for v in self.azure_private_endpoint_rules] + body["{azure_private_endpoint_rules}"] = [v.as_dict() for v in self.azure_private_endpoint_rules] return body def as_shallow_dict(self) -> dict: """Serializes the NccEgressTargetRules into a shallow dictionary of its immediate attributes.""" body = {} if self.azure_private_endpoint_rules: - body["azure_private_endpoint_rules"] = self.azure_private_endpoint_rules + body["{azure_private_endpoint_rules}"] = self.azure_private_endpoint_rules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccEgressTargetRules: """Deserializes the NccEgressTargetRules from a dictionary.""" return cls( - azure_private_endpoint_rules=_repeated_dict(d, "azure_private_endpoint_rules", NccAzurePrivateEndpointRule) + azure_private_endpoint_rules=_repeated_dict( + d, "{azure_private_endpoint_rules}", NccAzurePrivateEndpointRule + ) ) @@ -2916,51 +2920,51 @@ def as_dict(self) -> dict: """Serializes the NetworkConnectivityConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.egress_config: - body["egress_config"] = self.egress_config.as_dict() + body["{egress_config}"] = self.egress_config.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.updated_time is not None: - body["updated_time"] = self.updated_time + body["{updated_time}"] = self.updated_time return body def as_shallow_dict(self) -> dict: """Serializes the NetworkConnectivityConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["account_id"] = self.account_id + body["{account_id}"] = self.account_id if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.egress_config: - body["egress_config"] = self.egress_config + body["{egress_config}"] = self.egress_config if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.network_connectivity_config_id is not None: - body["network_connectivity_config_id"] = self.network_connectivity_config_id + body["{network_connectivity_config_id}"] = self.network_connectivity_config_id if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.updated_time is not None: - body["updated_time"] = self.updated_time + body["{updated_time}"] = self.updated_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkConnectivityConfiguration: """Deserializes the NetworkConnectivityConfiguration from a dictionary.""" return cls( - account_id=d.get("account_id", None), - creation_time=d.get("creation_time", None), - egress_config=_from_dict(d, "egress_config", NccEgressConfig), - name=d.get("name", None), - network_connectivity_config_id=d.get("network_connectivity_config_id", None), - region=d.get("region", None), - updated_time=d.get("updated_time", None), + account_id=d.get("{account_id}", None), + creation_time=d.get("{creation_time}", None), + egress_config=_from_dict(d, "{egress_config}", NccEgressConfig), + name=d.get("{name}", None), + network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), + region=d.get("{region}", None), + updated_time=d.get("{updated_time}", None), ) @@ -2983,36 +2987,36 @@ def as_dict(self) -> dict: """Serializes the NotificationDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.config: - body["config"] = self.config.as_dict() + body["{config}"] = self.config.as_dict() if self.destination_type is not None: - body["destination_type"] = self.destination_type.value + body["{destination_type}"] = self.destination_type.value if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the NotificationDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.config: - body["config"] = self.config + body["{config}"] = self.config if self.destination_type is not None: - body["destination_type"] = self.destination_type + body["{destination_type}"] = self.destination_type if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotificationDestination: """Deserializes the NotificationDestination from a dictionary.""" return cls( - config=_from_dict(d, "config", Config), - destination_type=_enum(d, "destination_type", DestinationType), - display_name=d.get("display_name", None), - id=d.get("id", None), + config=_from_dict(d, "{config}", Config), + destination_type=_enum(d, "{destination_type}", DestinationType), + display_name=d.get("{display_name}", None), + id=d.get("{id}", None), ) @@ -3028,25 +3032,25 @@ def as_dict(self) -> dict: """Serializes the PagerdutyConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_key is not None: - body["integration_key"] = self.integration_key + body["{integration_key}"] = self.integration_key if self.integration_key_set is not None: - body["integration_key_set"] = self.integration_key_set + body["{integration_key_set}"] = self.integration_key_set return body def as_shallow_dict(self) -> dict: """Serializes the PagerdutyConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_key is not None: - body["integration_key"] = self.integration_key + body["{integration_key}"] = self.integration_key if self.integration_key_set is not None: - body["integration_key_set"] = self.integration_key_set + body["{integration_key_set}"] = self.integration_key_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PagerdutyConfig: """Deserializes the PagerdutyConfig from a dictionary.""" return cls( - integration_key=d.get("integration_key", None), integration_key_set=d.get("integration_key_set", None) + integration_key=d.get("{integration_key}", None), integration_key_set=d.get("{integration_key_set}", None) ) @@ -3061,20 +3065,20 @@ def as_dict(self) -> dict: """Serializes the PartitionId into a dictionary suitable for use as a JSON request body.""" body = {} if self.workspace_id is not None: - body["workspaceId"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the PartitionId into a shallow dictionary of its immediate attributes.""" body = {} if self.workspace_id is not None: - body["workspaceId"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartitionId: """Deserializes the PartitionId from a dictionary.""" - return cls(workspace_id=d.get("workspaceId", None)) + return cls(workspace_id=d.get("{workspace_id}", None)) @dataclass @@ -3090,20 +3094,20 @@ def as_dict(self) -> dict: """Serializes the PersonalComputeMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["value"] = self.value.value + body["{value}"] = self.value.value return body def as_shallow_dict(self) -> dict: """Serializes the PersonalComputeMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PersonalComputeMessage: """Deserializes the PersonalComputeMessage from a dictionary.""" - return cls(value=_enum(d, "value", PersonalComputeMessageEnum)) + return cls(value=_enum(d, "{value}", PersonalComputeMessageEnum)) class PersonalComputeMessageEnum(Enum): @@ -3139,31 +3143,31 @@ def as_dict(self) -> dict: """Serializes the PersonalComputeSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.personal_compute: - body["personal_compute"] = self.personal_compute.as_dict() + body["{personal_compute}"] = self.personal_compute.as_dict() if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the PersonalComputeSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.personal_compute: - body["personal_compute"] = self.personal_compute + body["{personal_compute}"] = self.personal_compute if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PersonalComputeSetting: """Deserializes the PersonalComputeSetting from a dictionary.""" return cls( - etag=d.get("etag", None), - personal_compute=_from_dict(d, "personal_compute", PersonalComputeMessage), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + personal_compute=_from_dict(d, "{personal_compute}", PersonalComputeMessage), + setting_name=d.get("{setting_name}", None), ) @@ -3185,36 +3189,36 @@ def as_dict(self) -> dict: """Serializes the PublicTokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.expiry_time is not None: - body["expiry_time"] = self.expiry_time + body["{expiry_time}"] = self.expiry_time if self.token_id is not None: - body["token_id"] = self.token_id + body["{token_id}"] = self.token_id return body def as_shallow_dict(self) -> dict: """Serializes the PublicTokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.expiry_time is not None: - body["expiry_time"] = self.expiry_time + body["{expiry_time}"] = self.expiry_time if self.token_id is not None: - body["token_id"] = self.token_id + body["{token_id}"] = self.token_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublicTokenInfo: """Deserializes the PublicTokenInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - creation_time=d.get("creation_time", None), - expiry_time=d.get("expiry_time", None), - token_id=d.get("token_id", None), + comment=d.get("{comment}", None), + creation_time=d.get("{creation_time}", None), + expiry_time=d.get("{expiry_time}", None), + token_id=d.get("{token_id}", None), ) @@ -3243,41 +3247,41 @@ def as_dict(self) -> dict: """Serializes the ReplaceIpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.ip_access_list_id is not None: - body["ip_access_list_id"] = self.ip_access_list_id + body["{ip_access_list_id}"] = self.ip_access_list_id if self.ip_addresses: - body["ip_addresses"] = [v for v in self.ip_addresses] + body["{ip_addresses}"] = [v for v in self.ip_addresses] if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_type is not None: - body["list_type"] = self.list_type.value + body["{list_type}"] = self.list_type.value return body def as_shallow_dict(self) -> dict: """Serializes the ReplaceIpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.ip_access_list_id is not None: - body["ip_access_list_id"] = self.ip_access_list_id + body["{ip_access_list_id}"] = self.ip_access_list_id if self.ip_addresses: - body["ip_addresses"] = self.ip_addresses + body["{ip_addresses}"] = self.ip_addresses if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_type is not None: - body["list_type"] = self.list_type + body["{list_type}"] = self.list_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ReplaceIpAccessList: """Deserializes the ReplaceIpAccessList from a dictionary.""" return cls( - enabled=d.get("enabled", None), - ip_access_list_id=d.get("ip_access_list_id", None), - ip_addresses=d.get("ip_addresses", None), - label=d.get("label", None), - list_type=_enum(d, "list_type", ListType), + enabled=d.get("{enabled}", None), + ip_access_list_id=d.get("{ip_access_list_id}", None), + ip_addresses=d.get("{ip_addresses}", None), + label=d.get("{label}", None), + list_type=_enum(d, "{list_type}", ListType), ) @@ -3307,20 +3311,20 @@ def as_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestrictWorkspaceAdminsMessage: """Deserializes the RestrictWorkspaceAdminsMessage from a dictionary.""" - return cls(status=_enum(d, "status", RestrictWorkspaceAdminsMessageStatus)) + return cls(status=_enum(d, "{status}", RestrictWorkspaceAdminsMessageStatus)) class RestrictWorkspaceAdminsMessageStatus(Enum): @@ -3351,31 +3355,31 @@ def as_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.restrict_workspace_admins: - body["restrict_workspace_admins"] = self.restrict_workspace_admins.as_dict() + body["{restrict_workspace_admins}"] = self.restrict_workspace_admins.as_dict() if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body def as_shallow_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["etag"] = self.etag + body["{etag}"] = self.etag if self.restrict_workspace_admins: - body["restrict_workspace_admins"] = self.restrict_workspace_admins + body["{restrict_workspace_admins}"] = self.restrict_workspace_admins if self.setting_name is not None: - body["setting_name"] = self.setting_name + body["{setting_name}"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestrictWorkspaceAdminsSetting: """Deserializes the RestrictWorkspaceAdminsSetting from a dictionary.""" return cls( - etag=d.get("etag", None), - restrict_workspace_admins=_from_dict(d, "restrict_workspace_admins", RestrictWorkspaceAdminsMessage), - setting_name=d.get("setting_name", None), + etag=d.get("{etag}", None), + restrict_workspace_admins=_from_dict(d, "{restrict_workspace_admins}", RestrictWorkspaceAdminsMessage), + setting_name=d.get("{setting_name}", None), ) @@ -3388,20 +3392,20 @@ def as_dict(self) -> dict: """Serializes the RevokeTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_id is not None: - body["token_id"] = self.token_id + body["{token_id}"] = self.token_id return body def as_shallow_dict(self) -> dict: """Serializes the RevokeTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.token_id is not None: - body["token_id"] = self.token_id + body["{token_id}"] = self.token_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RevokeTokenRequest: """Deserializes the RevokeTokenRequest from a dictionary.""" - return cls(token_id=d.get("token_id", None)) + return cls(token_id=d.get("{token_id}", None)) @dataclass @@ -3452,24 +3456,24 @@ def as_dict(self) -> dict: """Serializes the SlackConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.url_set is not None: - body["url_set"] = self.url_set + body["{url_set}"] = self.url_set return body def as_shallow_dict(self) -> dict: """Serializes the SlackConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url if self.url_set is not None: - body["url_set"] = self.url_set + body["{url_set}"] = self.url_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SlackConfig: """Deserializes the SlackConfig from a dictionary.""" - return cls(url=d.get("url", None), url_set=d.get("url_set", None)) + return cls(url=d.get("{url}", None), url_set=d.get("{url_set}", None)) @dataclass @@ -3481,20 +3485,20 @@ def as_dict(self) -> dict: """Serializes the StringMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the StringMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StringMessage: """Deserializes the StringMessage from a dictionary.""" - return cls(value=d.get("value", None)) + return cls(value=d.get("{value}", None)) @dataclass @@ -3515,36 +3519,36 @@ def as_dict(self) -> dict: """Serializes the TokenAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the TokenAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenAccessControlRequest: """Deserializes the TokenAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", TokenPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", TokenPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3569,41 +3573,41 @@ def as_dict(self) -> dict: """Serializes the TokenAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the TokenAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenAccessControlResponse: """Deserializes the TokenAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", TokenPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", TokenPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -3640,61 +3644,61 @@ def as_dict(self) -> dict: """Serializes the TokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_by_id is not None: - body["created_by_id"] = self.created_by_id + body["{created_by_id}"] = self.created_by_id if self.created_by_username is not None: - body["created_by_username"] = self.created_by_username + body["{created_by_username}"] = self.created_by_username if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.expiry_time is not None: - body["expiry_time"] = self.expiry_time + body["{expiry_time}"] = self.expiry_time if self.last_used_day is not None: - body["last_used_day"] = self.last_used_day + body["{last_used_day}"] = self.last_used_day if self.owner_id is not None: - body["owner_id"] = self.owner_id + body["{owner_id}"] = self.owner_id if self.token_id is not None: - body["token_id"] = self.token_id + body["{token_id}"] = self.token_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body def as_shallow_dict(self) -> dict: """Serializes the TokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_by_id is not None: - body["created_by_id"] = self.created_by_id + body["{created_by_id}"] = self.created_by_id if self.created_by_username is not None: - body["created_by_username"] = self.created_by_username + body["{created_by_username}"] = self.created_by_username if self.creation_time is not None: - body["creation_time"] = self.creation_time + body["{creation_time}"] = self.creation_time if self.expiry_time is not None: - body["expiry_time"] = self.expiry_time + body["{expiry_time}"] = self.expiry_time if self.last_used_day is not None: - body["last_used_day"] = self.last_used_day + body["{last_used_day}"] = self.last_used_day if self.owner_id is not None: - body["owner_id"] = self.owner_id + body["{owner_id}"] = self.owner_id if self.token_id is not None: - body["token_id"] = self.token_id + body["{token_id}"] = self.token_id if self.workspace_id is not None: - body["workspace_id"] = self.workspace_id + body["{workspace_id}"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenInfo: """Deserializes the TokenInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - created_by_id=d.get("created_by_id", None), - created_by_username=d.get("created_by_username", None), - creation_time=d.get("creation_time", None), - expiry_time=d.get("expiry_time", None), - last_used_day=d.get("last_used_day", None), - owner_id=d.get("owner_id", None), - token_id=d.get("token_id", None), - workspace_id=d.get("workspace_id", None), + comment=d.get("{comment}", None), + created_by_id=d.get("{created_by_id}", None), + created_by_username=d.get("{created_by_username}", None), + creation_time=d.get("{creation_time}", None), + expiry_time=d.get("{expiry_time}", None), + last_used_day=d.get("{last_used_day}", None), + owner_id=d.get("{owner_id}", None), + token_id=d.get("{token_id}", None), + workspace_id=d.get("{workspace_id}", None), ) @@ -3711,31 +3715,31 @@ def as_dict(self) -> dict: """Serializes the TokenPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the TokenPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermission: """Deserializes the TokenPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", TokenPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", TokenPermissionLevel), ) @@ -3757,31 +3761,31 @@ def as_dict(self) -> dict: """Serializes the TokenPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the TokenPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermissions: """Deserializes the TokenPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", TokenAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", TokenAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -3796,25 +3800,26 @@ def as_dict(self) -> dict: """Serializes the TokenPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the TokenPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermissionsDescription: """Deserializes the TokenPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", TokenPermissionLevel) + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", TokenPermissionLevel), ) @@ -3826,20 +3831,20 @@ def as_dict(self) -> dict: """Serializes the TokenPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] return body def as_shallow_dict(self) -> dict: """Serializes the TokenPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermissionsRequest: """Deserializes the TokenPermissionsRequest from a dictionary.""" - return cls(access_control_list=_repeated_dict(d, "access_control_list", TokenAccessControlRequest)) + return cls(access_control_list=_repeated_dict(d, "{access_control_list}", TokenAccessControlRequest)) class TokenType(Enum): @@ -3878,31 +3883,31 @@ def as_dict(self) -> dict: """Serializes the UpdateAccountIpAccessEnableRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateAccountIpAccessEnableRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAccountIpAccessEnableRequest: """Deserializes the UpdateAccountIpAccessEnableRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", AccountIpAccessEnable), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", AccountIpAccessEnable), ) @@ -3930,31 +3935,31 @@ def as_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAibiDashboardEmbeddingAccessPolicySettingRequest: """Deserializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", AibiDashboardEmbeddingAccessPolicySetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", AibiDashboardEmbeddingAccessPolicySetting), ) @@ -3982,31 +3987,31 @@ def as_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest: """Deserializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", AibiDashboardEmbeddingApprovedDomainsSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", AibiDashboardEmbeddingApprovedDomainsSetting), ) @@ -4034,31 +4039,31 @@ def as_dict(self) -> dict: """Serializes the UpdateAutomaticClusterUpdateSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateAutomaticClusterUpdateSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAutomaticClusterUpdateSettingRequest: """Deserializes the UpdateAutomaticClusterUpdateSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", AutomaticClusterUpdateSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", AutomaticClusterUpdateSetting), ) @@ -4086,31 +4091,31 @@ def as_dict(self) -> dict: """Serializes the UpdateComplianceSecurityProfileSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateComplianceSecurityProfileSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateComplianceSecurityProfileSettingRequest: """Deserializes the UpdateComplianceSecurityProfileSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", ComplianceSecurityProfileSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", ComplianceSecurityProfileSetting), ) @@ -4138,31 +4143,31 @@ def as_dict(self) -> dict: """Serializes the UpdateCspEnablementAccountSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCspEnablementAccountSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCspEnablementAccountSettingRequest: """Deserializes the UpdateCspEnablementAccountSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", CspEnablementAccountSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", CspEnablementAccountSetting), ) @@ -4197,31 +4202,31 @@ def as_dict(self) -> dict: """Serializes the UpdateDefaultNamespaceSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateDefaultNamespaceSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDefaultNamespaceSettingRequest: """Deserializes the UpdateDefaultNamespaceSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", DefaultNamespaceSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", DefaultNamespaceSetting), ) @@ -4249,31 +4254,31 @@ def as_dict(self) -> dict: """Serializes the UpdateDisableLegacyAccessRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateDisableLegacyAccessRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDisableLegacyAccessRequest: """Deserializes the UpdateDisableLegacyAccessRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", DisableLegacyAccess), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", DisableLegacyAccess), ) @@ -4301,31 +4306,31 @@ def as_dict(self) -> dict: """Serializes the UpdateDisableLegacyDbfsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateDisableLegacyDbfsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDisableLegacyDbfsRequest: """Deserializes the UpdateDisableLegacyDbfsRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", DisableLegacyDbfs), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", DisableLegacyDbfs), ) @@ -4353,31 +4358,31 @@ def as_dict(self) -> dict: """Serializes the UpdateDisableLegacyFeaturesRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateDisableLegacyFeaturesRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDisableLegacyFeaturesRequest: """Deserializes the UpdateDisableLegacyFeaturesRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", DisableLegacyFeatures), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", DisableLegacyFeatures), ) @@ -4405,31 +4410,31 @@ def as_dict(self) -> dict: """Serializes the UpdateEnhancedSecurityMonitoringSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateEnhancedSecurityMonitoringSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateEnhancedSecurityMonitoringSettingRequest: """Deserializes the UpdateEnhancedSecurityMonitoringSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", EnhancedSecurityMonitoringSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", EnhancedSecurityMonitoringSetting), ) @@ -4457,31 +4462,31 @@ def as_dict(self) -> dict: """Serializes the UpdateEsmEnablementAccountSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateEsmEnablementAccountSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateEsmEnablementAccountSettingRequest: """Deserializes the UpdateEsmEnablementAccountSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", EsmEnablementAccountSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", EsmEnablementAccountSetting), ) @@ -4510,41 +4515,41 @@ def as_dict(self) -> dict: """Serializes the UpdateIpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.ip_access_list_id is not None: - body["ip_access_list_id"] = self.ip_access_list_id + body["{ip_access_list_id}"] = self.ip_access_list_id if self.ip_addresses: - body["ip_addresses"] = [v for v in self.ip_addresses] + body["{ip_addresses}"] = [v for v in self.ip_addresses] if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_type is not None: - body["list_type"] = self.list_type.value + body["{list_type}"] = self.list_type.value return body def as_shallow_dict(self) -> dict: """Serializes the UpdateIpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.ip_access_list_id is not None: - body["ip_access_list_id"] = self.ip_access_list_id + body["{ip_access_list_id}"] = self.ip_access_list_id if self.ip_addresses: - body["ip_addresses"] = self.ip_addresses + body["{ip_addresses}"] = self.ip_addresses if self.label is not None: - body["label"] = self.label + body["{label}"] = self.label if self.list_type is not None: - body["list_type"] = self.list_type + body["{list_type}"] = self.list_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateIpAccessList: """Deserializes the UpdateIpAccessList from a dictionary.""" return cls( - enabled=d.get("enabled", None), - ip_access_list_id=d.get("ip_access_list_id", None), - ip_addresses=d.get("ip_addresses", None), - label=d.get("label", None), - list_type=_enum(d, "list_type", ListType), + enabled=d.get("{enabled}", None), + ip_access_list_id=d.get("{ip_access_list_id}", None), + ip_addresses=d.get("{ip_addresses}", None), + label=d.get("{label}", None), + list_type=_enum(d, "{list_type}", ListType), ) @@ -4563,29 +4568,29 @@ def as_dict(self) -> dict: """Serializes the UpdateNotificationDestinationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.config: - body["config"] = self.config.as_dict() + body["{config}"] = self.config.as_dict() if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateNotificationDestinationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.config: - body["config"] = self.config + body["{config}"] = self.config if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateNotificationDestinationRequest: """Deserializes the UpdateNotificationDestinationRequest from a dictionary.""" return cls( - config=_from_dict(d, "config", Config), display_name=d.get("display_name", None), id=d.get("id", None) + config=_from_dict(d, "{config}", Config), display_name=d.get("{display_name}", None), id=d.get("{id}", None) ) @@ -4613,31 +4618,31 @@ def as_dict(self) -> dict: """Serializes the UpdatePersonalComputeSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdatePersonalComputeSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePersonalComputeSettingRequest: """Deserializes the UpdatePersonalComputeSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", PersonalComputeSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", PersonalComputeSetting), ) @@ -4683,31 +4688,31 @@ def as_dict(self) -> dict: """Serializes the UpdateRestrictWorkspaceAdminsSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting.as_dict() + body["{setting}"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRestrictWorkspaceAdminsSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["allow_missing"] = self.allow_missing + body["{allow_missing}"] = self.allow_missing if self.field_mask is not None: - body["field_mask"] = self.field_mask + body["{field_mask}"] = self.field_mask if self.setting: - body["setting"] = self.setting + body["{setting}"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRestrictWorkspaceAdminsSettingRequest: """Deserializes the UpdateRestrictWorkspaceAdminsSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("allow_missing", None), - field_mask=d.get("field_mask", None), - setting=_from_dict(d, "setting", RestrictWorkspaceAdminsSetting), + allow_missing=d.get("{allow_missing}", None), + field_mask=d.get("{field_mask}", None), + setting=_from_dict(d, "{setting}", RestrictWorkspaceAdminsSetting), ) @@ -4769,14 +4774,14 @@ def create( """ body = {} if ip_addresses is not None: - body["ip_addresses"] = [v for v in ip_addresses] + body["{ip_addresses}"] = [v for v in ip_addresses] if label is not None: - body["label"] = label + body["{label}"] = label if list_type is not None: - body["list_type"] = list_type.value + body["{list_type}"] = list_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -4813,7 +4818,7 @@ def get(self, ip_access_list_id: str) -> GetIpAccessListResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -4830,7 +4835,7 @@ def list(self) -> Iterator[IpAccessListInfo]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/ip-access-lists", headers=headers) @@ -4875,15 +4880,15 @@ def replace( """ body = {} if enabled is not None: - body["enabled"] = enabled + body["{enabled}"] = enabled if ip_addresses is not None: - body["ip_addresses"] = [v for v in ip_addresses] + body["{ip_addresses}"] = [v for v in ip_addresses] if label is not None: - body["label"] = label + body["{label}"] = label if list_type is not None: - body["list_type"] = list_type.value + body["{list_type}"] = list_type.value headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do( @@ -4935,15 +4940,15 @@ def update( """ body = {} if enabled is not None: - body["enabled"] = enabled + body["{enabled}"] = enabled if ip_addresses is not None: - body["ip_addresses"] = [v for v in ip_addresses] + body["{ip_addresses}"] = [v for v in ip_addresses] if label is not None: - body["label"] = label + body["{label}"] = label if list_type is not None: - body["list_type"] = list_type.value + body["{list_type}"] = list_type.value headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do( @@ -4960,37 +4965,6 @@ class AccountSettingsAPI: def __init__(self, api_client): self._api = api_client - self._csp_enablement_account = CspEnablementAccountAPI(self._api) - self._disable_legacy_features = DisableLegacyFeaturesAPI(self._api) - self._enable_ip_access_lists = EnableIpAccessListsAPI(self._api) - self._esm_enablement_account = EsmEnablementAccountAPI(self._api) - self._personal_compute = PersonalComputeAPI(self._api) - - @property - def csp_enablement_account(self) -> CspEnablementAccountAPI: - """The compliance security profile settings at the account level control whether to enable it for new workspaces.""" - return self._csp_enablement_account - - @property - def disable_legacy_features(self) -> DisableLegacyFeaturesAPI: - """Disable legacy features for new Databricks workspaces.""" - return self._disable_legacy_features - - @property - def enable_ip_access_lists(self) -> EnableIpAccessListsAPI: - """Controls the enforcement of IP access lists for accessing the account console.""" - return self._enable_ip_access_lists - - @property - def esm_enablement_account(self) -> EsmEnablementAccountAPI: - """The enhanced security monitoring setting at the account level controls whether to enable the feature on new workspaces.""" - return self._esm_enablement_account - - @property - def personal_compute(self) -> PersonalComputeAPI: - """The Personal Compute enablement setting lets you control which users can use the Personal Compute default policy to create compute resources.""" - return self._personal_compute - class AibiDashboardEmbeddingAccessPolicyAPI: """Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the @@ -5016,9 +4990,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5047,9 +5021,9 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingAccessPoli query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5082,14 +5056,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5123,9 +5097,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5153,9 +5127,9 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingApprovedDo query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5192,14 +5166,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5235,9 +5209,9 @@ def get(self, *, etag: Optional[str] = None) -> AutomaticClusterUpdateSetting: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5273,14 +5247,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5315,9 +5289,9 @@ def get(self, *, etag: Optional[str] = None) -> ComplianceSecurityProfileSetting query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5353,14 +5327,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5395,14 +5369,14 @@ def exchange_token( """ body = {} if partition_id is not None: - body["partitionId"] = partition_id.as_dict() + body["{partition_id}"] = partition_id.as_dict() if scopes is not None: - body["scopes"] = [v for v in scopes] + body["{scopes}"] = [v for v in scopes] if token_type is not None: - body["tokenType"] = [v.value for v in token_type] + body["{token_type}"] = [v.value for v in token_type] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/credentials-manager/exchange-tokens/token", body=body, headers=headers) @@ -5437,9 +5411,9 @@ def get(self, *, etag: Optional[str] = None) -> CspEnablementAccountSetting: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5475,14 +5449,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5529,9 +5503,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultNamespaceSetting query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5556,9 +5530,9 @@ def get(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5601,14 +5575,14 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5645,9 +5619,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyAccessResp query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5672,9 +5646,9 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyAccess: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5705,14 +5679,14 @@ def update(self, allow_missing: bool, setting: DisableLegacyAccess, field_mask: """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5745,9 +5719,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyDbfsRespon query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5772,9 +5746,9 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyDbfs: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5805,14 +5779,14 @@ def update(self, allow_missing: bool, setting: DisableLegacyDbfs, field_mask: st """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5848,9 +5822,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyFeaturesRe query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5878,9 +5852,9 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyFeatures: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5914,14 +5888,14 @@ def update(self, allow_missing: bool, setting: DisableLegacyFeatures, field_mask """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -5957,9 +5931,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAccountIpAccessEnableRe query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -5987,9 +5961,9 @@ def get(self, *, etag: Optional[str] = None) -> AccountIpAccessEnable: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6023,14 +5997,14 @@ def update(self, allow_missing: bool, setting: AccountIpAccessEnable, field_mask """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -6070,9 +6044,9 @@ def get(self, *, etag: Optional[str] = None) -> EnhancedSecurityMonitoringSettin query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6108,14 +6082,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -6149,9 +6123,9 @@ def get(self, *, etag: Optional[str] = None) -> EsmEnablementAccountSetting: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6187,14 +6161,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -6261,14 +6235,14 @@ def create( """ body = {} if ip_addresses is not None: - body["ip_addresses"] = [v for v in ip_addresses] + body["{ip_addresses}"] = [v for v in ip_addresses] if label is not None: - body["label"] = label + body["{label}"] = label if list_type is not None: - body["list_type"] = list_type.value + body["{list_type}"] = list_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/ip-access-lists", body=body, headers=headers) @@ -6301,7 +6275,7 @@ def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/ip-access-lists/{ip_access_list_id}", headers=headers) @@ -6316,7 +6290,7 @@ def list(self) -> Iterator[IpAccessListInfo]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/ip-access-lists", headers=headers) @@ -6362,15 +6336,15 @@ def replace( """ body = {} if enabled is not None: - body["enabled"] = enabled + body["{enabled}"] = enabled if ip_addresses is not None: - body["ip_addresses"] = [v for v in ip_addresses] + body["{ip_addresses}"] = [v for v in ip_addresses] if label is not None: - body["label"] = label + body["{label}"] = label if list_type is not None: - body["list_type"] = list_type.value + body["{list_type}"] = list_type.value headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/ip-access-lists/{ip_access_list_id}", body=body, headers=headers) @@ -6418,15 +6392,15 @@ def update( """ body = {} if enabled is not None: - body["enabled"] = enabled + body["{enabled}"] = enabled if ip_addresses is not None: - body["ip_addresses"] = [v for v in ip_addresses] + body["{ip_addresses}"] = [v for v in ip_addresses] if label is not None: - body["label"] = label + body["{label}"] = label if list_type is not None: - body["list_type"] = list_type.value + body["{list_type}"] = list_type.value headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.0/ip-access-lists/{ip_access_list_id}", body=body, headers=headers) @@ -6454,12 +6428,12 @@ def create_network_connectivity_configuration(self, name: str, region: str) -> N """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if region is not None: - body["region"] = region + body["{region}"] = region headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -6494,12 +6468,12 @@ def create_private_endpoint_rule( """ body = {} if group_id is not None: - body["group_id"] = group_id.value + body["{group_id}"] = group_id.value if resource_id is not None: - body["resource_id"] = resource_id + body["{resource_id}"] = resource_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -6522,7 +6496,7 @@ def delete_network_connectivity_configuration(self, network_connectivity_config_ """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -6550,7 +6524,7 @@ def delete_private_endpoint_rule( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6574,7 +6548,7 @@ def get_network_connectivity_configuration( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6600,7 +6574,7 @@ def get_private_endpoint_rule( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6625,9 +6599,9 @@ def list_network_connectivity_configurations( query = {} if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -6637,12 +6611,12 @@ def list_network_connectivity_configurations( query=query, headers=headers, ) - if "items" in json: - for v in json["items"]: + if "{items}" in json: + for v in json["{items}"]: yield NetworkConnectivityConfiguration.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_private_endpoint_rules( self, network_connectivity_config_id: str, *, page_token: Optional[str] = None @@ -6661,9 +6635,9 @@ def list_private_endpoint_rules( query = {} if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: @@ -6673,12 +6647,12 @@ def list_private_endpoint_rules( query=query, headers=headers, ) - if "items" in json: - for v in json["items"]: + if "{items}" in json: + for v in json["{items}"]: yield NccAzurePrivateEndpointRule.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class NotificationDestinationsAPI: @@ -6704,12 +6678,12 @@ def create(self, *, config: Optional[Config] = None, display_name: Optional[str] """ body = {} if config is not None: - body["config"] = config.as_dict() + body["{config}"] = config.as_dict() if display_name is not None: - body["display_name"] = display_name + body["{display_name}"] = display_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/notification-destinations", body=body, headers=headers) @@ -6726,7 +6700,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/notification-destinations/{id}", headers=headers) @@ -6742,7 +6716,7 @@ def get(self, id: str) -> NotificationDestination: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/notification-destinations/{id}", headers=headers) @@ -6763,21 +6737,21 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/notification-destinations", query=query, headers=headers) - if "results" in json: - for v in json["results"]: + if "{results}" in json: + for v in json["{results}"]: yield ListNotificationDestinationsResult.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, id: str, *, config: Optional[Config] = None, display_name: Optional[str] = None @@ -6798,12 +6772,12 @@ def update( """ body = {} if config is not None: - body["config"] = config.as_dict() + body["{config}"] = config.as_dict() if display_name is not None: - body["display_name"] = display_name + body["{display_name}"] = display_name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/notification-destinations/{id}", body=body, headers=headers) @@ -6839,9 +6813,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeletePersonalComputeSettingR query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6869,9 +6843,9 @@ def get(self, *, etag: Optional[str] = None) -> PersonalComputeSetting: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6905,14 +6879,14 @@ def update(self, allow_missing: bool, setting: PersonalComputeSetting, field_mas """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -6958,9 +6932,9 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteRestrictWorkspaceAdmins query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -6985,9 +6959,9 @@ def get(self, *, etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting: query = {} if etag is not None: - query["etag"] = etag + query["{etag}"] = etag headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -7023,14 +6997,14 @@ def update( """ body = {} if allow_missing is not None: - body["allow_missing"] = allow_missing + body["{allow_missing}"] = allow_missing if field_mask is not None: - body["field_mask"] = field_mask + body["{field_mask}"] = field_mask if setting is not None: - body["setting"] = setting.as_dict() + body["{setting}"] = setting.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -7045,61 +7019,6 @@ class SettingsAPI: def __init__(self, api_client): self._api = api_client - self._aibi_dashboard_embedding_access_policy = AibiDashboardEmbeddingAccessPolicyAPI(self._api) - self._aibi_dashboard_embedding_approved_domains = AibiDashboardEmbeddingApprovedDomainsAPI(self._api) - self._automatic_cluster_update = AutomaticClusterUpdateAPI(self._api) - self._compliance_security_profile = ComplianceSecurityProfileAPI(self._api) - self._default_namespace = DefaultNamespaceAPI(self._api) - self._disable_legacy_access = DisableLegacyAccessAPI(self._api) - self._disable_legacy_dbfs = DisableLegacyDbfsAPI(self._api) - self._enhanced_security_monitoring = EnhancedSecurityMonitoringAPI(self._api) - self._restrict_workspace_admins = RestrictWorkspaceAdminsAPI(self._api) - - @property - def aibi_dashboard_embedding_access_policy(self) -> AibiDashboardEmbeddingAccessPolicyAPI: - """Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the workspace level.""" - return self._aibi_dashboard_embedding_access_policy - - @property - def aibi_dashboard_embedding_approved_domains(self) -> AibiDashboardEmbeddingApprovedDomainsAPI: - """Controls the list of domains approved to host the embedded AI/BI dashboards.""" - return self._aibi_dashboard_embedding_approved_domains - - @property - def automatic_cluster_update(self) -> AutomaticClusterUpdateAPI: - """Controls whether automatic cluster update is enabled for the current workspace.""" - return self._automatic_cluster_update - - @property - def compliance_security_profile(self) -> ComplianceSecurityProfileAPI: - """Controls whether to enable the compliance security profile for the current workspace.""" - return self._compliance_security_profile - - @property - def default_namespace(self) -> DefaultNamespaceAPI: - """The default namespace setting API allows users to configure the default namespace for a Databricks workspace.""" - return self._default_namespace - - @property - def disable_legacy_access(self) -> DisableLegacyAccessAPI: - """'Disabling legacy access' has the following impacts: 1.""" - return self._disable_legacy_access - - @property - def disable_legacy_dbfs(self) -> DisableLegacyDbfsAPI: - """When this setting is on, access to DBFS root and DBFS mounts is disallowed (as well as creation of new mounts).""" - return self._disable_legacy_dbfs - - @property - def enhanced_security_monitoring(self) -> EnhancedSecurityMonitoringAPI: - """Controls whether enhanced security monitoring is enabled for the current workspace.""" - return self._enhanced_security_monitoring - - @property - def restrict_workspace_admins(self) -> RestrictWorkspaceAdminsAPI: - """The Restrict Workspace Admins setting lets you control the capabilities of workspace admins.""" - return self._restrict_workspace_admins - class TokenManagementAPI: """Enables administrators to get all tokens and delete tokens for other users. Admins can either get every @@ -7126,14 +7045,14 @@ def create_obo_token( """ body = {} if application_id is not None: - body["application_id"] = application_id + body["{application_id}"] = application_id if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if lifetime_seconds is not None: - body["lifetime_seconds"] = lifetime_seconds + body["{lifetime_seconds}"] = lifetime_seconds headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/token-management/on-behalf-of/tokens", body=body, headers=headers) @@ -7166,7 +7085,7 @@ def get(self, token_id: str) -> GetTokenResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/token-management/tokens/{token_id}", headers=headers) @@ -7181,7 +7100,7 @@ def get_permission_levels(self) -> GetTokenPermissionLevelsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/permissions/authorization/tokens/permissionLevels", headers=headers) @@ -7196,7 +7115,7 @@ def get_permissions(self) -> TokenPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/permissions/authorization/tokens", headers=headers) @@ -7219,11 +7138,11 @@ def list( query = {} if created_by_id is not None: - query["created_by_id"] = created_by_id + query["{created_by_id}"] = created_by_id if created_by_username is not None: - query["created_by_username"] = created_by_username + query["{created_by_username}"] = created_by_username headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/token-management/tokens", query=query, headers=headers) @@ -7244,10 +7163,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) @@ -7266,10 +7185,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) @@ -7301,12 +7220,12 @@ def create(self, *, comment: Optional[str] = None, lifetime_seconds: Optional[in """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if lifetime_seconds is not None: - body["lifetime_seconds"] = lifetime_seconds + body["{lifetime_seconds}"] = lifetime_seconds headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/token/create", body=body, headers=headers) @@ -7326,10 +7245,10 @@ def delete(self, token_id: str): """ body = {} if token_id is not None: - body["token_id"] = token_id + body["{token_id}"] = token_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/token/delete", body=body, headers=headers) @@ -7343,7 +7262,7 @@ def list(self) -> Iterator[PublicTokenInfo]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/token/list", headers=headers) @@ -7369,9 +7288,9 @@ def get_status(self, keys: str) -> WorkspaceConf: query = {} if keys is not None: - query["keys"] = keys + query["{keys}"] = keys headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/workspace-conf", query=query, headers=headers) @@ -7387,7 +7306,7 @@ def set_status(self, contents: Dict[str, str]): """ headers = { - "Content-Type": "application/json", + "0": "{Content-Type application/json}", } self._api.do("PATCH", "/api/2.0/workspace-conf", body=contents, headers=headers) diff --git a/databricks/sdk/service/sharing.py b/databricks/sdk/sharing/v2/impl.py similarity index 72% rename from databricks/sdk/service/sharing.py rename to databricks/sdk/sharing/v2/impl.py index b8e93d5c0..62692e283 100755 --- a/databricks/sdk/service/sharing.py +++ b/databricks/sdk/sharing/v2/impl.py @@ -7,11 +7,11 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (_enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -71,36 +71,36 @@ def as_dict(self) -> dict: """Serializes the CreateProvider into a dictionary suitable for use as a JSON request body.""" body = {} if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type.value + body["{authentication_type}"] = self.authentication_type.value if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.recipient_profile_str is not None: - body["recipient_profile_str"] = self.recipient_profile_str + body["{recipient_profile_str}"] = self.recipient_profile_str return body def as_shallow_dict(self) -> dict: """Serializes the CreateProvider into a shallow dictionary of its immediate attributes.""" body = {} if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type + body["{authentication_type}"] = self.authentication_type if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.recipient_profile_str is not None: - body["recipient_profile_str"] = self.recipient_profile_str + body["{recipient_profile_str}"] = self.recipient_profile_str return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateProvider: """Deserializes the CreateProvider from a dictionary.""" return cls( - authentication_type=_enum(d, "authentication_type", AuthenticationType), - comment=d.get("comment", None), - name=d.get("name", None), - recipient_profile_str=d.get("recipient_profile_str", None), + authentication_type=_enum(d, "{authentication_type}", AuthenticationType), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + recipient_profile_str=d.get("{recipient_profile_str}", None), ) @@ -142,61 +142,61 @@ def as_dict(self) -> dict: """Serializes the CreateRecipient into a dictionary suitable for use as a JSON request body.""" body = {} if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type.value + body["{authentication_type}"] = self.authentication_type.value if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.data_recipient_global_metastore_id is not None: - body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id + body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list.as_dict() + body["{ip_access_list}"] = self.ip_access_list.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties_kvpairs: - body["properties_kvpairs"] = self.properties_kvpairs.as_dict() + body["{properties_kvpairs}"] = self.properties_kvpairs.as_dict() if self.sharing_code is not None: - body["sharing_code"] = self.sharing_code + body["{sharing_code}"] = self.sharing_code return body def as_shallow_dict(self) -> dict: """Serializes the CreateRecipient into a shallow dictionary of its immediate attributes.""" body = {} if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type + body["{authentication_type}"] = self.authentication_type if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.data_recipient_global_metastore_id is not None: - body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id + body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list + body["{ip_access_list}"] = self.ip_access_list if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties_kvpairs: - body["properties_kvpairs"] = self.properties_kvpairs + body["{properties_kvpairs}"] = self.properties_kvpairs if self.sharing_code is not None: - body["sharing_code"] = self.sharing_code + body["{sharing_code}"] = self.sharing_code return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRecipient: """Deserializes the CreateRecipient from a dictionary.""" return cls( - authentication_type=_enum(d, "authentication_type", AuthenticationType), - comment=d.get("comment", None), - data_recipient_global_metastore_id=d.get("data_recipient_global_metastore_id", None), - expiration_time=d.get("expiration_time", None), - ip_access_list=_from_dict(d, "ip_access_list", IpAccessList), - name=d.get("name", None), - owner=d.get("owner", None), - properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs), - sharing_code=d.get("sharing_code", None), + authentication_type=_enum(d, "{authentication_type}", AuthenticationType), + comment=d.get("{comment}", None), + data_recipient_global_metastore_id=d.get("{data_recipient_global_metastore_id}", None), + expiration_time=d.get("{expiration_time}", None), + ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessList), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + properties_kvpairs=_from_dict(d, "{properties_kvpairs}", SecurablePropertiesKvPairs), + sharing_code=d.get("{sharing_code}", None), ) @@ -215,28 +215,30 @@ def as_dict(self) -> dict: """Serializes the CreateShare into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body def as_shallow_dict(self) -> dict: """Serializes the CreateShare into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateShare: """Deserializes the CreateShare from a dictionary.""" - return cls(comment=d.get("comment", None), name=d.get("name", None), storage_root=d.get("storage_root", None)) + return cls( + comment=d.get("{comment}", None), name=d.get("{name}", None), storage_root=d.get("{storage_root}", None) + ) @dataclass @@ -271,26 +273,26 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function: - body["function"] = self.function.as_dict() + body["{function}"] = self.function.as_dict() if self.table: - body["table"] = self.table.as_dict() + body["{table}"] = self.table.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function: - body["function"] = self.function + body["{function}"] = self.function if self.table: - body["table"] = self.table + body["{table}"] = self.table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingDependency: """Deserializes the DeltaSharingDependency from a dictionary.""" return cls( - function=_from_dict(d, "function", DeltaSharingFunctionDependency), - table=_from_dict(d, "table", DeltaSharingTableDependency), + function=_from_dict(d, "{function}", DeltaSharingFunctionDependency), + table=_from_dict(d, "{table}", DeltaSharingTableDependency), ) @@ -305,20 +307,20 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingDependencyList into a dictionary suitable for use as a JSON request body.""" body = {} if self.dependencies: - body["dependencies"] = [v.as_dict() for v in self.dependencies] + body["{dependencies}"] = [v.as_dict() for v in self.dependencies] return body def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingDependencyList into a shallow dictionary of its immediate attributes.""" body = {} if self.dependencies: - body["dependencies"] = self.dependencies + body["{dependencies}"] = self.dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingDependencyList: """Deserializes the DeltaSharingDependencyList from a dictionary.""" - return cls(dependencies=_repeated_dict(d, "dependencies", DeltaSharingDependency)) + return cls(dependencies=_repeated_dict(d, "{dependencies}", DeltaSharingDependency)) @dataclass @@ -375,96 +377,96 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingFunction into a dictionary suitable for use as a JSON request body.""" body = {} if self.aliases: - body["aliases"] = [v.as_dict() for v in self.aliases] + body["{aliases}"] = [v.as_dict() for v in self.aliases] if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.data_type is not None: - body["data_type"] = self.data_type.value + body["{data_type}"] = self.data_type.value if self.dependency_list: - body["dependency_list"] = self.dependency_list.as_dict() + body["{dependency_list}"] = self.dependency_list.as_dict() if self.full_data_type is not None: - body["full_data_type"] = self.full_data_type + body["{full_data_type}"] = self.full_data_type if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.input_params: - body["input_params"] = self.input_params.as_dict() + body["{input_params}"] = self.input_params.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.properties is not None: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.routine_definition is not None: - body["routine_definition"] = self.routine_definition + body["{routine_definition}"] = self.routine_definition if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.securable_kind is not None: - body["securable_kind"] = self.securable_kind.value + body["{securable_kind}"] = self.securable_kind.value if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingFunction into a shallow dictionary of its immediate attributes.""" body = {} if self.aliases: - body["aliases"] = self.aliases + body["{aliases}"] = self.aliases if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.data_type is not None: - body["data_type"] = self.data_type + body["{data_type}"] = self.data_type if self.dependency_list: - body["dependency_list"] = self.dependency_list + body["{dependency_list}"] = self.dependency_list if self.full_data_type is not None: - body["full_data_type"] = self.full_data_type + body["{full_data_type}"] = self.full_data_type if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.input_params: - body["input_params"] = self.input_params + body["{input_params}"] = self.input_params if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.properties is not None: - body["properties"] = self.properties + body["{properties}"] = self.properties if self.routine_definition is not None: - body["routine_definition"] = self.routine_definition + body["{routine_definition}"] = self.routine_definition if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.securable_kind is not None: - body["securable_kind"] = self.securable_kind + body["{securable_kind}"] = self.securable_kind if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingFunction: """Deserializes the DeltaSharingFunction from a dictionary.""" return cls( - aliases=_repeated_dict(d, "aliases", RegisteredModelAlias), - comment=d.get("comment", None), - data_type=_enum(d, "data_type", ColumnTypeName), - dependency_list=_from_dict(d, "dependency_list", DeltaSharingDependencyList), - full_data_type=d.get("full_data_type", None), - id=d.get("id", None), - input_params=_from_dict(d, "input_params", FunctionParameterInfos), - name=d.get("name", None), - properties=d.get("properties", None), - routine_definition=d.get("routine_definition", None), - schema=d.get("schema", None), - securable_kind=_enum(d, "securable_kind", SharedSecurableKind), - share=d.get("share", None), - share_id=d.get("share_id", None), - storage_location=d.get("storage_location", None), - tags=_repeated_dict(d, "tags", TagKeyValue), + aliases=_repeated_dict(d, "{aliases}", RegisteredModelAlias), + comment=d.get("{comment}", None), + data_type=_enum(d, "{data_type}", ColumnTypeName), + dependency_list=_from_dict(d, "{dependency_list}", DeltaSharingDependencyList), + full_data_type=d.get("{full_data_type}", None), + id=d.get("{id}", None), + input_params=_from_dict(d, "{input_params}", FunctionParameterInfos), + name=d.get("{name}", None), + properties=d.get("{properties}", None), + routine_definition=d.get("{routine_definition}", None), + schema=d.get("{schema}", None), + securable_kind=_enum(d, "{securable_kind}", SharedSecurableKind), + share=d.get("{share}", None), + share_id=d.get("{share_id}", None), + storage_location=d.get("{storage_location}", None), + tags=_repeated_dict(d, "{tags}", TagKeyValue), ) @@ -480,24 +482,24 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingFunctionDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name return body def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingFunctionDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["function_name"] = self.function_name + body["{function_name}"] = self.function_name if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingFunctionDependency: """Deserializes the DeltaSharingFunctionDependency from a dictionary.""" - return cls(function_name=d.get("function_name", None), schema_name=d.get("schema_name", None)) + return cls(function_name=d.get("{function_name}", None), schema_name=d.get("{schema_name}", None)) @dataclass @@ -512,24 +514,24 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingTableDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name return body def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingTableDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.schema_name is not None: - body["schema_name"] = self.schema_name + body["{schema_name}"] = self.schema_name if self.table_name is not None: - body["table_name"] = self.table_name + body["{table_name}"] = self.table_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingTableDependency: """Deserializes the DeltaSharingTableDependency from a dictionary.""" - return cls(schema_name=d.get("schema_name", None), table_name=d.get("table_name", None)) + return cls(schema_name=d.get("{schema_name}", None), table_name=d.get("{table_name}", None)) @dataclass @@ -577,76 +579,76 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parameter_default is not None: - body["parameter_default"] = self.parameter_default + body["{parameter_default}"] = self.parameter_default if self.parameter_mode is not None: - body["parameter_mode"] = self.parameter_mode.value + body["{parameter_mode}"] = self.parameter_mode.value if self.parameter_type is not None: - body["parameter_type"] = self.parameter_type.value + body["{parameter_type}"] = self.parameter_type.value if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name.value + body["{type_name}"] = self.type_name.value if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parameter_default is not None: - body["parameter_default"] = self.parameter_default + body["{parameter_default}"] = self.parameter_default if self.parameter_mode is not None: - body["parameter_mode"] = self.parameter_mode + body["{parameter_mode}"] = self.parameter_mode if self.parameter_type is not None: - body["parameter_type"] = self.parameter_type + body["{parameter_type}"] = self.parameter_type if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_json is not None: - body["type_json"] = self.type_json + body["{type_json}"] = self.type_json if self.type_name is not None: - body["type_name"] = self.type_name + body["{type_name}"] = self.type_name if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfo: """Deserializes the FunctionParameterInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - name=d.get("name", None), - parameter_default=d.get("parameter_default", None), - parameter_mode=_enum(d, "parameter_mode", FunctionParameterMode), - parameter_type=_enum(d, "parameter_type", FunctionParameterType), - position=d.get("position", None), - type_interval_type=d.get("type_interval_type", None), - type_json=d.get("type_json", None), - type_name=_enum(d, "type_name", ColumnTypeName), - type_precision=d.get("type_precision", None), - type_scale=d.get("type_scale", None), - type_text=d.get("type_text", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + parameter_default=d.get("{parameter_default}", None), + parameter_mode=_enum(d, "{parameter_mode}", FunctionParameterMode), + parameter_type=_enum(d, "{parameter_type}", FunctionParameterType), + position=d.get("{position}", None), + type_interval_type=d.get("{type_interval_type}", None), + type_json=d.get("{type_json}", None), + type_name=_enum(d, "{type_name}", ColumnTypeName), + type_precision=d.get("{type_precision}", None), + type_scale=d.get("{type_scale}", None), + type_text=d.get("{type_text}", None), ) @@ -659,20 +661,20 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfos into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] return body def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfos into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfos: """Deserializes the FunctionParameterInfos from a dictionary.""" - return cls(parameters=_repeated_dict(d, "parameters", FunctionParameterInfo)) + return cls(parameters=_repeated_dict(d, "{parameters}", FunctionParameterInfo)) class FunctionParameterMode(Enum): @@ -719,26 +721,26 @@ def as_dict(self) -> dict: """Serializes the GetRecipientSharePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.permissions_out: - body["permissions_out"] = [v.as_dict() for v in self.permissions_out] + body["{permissions_out}"] = [v.as_dict() for v in self.permissions_out] return body def as_shallow_dict(self) -> dict: """Serializes the GetRecipientSharePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.permissions_out: - body["permissions_out"] = self.permissions_out + body["{permissions_out}"] = self.permissions_out return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRecipientSharePermissionsResponse: """Deserializes the GetRecipientSharePermissionsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - permissions_out=_repeated_dict(d, "permissions_out", ShareToPrivilegeAssignment), + next_page_token=d.get("{next_page_token}", None), + permissions_out=_repeated_dict(d, "{permissions_out}", ShareToPrivilegeAssignment), ) @@ -755,26 +757,26 @@ def as_dict(self) -> dict: """Serializes the GetSharePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.privilege_assignments: - body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] + body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: """Serializes the GetSharePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.privilege_assignments: - body["privilege_assignments"] = self.privilege_assignments + body["{privilege_assignments}"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetSharePermissionsResponse: """Deserializes the GetSharePermissionsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment), + next_page_token=d.get("{next_page_token}", None), + privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment), ) @@ -787,20 +789,20 @@ def as_dict(self) -> dict: """Serializes the IpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_ip_addresses: - body["allowed_ip_addresses"] = [v for v in self.allowed_ip_addresses] + body["{allowed_ip_addresses}"] = [v for v in self.allowed_ip_addresses] return body def as_shallow_dict(self) -> dict: """Serializes the IpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_ip_addresses: - body["allowed_ip_addresses"] = self.allowed_ip_addresses + body["{allowed_ip_addresses}"] = self.allowed_ip_addresses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IpAccessList: """Deserializes the IpAccessList from a dictionary.""" - return cls(allowed_ip_addresses=d.get("allowed_ip_addresses", None)) + return cls(allowed_ip_addresses=d.get("{allowed_ip_addresses}", None)) @dataclass @@ -823,36 +825,36 @@ def as_dict(self) -> dict: """Serializes the ListProviderShareAssetsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.functions: - body["functions"] = [v.as_dict() for v in self.functions] + body["{functions}"] = [v.as_dict() for v in self.functions] if self.notebooks: - body["notebooks"] = [v.as_dict() for v in self.notebooks] + body["{notebooks}"] = [v.as_dict() for v in self.notebooks] if self.tables: - body["tables"] = [v.as_dict() for v in self.tables] + body["{tables}"] = [v.as_dict() for v in self.tables] if self.volumes: - body["volumes"] = [v.as_dict() for v in self.volumes] + body["{volumes}"] = [v.as_dict() for v in self.volumes] return body def as_shallow_dict(self) -> dict: """Serializes the ListProviderShareAssetsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.functions: - body["functions"] = self.functions + body["{functions}"] = self.functions if self.notebooks: - body["notebooks"] = self.notebooks + body["{notebooks}"] = self.notebooks if self.tables: - body["tables"] = self.tables + body["{tables}"] = self.tables if self.volumes: - body["volumes"] = self.volumes + body["{volumes}"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProviderShareAssetsResponse: """Deserializes the ListProviderShareAssetsResponse from a dictionary.""" return cls( - functions=_repeated_dict(d, "functions", DeltaSharingFunction), - notebooks=_repeated_dict(d, "notebooks", NotebookFile), - tables=_repeated_dict(d, "tables", Table), - volumes=_repeated_dict(d, "volumes", Volume), + functions=_repeated_dict(d, "{functions}", DeltaSharingFunction), + notebooks=_repeated_dict(d, "{notebooks}", NotebookFile), + tables=_repeated_dict(d, "{tables}", Table), + volumes=_repeated_dict(d, "{volumes}", Volume), ) @@ -869,24 +871,26 @@ def as_dict(self) -> dict: """Serializes the ListProviderSharesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.shares: - body["shares"] = [v.as_dict() for v in self.shares] + body["{shares}"] = [v.as_dict() for v in self.shares] return body def as_shallow_dict(self) -> dict: """Serializes the ListProviderSharesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.shares: - body["shares"] = self.shares + body["{shares}"] = self.shares return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProviderSharesResponse: """Deserializes the ListProviderSharesResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), shares=_repeated_dict(d, "shares", ProviderShare)) + return cls( + next_page_token=d.get("{next_page_token}", None), shares=_repeated_dict(d, "{shares}", ProviderShare) + ) @dataclass @@ -902,25 +906,25 @@ def as_dict(self) -> dict: """Serializes the ListProvidersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.providers: - body["providers"] = [v.as_dict() for v in self.providers] + body["{providers}"] = [v.as_dict() for v in self.providers] return body def as_shallow_dict(self) -> dict: """Serializes the ListProvidersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.providers: - body["providers"] = self.providers + body["{providers}"] = self.providers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProvidersResponse: """Deserializes the ListProvidersResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), providers=_repeated_dict(d, "providers", ProviderInfo) + next_page_token=d.get("{next_page_token}", None), providers=_repeated_dict(d, "{providers}", ProviderInfo) ) @@ -937,25 +941,26 @@ def as_dict(self) -> dict: """Serializes the ListRecipientsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.recipients: - body["recipients"] = [v.as_dict() for v in self.recipients] + body["{recipients}"] = [v.as_dict() for v in self.recipients] return body def as_shallow_dict(self) -> dict: """Serializes the ListRecipientsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.recipients: - body["recipients"] = self.recipients + body["{recipients}"] = self.recipients return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListRecipientsResponse: """Deserializes the ListRecipientsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), recipients=_repeated_dict(d, "recipients", RecipientInfo) + next_page_token=d.get("{next_page_token}", None), + recipients=_repeated_dict(d, "{recipients}", RecipientInfo), ) @@ -972,24 +977,24 @@ def as_dict(self) -> dict: """Serializes the ListSharesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.shares: - body["shares"] = [v.as_dict() for v in self.shares] + body["{shares}"] = [v.as_dict() for v in self.shares] return body def as_shallow_dict(self) -> dict: """Serializes the ListSharesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.shares: - body["shares"] = self.shares + body["{shares}"] = self.shares return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSharesResponse: """Deserializes the ListSharesResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), shares=_repeated_dict(d, "shares", ShareInfo)) + return cls(next_page_token=d.get("{next_page_token}", None), shares=_repeated_dict(d, "{shares}", ShareInfo)) @dataclass @@ -1016,46 +1021,46 @@ def as_dict(self) -> dict: """Serializes the NotebookFile into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the NotebookFile into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookFile: """Deserializes the NotebookFile from a dictionary.""" return cls( - comment=d.get("comment", None), - id=d.get("id", None), - name=d.get("name", None), - share=d.get("share", None), - share_id=d.get("share_id", None), - tags=_repeated_dict(d, "tags", TagKeyValue), + comment=d.get("{comment}", None), + id=d.get("{id}", None), + name=d.get("{name}", None), + share=d.get("{share}", None), + share_id=d.get("{share_id}", None), + tags=_repeated_dict(d, "{tags}", TagKeyValue), ) @@ -1068,20 +1073,20 @@ def as_dict(self) -> dict: """Serializes the Partition into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["values"] = [v.as_dict() for v in self.values] + body["{values}"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the Partition into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Partition: """Deserializes the Partition from a dictionary.""" - return cls(values=_repeated_dict(d, "values", PartitionValue)) + return cls(values=_repeated_dict(d, "{values}", PartitionValue)) @dataclass @@ -1104,36 +1109,36 @@ def as_dict(self) -> dict: """Serializes the PartitionValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.op is not None: - body["op"] = self.op.value + body["{op}"] = self.op.value if self.recipient_property_key is not None: - body["recipient_property_key"] = self.recipient_property_key + body["{recipient_property_key}"] = self.recipient_property_key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the PartitionValue into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.recipient_property_key is not None: - body["recipient_property_key"] = self.recipient_property_key + body["{recipient_property_key}"] = self.recipient_property_key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartitionValue: """Deserializes the PartitionValue from a dictionary.""" return cls( - name=d.get("name", None), - op=_enum(d, "op", PartitionValueOp), - recipient_property_key=d.get("recipient_property_key", None), - value=d.get("value", None), + name=d.get("{name}", None), + op=_enum(d, "{op}", PartitionValueOp), + recipient_property_key=d.get("{recipient_property_key}", None), + value=d.get("{value}", None), ) @@ -1158,28 +1163,28 @@ def as_dict(self) -> dict: """Serializes the PermissionsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.add: - body["add"] = [v for v in self.add] + body["{add}"] = [v for v in self.add] if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.remove: - body["remove"] = [v for v in self.remove] + body["{remove}"] = [v for v in self.remove] return body def as_shallow_dict(self) -> dict: """Serializes the PermissionsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.add: - body["add"] = self.add + body["{add}"] = self.add if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.remove: - body["remove"] = self.remove + body["{remove}"] = self.remove return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsChange: """Deserializes the PermissionsChange from a dictionary.""" - return cls(add=d.get("add", None), principal=d.get("principal", None), remove=d.get("remove", None)) + return cls(add=d.get("{add}", None), principal=d.get("{principal}", None), remove=d.get("{remove}", None)) class Privilege(Enum): @@ -1243,24 +1248,24 @@ def as_dict(self) -> dict: """Serializes the PrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.privileges: - body["privileges"] = [v.value for v in self.privileges] + body["{privileges}"] = [v.value for v in self.privileges] return body def as_shallow_dict(self) -> dict: """Serializes the PrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.privileges: - body["privileges"] = self.privileges + body["{privileges}"] = self.privileges return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrivilegeAssignment: """Deserializes the PrivilegeAssignment from a dictionary.""" - return cls(principal=d.get("principal", None), privileges=_repeated_enum(d, "privileges", Privilege)) + return cls(principal=d.get("{principal}", None), privileges=_repeated_enum(d, "{privileges}", Privilege)) @dataclass @@ -1318,86 +1323,86 @@ def as_dict(self) -> dict: """Serializes the ProviderInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type.value + body["{authentication_type}"] = self.authentication_type.value if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_provider_global_metastore_id is not None: - body["data_provider_global_metastore_id"] = self.data_provider_global_metastore_id + body["{data_provider_global_metastore_id}"] = self.data_provider_global_metastore_id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.recipient_profile: - body["recipient_profile"] = self.recipient_profile.as_dict() + body["{recipient_profile}"] = self.recipient_profile.as_dict() if self.recipient_profile_str is not None: - body["recipient_profile_str"] = self.recipient_profile_str + body["{recipient_profile_str}"] = self.recipient_profile_str if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the ProviderInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type + body["{authentication_type}"] = self.authentication_type if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_provider_global_metastore_id is not None: - body["data_provider_global_metastore_id"] = self.data_provider_global_metastore_id + body["{data_provider_global_metastore_id}"] = self.data_provider_global_metastore_id if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.recipient_profile: - body["recipient_profile"] = self.recipient_profile + body["{recipient_profile}"] = self.recipient_profile if self.recipient_profile_str is not None: - body["recipient_profile_str"] = self.recipient_profile_str + body["{recipient_profile_str}"] = self.recipient_profile_str if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderInfo: """Deserializes the ProviderInfo from a dictionary.""" return cls( - authentication_type=_enum(d, "authentication_type", AuthenticationType), - cloud=d.get("cloud", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - data_provider_global_metastore_id=d.get("data_provider_global_metastore_id", None), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - recipient_profile=_from_dict(d, "recipient_profile", RecipientProfile), - recipient_profile_str=d.get("recipient_profile_str", None), - region=d.get("region", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + authentication_type=_enum(d, "{authentication_type}", AuthenticationType), + cloud=d.get("{cloud}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + data_provider_global_metastore_id=d.get("{data_provider_global_metastore_id}", None), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + recipient_profile=_from_dict(d, "{recipient_profile}", RecipientProfile), + recipient_profile_str=d.get("{recipient_profile_str}", None), + region=d.get("{region}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -1410,20 +1415,20 @@ def as_dict(self) -> dict: """Serializes the ProviderShare into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the ProviderShare into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderShare: """Deserializes the ProviderShare from a dictionary.""" - return cls(name=d.get("name", None)) + return cls(name=d.get("{name}", None)) @dataclass @@ -1498,111 +1503,111 @@ def as_dict(self) -> dict: """Serializes the RecipientInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.activated is not None: - body["activated"] = self.activated + body["{activated}"] = self.activated if self.activation_url is not None: - body["activation_url"] = self.activation_url + body["{activation_url}"] = self.activation_url if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type.value + body["{authentication_type}"] = self.authentication_type.value if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_recipient_global_metastore_id is not None: - body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id + body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list.as_dict() + body["{ip_access_list}"] = self.ip_access_list.as_dict() if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties_kvpairs: - body["properties_kvpairs"] = self.properties_kvpairs.as_dict() + body["{properties_kvpairs}"] = self.properties_kvpairs.as_dict() if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.sharing_code is not None: - body["sharing_code"] = self.sharing_code + body["{sharing_code}"] = self.sharing_code if self.tokens: - body["tokens"] = [v.as_dict() for v in self.tokens] + body["{tokens}"] = [v.as_dict() for v in self.tokens] if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the RecipientInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.activated is not None: - body["activated"] = self.activated + body["{activated}"] = self.activated if self.activation_url is not None: - body["activation_url"] = self.activation_url + body["{activation_url}"] = self.activation_url if self.authentication_type is not None: - body["authentication_type"] = self.authentication_type + body["{authentication_type}"] = self.authentication_type if self.cloud is not None: - body["cloud"] = self.cloud + body["{cloud}"] = self.cloud if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.data_recipient_global_metastore_id is not None: - body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id + body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list + body["{ip_access_list}"] = self.ip_access_list if self.metastore_id is not None: - body["metastore_id"] = self.metastore_id + body["{metastore_id}"] = self.metastore_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties_kvpairs: - body["properties_kvpairs"] = self.properties_kvpairs + body["{properties_kvpairs}"] = self.properties_kvpairs if self.region is not None: - body["region"] = self.region + body["{region}"] = self.region if self.sharing_code is not None: - body["sharing_code"] = self.sharing_code + body["{sharing_code}"] = self.sharing_code if self.tokens: - body["tokens"] = self.tokens + body["{tokens}"] = self.tokens if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RecipientInfo: """Deserializes the RecipientInfo from a dictionary.""" return cls( - activated=d.get("activated", None), - activation_url=d.get("activation_url", None), - authentication_type=_enum(d, "authentication_type", AuthenticationType), - cloud=d.get("cloud", None), - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - data_recipient_global_metastore_id=d.get("data_recipient_global_metastore_id", None), - expiration_time=d.get("expiration_time", None), - ip_access_list=_from_dict(d, "ip_access_list", IpAccessList), - metastore_id=d.get("metastore_id", None), - name=d.get("name", None), - owner=d.get("owner", None), - properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs), - region=d.get("region", None), - sharing_code=d.get("sharing_code", None), - tokens=_repeated_dict(d, "tokens", RecipientTokenInfo), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + activated=d.get("{activated}", None), + activation_url=d.get("{activation_url}", None), + authentication_type=_enum(d, "{authentication_type}", AuthenticationType), + cloud=d.get("{cloud}", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + data_recipient_global_metastore_id=d.get("{data_recipient_global_metastore_id}", None), + expiration_time=d.get("{expiration_time}", None), + ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessList), + metastore_id=d.get("{metastore_id}", None), + name=d.get("{name}", None), + owner=d.get("{owner}", None), + properties_kvpairs=_from_dict(d, "{properties_kvpairs}", SecurablePropertiesKvPairs), + region=d.get("{region}", None), + sharing_code=d.get("{sharing_code}", None), + tokens=_repeated_dict(d, "{tokens}", RecipientTokenInfo), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -1621,31 +1626,31 @@ def as_dict(self) -> dict: """Serializes the RecipientProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.bearer_token is not None: - body["bearer_token"] = self.bearer_token + body["{bearer_token}"] = self.bearer_token if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.share_credentials_version is not None: - body["share_credentials_version"] = self.share_credentials_version + body["{share_credentials_version}"] = self.share_credentials_version return body def as_shallow_dict(self) -> dict: """Serializes the RecipientProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.bearer_token is not None: - body["bearer_token"] = self.bearer_token + body["{bearer_token}"] = self.bearer_token if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.share_credentials_version is not None: - body["share_credentials_version"] = self.share_credentials_version + body["{share_credentials_version}"] = self.share_credentials_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RecipientProfile: """Deserializes the RecipientProfile from a dictionary.""" return cls( - bearer_token=d.get("bearer_token", None), - endpoint=d.get("endpoint", None), - share_credentials_version=d.get("share_credentials_version", None), + bearer_token=d.get("{bearer_token}", None), + endpoint=d.get("{endpoint}", None), + share_credentials_version=d.get("{share_credentials_version}", None), ) @@ -1677,51 +1682,51 @@ def as_dict(self) -> dict: """Serializes the RecipientTokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.activation_url is not None: - body["activation_url"] = self.activation_url + body["{activation_url}"] = self.activation_url if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the RecipientTokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.activation_url is not None: - body["activation_url"] = self.activation_url + body["{activation_url}"] = self.activation_url if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RecipientTokenInfo: """Deserializes the RecipientTokenInfo from a dictionary.""" return cls( - activation_url=d.get("activation_url", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - expiration_time=d.get("expiration_time", None), - id=d.get("id", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + activation_url=d.get("{activation_url}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + expiration_time=d.get("{expiration_time}", None), + id=d.get("{id}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -1737,24 +1742,24 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAlias into a dictionary suitable for use as a JSON request body.""" body = {} if self.alias_name is not None: - body["alias_name"] = self.alias_name + body["{alias_name}"] = self.alias_name if self.version_num is not None: - body["version_num"] = self.version_num + body["{version_num}"] = self.version_num return body def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAlias into a shallow dictionary of its immediate attributes.""" body = {} if self.alias_name is not None: - body["alias_name"] = self.alias_name + body["{alias_name}"] = self.alias_name if self.version_num is not None: - body["version_num"] = self.version_num + body["{version_num}"] = self.version_num return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAlias: """Deserializes the RegisteredModelAlias from a dictionary.""" - return cls(alias_name=d.get("alias_name", None), version_num=d.get("version_num", None)) + return cls(alias_name=d.get("{alias_name}", None), version_num=d.get("{version_num}", None)) @dataclass @@ -1775,36 +1780,36 @@ def as_dict(self) -> dict: """Serializes the RetrieveTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.bearer_token is not None: - body["bearerToken"] = self.bearer_token + body["{bearer_token}"] = self.bearer_token if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.expiration_time is not None: - body["expirationTime"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.share_credentials_version is not None: - body["shareCredentialsVersion"] = self.share_credentials_version + body["{share_credentials_version}"] = self.share_credentials_version return body def as_shallow_dict(self) -> dict: """Serializes the RetrieveTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.bearer_token is not None: - body["bearerToken"] = self.bearer_token + body["{bearer_token}"] = self.bearer_token if self.endpoint is not None: - body["endpoint"] = self.endpoint + body["{endpoint}"] = self.endpoint if self.expiration_time is not None: - body["expirationTime"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.share_credentials_version is not None: - body["shareCredentialsVersion"] = self.share_credentials_version + body["{share_credentials_version}"] = self.share_credentials_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RetrieveTokenResponse: """Deserializes the RetrieveTokenResponse from a dictionary.""" return cls( - bearer_token=d.get("bearerToken", None), - endpoint=d.get("endpoint", None), - expiration_time=d.get("expirationTime", None), - share_credentials_version=d.get("shareCredentialsVersion", None), + bearer_token=d.get("{bearer_token}", None), + endpoint=d.get("{endpoint}", None), + expiration_time=d.get("{expiration_time}", None), + share_credentials_version=d.get("{share_credentials_version}", None), ) @@ -1822,25 +1827,26 @@ def as_dict(self) -> dict: """Serializes the RotateRecipientToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.existing_token_expire_in_seconds is not None: - body["existing_token_expire_in_seconds"] = self.existing_token_expire_in_seconds + body["{existing_token_expire_in_seconds}"] = self.existing_token_expire_in_seconds if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the RotateRecipientToken into a shallow dictionary of its immediate attributes.""" body = {} if self.existing_token_expire_in_seconds is not None: - body["existing_token_expire_in_seconds"] = self.existing_token_expire_in_seconds + body["{existing_token_expire_in_seconds}"] = self.existing_token_expire_in_seconds if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RotateRecipientToken: """Deserializes the RotateRecipientToken from a dictionary.""" return cls( - existing_token_expire_in_seconds=d.get("existing_token_expire_in_seconds", None), name=d.get("name", None) + existing_token_expire_in_seconds=d.get("{existing_token_expire_in_seconds}", None), + name=d.get("{name}", None), ) @@ -1855,20 +1861,20 @@ def as_dict(self) -> dict: """Serializes the SecurablePropertiesKvPairs into a dictionary suitable for use as a JSON request body.""" body = {} if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties return body def as_shallow_dict(self) -> dict: """Serializes the SecurablePropertiesKvPairs into a shallow dictionary of its immediate attributes.""" body = {} if self.properties: - body["properties"] = self.properties + body["{properties}"] = self.properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecurablePropertiesKvPairs: """Deserializes the SecurablePropertiesKvPairs from a dictionary.""" - return cls(properties=d.get("properties", None)) + return cls(properties=d.get("{properties}", None)) @dataclass @@ -1907,66 +1913,66 @@ def as_dict(self) -> dict: """Serializes the ShareInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.objects: - body["objects"] = [v.as_dict() for v in self.objects] + body["{objects}"] = [v.as_dict() for v in self.objects] if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body def as_shallow_dict(self) -> dict: """Serializes the ShareInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.created_by is not None: - body["created_by"] = self.created_by + body["{created_by}"] = self.created_by if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.objects: - body["objects"] = self.objects + body["{objects}"] = self.objects if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.updated_by is not None: - body["updated_by"] = self.updated_by + body["{updated_by}"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ShareInfo: """Deserializes the ShareInfo from a dictionary.""" return cls( - comment=d.get("comment", None), - created_at=d.get("created_at", None), - created_by=d.get("created_by", None), - name=d.get("name", None), - objects=_repeated_dict(d, "objects", SharedDataObject), - owner=d.get("owner", None), - storage_location=d.get("storage_location", None), - storage_root=d.get("storage_root", None), - updated_at=d.get("updated_at", None), - updated_by=d.get("updated_by", None), + comment=d.get("{comment}", None), + created_at=d.get("{created_at}", None), + created_by=d.get("{created_by}", None), + name=d.get("{name}", None), + objects=_repeated_dict(d, "{objects}", SharedDataObject), + owner=d.get("{owner}", None), + storage_location=d.get("{storage_location}", None), + storage_root=d.get("{storage_root}", None), + updated_at=d.get("{updated_at}", None), + updated_by=d.get("{updated_by}", None), ) @@ -1982,26 +1988,26 @@ def as_dict(self) -> dict: """Serializes the ShareToPrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] + body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name return body def as_shallow_dict(self) -> dict: """Serializes the ShareToPrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = self.privilege_assignments + body["{privilege_assignments}"] = self.privilege_assignments if self.share_name is not None: - body["share_name"] = self.share_name + body["{share_name}"] = self.share_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ShareToPrivilegeAssignment: """Deserializes the ShareToPrivilegeAssignment from a dictionary.""" return cls( - privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment), - share_name=d.get("share_name", None), + privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment), + share_name=d.get("{share_name}", None), ) @@ -2064,83 +2070,83 @@ def as_dict(self) -> dict: """Serializes the SharedDataObject into a dictionary suitable for use as a JSON request body.""" body = {} if self.added_at is not None: - body["added_at"] = self.added_at + body["{added_at}"] = self.added_at if self.added_by is not None: - body["added_by"] = self.added_by + body["{added_by}"] = self.added_by if self.cdf_enabled is not None: - body["cdf_enabled"] = self.cdf_enabled + body["{cdf_enabled}"] = self.cdf_enabled if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.data_object_type is not None: - body["data_object_type"] = self.data_object_type.value + body["{data_object_type}"] = self.data_object_type.value if self.history_data_sharing_status is not None: - body["history_data_sharing_status"] = self.history_data_sharing_status.value + body["{history_data_sharing_status}"] = self.history_data_sharing_status.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.partitions: - body["partitions"] = [v.as_dict() for v in self.partitions] + body["{partitions}"] = [v.as_dict() for v in self.partitions] if self.shared_as is not None: - body["shared_as"] = self.shared_as + body["{shared_as}"] = self.shared_as if self.start_version is not None: - body["start_version"] = self.start_version + body["{start_version}"] = self.start_version if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.string_shared_as is not None: - body["string_shared_as"] = self.string_shared_as + body["{string_shared_as}"] = self.string_shared_as return body def as_shallow_dict(self) -> dict: """Serializes the SharedDataObject into a shallow dictionary of its immediate attributes.""" body = {} if self.added_at is not None: - body["added_at"] = self.added_at + body["{added_at}"] = self.added_at if self.added_by is not None: - body["added_by"] = self.added_by + body["{added_by}"] = self.added_by if self.cdf_enabled is not None: - body["cdf_enabled"] = self.cdf_enabled + body["{cdf_enabled}"] = self.cdf_enabled if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.data_object_type is not None: - body["data_object_type"] = self.data_object_type + body["{data_object_type}"] = self.data_object_type if self.history_data_sharing_status is not None: - body["history_data_sharing_status"] = self.history_data_sharing_status + body["{history_data_sharing_status}"] = self.history_data_sharing_status if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.partitions: - body["partitions"] = self.partitions + body["{partitions}"] = self.partitions if self.shared_as is not None: - body["shared_as"] = self.shared_as + body["{shared_as}"] = self.shared_as if self.start_version is not None: - body["start_version"] = self.start_version + body["{start_version}"] = self.start_version if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.string_shared_as is not None: - body["string_shared_as"] = self.string_shared_as + body["{string_shared_as}"] = self.string_shared_as return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SharedDataObject: """Deserializes the SharedDataObject from a dictionary.""" return cls( - added_at=d.get("added_at", None), - added_by=d.get("added_by", None), - cdf_enabled=d.get("cdf_enabled", None), - comment=d.get("comment", None), - content=d.get("content", None), - data_object_type=_enum(d, "data_object_type", SharedDataObjectDataObjectType), + added_at=d.get("{added_at}", None), + added_by=d.get("{added_by}", None), + cdf_enabled=d.get("{cdf_enabled}", None), + comment=d.get("{comment}", None), + content=d.get("{content}", None), + data_object_type=_enum(d, "{data_object_type}", SharedDataObjectDataObjectType), history_data_sharing_status=_enum( - d, "history_data_sharing_status", SharedDataObjectHistoryDataSharingStatus + d, "{history_data_sharing_status}", SharedDataObjectHistoryDataSharingStatus ), - name=d.get("name", None), - partitions=_repeated_dict(d, "partitions", Partition), - shared_as=d.get("shared_as", None), - start_version=d.get("start_version", None), - status=_enum(d, "status", SharedDataObjectStatus), - string_shared_as=d.get("string_shared_as", None), + name=d.get("{name}", None), + partitions=_repeated_dict(d, "{partitions}", Partition), + shared_as=d.get("{shared_as}", None), + start_version=d.get("{start_version}", None), + status=_enum(d, "{status}", SharedDataObjectStatus), + string_shared_as=d.get("{string_shared_as}", None), ) @@ -2181,26 +2187,26 @@ def as_dict(self) -> dict: """Serializes the SharedDataObjectUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.action is not None: - body["action"] = self.action.value + body["{action}"] = self.action.value if self.data_object: - body["data_object"] = self.data_object.as_dict() + body["{data_object}"] = self.data_object.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the SharedDataObjectUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.action is not None: - body["action"] = self.action + body["{action}"] = self.action if self.data_object: - body["data_object"] = self.data_object + body["{data_object}"] = self.data_object return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SharedDataObjectUpdate: """Deserializes the SharedDataObjectUpdate from a dictionary.""" return cls( - action=_enum(d, "action", SharedDataObjectUpdateAction), - data_object=_from_dict(d, "data_object", SharedDataObject), + action=_enum(d, "{action}", SharedDataObjectUpdateAction), + data_object=_from_dict(d, "{data_object}", SharedDataObject), ) @@ -2252,61 +2258,61 @@ def as_dict(self) -> dict: """Serializes the Table into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.internal_attributes: - body["internal_attributes"] = self.internal_attributes.as_dict() + body["{internal_attributes}"] = self.internal_attributes.as_dict() if self.materialized_table_name is not None: - body["materialized_table_name"] = self.materialized_table_name + body["{materialized_table_name}"] = self.materialized_table_name if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the Table into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.internal_attributes: - body["internal_attributes"] = self.internal_attributes + body["{internal_attributes}"] = self.internal_attributes if self.materialized_table_name is not None: - body["materialized_table_name"] = self.materialized_table_name + body["{materialized_table_name}"] = self.materialized_table_name if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Table: """Deserializes the Table from a dictionary.""" return cls( - comment=d.get("comment", None), - id=d.get("id", None), - internal_attributes=_from_dict(d, "internal_attributes", TableInternalAttributes), - materialized_table_name=d.get("materialized_table_name", None), - name=d.get("name", None), - schema=d.get("schema", None), - share=d.get("share", None), - share_id=d.get("share_id", None), - tags=_repeated_dict(d, "tags", TagKeyValue), + comment=d.get("{comment}", None), + id=d.get("{id}", None), + internal_attributes=_from_dict(d, "{internal_attributes}", TableInternalAttributes), + materialized_table_name=d.get("{materialized_table_name}", None), + name=d.get("{name}", None), + schema=d.get("{schema}", None), + share=d.get("{share}", None), + share_id=d.get("{share_id}", None), + tags=_repeated_dict(d, "{tags}", TagKeyValue), ) @@ -2335,36 +2341,36 @@ def as_dict(self) -> dict: """Serializes the TableInternalAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.parent_storage_location is not None: - body["parent_storage_location"] = self.parent_storage_location + body["{parent_storage_location}"] = self.parent_storage_location if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value if self.view_definition is not None: - body["view_definition"] = self.view_definition + body["{view_definition}"] = self.view_definition return body def as_shallow_dict(self) -> dict: """Serializes the TableInternalAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.parent_storage_location is not None: - body["parent_storage_location"] = self.parent_storage_location + body["{parent_storage_location}"] = self.parent_storage_location if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.view_definition is not None: - body["view_definition"] = self.view_definition + body["{view_definition}"] = self.view_definition return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableInternalAttributes: """Deserializes the TableInternalAttributes from a dictionary.""" return cls( - parent_storage_location=d.get("parent_storage_location", None), - storage_location=d.get("storage_location", None), - type=_enum(d, "type", TableInternalAttributesSharedTableType), - view_definition=d.get("view_definition", None), + parent_storage_location=d.get("{parent_storage_location}", None), + storage_location=d.get("{storage_location}", None), + type=_enum(d, "{type}", TableInternalAttributesSharedTableType), + view_definition=d.get("{view_definition}", None), ) @@ -2390,24 +2396,24 @@ def as_dict(self) -> dict: """Serializes the TagKeyValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the TagKeyValue into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TagKeyValue: """Deserializes the TagKeyValue from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -2432,41 +2438,41 @@ def as_dict(self) -> dict: """Serializes the UpdateProvider into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.recipient_profile_str is not None: - body["recipient_profile_str"] = self.recipient_profile_str + body["{recipient_profile_str}"] = self.recipient_profile_str return body def as_shallow_dict(self) -> dict: """Serializes the UpdateProvider into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.recipient_profile_str is not None: - body["recipient_profile_str"] = self.recipient_profile_str + body["{recipient_profile_str}"] = self.recipient_profile_str return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProvider: """Deserializes the UpdateProvider from a dictionary.""" return cls( - comment=d.get("comment", None), - name=d.get("name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - recipient_profile_str=d.get("recipient_profile_str", None), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + recipient_profile_str=d.get("{recipient_profile_str}", None), ) @@ -2499,51 +2505,51 @@ def as_dict(self) -> dict: """Serializes the UpdateRecipient into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list.as_dict() + body["{ip_access_list}"] = self.ip_access_list.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties_kvpairs: - body["properties_kvpairs"] = self.properties_kvpairs.as_dict() + body["{properties_kvpairs}"] = self.properties_kvpairs.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRecipient into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.expiration_time is not None: - body["expiration_time"] = self.expiration_time + body["{expiration_time}"] = self.expiration_time if self.ip_access_list: - body["ip_access_list"] = self.ip_access_list + body["{ip_access_list}"] = self.ip_access_list if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.properties_kvpairs: - body["properties_kvpairs"] = self.properties_kvpairs + body["{properties_kvpairs}"] = self.properties_kvpairs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRecipient: """Deserializes the UpdateRecipient from a dictionary.""" return cls( - comment=d.get("comment", None), - expiration_time=d.get("expiration_time", None), - ip_access_list=_from_dict(d, "ip_access_list", IpAccessList), - name=d.get("name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs), + comment=d.get("{comment}", None), + expiration_time=d.get("{expiration_time}", None), + ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessList), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + properties_kvpairs=_from_dict(d, "{properties_kvpairs}", SecurablePropertiesKvPairs), ) @@ -2571,46 +2577,46 @@ def as_dict(self) -> dict: """Serializes the UpdateShare into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updates: - body["updates"] = [v.as_dict() for v in self.updates] + body["{updates}"] = [v.as_dict() for v in self.updates] return body def as_shallow_dict(self) -> dict: """Serializes the UpdateShare into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.new_name is not None: - body["new_name"] = self.new_name + body["{new_name}"] = self.new_name if self.owner is not None: - body["owner"] = self.owner + body["{owner}"] = self.owner if self.storage_root is not None: - body["storage_root"] = self.storage_root + body["{storage_root}"] = self.storage_root if self.updates: - body["updates"] = self.updates + body["{updates}"] = self.updates return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateShare: """Deserializes the UpdateShare from a dictionary.""" return cls( - comment=d.get("comment", None), - name=d.get("name", None), - new_name=d.get("new_name", None), - owner=d.get("owner", None), - storage_root=d.get("storage_root", None), - updates=_repeated_dict(d, "updates", SharedDataObjectUpdate), + comment=d.get("{comment}", None), + name=d.get("{name}", None), + new_name=d.get("{new_name}", None), + owner=d.get("{owner}", None), + storage_root=d.get("{storage_root}", None), + updates=_repeated_dict(d, "{updates}", SharedDataObjectUpdate), ) @@ -2626,24 +2632,24 @@ def as_dict(self) -> dict: """Serializes the UpdateSharePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.changes: - body["changes"] = [v.as_dict() for v in self.changes] + body["{changes}"] = [v.as_dict() for v in self.changes] if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the UpdateSharePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.changes: - body["changes"] = self.changes + body["{changes}"] = self.changes if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateSharePermissions: """Deserializes the UpdateSharePermissions from a dictionary.""" - return cls(changes=_repeated_dict(d, "changes", PermissionsChange), name=d.get("name", None)) + return cls(changes=_repeated_dict(d, "{changes}", PermissionsChange), name=d.get("{name}", None)) @dataclass @@ -2655,20 +2661,20 @@ def as_dict(self) -> dict: """Serializes the UpdateSharePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] + body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: """Serializes the UpdateSharePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["privilege_assignments"] = self.privilege_assignments + body["{privilege_assignments}"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateSharePermissionsResponse: """Deserializes the UpdateSharePermissionsResponse from a dictionary.""" - return cls(privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment)) + return cls(privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment)) @dataclass @@ -2702,56 +2708,56 @@ def as_dict(self) -> dict: """Serializes the Volume into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.internal_attributes: - body["internal_attributes"] = self.internal_attributes.as_dict() + body["{internal_attributes}"] = self.internal_attributes.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.tags: - body["tags"] = [v.as_dict() for v in self.tags] + body["{tags}"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the Volume into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["comment"] = self.comment + body["{comment}"] = self.comment if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.internal_attributes: - body["internal_attributes"] = self.internal_attributes + body["{internal_attributes}"] = self.internal_attributes if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.share is not None: - body["share"] = self.share + body["{share}"] = self.share if self.share_id is not None: - body["share_id"] = self.share_id + body["{share_id}"] = self.share_id if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Volume: """Deserializes the Volume from a dictionary.""" return cls( - comment=d.get("comment", None), - id=d.get("id", None), - internal_attributes=_from_dict(d, "internal_attributes", VolumeInternalAttributes), - name=d.get("name", None), - schema=d.get("schema", None), - share=d.get("share", None), - share_id=d.get("share_id", None), - tags=_repeated_dict(d, "tags", TagKeyValue), + comment=d.get("{comment}", None), + id=d.get("{id}", None), + internal_attributes=_from_dict(d, "{internal_attributes}", VolumeInternalAttributes), + name=d.get("{name}", None), + schema=d.get("{schema}", None), + share=d.get("{share}", None), + share_id=d.get("{share_id}", None), + tags=_repeated_dict(d, "{tags}", TagKeyValue), ) @@ -2769,24 +2775,24 @@ def as_dict(self) -> dict: """Serializes the VolumeInternalAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body def as_shallow_dict(self) -> dict: """Serializes the VolumeInternalAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.storage_location is not None: - body["storage_location"] = self.storage_location + body["{storage_location}"] = self.storage_location if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumeInternalAttributes: """Deserializes the VolumeInternalAttributes from a dictionary.""" - return cls(storage_location=d.get("storage_location", None), type=d.get("type", None)) + return cls(storage_location=d.get("{storage_location}", None), type=d.get("{type}", None)) class ProvidersAPI: @@ -2823,16 +2829,16 @@ def create( """ body = {} if authentication_type is not None: - body["authentication_type"] = authentication_type.value + body["{authentication_type}"] = authentication_type.value if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if recipient_profile_str is not None: - body["recipient_profile_str"] = recipient_profile_str + body["{recipient_profile_str}"] = recipient_profile_str headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/providers", body=body, headers=headers) @@ -2867,7 +2873,7 @@ def get(self, name: str) -> ProviderInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/providers/{name}", headers=headers) @@ -2905,25 +2911,25 @@ def list( query = {} if data_provider_global_metastore_id is not None: - query["data_provider_global_metastore_id"] = data_provider_global_metastore_id + query["{data_provider_global_metastore_id}"] = data_provider_global_metastore_id if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/providers", query=query, headers=headers) - if "providers" in json: - for v in json["providers"]: + if "{providers}" in json: + for v in json["{providers}"]: yield ProviderInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_provider_share_assets( self, @@ -2958,15 +2964,15 @@ def list_provider_share_assets( query = {} if function_max_results is not None: - query["function_max_results"] = function_max_results + query["{function_max_results}"] = function_max_results if notebook_max_results is not None: - query["notebook_max_results"] = notebook_max_results + query["{notebook_max_results}"] = notebook_max_results if table_max_results is not None: - query["table_max_results"] = table_max_results + query["{table_max_results}"] = table_max_results if volume_max_results is not None: - query["volume_max_results"] = volume_max_results + query["{volume_max_results}"] = volume_max_results headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3001,23 +3007,23 @@ def list_shares( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", f"/api/2.1/unity-catalog/providers/{name}/shares", query=query, headers=headers) - if "shares" in json: - for v in json["shares"]: + if "{shares}" in json: + for v in json["{shares}"]: yield ProviderShare.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update( self, @@ -3050,16 +3056,16 @@ def update( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if recipient_profile_str is not None: - body["recipient_profile_str"] = recipient_profile_str + body["{recipient_profile_str}"] = recipient_profile_str headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/providers/{name}", body=body, headers=headers) @@ -3090,7 +3096,7 @@ def get_activation_url_info(self, activation_url: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do( @@ -3109,7 +3115,7 @@ def retrieve_token(self, activation_url: str) -> RetrieveTokenResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3182,26 +3188,26 @@ def create( """ body = {} if authentication_type is not None: - body["authentication_type"] = authentication_type.value + body["{authentication_type}"] = authentication_type.value if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if data_recipient_global_metastore_id is not None: - body["data_recipient_global_metastore_id"] = data_recipient_global_metastore_id + body["{data_recipient_global_metastore_id}"] = data_recipient_global_metastore_id if expiration_time is not None: - body["expiration_time"] = expiration_time + body["{expiration_time}"] = expiration_time if ip_access_list is not None: - body["ip_access_list"] = ip_access_list.as_dict() + body["{ip_access_list}"] = ip_access_list.as_dict() if name is not None: - body["name"] = name + body["{name}"] = name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if properties_kvpairs is not None: - body["properties_kvpairs"] = properties_kvpairs.as_dict() + body["{properties_kvpairs}"] = properties_kvpairs.as_dict() if sharing_code is not None: - body["sharing_code"] = sharing_code + body["{sharing_code}"] = sharing_code headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/recipients", body=body, headers=headers) @@ -3236,7 +3242,7 @@ def get(self, name: str) -> RecipientInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/recipients/{name}", headers=headers) @@ -3275,25 +3281,25 @@ def list( query = {} if data_recipient_global_metastore_id is not None: - query["data_recipient_global_metastore_id"] = data_recipient_global_metastore_id + query["{data_recipient_global_metastore_id}"] = data_recipient_global_metastore_id if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/recipients", query=query, headers=headers) - if "recipients" in json: - for v in json["recipients"]: + if "{recipients}" in json: + for v in json["{recipients}"]: yield RecipientInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> RecipientInfo: """Rotate a token. @@ -3312,10 +3318,10 @@ def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> Reci """ body = {} if existing_token_expire_in_seconds is not None: - body["existing_token_expire_in_seconds"] = existing_token_expire_in_seconds + body["{existing_token_expire_in_seconds}"] = existing_token_expire_in_seconds headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.1/unity-catalog/recipients/{name}/rotate-token", body=body, headers=headers) @@ -3347,11 +3353,11 @@ def share_permissions( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3397,20 +3403,20 @@ def update( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if expiration_time is not None: - body["expiration_time"] = expiration_time + body["{expiration_time}"] = expiration_time if ip_access_list is not None: - body["ip_access_list"] = ip_access_list.as_dict() + body["{ip_access_list}"] = ip_access_list.as_dict() if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if properties_kvpairs is not None: - body["properties_kvpairs"] = properties_kvpairs.as_dict() + body["{properties_kvpairs}"] = properties_kvpairs.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/recipients/{name}", body=body, headers=headers) @@ -3443,14 +3449,14 @@ def create(self, name: str, *, comment: Optional[str] = None, storage_root: Opti """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if name is not None: - body["name"] = name + body["{name}"] = name if storage_root is not None: - body["storage_root"] = storage_root + body["{storage_root}"] = storage_root headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.1/unity-catalog/shares", body=body, headers=headers) @@ -3487,9 +3493,9 @@ def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> Share query = {} if include_shared_data is not None: - query["include_shared_data"] = include_shared_data + query["{include_shared_data}"] = include_shared_data headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}", query=query, headers=headers) @@ -3517,23 +3523,23 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } - if "max_results" not in query: - query["max_results"] = 0 + if "{max_results}" not in query: + query["{max_results}"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/shares", query=query, headers=headers) - if "shares" in json: - for v in json["shares"]: + if "{shares}" in json: + for v in json["{shares}"]: yield ShareInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def share_permissions( self, name: str, *, max_results: Optional[int] = None, page_token: Optional[str] = None @@ -3561,11 +3567,11 @@ def share_permissions( query = {} if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}/permissions", query=query, headers=headers) @@ -3616,18 +3622,18 @@ def update( """ body = {} if comment is not None: - body["comment"] = comment + body["{comment}"] = comment if new_name is not None: - body["new_name"] = new_name + body["{new_name}"] = new_name if owner is not None: - body["owner"] = owner + body["{owner}"] = owner if storage_root is not None: - body["storage_root"] = storage_root + body["{storage_root}"] = storage_root if updates is not None: - body["updates"] = [v.as_dict() for v in updates] + body["{updates}"] = [v.as_dict() for v in updates] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}", body=body, headers=headers) @@ -3653,10 +3659,10 @@ def update_permissions( """ body = {} if changes is not None: - body["changes"] = [v.as_dict() for v in changes] + body["{changes}"] = [v.as_dict() for v in changes] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}/permissions", body=body, headers=headers) diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/sql/v2/impl.py similarity index 72% rename from databricks/sdk/service/sql.py rename to databricks/sdk/sql/v2/impl.py index 297661c11..d32603118 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/sql/v2/impl.py @@ -3,19 +3,16 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict, _repeated_enum +from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, + _repeated_enum) _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -33,31 +30,31 @@ def as_dict(self) -> dict: """Serializes the AccessControl into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the AccessControl into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccessControl: """Deserializes the AccessControl from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", PermissionLevel), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", PermissionLevel), + user_name=d.get("{user_name}", None), ) @@ -119,91 +116,91 @@ def as_dict(self) -> dict: """Serializes the Alert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["condition"] = self.condition.as_dict() + body["{condition}"] = self.condition.as_dict() if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state.value + body["{lifecycle_state}"] = self.lifecycle_state.value if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.trigger_time is not None: - body["trigger_time"] = self.trigger_time + body["{trigger_time}"] = self.trigger_time if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the Alert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["condition"] = self.condition + body["{condition}"] = self.condition if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state + body["{lifecycle_state}"] = self.lifecycle_state if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.trigger_time is not None: - body["trigger_time"] = self.trigger_time + body["{trigger_time}"] = self.trigger_time if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Alert: """Deserializes the Alert from a dictionary.""" return cls( - condition=_from_dict(d, "condition", AlertCondition), - create_time=d.get("create_time", None), - custom_body=d.get("custom_body", None), - custom_subject=d.get("custom_subject", None), - display_name=d.get("display_name", None), - id=d.get("id", None), - lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), - notify_on_ok=d.get("notify_on_ok", None), - owner_user_name=d.get("owner_user_name", None), - parent_path=d.get("parent_path", None), - query_id=d.get("query_id", None), - seconds_to_retrigger=d.get("seconds_to_retrigger", None), - state=_enum(d, "state", AlertState), - trigger_time=d.get("trigger_time", None), - update_time=d.get("update_time", None), + condition=_from_dict(d, "{condition}", AlertCondition), + create_time=d.get("{create_time}", None), + custom_body=d.get("{custom_body}", None), + custom_subject=d.get("{custom_subject}", None), + display_name=d.get("{display_name}", None), + id=d.get("{id}", None), + lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), + notify_on_ok=d.get("{notify_on_ok}", None), + owner_user_name=d.get("{owner_user_name}", None), + parent_path=d.get("{parent_path}", None), + query_id=d.get("{query_id}", None), + seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), + state=_enum(d, "{state}", AlertState), + trigger_time=d.get("{trigger_time}", None), + update_time=d.get("{update_time}", None), ) @@ -225,36 +222,36 @@ def as_dict(self) -> dict: """Serializes the AlertCondition into a dictionary suitable for use as a JSON request body.""" body = {} if self.empty_result_state is not None: - body["empty_result_state"] = self.empty_result_state.value + body["{empty_result_state}"] = self.empty_result_state.value if self.op is not None: - body["op"] = self.op.value + body["{op}"] = self.op.value if self.operand: - body["operand"] = self.operand.as_dict() + body["{operand}"] = self.operand.as_dict() if self.threshold: - body["threshold"] = self.threshold.as_dict() + body["{threshold}"] = self.threshold.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AlertCondition into a shallow dictionary of its immediate attributes.""" body = {} if self.empty_result_state is not None: - body["empty_result_state"] = self.empty_result_state + body["{empty_result_state}"] = self.empty_result_state if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.operand: - body["operand"] = self.operand + body["{operand}"] = self.operand if self.threshold: - body["threshold"] = self.threshold + body["{threshold}"] = self.threshold return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertCondition: """Deserializes the AlertCondition from a dictionary.""" return cls( - empty_result_state=_enum(d, "empty_result_state", AlertState), - op=_enum(d, "op", AlertOperator), - operand=_from_dict(d, "operand", AlertConditionOperand), - threshold=_from_dict(d, "threshold", AlertConditionThreshold), + empty_result_state=_enum(d, "{empty_result_state}", AlertState), + op=_enum(d, "{op}", AlertOperator), + operand=_from_dict(d, "{operand}", AlertConditionOperand), + threshold=_from_dict(d, "{threshold}", AlertConditionThreshold), ) @@ -266,20 +263,20 @@ def as_dict(self) -> dict: """Serializes the AlertConditionOperand into a dictionary suitable for use as a JSON request body.""" body = {} if self.column: - body["column"] = self.column.as_dict() + body["{column}"] = self.column.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AlertConditionOperand into a shallow dictionary of its immediate attributes.""" body = {} if self.column: - body["column"] = self.column + body["{column}"] = self.column return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertConditionOperand: """Deserializes the AlertConditionOperand from a dictionary.""" - return cls(column=_from_dict(d, "column", AlertOperandColumn)) + return cls(column=_from_dict(d, "{column}", AlertOperandColumn)) @dataclass @@ -290,20 +287,20 @@ def as_dict(self) -> dict: """Serializes the AlertConditionThreshold into a dictionary suitable for use as a JSON request body.""" body = {} if self.value: - body["value"] = self.value.as_dict() + body["{value}"] = self.value.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the AlertConditionThreshold into a shallow dictionary of its immediate attributes.""" body = {} if self.value: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertConditionThreshold: """Deserializes the AlertConditionThreshold from a dictionary.""" - return cls(value=_from_dict(d, "value", AlertOperandValue)) + return cls(value=_from_dict(d, "{value}", AlertOperandValue)) @dataclass @@ -314,20 +311,20 @@ def as_dict(self) -> dict: """Serializes the AlertOperandColumn into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the AlertOperandColumn into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertOperandColumn: """Deserializes the AlertOperandColumn from a dictionary.""" - return cls(name=d.get("name", None)) + return cls(name=d.get("{name}", None)) @dataclass @@ -342,31 +339,31 @@ def as_dict(self) -> dict: """Serializes the AlertOperandValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.bool_value is not None: - body["bool_value"] = self.bool_value + body["{bool_value}"] = self.bool_value if self.double_value is not None: - body["double_value"] = self.double_value + body["{double_value}"] = self.double_value if self.string_value is not None: - body["string_value"] = self.string_value + body["{string_value}"] = self.string_value return body def as_shallow_dict(self) -> dict: """Serializes the AlertOperandValue into a shallow dictionary of its immediate attributes.""" body = {} if self.bool_value is not None: - body["bool_value"] = self.bool_value + body["{bool_value}"] = self.bool_value if self.double_value is not None: - body["double_value"] = self.double_value + body["{double_value}"] = self.double_value if self.string_value is not None: - body["string_value"] = self.string_value + body["{string_value}"] = self.string_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertOperandValue: """Deserializes the AlertOperandValue from a dictionary.""" return cls( - bool_value=d.get("bool_value", None), - double_value=d.get("double_value", None), - string_value=d.get("string_value", None), + bool_value=d.get("{bool_value}", None), + double_value=d.get("{double_value}", None), + string_value=d.get("{string_value}", None), ) @@ -417,51 +414,51 @@ def as_dict(self) -> dict: """Serializes the AlertOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.column is not None: - body["column"] = self.column + body["{column}"] = self.column if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.empty_result_state is not None: - body["empty_result_state"] = self.empty_result_state.value + body["{empty_result_state}"] = self.empty_result_state.value if self.muted is not None: - body["muted"] = self.muted + body["{muted}"] = self.muted if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.value: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the AlertOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.column is not None: - body["column"] = self.column + body["{column}"] = self.column if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.empty_result_state is not None: - body["empty_result_state"] = self.empty_result_state + body["{empty_result_state}"] = self.empty_result_state if self.muted is not None: - body["muted"] = self.muted + body["{muted}"] = self.muted if self.op is not None: - body["op"] = self.op + body["{op}"] = self.op if self.value: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertOptions: """Deserializes the AlertOptions from a dictionary.""" return cls( - column=d.get("column", None), - custom_body=d.get("custom_body", None), - custom_subject=d.get("custom_subject", None), - empty_result_state=_enum(d, "empty_result_state", AlertOptionsEmptyResultState), - muted=d.get("muted", None), - op=d.get("op", None), - value=d.get("value", None), + column=d.get("{column}", None), + custom_body=d.get("{custom_body}", None), + custom_subject=d.get("{custom_subject}", None), + empty_result_state=_enum(d, "{empty_result_state}", AlertOptionsEmptyResultState), + muted=d.get("{muted}", None), + op=d.get("{op}", None), + value=d.get("{value}", None), ) @@ -524,81 +521,81 @@ def as_dict(self) -> dict: """Serializes the AlertQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_archived is not None: - body["is_archived"] = self.is_archived + body["{is_archived}"] = self.is_archived if self.is_draft is not None: - body["is_draft"] = self.is_draft + body["{is_draft}"] = self.is_draft if self.is_safe is not None: - body["is_safe"] = self.is_safe + body["{is_safe}"] = self.is_safe if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body def as_shallow_dict(self) -> dict: """Serializes the AlertQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_archived is not None: - body["is_archived"] = self.is_archived + body["{is_archived}"] = self.is_archived if self.is_draft is not None: - body["is_draft"] = self.is_draft + body["{is_draft}"] = self.is_draft if self.is_safe is not None: - body["is_safe"] = self.is_safe + body["{is_safe}"] = self.is_safe if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertQuery: """Deserializes the AlertQuery from a dictionary.""" return cls( - created_at=d.get("created_at", None), - data_source_id=d.get("data_source_id", None), - description=d.get("description", None), - id=d.get("id", None), - is_archived=d.get("is_archived", None), - is_draft=d.get("is_draft", None), - is_safe=d.get("is_safe", None), - name=d.get("name", None), - options=_from_dict(d, "options", QueryOptions), - query=d.get("query", None), - tags=d.get("tags", None), - updated_at=d.get("updated_at", None), - user_id=d.get("user_id", None), + created_at=d.get("{created_at}", None), + data_source_id=d.get("{data_source_id}", None), + description=d.get("{description}", None), + id=d.get("{id}", None), + is_archived=d.get("{is_archived}", None), + is_draft=d.get("{is_draft}", None), + is_safe=d.get("{is_safe}", None), + name=d.get("{name}", None), + options=_from_dict(d, "{options}", QueryOptions), + query=d.get("{query}", None), + tags=d.get("{tags}", None), + updated_at=d.get("{updated_at}", None), + user_id=d.get("{user_id}", None), ) @@ -631,36 +628,36 @@ def as_dict(self) -> dict: """Serializes the BaseChunkInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body def as_shallow_dict(self) -> dict: """Serializes the BaseChunkInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseChunkInfo: """Deserializes the BaseChunkInfo from a dictionary.""" return cls( - byte_count=d.get("byte_count", None), - chunk_index=d.get("chunk_index", None), - row_count=d.get("row_count", None), - row_offset=d.get("row_offset", None), + byte_count=d.get("{byte_count}", None), + chunk_index=d.get("{chunk_index}", None), + row_count=d.get("{row_count}", None), + row_offset=d.get("{row_offset}", None), ) @@ -695,24 +692,24 @@ def as_dict(self) -> dict: """Serializes the Channel into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbsql_version is not None: - body["dbsql_version"] = self.dbsql_version + body["{dbsql_version}"] = self.dbsql_version if self.name is not None: - body["name"] = self.name.value + body["{name}"] = self.name.value return body def as_shallow_dict(self) -> dict: """Serializes the Channel into a shallow dictionary of its immediate attributes.""" body = {} if self.dbsql_version is not None: - body["dbsql_version"] = self.dbsql_version + body["{dbsql_version}"] = self.dbsql_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Channel: """Deserializes the Channel from a dictionary.""" - return cls(dbsql_version=d.get("dbsql_version", None), name=_enum(d, "name", ChannelName)) + return cls(dbsql_version=d.get("{dbsql_version}", None), name=_enum(d, "{name}", ChannelName)) @dataclass @@ -729,24 +726,24 @@ def as_dict(self) -> dict: """Serializes the ChannelInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbsql_version is not None: - body["dbsql_version"] = self.dbsql_version + body["{dbsql_version}"] = self.dbsql_version if self.name is not None: - body["name"] = self.name.value + body["{name}"] = self.name.value return body def as_shallow_dict(self) -> dict: """Serializes the ChannelInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.dbsql_version is not None: - body["dbsql_version"] = self.dbsql_version + body["{dbsql_version}"] = self.dbsql_version if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ChannelInfo: """Deserializes the ChannelInfo from a dictionary.""" - return cls(dbsql_version=d.get("dbsql_version", None), name=_enum(d, "name", ChannelName)) + return cls(dbsql_version=d.get("{dbsql_version}", None), name=_enum(d, "{name}", ChannelName)) class ChannelName(Enum): @@ -783,66 +780,66 @@ def as_dict(self) -> dict: """Serializes the ClientConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_custom_js_visualizations is not None: - body["allow_custom_js_visualizations"] = self.allow_custom_js_visualizations + body["{allow_custom_js_visualizations}"] = self.allow_custom_js_visualizations if self.allow_downloads is not None: - body["allow_downloads"] = self.allow_downloads + body["{allow_downloads}"] = self.allow_downloads if self.allow_external_shares is not None: - body["allow_external_shares"] = self.allow_external_shares + body["{allow_external_shares}"] = self.allow_external_shares if self.allow_subscriptions is not None: - body["allow_subscriptions"] = self.allow_subscriptions + body["{allow_subscriptions}"] = self.allow_subscriptions if self.date_format is not None: - body["date_format"] = self.date_format + body["{date_format}"] = self.date_format if self.date_time_format is not None: - body["date_time_format"] = self.date_time_format + body["{date_time_format}"] = self.date_time_format if self.disable_publish is not None: - body["disable_publish"] = self.disable_publish + body["{disable_publish}"] = self.disable_publish if self.enable_legacy_autodetect_types is not None: - body["enable_legacy_autodetect_types"] = self.enable_legacy_autodetect_types + body["{enable_legacy_autodetect_types}"] = self.enable_legacy_autodetect_types if self.feature_show_permissions_control is not None: - body["feature_show_permissions_control"] = self.feature_show_permissions_control + body["{feature_show_permissions_control}"] = self.feature_show_permissions_control if self.hide_plotly_mode_bar is not None: - body["hide_plotly_mode_bar"] = self.hide_plotly_mode_bar + body["{hide_plotly_mode_bar}"] = self.hide_plotly_mode_bar return body def as_shallow_dict(self) -> dict: """Serializes the ClientConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_custom_js_visualizations is not None: - body["allow_custom_js_visualizations"] = self.allow_custom_js_visualizations + body["{allow_custom_js_visualizations}"] = self.allow_custom_js_visualizations if self.allow_downloads is not None: - body["allow_downloads"] = self.allow_downloads + body["{allow_downloads}"] = self.allow_downloads if self.allow_external_shares is not None: - body["allow_external_shares"] = self.allow_external_shares + body["{allow_external_shares}"] = self.allow_external_shares if self.allow_subscriptions is not None: - body["allow_subscriptions"] = self.allow_subscriptions + body["{allow_subscriptions}"] = self.allow_subscriptions if self.date_format is not None: - body["date_format"] = self.date_format + body["{date_format}"] = self.date_format if self.date_time_format is not None: - body["date_time_format"] = self.date_time_format + body["{date_time_format}"] = self.date_time_format if self.disable_publish is not None: - body["disable_publish"] = self.disable_publish + body["{disable_publish}"] = self.disable_publish if self.enable_legacy_autodetect_types is not None: - body["enable_legacy_autodetect_types"] = self.enable_legacy_autodetect_types + body["{enable_legacy_autodetect_types}"] = self.enable_legacy_autodetect_types if self.feature_show_permissions_control is not None: - body["feature_show_permissions_control"] = self.feature_show_permissions_control + body["{feature_show_permissions_control}"] = self.feature_show_permissions_control if self.hide_plotly_mode_bar is not None: - body["hide_plotly_mode_bar"] = self.hide_plotly_mode_bar + body["{hide_plotly_mode_bar}"] = self.hide_plotly_mode_bar return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClientConfig: """Deserializes the ClientConfig from a dictionary.""" return cls( - allow_custom_js_visualizations=d.get("allow_custom_js_visualizations", None), - allow_downloads=d.get("allow_downloads", None), - allow_external_shares=d.get("allow_external_shares", None), - allow_subscriptions=d.get("allow_subscriptions", None), - date_format=d.get("date_format", None), - date_time_format=d.get("date_time_format", None), - disable_publish=d.get("disable_publish", None), - enable_legacy_autodetect_types=d.get("enable_legacy_autodetect_types", None), - feature_show_permissions_control=d.get("feature_show_permissions_control", None), - hide_plotly_mode_bar=d.get("hide_plotly_mode_bar", None), + allow_custom_js_visualizations=d.get("{allow_custom_js_visualizations}", None), + allow_downloads=d.get("{allow_downloads}", None), + allow_external_shares=d.get("{allow_external_shares}", None), + allow_subscriptions=d.get("{allow_subscriptions}", None), + date_format=d.get("{date_format}", None), + date_time_format=d.get("{date_time_format}", None), + disable_publish=d.get("{disable_publish}", None), + enable_legacy_autodetect_types=d.get("{enable_legacy_autodetect_types}", None), + feature_show_permissions_control=d.get("{feature_show_permissions_control}", None), + hide_plotly_mode_bar=d.get("{hide_plotly_mode_bar}", None), ) @@ -875,51 +872,51 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_name is not None: - body["type_name"] = self.type_name.value + body["{type_name}"] = self.type_name.value if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.position is not None: - body["position"] = self.position + body["{position}"] = self.position if self.type_interval_type is not None: - body["type_interval_type"] = self.type_interval_type + body["{type_interval_type}"] = self.type_interval_type if self.type_name is not None: - body["type_name"] = self.type_name + body["{type_name}"] = self.type_name if self.type_precision is not None: - body["type_precision"] = self.type_precision + body["{type_precision}"] = self.type_precision if self.type_scale is not None: - body["type_scale"] = self.type_scale + body["{type_scale}"] = self.type_scale if self.type_text is not None: - body["type_text"] = self.type_text + body["{type_text}"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - name=d.get("name", None), - position=d.get("position", None), - type_interval_type=d.get("type_interval_type", None), - type_name=_enum(d, "type_name", ColumnInfoTypeName), - type_precision=d.get("type_precision", None), - type_scale=d.get("type_scale", None), - type_text=d.get("type_text", None), + name=d.get("{name}", None), + position=d.get("{position}", None), + type_interval_type=d.get("{type_interval_type}", None), + type_name=_enum(d, "{type_name}", ColumnInfoTypeName), + type_precision=d.get("{type_precision}", None), + type_scale=d.get("{type_scale}", None), + type_text=d.get("{type_text}", None), ) @@ -970,41 +967,41 @@ def as_dict(self) -> dict: """Serializes the CreateAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.rearm is not None: - body["rearm"] = self.rearm + body["{rearm}"] = self.rearm return body def as_shallow_dict(self) -> dict: """Serializes the CreateAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.rearm is not None: - body["rearm"] = self.rearm + body["{rearm}"] = self.rearm return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAlert: """Deserializes the CreateAlert from a dictionary.""" return cls( - name=d.get("name", None), - options=_from_dict(d, "options", AlertOptions), - parent=d.get("parent", None), - query_id=d.get("query_id", None), - rearm=d.get("rearm", None), + name=d.get("{name}", None), + options=_from_dict(d, "{options}", AlertOptions), + parent=d.get("{parent}", None), + query_id=d.get("{query_id}", None), + rearm=d.get("{rearm}", None), ) @@ -1016,20 +1013,20 @@ def as_dict(self) -> dict: """Serializes the CreateAlertRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert: - body["alert"] = self.alert.as_dict() + body["{alert}"] = self.alert.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateAlertRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.alert: - body["alert"] = self.alert + body["{alert}"] = self.alert return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAlertRequest: """Deserializes the CreateAlertRequest from a dictionary.""" - return cls(alert=_from_dict(d, "alert", CreateAlertRequestAlert)) + return cls(alert=_from_dict(d, "{alert}", CreateAlertRequestAlert)) @dataclass @@ -1068,56 +1065,56 @@ def as_dict(self) -> dict: """Serializes the CreateAlertRequestAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["condition"] = self.condition.as_dict() + body["{condition}"] = self.condition.as_dict() if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger return body def as_shallow_dict(self) -> dict: """Serializes the CreateAlertRequestAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["condition"] = self.condition + body["{condition}"] = self.condition if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAlertRequestAlert: """Deserializes the CreateAlertRequestAlert from a dictionary.""" return cls( - condition=_from_dict(d, "condition", AlertCondition), - custom_body=d.get("custom_body", None), - custom_subject=d.get("custom_subject", None), - display_name=d.get("display_name", None), - notify_on_ok=d.get("notify_on_ok", None), - parent_path=d.get("parent_path", None), - query_id=d.get("query_id", None), - seconds_to_retrigger=d.get("seconds_to_retrigger", None), + condition=_from_dict(d, "{condition}", AlertCondition), + custom_body=d.get("{custom_body}", None), + custom_subject=d.get("{custom_subject}", None), + display_name=d.get("{display_name}", None), + notify_on_ok=d.get("{notify_on_ok}", None), + parent_path=d.get("{parent_path}", None), + query_id=d.get("{query_id}", None), + seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), ) @@ -1129,20 +1126,20 @@ def as_dict(self) -> dict: """Serializes the CreateQueryRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.query: - body["query"] = self.query.as_dict() + body["{query}"] = self.query.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateQueryRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.query: - body["query"] = self.query + body["{query}"] = self.query return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateQueryRequest: """Deserializes the CreateQueryRequest from a dictionary.""" - return cls(query=_from_dict(d, "query", CreateQueryRequestQuery)) + return cls(query=_from_dict(d, "{query}", CreateQueryRequestQuery)) @dataclass @@ -1183,71 +1180,71 @@ def as_dict(self) -> dict: """Serializes the CreateQueryRequestQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode.value + body["{run_as_mode}"] = self.run_as_mode.value if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the CreateQueryRequestQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode + body["{run_as_mode}"] = self.run_as_mode if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateQueryRequestQuery: """Deserializes the CreateQueryRequestQuery from a dictionary.""" return cls( - apply_auto_limit=d.get("apply_auto_limit", None), - catalog=d.get("catalog", None), - description=d.get("description", None), - display_name=d.get("display_name", None), - parameters=_repeated_dict(d, "parameters", QueryParameter), - parent_path=d.get("parent_path", None), - query_text=d.get("query_text", None), - run_as_mode=_enum(d, "run_as_mode", RunAsMode), - schema=d.get("schema", None), - tags=d.get("tags", None), - warehouse_id=d.get("warehouse_id", None), + apply_auto_limit=d.get("{apply_auto_limit}", None), + catalog=d.get("{catalog}", None), + description=d.get("{description}", None), + display_name=d.get("{display_name}", None), + parameters=_repeated_dict(d, "{parameters}", QueryParameter), + parent_path=d.get("{parent_path}", None), + query_text=d.get("{query_text}", None), + run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), + schema=d.get("{schema}", None), + tags=d.get("{tags}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -1259,20 +1256,20 @@ def as_dict(self) -> dict: """Serializes the CreateVisualizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.visualization: - body["visualization"] = self.visualization.as_dict() + body["{visualization}"] = self.visualization.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateVisualizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.visualization: - body["visualization"] = self.visualization + body["{visualization}"] = self.visualization return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVisualizationRequest: """Deserializes the CreateVisualizationRequest from a dictionary.""" - return cls(visualization=_from_dict(d, "visualization", CreateVisualizationRequestVisualization)) + return cls(visualization=_from_dict(d, "{visualization}", CreateVisualizationRequestVisualization)) @dataclass @@ -1298,41 +1295,41 @@ def as_dict(self) -> dict: """Serializes the CreateVisualizationRequestVisualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.serialized_options is not None: - body["serialized_options"] = self.serialized_options + body["{serialized_options}"] = self.serialized_options if self.serialized_query_plan is not None: - body["serialized_query_plan"] = self.serialized_query_plan + body["{serialized_query_plan}"] = self.serialized_query_plan if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body def as_shallow_dict(self) -> dict: """Serializes the CreateVisualizationRequestVisualization into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.serialized_options is not None: - body["serialized_options"] = self.serialized_options + body["{serialized_options}"] = self.serialized_options if self.serialized_query_plan is not None: - body["serialized_query_plan"] = self.serialized_query_plan + body["{serialized_query_plan}"] = self.serialized_query_plan if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVisualizationRequestVisualization: """Deserializes the CreateVisualizationRequestVisualization from a dictionary.""" return cls( - display_name=d.get("display_name", None), - query_id=d.get("query_id", None), - serialized_options=d.get("serialized_options", None), - serialized_query_plan=d.get("serialized_query_plan", None), - type=d.get("type", None), + display_name=d.get("{display_name}", None), + query_id=d.get("{query_id}", None), + serialized_options=d.get("{serialized_options}", None), + serialized_query_plan=d.get("{serialized_query_plan}", None), + type=d.get("{type}", None), ) @@ -1411,81 +1408,81 @@ def as_dict(self) -> dict: """Serializes the CreateWarehouseRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel.as_dict() + body["{channel}"] = self.channel.as_dict() if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy.value + body["{spot_instance_policy}"] = self.spot_instance_policy.value if self.tags: - body["tags"] = self.tags.as_dict() + body["{tags}"] = self.tags.as_dict() if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type.value + body["{warehouse_type}"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: """Serializes the CreateWarehouseRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy + body["{spot_instance_policy}"] = self.spot_instance_policy if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type + body["{warehouse_type}"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseRequest: """Deserializes the CreateWarehouseRequest from a dictionary.""" return cls( - auto_stop_mins=d.get("auto_stop_mins", None), - channel=_from_dict(d, "channel", Channel), - cluster_size=d.get("cluster_size", None), - creator_name=d.get("creator_name", None), - enable_photon=d.get("enable_photon", None), - enable_serverless_compute=d.get("enable_serverless_compute", None), - instance_profile_arn=d.get("instance_profile_arn", None), - max_num_clusters=d.get("max_num_clusters", None), - min_num_clusters=d.get("min_num_clusters", None), - name=d.get("name", None), - spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), - tags=_from_dict(d, "tags", EndpointTags), - warehouse_type=_enum(d, "warehouse_type", CreateWarehouseRequestWarehouseType), + auto_stop_mins=d.get("{auto_stop_mins}", None), + channel=_from_dict(d, "{channel}", Channel), + cluster_size=d.get("{cluster_size}", None), + creator_name=d.get("{creator_name}", None), + enable_photon=d.get("{enable_photon}", None), + enable_serverless_compute=d.get("{enable_serverless_compute}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + max_num_clusters=d.get("{max_num_clusters}", None), + min_num_clusters=d.get("{min_num_clusters}", None), + name=d.get("{name}", None), + spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), + tags=_from_dict(d, "{tags}", EndpointTags), + warehouse_type=_enum(d, "{warehouse_type}", CreateWarehouseRequestWarehouseType), ) @@ -1507,20 +1504,20 @@ def as_dict(self) -> dict: """Serializes the CreateWarehouseResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body def as_shallow_dict(self) -> dict: """Serializes the CreateWarehouseResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseResponse: """Deserializes the CreateWarehouseResponse from a dictionary.""" - return cls(id=d.get("id", None)) + return cls(id=d.get("{id}", None)) @dataclass @@ -1547,46 +1544,46 @@ def as_dict(self) -> dict: """Serializes the CreateWidget into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.text is not None: - body["text"] = self.text + body["{text}"] = self.text if self.visualization_id is not None: - body["visualization_id"] = self.visualization_id + body["{visualization_id}"] = self.visualization_id if self.width is not None: - body["width"] = self.width + body["{width}"] = self.width return body def as_shallow_dict(self) -> dict: """Serializes the CreateWidget into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.text is not None: - body["text"] = self.text + body["{text}"] = self.text if self.visualization_id is not None: - body["visualization_id"] = self.visualization_id + body["{visualization_id}"] = self.visualization_id if self.width is not None: - body["width"] = self.width + body["{width}"] = self.width return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWidget: """Deserializes the CreateWidget from a dictionary.""" return cls( - dashboard_id=d.get("dashboard_id", None), - id=d.get("id", None), - options=_from_dict(d, "options", WidgetOptions), - text=d.get("text", None), - visualization_id=d.get("visualization_id", None), - width=d.get("width", None), + dashboard_id=d.get("{dashboard_id}", None), + id=d.get("{id}", None), + options=_from_dict(d, "{options}", WidgetOptions), + text=d.get("{text}", None), + visualization_id=d.get("{visualization_id}", None), + width=d.get("{width}", None), ) @@ -1651,101 +1648,101 @@ def as_dict(self) -> dict: """Serializes the Dashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.can_edit is not None: - body["can_edit"] = self.can_edit + body["{can_edit}"] = self.can_edit if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.dashboard_filters_enabled is not None: - body["dashboard_filters_enabled"] = self.dashboard_filters_enabled + body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_archived is not None: - body["is_archived"] = self.is_archived + body["{is_archived}"] = self.is_archived if self.is_draft is not None: - body["is_draft"] = self.is_draft + body["{is_draft}"] = self.is_draft if self.is_favorite is not None: - body["is_favorite"] = self.is_favorite + body["{is_favorite}"] = self.is_favorite if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.permission_tier is not None: - body["permission_tier"] = self.permission_tier.value + body["{permission_tier}"] = self.permission_tier.value if self.slug is not None: - body["slug"] = self.slug + body["{slug}"] = self.slug if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user: - body["user"] = self.user.as_dict() + body["{user}"] = self.user.as_dict() if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.widgets: - body["widgets"] = [v.as_dict() for v in self.widgets] + body["{widgets}"] = [v.as_dict() for v in self.widgets] return body def as_shallow_dict(self) -> dict: """Serializes the Dashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.can_edit is not None: - body["can_edit"] = self.can_edit + body["{can_edit}"] = self.can_edit if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.dashboard_filters_enabled is not None: - body["dashboard_filters_enabled"] = self.dashboard_filters_enabled + body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_archived is not None: - body["is_archived"] = self.is_archived + body["{is_archived}"] = self.is_archived if self.is_draft is not None: - body["is_draft"] = self.is_draft + body["{is_draft}"] = self.is_draft if self.is_favorite is not None: - body["is_favorite"] = self.is_favorite + body["{is_favorite}"] = self.is_favorite if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.permission_tier is not None: - body["permission_tier"] = self.permission_tier + body["{permission_tier}"] = self.permission_tier if self.slug is not None: - body["slug"] = self.slug + body["{slug}"] = self.slug if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user: - body["user"] = self.user + body["{user}"] = self.user if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.widgets: - body["widgets"] = self.widgets + body["{widgets}"] = self.widgets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dashboard: """Deserializes the Dashboard from a dictionary.""" return cls( - can_edit=d.get("can_edit", None), - created_at=d.get("created_at", None), - dashboard_filters_enabled=d.get("dashboard_filters_enabled", None), - id=d.get("id", None), - is_archived=d.get("is_archived", None), - is_draft=d.get("is_draft", None), - is_favorite=d.get("is_favorite", None), - name=d.get("name", None), - options=_from_dict(d, "options", DashboardOptions), - parent=d.get("parent", None), - permission_tier=_enum(d, "permission_tier", PermissionLevel), - slug=d.get("slug", None), - tags=d.get("tags", None), - updated_at=d.get("updated_at", None), - user=_from_dict(d, "user", User), - user_id=d.get("user_id", None), - widgets=_repeated_dict(d, "widgets", Widget), + can_edit=d.get("{can_edit}", None), + created_at=d.get("{created_at}", None), + dashboard_filters_enabled=d.get("{dashboard_filters_enabled}", None), + id=d.get("{id}", None), + is_archived=d.get("{is_archived}", None), + is_draft=d.get("{is_draft}", None), + is_favorite=d.get("{is_favorite}", None), + name=d.get("{name}", None), + options=_from_dict(d, "{options}", DashboardOptions), + parent=d.get("{parent}", None), + permission_tier=_enum(d, "{permission_tier}", PermissionLevel), + slug=d.get("{slug}", None), + tags=d.get("{tags}", None), + updated_at=d.get("{updated_at}", None), + user=_from_dict(d, "{user}", User), + user_id=d.get("{user_id}", None), + widgets=_repeated_dict(d, "{widgets}", Widget), ) @@ -1766,36 +1763,36 @@ def as_dict(self) -> dict: """Serializes the DashboardEditContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role.value + body["{run_as_role}"] = self.run_as_role.value if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the DashboardEditContent into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role + body["{run_as_role}"] = self.run_as_role if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DashboardEditContent: """Deserializes the DashboardEditContent from a dictionary.""" return cls( - dashboard_id=d.get("dashboard_id", None), - name=d.get("name", None), - run_as_role=_enum(d, "run_as_role", RunAsRole), - tags=d.get("tags", None), + dashboard_id=d.get("{dashboard_id}", None), + name=d.get("{name}", None), + run_as_role=_enum(d, "{run_as_role}", RunAsRole), + tags=d.get("{tags}", None), ) @@ -1809,20 +1806,20 @@ def as_dict(self) -> dict: """Serializes the DashboardOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.moved_to_trash_at is not None: - body["moved_to_trash_at"] = self.moved_to_trash_at + body["{moved_to_trash_at}"] = self.moved_to_trash_at return body def as_shallow_dict(self) -> dict: """Serializes the DashboardOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.moved_to_trash_at is not None: - body["moved_to_trash_at"] = self.moved_to_trash_at + body["{moved_to_trash_at}"] = self.moved_to_trash_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DashboardOptions: """Deserializes the DashboardOptions from a dictionary.""" - return cls(moved_to_trash_at=d.get("moved_to_trash_at", None)) + return cls(moved_to_trash_at=d.get("{moved_to_trash_at}", None)) @dataclass @@ -1849,46 +1846,46 @@ def as_dict(self) -> dict: """Serializes the DashboardPostContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_filters_enabled is not None: - body["dashboard_filters_enabled"] = self.dashboard_filters_enabled + body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled if self.is_favorite is not None: - body["is_favorite"] = self.is_favorite + body["{is_favorite}"] = self.is_favorite if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role.value + body["{run_as_role}"] = self.run_as_role.value if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the DashboardPostContent into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_filters_enabled is not None: - body["dashboard_filters_enabled"] = self.dashboard_filters_enabled + body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled if self.is_favorite is not None: - body["is_favorite"] = self.is_favorite + body["{is_favorite}"] = self.is_favorite if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role + body["{run_as_role}"] = self.run_as_role if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DashboardPostContent: """Deserializes the DashboardPostContent from a dictionary.""" return cls( - dashboard_filters_enabled=d.get("dashboard_filters_enabled", None), - is_favorite=d.get("is_favorite", None), - name=d.get("name", None), - parent=d.get("parent", None), - run_as_role=_enum(d, "run_as_role", RunAsRole), - tags=d.get("tags", None), + dashboard_filters_enabled=d.get("{dashboard_filters_enabled}", None), + is_favorite=d.get("{is_favorite}", None), + name=d.get("{name}", None), + parent=d.get("{parent}", None), + run_as_role=_enum(d, "{run_as_role}", RunAsRole), + tags=d.get("{tags}", None), ) @@ -1931,61 +1928,61 @@ def as_dict(self) -> dict: """Serializes the DataSource into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pause_reason is not None: - body["pause_reason"] = self.pause_reason + body["{pause_reason}"] = self.pause_reason if self.paused is not None: - body["paused"] = self.paused + body["{paused}"] = self.paused if self.supports_auto_limit is not None: - body["supports_auto_limit"] = self.supports_auto_limit + body["{supports_auto_limit}"] = self.supports_auto_limit if self.syntax is not None: - body["syntax"] = self.syntax + body["{syntax}"] = self.syntax if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.view_only is not None: - body["view_only"] = self.view_only + body["{view_only}"] = self.view_only if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the DataSource into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.pause_reason is not None: - body["pause_reason"] = self.pause_reason + body["{pause_reason}"] = self.pause_reason if self.paused is not None: - body["paused"] = self.paused + body["{paused}"] = self.paused if self.supports_auto_limit is not None: - body["supports_auto_limit"] = self.supports_auto_limit + body["{supports_auto_limit}"] = self.supports_auto_limit if self.syntax is not None: - body["syntax"] = self.syntax + body["{syntax}"] = self.syntax if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.view_only is not None: - body["view_only"] = self.view_only + body["{view_only}"] = self.view_only if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataSource: """Deserializes the DataSource from a dictionary.""" return cls( - id=d.get("id", None), - name=d.get("name", None), - pause_reason=d.get("pause_reason", None), - paused=d.get("paused", None), - supports_auto_limit=d.get("supports_auto_limit", None), - syntax=d.get("syntax", None), - type=d.get("type", None), - view_only=d.get("view_only", None), - warehouse_id=d.get("warehouse_id", None), + id=d.get("{id}", None), + name=d.get("{name}", None), + pause_reason=d.get("{pause_reason}", None), + paused=d.get("{paused}", None), + supports_auto_limit=d.get("{supports_auto_limit}", None), + syntax=d.get("{syntax}", None), + type=d.get("{type}", None), + view_only=d.get("{view_only}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -2006,24 +2003,24 @@ def as_dict(self) -> dict: """Serializes the DateRange into a dictionary suitable for use as a JSON request body.""" body = {} if self.end is not None: - body["end"] = self.end + body["{end}"] = self.end if self.start is not None: - body["start"] = self.start + body["{start}"] = self.start return body def as_shallow_dict(self) -> dict: """Serializes the DateRange into a shallow dictionary of its immediate attributes.""" body = {} if self.end is not None: - body["end"] = self.end + body["{end}"] = self.end if self.start is not None: - body["start"] = self.start + body["{start}"] = self.start return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DateRange: """Deserializes the DateRange from a dictionary.""" - return cls(end=d.get("end", None), start=d.get("start", None)) + return cls(end=d.get("{end}", None), start=d.get("{start}", None)) @dataclass @@ -2044,36 +2041,36 @@ def as_dict(self) -> dict: """Serializes the DateRangeValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.date_range_value: - body["date_range_value"] = self.date_range_value.as_dict() + body["{date_range_value}"] = self.date_range_value.as_dict() if self.dynamic_date_range_value is not None: - body["dynamic_date_range_value"] = self.dynamic_date_range_value.value + body["{dynamic_date_range_value}"] = self.dynamic_date_range_value.value if self.precision is not None: - body["precision"] = self.precision.value + body["{precision}"] = self.precision.value if self.start_day_of_week is not None: - body["start_day_of_week"] = self.start_day_of_week + body["{start_day_of_week}"] = self.start_day_of_week return body def as_shallow_dict(self) -> dict: """Serializes the DateRangeValue into a shallow dictionary of its immediate attributes.""" body = {} if self.date_range_value: - body["date_range_value"] = self.date_range_value + body["{date_range_value}"] = self.date_range_value if self.dynamic_date_range_value is not None: - body["dynamic_date_range_value"] = self.dynamic_date_range_value + body["{dynamic_date_range_value}"] = self.dynamic_date_range_value if self.precision is not None: - body["precision"] = self.precision + body["{precision}"] = self.precision if self.start_day_of_week is not None: - body["start_day_of_week"] = self.start_day_of_week + body["{start_day_of_week}"] = self.start_day_of_week return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DateRangeValue: """Deserializes the DateRangeValue from a dictionary.""" return cls( - date_range_value=_from_dict(d, "date_range_value", DateRange), - dynamic_date_range_value=_enum(d, "dynamic_date_range_value", DateRangeValueDynamicDateRange), - precision=_enum(d, "precision", DatePrecision), - start_day_of_week=d.get("start_day_of_week", None), + date_range_value=_from_dict(d, "{date_range_value}", DateRange), + dynamic_date_range_value=_enum(d, "{dynamic_date_range_value}", DateRangeValueDynamicDateRange), + precision=_enum(d, "{precision}", DatePrecision), + start_day_of_week=d.get("{start_day_of_week}", None), ) @@ -2114,31 +2111,31 @@ def as_dict(self) -> dict: """Serializes the DateValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.date_value is not None: - body["date_value"] = self.date_value + body["{date_value}"] = self.date_value if self.dynamic_date_value is not None: - body["dynamic_date_value"] = self.dynamic_date_value.value + body["{dynamic_date_value}"] = self.dynamic_date_value.value if self.precision is not None: - body["precision"] = self.precision.value + body["{precision}"] = self.precision.value return body def as_shallow_dict(self) -> dict: """Serializes the DateValue into a shallow dictionary of its immediate attributes.""" body = {} if self.date_value is not None: - body["date_value"] = self.date_value + body["{date_value}"] = self.date_value if self.dynamic_date_value is not None: - body["dynamic_date_value"] = self.dynamic_date_value + body["{dynamic_date_value}"] = self.dynamic_date_value if self.precision is not None: - body["precision"] = self.precision + body["{precision}"] = self.precision return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DateValue: """Deserializes the DateValue from a dictionary.""" return cls( - date_value=d.get("date_value", None), - dynamic_date_value=_enum(d, "dynamic_date_value", DateValueDynamicDate), - precision=_enum(d, "precision", DatePrecision), + date_value=d.get("{date_value}", None), + dynamic_date_value=_enum(d, "{dynamic_date_value}", DateValueDynamicDate), + precision=_enum(d, "{precision}", DatePrecision), ) @@ -2211,41 +2208,41 @@ def as_dict(self) -> dict: """Serializes the EditAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_id is not None: - body["alert_id"] = self.alert_id + body["{alert_id}"] = self.alert_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.rearm is not None: - body["rearm"] = self.rearm + body["{rearm}"] = self.rearm return body def as_shallow_dict(self) -> dict: """Serializes the EditAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_id is not None: - body["alert_id"] = self.alert_id + body["{alert_id}"] = self.alert_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.rearm is not None: - body["rearm"] = self.rearm + body["{rearm}"] = self.rearm return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditAlert: """Deserializes the EditAlert from a dictionary.""" return cls( - alert_id=d.get("alert_id", None), - name=d.get("name", None), - options=_from_dict(d, "options", AlertOptions), - query_id=d.get("query_id", None), - rearm=d.get("rearm", None), + alert_id=d.get("{alert_id}", None), + name=d.get("{name}", None), + options=_from_dict(d, "{options}", AlertOptions), + query_id=d.get("{query_id}", None), + rearm=d.get("{rearm}", None), ) @@ -2326,86 +2323,86 @@ def as_dict(self) -> dict: """Serializes the EditWarehouseRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel.as_dict() + body["{channel}"] = self.channel.as_dict() if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy.value + body["{spot_instance_policy}"] = self.spot_instance_policy.value if self.tags: - body["tags"] = self.tags.as_dict() + body["{tags}"] = self.tags.as_dict() if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type.value + body["{warehouse_type}"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: """Serializes the EditWarehouseRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy + body["{spot_instance_policy}"] = self.spot_instance_policy if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type + body["{warehouse_type}"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditWarehouseRequest: """Deserializes the EditWarehouseRequest from a dictionary.""" return cls( - auto_stop_mins=d.get("auto_stop_mins", None), - channel=_from_dict(d, "channel", Channel), - cluster_size=d.get("cluster_size", None), - creator_name=d.get("creator_name", None), - enable_photon=d.get("enable_photon", None), - enable_serverless_compute=d.get("enable_serverless_compute", None), - id=d.get("id", None), - instance_profile_arn=d.get("instance_profile_arn", None), - max_num_clusters=d.get("max_num_clusters", None), - min_num_clusters=d.get("min_num_clusters", None), - name=d.get("name", None), - spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), - tags=_from_dict(d, "tags", EndpointTags), - warehouse_type=_enum(d, "warehouse_type", EditWarehouseRequestWarehouseType), + auto_stop_mins=d.get("{auto_stop_mins}", None), + channel=_from_dict(d, "{channel}", Channel), + cluster_size=d.get("{cluster_size}", None), + creator_name=d.get("{creator_name}", None), + enable_photon=d.get("{enable_photon}", None), + enable_serverless_compute=d.get("{enable_serverless_compute}", None), + id=d.get("{id}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + max_num_clusters=d.get("{max_num_clusters}", None), + min_num_clusters=d.get("{min_num_clusters}", None), + name=d.get("{name}", None), + spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), + tags=_from_dict(d, "{tags}", EndpointTags), + warehouse_type=_enum(d, "{warehouse_type}", EditWarehouseRequestWarehouseType), ) @@ -2467,24 +2464,24 @@ def as_dict(self) -> dict: """Serializes the EndpointConfPair into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the EndpointConfPair into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointConfPair: """Deserializes the EndpointConfPair from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -2509,41 +2506,41 @@ def as_dict(self) -> dict: """Serializes the EndpointHealth into a dictionary suitable for use as a JSON request body.""" body = {} if self.details is not None: - body["details"] = self.details + body["{details}"] = self.details if self.failure_reason: - body["failure_reason"] = self.failure_reason.as_dict() + body["{failure_reason}"] = self.failure_reason.as_dict() if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.summary is not None: - body["summary"] = self.summary + body["{summary}"] = self.summary return body def as_shallow_dict(self) -> dict: """Serializes the EndpointHealth into a shallow dictionary of its immediate attributes.""" body = {} if self.details is not None: - body["details"] = self.details + body["{details}"] = self.details if self.failure_reason: - body["failure_reason"] = self.failure_reason + body["{failure_reason}"] = self.failure_reason if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.summary is not None: - body["summary"] = self.summary + body["{summary}"] = self.summary return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointHealth: """Deserializes the EndpointHealth from a dictionary.""" return cls( - details=d.get("details", None), - failure_reason=_from_dict(d, "failure_reason", TerminationReason), - message=d.get("message", None), - status=_enum(d, "status", Status), - summary=d.get("summary", None), + details=d.get("{details}", None), + failure_reason=_from_dict(d, "{failure_reason}", TerminationReason), + message=d.get("{message}", None), + status=_enum(d, "{status}", Status), + summary=d.get("{summary}", None), ) @@ -2642,116 +2639,116 @@ def as_dict(self) -> dict: """Serializes the EndpointInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel.as_dict() + body["{channel}"] = self.channel.as_dict() if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.health: - body["health"] = self.health.as_dict() + body["{health}"] = self.health.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.jdbc_url is not None: - body["jdbc_url"] = self.jdbc_url + body["{jdbc_url}"] = self.jdbc_url if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.num_active_sessions is not None: - body["num_active_sessions"] = self.num_active_sessions + body["{num_active_sessions}"] = self.num_active_sessions if self.num_clusters is not None: - body["num_clusters"] = self.num_clusters + body["{num_clusters}"] = self.num_clusters if self.odbc_params: - body["odbc_params"] = self.odbc_params.as_dict() + body["{odbc_params}"] = self.odbc_params.as_dict() if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy.value + body["{spot_instance_policy}"] = self.spot_instance_policy.value if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.tags: - body["tags"] = self.tags.as_dict() + body["{tags}"] = self.tags.as_dict() if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type.value + body["{warehouse_type}"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: """Serializes the EndpointInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.health: - body["health"] = self.health + body["{health}"] = self.health if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.jdbc_url is not None: - body["jdbc_url"] = self.jdbc_url + body["{jdbc_url}"] = self.jdbc_url if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.num_active_sessions is not None: - body["num_active_sessions"] = self.num_active_sessions + body["{num_active_sessions}"] = self.num_active_sessions if self.num_clusters is not None: - body["num_clusters"] = self.num_clusters + body["{num_clusters}"] = self.num_clusters if self.odbc_params: - body["odbc_params"] = self.odbc_params + body["{odbc_params}"] = self.odbc_params if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy + body["{spot_instance_policy}"] = self.spot_instance_policy if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type + body["{warehouse_type}"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointInfo: """Deserializes the EndpointInfo from a dictionary.""" return cls( - auto_stop_mins=d.get("auto_stop_mins", None), - channel=_from_dict(d, "channel", Channel), - cluster_size=d.get("cluster_size", None), - creator_name=d.get("creator_name", None), - enable_photon=d.get("enable_photon", None), - enable_serverless_compute=d.get("enable_serverless_compute", None), - health=_from_dict(d, "health", EndpointHealth), - id=d.get("id", None), - instance_profile_arn=d.get("instance_profile_arn", None), - jdbc_url=d.get("jdbc_url", None), - max_num_clusters=d.get("max_num_clusters", None), - min_num_clusters=d.get("min_num_clusters", None), - name=d.get("name", None), - num_active_sessions=d.get("num_active_sessions", None), - num_clusters=d.get("num_clusters", None), - odbc_params=_from_dict(d, "odbc_params", OdbcParams), - spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), - state=_enum(d, "state", State), - tags=_from_dict(d, "tags", EndpointTags), - warehouse_type=_enum(d, "warehouse_type", EndpointInfoWarehouseType), + auto_stop_mins=d.get("{auto_stop_mins}", None), + channel=_from_dict(d, "{channel}", Channel), + cluster_size=d.get("{cluster_size}", None), + creator_name=d.get("{creator_name}", None), + enable_photon=d.get("{enable_photon}", None), + enable_serverless_compute=d.get("{enable_serverless_compute}", None), + health=_from_dict(d, "{health}", EndpointHealth), + id=d.get("{id}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + jdbc_url=d.get("{jdbc_url}", None), + max_num_clusters=d.get("{max_num_clusters}", None), + min_num_clusters=d.get("{min_num_clusters}", None), + name=d.get("{name}", None), + num_active_sessions=d.get("{num_active_sessions}", None), + num_clusters=d.get("{num_clusters}", None), + odbc_params=_from_dict(d, "{odbc_params}", OdbcParams), + spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), + state=_enum(d, "{state}", State), + tags=_from_dict(d, "{tags}", EndpointTags), + warehouse_type=_enum(d, "{warehouse_type}", EndpointInfoWarehouseType), ) @@ -2774,24 +2771,24 @@ def as_dict(self) -> dict: """Serializes the EndpointTagPair into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the EndpointTagPair into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTagPair: """Deserializes the EndpointTagPair from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -2802,20 +2799,20 @@ def as_dict(self) -> dict: """Serializes the EndpointTags into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_tags: - body["custom_tags"] = [v.as_dict() for v in self.custom_tags] + body["{custom_tags}"] = [v.as_dict() for v in self.custom_tags] return body def as_shallow_dict(self) -> dict: """Serializes the EndpointTags into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_tags: - body["custom_tags"] = self.custom_tags + body["{custom_tags}"] = self.custom_tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTags: """Deserializes the EndpointTags from a dictionary.""" - return cls(custom_tags=_repeated_dict(d, "custom_tags", EndpointTagPair)) + return cls(custom_tags=_repeated_dict(d, "{custom_tags}", EndpointTagPair)) @dataclass @@ -2833,31 +2830,31 @@ def as_dict(self) -> dict: """Serializes the EnumValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.enum_options is not None: - body["enum_options"] = self.enum_options + body["{enum_options}"] = self.enum_options if self.multi_values_options: - body["multi_values_options"] = self.multi_values_options.as_dict() + body["{multi_values_options}"] = self.multi_values_options.as_dict() if self.values: - body["values"] = [v for v in self.values] + body["{values}"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the EnumValue into a shallow dictionary of its immediate attributes.""" body = {} if self.enum_options is not None: - body["enum_options"] = self.enum_options + body["{enum_options}"] = self.enum_options if self.multi_values_options: - body["multi_values_options"] = self.multi_values_options + body["{multi_values_options}"] = self.multi_values_options if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnumValue: """Deserializes the EnumValue from a dictionary.""" return cls( - enum_options=d.get("enum_options", None), - multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions), - values=d.get("values", None), + enum_options=d.get("{enum_options}", None), + multi_values_options=_from_dict(d, "{multi_values_options}", MultiValuesOptions), + values=d.get("{values}", None), ) @@ -2982,71 +2979,71 @@ def as_dict(self) -> dict: """Serializes the ExecuteStatementRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_limit is not None: - body["byte_limit"] = self.byte_limit + body["{byte_limit}"] = self.byte_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.disposition is not None: - body["disposition"] = self.disposition.value + body["{disposition}"] = self.disposition.value if self.format is not None: - body["format"] = self.format.value + body["{format}"] = self.format.value if self.on_wait_timeout is not None: - body["on_wait_timeout"] = self.on_wait_timeout.value + body["{on_wait_timeout}"] = self.on_wait_timeout.value if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.row_limit is not None: - body["row_limit"] = self.row_limit + body["{row_limit}"] = self.row_limit if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.statement is not None: - body["statement"] = self.statement + body["{statement}"] = self.statement if self.wait_timeout is not None: - body["wait_timeout"] = self.wait_timeout + body["{wait_timeout}"] = self.wait_timeout if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the ExecuteStatementRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_limit is not None: - body["byte_limit"] = self.byte_limit + body["{byte_limit}"] = self.byte_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.disposition is not None: - body["disposition"] = self.disposition + body["{disposition}"] = self.disposition if self.format is not None: - body["format"] = self.format + body["{format}"] = self.format if self.on_wait_timeout is not None: - body["on_wait_timeout"] = self.on_wait_timeout + body["{on_wait_timeout}"] = self.on_wait_timeout if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.row_limit is not None: - body["row_limit"] = self.row_limit + body["{row_limit}"] = self.row_limit if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.statement is not None: - body["statement"] = self.statement + body["{statement}"] = self.statement if self.wait_timeout is not None: - body["wait_timeout"] = self.wait_timeout + body["{wait_timeout}"] = self.wait_timeout if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExecuteStatementRequest: """Deserializes the ExecuteStatementRequest from a dictionary.""" return cls( - byte_limit=d.get("byte_limit", None), - catalog=d.get("catalog", None), - disposition=_enum(d, "disposition", Disposition), - format=_enum(d, "format", Format), - on_wait_timeout=_enum(d, "on_wait_timeout", ExecuteStatementRequestOnWaitTimeout), - parameters=_repeated_dict(d, "parameters", StatementParameterListItem), - row_limit=d.get("row_limit", None), - schema=d.get("schema", None), - statement=d.get("statement", None), - wait_timeout=d.get("wait_timeout", None), - warehouse_id=d.get("warehouse_id", None), + byte_limit=d.get("{byte_limit}", None), + catalog=d.get("{catalog}", None), + disposition=_enum(d, "{disposition}", Disposition), + format=_enum(d, "{format}", Format), + on_wait_timeout=_enum(d, "{on_wait_timeout}", ExecuteStatementRequestOnWaitTimeout), + parameters=_repeated_dict(d, "{parameters}", StatementParameterListItem), + row_limit=d.get("{row_limit}", None), + schema=d.get("{schema}", None), + statement=d.get("{statement}", None), + wait_timeout=d.get("{wait_timeout}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -3103,61 +3100,61 @@ def as_dict(self) -> dict: """Serializes the ExternalLink into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.expiration is not None: - body["expiration"] = self.expiration + body["{expiration}"] = self.expiration if self.external_link is not None: - body["external_link"] = self.external_link + body["{external_link}"] = self.external_link if self.http_headers: - body["http_headers"] = self.http_headers + body["{http_headers}"] = self.http_headers if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body def as_shallow_dict(self) -> dict: """Serializes the ExternalLink into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.expiration is not None: - body["expiration"] = self.expiration + body["{expiration}"] = self.expiration if self.external_link is not None: - body["external_link"] = self.external_link + body["{external_link}"] = self.external_link if self.http_headers: - body["http_headers"] = self.http_headers + body["{http_headers}"] = self.http_headers if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalLink: """Deserializes the ExternalLink from a dictionary.""" return cls( - byte_count=d.get("byte_count", None), - chunk_index=d.get("chunk_index", None), - expiration=d.get("expiration", None), - external_link=d.get("external_link", None), - http_headers=d.get("http_headers", None), - next_chunk_index=d.get("next_chunk_index", None), - next_chunk_internal_link=d.get("next_chunk_internal_link", None), - row_count=d.get("row_count", None), - row_offset=d.get("row_offset", None), + byte_count=d.get("{byte_count}", None), + chunk_index=d.get("{chunk_index}", None), + expiration=d.get("{expiration}", None), + external_link=d.get("{external_link}", None), + http_headers=d.get("{http_headers}", None), + next_chunk_index=d.get("{next_chunk_index}", None), + next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), + row_count=d.get("{row_count}", None), + row_offset=d.get("{row_offset}", None), ) @@ -3187,51 +3184,51 @@ def as_dict(self) -> dict: """Serializes the ExternalQuerySource into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_id is not None: - body["alert_id"] = self.alert_id + body["{alert_id}"] = self.alert_id if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.genie_space_id is not None: - body["genie_space_id"] = self.genie_space_id + body["{genie_space_id}"] = self.genie_space_id if self.job_info: - body["job_info"] = self.job_info.as_dict() + body["{job_info}"] = self.job_info.as_dict() if self.legacy_dashboard_id is not None: - body["legacy_dashboard_id"] = self.legacy_dashboard_id + body["{legacy_dashboard_id}"] = self.legacy_dashboard_id if self.notebook_id is not None: - body["notebook_id"] = self.notebook_id + body["{notebook_id}"] = self.notebook_id if self.sql_query_id is not None: - body["sql_query_id"] = self.sql_query_id + body["{sql_query_id}"] = self.sql_query_id return body def as_shallow_dict(self) -> dict: """Serializes the ExternalQuerySource into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_id is not None: - body["alert_id"] = self.alert_id + body["{alert_id}"] = self.alert_id if self.dashboard_id is not None: - body["dashboard_id"] = self.dashboard_id + body["{dashboard_id}"] = self.dashboard_id if self.genie_space_id is not None: - body["genie_space_id"] = self.genie_space_id + body["{genie_space_id}"] = self.genie_space_id if self.job_info: - body["job_info"] = self.job_info + body["{job_info}"] = self.job_info if self.legacy_dashboard_id is not None: - body["legacy_dashboard_id"] = self.legacy_dashboard_id + body["{legacy_dashboard_id}"] = self.legacy_dashboard_id if self.notebook_id is not None: - body["notebook_id"] = self.notebook_id + body["{notebook_id}"] = self.notebook_id if self.sql_query_id is not None: - body["sql_query_id"] = self.sql_query_id + body["{sql_query_id}"] = self.sql_query_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalQuerySource: """Deserializes the ExternalQuerySource from a dictionary.""" return cls( - alert_id=d.get("alert_id", None), - dashboard_id=d.get("dashboard_id", None), - genie_space_id=d.get("genie_space_id", None), - job_info=_from_dict(d, "job_info", ExternalQuerySourceJobInfo), - legacy_dashboard_id=d.get("legacy_dashboard_id", None), - notebook_id=d.get("notebook_id", None), - sql_query_id=d.get("sql_query_id", None), + alert_id=d.get("{alert_id}", None), + dashboard_id=d.get("{dashboard_id}", None), + genie_space_id=d.get("{genie_space_id}", None), + job_info=_from_dict(d, "{job_info}", ExternalQuerySourceJobInfo), + legacy_dashboard_id=d.get("{legacy_dashboard_id}", None), + notebook_id=d.get("{notebook_id}", None), + sql_query_id=d.get("{sql_query_id}", None), ) @@ -3250,31 +3247,31 @@ def as_dict(self) -> dict: """Serializes the ExternalQuerySourceJobInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_run_id is not None: - body["job_run_id"] = self.job_run_id + body["{job_run_id}"] = self.job_run_id if self.job_task_run_id is not None: - body["job_task_run_id"] = self.job_task_run_id + body["{job_task_run_id}"] = self.job_task_run_id return body def as_shallow_dict(self) -> dict: """Serializes the ExternalQuerySourceJobInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["job_id"] = self.job_id + body["{job_id}"] = self.job_id if self.job_run_id is not None: - body["job_run_id"] = self.job_run_id + body["{job_run_id}"] = self.job_run_id if self.job_task_run_id is not None: - body["job_task_run_id"] = self.job_task_run_id + body["{job_task_run_id}"] = self.job_task_run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalQuerySourceJobInfo: """Deserializes the ExternalQuerySourceJobInfo from a dictionary.""" return cls( - job_id=d.get("job_id", None), - job_run_id=d.get("job_run_id", None), - job_task_run_id=d.get("job_task_run_id", None), + job_id=d.get("{job_id}", None), + job_run_id=d.get("{job_run_id}", None), + job_task_run_id=d.get("{job_task_run_id}", None), ) @@ -3299,31 +3296,31 @@ def as_dict(self) -> dict: """Serializes the GetResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type.value + body["{object_type}"] = self.object_type.value return body def as_shallow_dict(self) -> dict: """Serializes the GetResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetResponse: """Deserializes the GetResponse from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", AccessControl), - object_id=d.get("object_id", None), - object_type=_enum(d, "object_type", ObjectType), + access_control_list=_repeated_dict(d, "{access_control_list}", AccessControl), + object_id=d.get("{object_id}", None), + object_type=_enum(d, "{object_type}", ObjectType), ) @@ -3336,20 +3333,20 @@ def as_dict(self) -> dict: """Serializes the GetWarehousePermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetWarehousePermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWarehousePermissionLevelsResponse: """Deserializes the GetWarehousePermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", WarehousePermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", WarehousePermissionsDescription)) @dataclass @@ -3447,116 +3444,116 @@ def as_dict(self) -> dict: """Serializes the GetWarehouseResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel.as_dict() + body["{channel}"] = self.channel.as_dict() if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.health: - body["health"] = self.health.as_dict() + body["{health}"] = self.health.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.jdbc_url is not None: - body["jdbc_url"] = self.jdbc_url + body["{jdbc_url}"] = self.jdbc_url if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.num_active_sessions is not None: - body["num_active_sessions"] = self.num_active_sessions + body["{num_active_sessions}"] = self.num_active_sessions if self.num_clusters is not None: - body["num_clusters"] = self.num_clusters + body["{num_clusters}"] = self.num_clusters if self.odbc_params: - body["odbc_params"] = self.odbc_params.as_dict() + body["{odbc_params}"] = self.odbc_params.as_dict() if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy.value + body["{spot_instance_policy}"] = self.spot_instance_policy.value if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.tags: - body["tags"] = self.tags.as_dict() + body["{tags}"] = self.tags.as_dict() if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type.value + body["{warehouse_type}"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: """Serializes the GetWarehouseResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["auto_stop_mins"] = self.auto_stop_mins + body["{auto_stop_mins}"] = self.auto_stop_mins if self.channel: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.cluster_size is not None: - body["cluster_size"] = self.cluster_size + body["{cluster_size}"] = self.cluster_size if self.creator_name is not None: - body["creator_name"] = self.creator_name + body["{creator_name}"] = self.creator_name if self.enable_photon is not None: - body["enable_photon"] = self.enable_photon + body["{enable_photon}"] = self.enable_photon if self.enable_serverless_compute is not None: - body["enable_serverless_compute"] = self.enable_serverless_compute + body["{enable_serverless_compute}"] = self.enable_serverless_compute if self.health: - body["health"] = self.health + body["{health}"] = self.health if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.jdbc_url is not None: - body["jdbc_url"] = self.jdbc_url + body["{jdbc_url}"] = self.jdbc_url if self.max_num_clusters is not None: - body["max_num_clusters"] = self.max_num_clusters + body["{max_num_clusters}"] = self.max_num_clusters if self.min_num_clusters is not None: - body["min_num_clusters"] = self.min_num_clusters + body["{min_num_clusters}"] = self.min_num_clusters if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.num_active_sessions is not None: - body["num_active_sessions"] = self.num_active_sessions + body["{num_active_sessions}"] = self.num_active_sessions if self.num_clusters is not None: - body["num_clusters"] = self.num_clusters + body["{num_clusters}"] = self.num_clusters if self.odbc_params: - body["odbc_params"] = self.odbc_params + body["{odbc_params}"] = self.odbc_params if self.spot_instance_policy is not None: - body["spot_instance_policy"] = self.spot_instance_policy + body["{spot_instance_policy}"] = self.spot_instance_policy if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type + body["{warehouse_type}"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWarehouseResponse: """Deserializes the GetWarehouseResponse from a dictionary.""" return cls( - auto_stop_mins=d.get("auto_stop_mins", None), - channel=_from_dict(d, "channel", Channel), - cluster_size=d.get("cluster_size", None), - creator_name=d.get("creator_name", None), - enable_photon=d.get("enable_photon", None), - enable_serverless_compute=d.get("enable_serverless_compute", None), - health=_from_dict(d, "health", EndpointHealth), - id=d.get("id", None), - instance_profile_arn=d.get("instance_profile_arn", None), - jdbc_url=d.get("jdbc_url", None), - max_num_clusters=d.get("max_num_clusters", None), - min_num_clusters=d.get("min_num_clusters", None), - name=d.get("name", None), - num_active_sessions=d.get("num_active_sessions", None), - num_clusters=d.get("num_clusters", None), - odbc_params=_from_dict(d, "odbc_params", OdbcParams), - spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), - state=_enum(d, "state", State), - tags=_from_dict(d, "tags", EndpointTags), - warehouse_type=_enum(d, "warehouse_type", GetWarehouseResponseWarehouseType), + auto_stop_mins=d.get("{auto_stop_mins}", None), + channel=_from_dict(d, "{channel}", Channel), + cluster_size=d.get("{cluster_size}", None), + creator_name=d.get("{creator_name}", None), + enable_photon=d.get("{enable_photon}", None), + enable_serverless_compute=d.get("{enable_serverless_compute}", None), + health=_from_dict(d, "{health}", EndpointHealth), + id=d.get("{id}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + jdbc_url=d.get("{jdbc_url}", None), + max_num_clusters=d.get("{max_num_clusters}", None), + min_num_clusters=d.get("{min_num_clusters}", None), + name=d.get("{name}", None), + num_active_sessions=d.get("{num_active_sessions}", None), + num_clusters=d.get("{num_clusters}", None), + odbc_params=_from_dict(d, "{odbc_params}", OdbcParams), + spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), + state=_enum(d, "{state}", State), + tags=_from_dict(d, "{tags}", EndpointTags), + warehouse_type=_enum(d, "{warehouse_type}", GetWarehouseResponseWarehouseType), ) @@ -3607,61 +3604,61 @@ def as_dict(self) -> dict: """Serializes the GetWorkspaceWarehouseConfigResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.channel: - body["channel"] = self.channel.as_dict() + body["{channel}"] = self.channel.as_dict() if self.config_param: - body["config_param"] = self.config_param.as_dict() + body["{config_param}"] = self.config_param.as_dict() if self.data_access_config: - body["data_access_config"] = [v.as_dict() for v in self.data_access_config] + body["{data_access_config}"] = [v.as_dict() for v in self.data_access_config] if self.enabled_warehouse_types: - body["enabled_warehouse_types"] = [v.as_dict() for v in self.enabled_warehouse_types] + body["{enabled_warehouse_types}"] = [v.as_dict() for v in self.enabled_warehouse_types] if self.global_param: - body["global_param"] = self.global_param.as_dict() + body["{global_param}"] = self.global_param.as_dict() if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.security_policy is not None: - body["security_policy"] = self.security_policy.value + body["{security_policy}"] = self.security_policy.value if self.sql_configuration_parameters: - body["sql_configuration_parameters"] = self.sql_configuration_parameters.as_dict() + body["{sql_configuration_parameters}"] = self.sql_configuration_parameters.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the GetWorkspaceWarehouseConfigResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.channel: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.config_param: - body["config_param"] = self.config_param + body["{config_param}"] = self.config_param if self.data_access_config: - body["data_access_config"] = self.data_access_config + body["{data_access_config}"] = self.data_access_config if self.enabled_warehouse_types: - body["enabled_warehouse_types"] = self.enabled_warehouse_types + body["{enabled_warehouse_types}"] = self.enabled_warehouse_types if self.global_param: - body["global_param"] = self.global_param + body["{global_param}"] = self.global_param if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.security_policy is not None: - body["security_policy"] = self.security_policy + body["{security_policy}"] = self.security_policy if self.sql_configuration_parameters: - body["sql_configuration_parameters"] = self.sql_configuration_parameters + body["{sql_configuration_parameters}"] = self.sql_configuration_parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWorkspaceWarehouseConfigResponse: """Deserializes the GetWorkspaceWarehouseConfigResponse from a dictionary.""" return cls( - channel=_from_dict(d, "channel", Channel), - config_param=_from_dict(d, "config_param", RepeatedEndpointConfPairs), - data_access_config=_repeated_dict(d, "data_access_config", EndpointConfPair), - enabled_warehouse_types=_repeated_dict(d, "enabled_warehouse_types", WarehouseTypePair), - global_param=_from_dict(d, "global_param", RepeatedEndpointConfPairs), - google_service_account=d.get("google_service_account", None), - instance_profile_arn=d.get("instance_profile_arn", None), - security_policy=_enum(d, "security_policy", GetWorkspaceWarehouseConfigResponseSecurityPolicy), - sql_configuration_parameters=_from_dict(d, "sql_configuration_parameters", RepeatedEndpointConfPairs), + channel=_from_dict(d, "{channel}", Channel), + config_param=_from_dict(d, "{config_param}", RepeatedEndpointConfPairs), + data_access_config=_repeated_dict(d, "{data_access_config}", EndpointConfPair), + enabled_warehouse_types=_repeated_dict(d, "{enabled_warehouse_types}", WarehouseTypePair), + global_param=_from_dict(d, "{global_param}", RepeatedEndpointConfPairs), + google_service_account=d.get("{google_service_account}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + security_policy=_enum(d, "{security_policy}", GetWorkspaceWarehouseConfigResponseSecurityPolicy), + sql_configuration_parameters=_from_dict(d, "{sql_configuration_parameters}", RepeatedEndpointConfPairs), ) @@ -3712,71 +3709,71 @@ def as_dict(self) -> dict: """Serializes the LegacyAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_triggered_at is not None: - body["last_triggered_at"] = self.last_triggered_at + body["{last_triggered_at}"] = self.last_triggered_at if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.query: - body["query"] = self.query.as_dict() + body["{query}"] = self.query.as_dict() if self.rearm is not None: - body["rearm"] = self.rearm + body["{rearm}"] = self.rearm if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user: - body["user"] = self.user.as_dict() + body["{user}"] = self.user.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the LegacyAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_triggered_at is not None: - body["last_triggered_at"] = self.last_triggered_at + body["{last_triggered_at}"] = self.last_triggered_at if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.query: - body["query"] = self.query + body["{query}"] = self.query if self.rearm is not None: - body["rearm"] = self.rearm + body["{rearm}"] = self.rearm if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user: - body["user"] = self.user + body["{user}"] = self.user return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LegacyAlert: """Deserializes the LegacyAlert from a dictionary.""" return cls( - created_at=d.get("created_at", None), - id=d.get("id", None), - last_triggered_at=d.get("last_triggered_at", None), - name=d.get("name", None), - options=_from_dict(d, "options", AlertOptions), - parent=d.get("parent", None), - query=_from_dict(d, "query", AlertQuery), - rearm=d.get("rearm", None), - state=_enum(d, "state", LegacyAlertState), - updated_at=d.get("updated_at", None), - user=_from_dict(d, "user", User), + created_at=d.get("{created_at}", None), + id=d.get("{id}", None), + last_triggered_at=d.get("{last_triggered_at}", None), + name=d.get("{name}", None), + options=_from_dict(d, "{options}", AlertOptions), + parent=d.get("{parent}", None), + query=_from_dict(d, "{query}", AlertQuery), + rearm=d.get("{rearm}", None), + state=_enum(d, "{state}", LegacyAlertState), + updated_at=d.get("{updated_at}", None), + user=_from_dict(d, "{user}", User), ) @@ -3874,136 +3871,136 @@ def as_dict(self) -> dict: """Serializes the LegacyQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.can_edit is not None: - body["can_edit"] = self.can_edit + body["{can_edit}"] = self.can_edit if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_archived is not None: - body["is_archived"] = self.is_archived + body["{is_archived}"] = self.is_archived if self.is_draft is not None: - body["is_draft"] = self.is_draft + body["{is_draft}"] = self.is_draft if self.is_favorite is not None: - body["is_favorite"] = self.is_favorite + body["{is_favorite}"] = self.is_favorite if self.is_safe is not None: - body["is_safe"] = self.is_safe + body["{is_safe}"] = self.is_safe if self.last_modified_by: - body["last_modified_by"] = self.last_modified_by.as_dict() + body["{last_modified_by}"] = self.last_modified_by.as_dict() if self.last_modified_by_id is not None: - body["last_modified_by_id"] = self.last_modified_by_id + body["{last_modified_by_id}"] = self.last_modified_by_id if self.latest_query_data_id is not None: - body["latest_query_data_id"] = self.latest_query_data_id + body["{latest_query_data_id}"] = self.latest_query_data_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.permission_tier is not None: - body["permission_tier"] = self.permission_tier.value + body["{permission_tier}"] = self.permission_tier.value if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.query_hash is not None: - body["query_hash"] = self.query_hash + body["{query_hash}"] = self.query_hash if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role.value + body["{run_as_role}"] = self.run_as_role.value if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user: - body["user"] = self.user.as_dict() + body["{user}"] = self.user.as_dict() if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.visualizations: - body["visualizations"] = [v.as_dict() for v in self.visualizations] + body["{visualizations}"] = [v.as_dict() for v in self.visualizations] return body def as_shallow_dict(self) -> dict: """Serializes the LegacyQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.can_edit is not None: - body["can_edit"] = self.can_edit + body["{can_edit}"] = self.can_edit if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.is_archived is not None: - body["is_archived"] = self.is_archived + body["{is_archived}"] = self.is_archived if self.is_draft is not None: - body["is_draft"] = self.is_draft + body["{is_draft}"] = self.is_draft if self.is_favorite is not None: - body["is_favorite"] = self.is_favorite + body["{is_favorite}"] = self.is_favorite if self.is_safe is not None: - body["is_safe"] = self.is_safe + body["{is_safe}"] = self.is_safe if self.last_modified_by: - body["last_modified_by"] = self.last_modified_by + body["{last_modified_by}"] = self.last_modified_by if self.last_modified_by_id is not None: - body["last_modified_by_id"] = self.last_modified_by_id + body["{last_modified_by_id}"] = self.last_modified_by_id if self.latest_query_data_id is not None: - body["latest_query_data_id"] = self.latest_query_data_id + body["{latest_query_data_id}"] = self.latest_query_data_id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.permission_tier is not None: - body["permission_tier"] = self.permission_tier + body["{permission_tier}"] = self.permission_tier if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.query_hash is not None: - body["query_hash"] = self.query_hash + body["{query_hash}"] = self.query_hash if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role + body["{run_as_role}"] = self.run_as_role if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at if self.user: - body["user"] = self.user + body["{user}"] = self.user if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.visualizations: - body["visualizations"] = self.visualizations + body["{visualizations}"] = self.visualizations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LegacyQuery: """Deserializes the LegacyQuery from a dictionary.""" return cls( - can_edit=d.get("can_edit", None), - created_at=d.get("created_at", None), - data_source_id=d.get("data_source_id", None), - description=d.get("description", None), - id=d.get("id", None), - is_archived=d.get("is_archived", None), - is_draft=d.get("is_draft", None), - is_favorite=d.get("is_favorite", None), - is_safe=d.get("is_safe", None), - last_modified_by=_from_dict(d, "last_modified_by", User), - last_modified_by_id=d.get("last_modified_by_id", None), - latest_query_data_id=d.get("latest_query_data_id", None), - name=d.get("name", None), - options=_from_dict(d, "options", QueryOptions), - parent=d.get("parent", None), - permission_tier=_enum(d, "permission_tier", PermissionLevel), - query=d.get("query", None), - query_hash=d.get("query_hash", None), - run_as_role=_enum(d, "run_as_role", RunAsRole), - tags=d.get("tags", None), - updated_at=d.get("updated_at", None), - user=_from_dict(d, "user", User), - user_id=d.get("user_id", None), - visualizations=_repeated_dict(d, "visualizations", LegacyVisualization), + can_edit=d.get("{can_edit}", None), + created_at=d.get("{created_at}", None), + data_source_id=d.get("{data_source_id}", None), + description=d.get("{description}", None), + id=d.get("{id}", None), + is_archived=d.get("{is_archived}", None), + is_draft=d.get("{is_draft}", None), + is_favorite=d.get("{is_favorite}", None), + is_safe=d.get("{is_safe}", None), + last_modified_by=_from_dict(d, "{last_modified_by}", User), + last_modified_by_id=d.get("{last_modified_by_id}", None), + latest_query_data_id=d.get("{latest_query_data_id}", None), + name=d.get("{name}", None), + options=_from_dict(d, "{options}", QueryOptions), + parent=d.get("{parent}", None), + permission_tier=_enum(d, "{permission_tier}", PermissionLevel), + query=d.get("{query}", None), + query_hash=d.get("{query_hash}", None), + run_as_role=_enum(d, "{run_as_role}", RunAsRole), + tags=d.get("{tags}", None), + updated_at=d.get("{updated_at}", None), + user=_from_dict(d, "{user}", User), + user_id=d.get("{user_id}", None), + visualizations=_repeated_dict(d, "{visualizations}", LegacyVisualization), ) @@ -4040,56 +4037,56 @@ def as_dict(self) -> dict: """Serializes the LegacyVisualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.query: - body["query"] = self.query.as_dict() + body["{query}"] = self.query.as_dict() if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body def as_shallow_dict(self) -> dict: """Serializes the LegacyVisualization into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.query: - body["query"] = self.query + body["{query}"] = self.query if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LegacyVisualization: """Deserializes the LegacyVisualization from a dictionary.""" return cls( - created_at=d.get("created_at", None), - description=d.get("description", None), - id=d.get("id", None), - name=d.get("name", None), - options=d.get("options", None), - query=_from_dict(d, "query", LegacyQuery), - type=d.get("type", None), - updated_at=d.get("updated_at", None), + created_at=d.get("{created_at}", None), + description=d.get("{description}", None), + id=d.get("{id}", None), + name=d.get("{name}", None), + options=d.get("{options}", None), + query=_from_dict(d, "{query}", LegacyQuery), + type=d.get("{type}", None), + updated_at=d.get("{updated_at}", None), ) @@ -4109,26 +4106,26 @@ def as_dict(self) -> dict: """Serializes the ListAlertsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the ListAlertsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAlertsResponse: """Deserializes the ListAlertsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - results=_repeated_dict(d, "results", ListAlertsResponseAlert), + next_page_token=d.get("{next_page_token}", None), + results=_repeated_dict(d, "{results}", ListAlertsResponseAlert), ) @@ -4187,86 +4184,86 @@ def as_dict(self) -> dict: """Serializes the ListAlertsResponseAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["condition"] = self.condition.as_dict() + body["{condition}"] = self.condition.as_dict() if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state.value + body["{lifecycle_state}"] = self.lifecycle_state.value if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value if self.trigger_time is not None: - body["trigger_time"] = self.trigger_time + body["{trigger_time}"] = self.trigger_time if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the ListAlertsResponseAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["condition"] = self.condition + body["{condition}"] = self.condition if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state + body["{lifecycle_state}"] = self.lifecycle_state if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state if self.trigger_time is not None: - body["trigger_time"] = self.trigger_time + body["{trigger_time}"] = self.trigger_time if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAlertsResponseAlert: """Deserializes the ListAlertsResponseAlert from a dictionary.""" return cls( - condition=_from_dict(d, "condition", AlertCondition), - create_time=d.get("create_time", None), - custom_body=d.get("custom_body", None), - custom_subject=d.get("custom_subject", None), - display_name=d.get("display_name", None), - id=d.get("id", None), - lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), - notify_on_ok=d.get("notify_on_ok", None), - owner_user_name=d.get("owner_user_name", None), - query_id=d.get("query_id", None), - seconds_to_retrigger=d.get("seconds_to_retrigger", None), - state=_enum(d, "state", AlertState), - trigger_time=d.get("trigger_time", None), - update_time=d.get("update_time", None), + condition=_from_dict(d, "{condition}", AlertCondition), + create_time=d.get("{create_time}", None), + custom_body=d.get("{custom_body}", None), + custom_subject=d.get("{custom_subject}", None), + display_name=d.get("{display_name}", None), + id=d.get("{id}", None), + lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), + notify_on_ok=d.get("{notify_on_ok}", None), + owner_user_name=d.get("{owner_user_name}", None), + query_id=d.get("{query_id}", None), + seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), + state=_enum(d, "{state}", AlertState), + trigger_time=d.get("{trigger_time}", None), + update_time=d.get("{update_time}", None), ) @@ -4290,31 +4287,31 @@ def as_dict(self) -> dict: """Serializes the ListQueriesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_next_page is not None: - body["has_next_page"] = self.has_next_page + body["{has_next_page}"] = self.has_next_page if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.res: - body["res"] = [v.as_dict() for v in self.res] + body["{res}"] = [v.as_dict() for v in self.res] return body def as_shallow_dict(self) -> dict: """Serializes the ListQueriesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_next_page is not None: - body["has_next_page"] = self.has_next_page + body["{has_next_page}"] = self.has_next_page if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.res: - body["res"] = self.res + body["{res}"] = self.res return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQueriesResponse: """Deserializes the ListQueriesResponse from a dictionary.""" return cls( - has_next_page=d.get("has_next_page", None), - next_page_token=d.get("next_page_token", None), - res=_repeated_dict(d, "res", QueryInfo), + has_next_page=d.get("{has_next_page}", None), + next_page_token=d.get("{next_page_token}", None), + res=_repeated_dict(d, "{res}", QueryInfo), ) @@ -4328,26 +4325,26 @@ def as_dict(self) -> dict: """Serializes the ListQueryObjectsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the ListQueryObjectsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQueryObjectsResponse: """Deserializes the ListQueryObjectsResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - results=_repeated_dict(d, "results", ListQueryObjectsResponseQuery), + next_page_token=d.get("{next_page_token}", None), + results=_repeated_dict(d, "{results}", ListQueryObjectsResponseQuery), ) @@ -4404,96 +4401,96 @@ def as_dict(self) -> dict: """Serializes the ListQueryObjectsResponseQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_modifier_user_name is not None: - body["last_modifier_user_name"] = self.last_modifier_user_name + body["{last_modifier_user_name}"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state.value + body["{lifecycle_state}"] = self.lifecycle_state.value if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode.value + body["{run_as_mode}"] = self.run_as_mode.value if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the ListQueryObjectsResponseQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_modifier_user_name is not None: - body["last_modifier_user_name"] = self.last_modifier_user_name + body["{last_modifier_user_name}"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state + body["{lifecycle_state}"] = self.lifecycle_state if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode + body["{run_as_mode}"] = self.run_as_mode if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQueryObjectsResponseQuery: """Deserializes the ListQueryObjectsResponseQuery from a dictionary.""" return cls( - apply_auto_limit=d.get("apply_auto_limit", None), - catalog=d.get("catalog", None), - create_time=d.get("create_time", None), - description=d.get("description", None), - display_name=d.get("display_name", None), - id=d.get("id", None), - last_modifier_user_name=d.get("last_modifier_user_name", None), - lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), - owner_user_name=d.get("owner_user_name", None), - parameters=_repeated_dict(d, "parameters", QueryParameter), - query_text=d.get("query_text", None), - run_as_mode=_enum(d, "run_as_mode", RunAsMode), - schema=d.get("schema", None), - tags=d.get("tags", None), - update_time=d.get("update_time", None), - warehouse_id=d.get("warehouse_id", None), + apply_auto_limit=d.get("{apply_auto_limit}", None), + catalog=d.get("{catalog}", None), + create_time=d.get("{create_time}", None), + description=d.get("{description}", None), + display_name=d.get("{display_name}", None), + id=d.get("{id}", None), + last_modifier_user_name=d.get("{last_modifier_user_name}", None), + lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), + owner_user_name=d.get("{owner_user_name}", None), + parameters=_repeated_dict(d, "{parameters}", QueryParameter), + query_text=d.get("{query_text}", None), + run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), + schema=d.get("{schema}", None), + tags=d.get("{tags}", None), + update_time=d.get("{update_time}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -4515,36 +4512,36 @@ def as_dict(self) -> dict: """Serializes the ListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.count is not None: - body["count"] = self.count + body["{count}"] = self.count if self.page is not None: - body["page"] = self.page + body["{page}"] = self.page if self.page_size is not None: - body["page_size"] = self.page_size + body["{page_size}"] = self.page_size if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the ListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.count is not None: - body["count"] = self.count + body["{count}"] = self.count if self.page is not None: - body["page"] = self.page + body["{page}"] = self.page if self.page_size is not None: - body["page_size"] = self.page_size + body["{page_size}"] = self.page_size if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListResponse: """Deserializes the ListResponse from a dictionary.""" return cls( - count=d.get("count", None), - page=d.get("page", None), - page_size=d.get("page_size", None), - results=_repeated_dict(d, "results", Dashboard), + count=d.get("{count}", None), + page=d.get("{page}", None), + page_size=d.get("{page_size}", None), + results=_repeated_dict(d, "{results}", Dashboard), ) @@ -4558,24 +4555,26 @@ def as_dict(self) -> dict: """Serializes the ListVisualizationsForQueryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the ListVisualizationsForQueryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListVisualizationsForQueryResponse: """Deserializes the ListVisualizationsForQueryResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), results=_repeated_dict(d, "results", Visualization)) + return cls( + next_page_token=d.get("{next_page_token}", None), results=_repeated_dict(d, "{results}", Visualization) + ) @dataclass @@ -4587,20 +4586,20 @@ def as_dict(self) -> dict: """Serializes the ListWarehousesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.warehouses: - body["warehouses"] = [v.as_dict() for v in self.warehouses] + body["{warehouses}"] = [v.as_dict() for v in self.warehouses] return body def as_shallow_dict(self) -> dict: """Serializes the ListWarehousesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.warehouses: - body["warehouses"] = self.warehouses + body["{warehouses}"] = self.warehouses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListWarehousesResponse: """Deserializes the ListWarehousesResponse from a dictionary.""" - return cls(warehouses=_repeated_dict(d, "warehouses", EndpointInfo)) + return cls(warehouses=_repeated_dict(d, "{warehouses}", EndpointInfo)) @dataclass @@ -4618,28 +4617,28 @@ def as_dict(self) -> dict: """Serializes the MultiValuesOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.prefix is not None: - body["prefix"] = self.prefix + body["{prefix}"] = self.prefix if self.separator is not None: - body["separator"] = self.separator + body["{separator}"] = self.separator if self.suffix is not None: - body["suffix"] = self.suffix + body["{suffix}"] = self.suffix return body def as_shallow_dict(self) -> dict: """Serializes the MultiValuesOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.prefix is not None: - body["prefix"] = self.prefix + body["{prefix}"] = self.prefix if self.separator is not None: - body["separator"] = self.separator + body["{separator}"] = self.separator if self.suffix is not None: - body["suffix"] = self.suffix + body["{suffix}"] = self.suffix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MultiValuesOptions: """Deserializes the MultiValuesOptions from a dictionary.""" - return cls(prefix=d.get("prefix", None), separator=d.get("separator", None), suffix=d.get("suffix", None)) + return cls(prefix=d.get("{prefix}", None), separator=d.get("{separator}", None), suffix=d.get("{suffix}", None)) @dataclass @@ -4650,20 +4649,20 @@ def as_dict(self) -> dict: """Serializes the NumericValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the NumericValue into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NumericValue: """Deserializes the NumericValue from a dictionary.""" - return cls(value=d.get("value", None)) + return cls(value=d.get("{value}", None)) class ObjectType(Enum): @@ -4698,36 +4697,36 @@ def as_dict(self) -> dict: """Serializes the OdbcParams into a dictionary suitable for use as a JSON request body.""" body = {} if self.hostname is not None: - body["hostname"] = self.hostname + body["{hostname}"] = self.hostname if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.port is not None: - body["port"] = self.port + body["{port}"] = self.port if self.protocol is not None: - body["protocol"] = self.protocol + body["{protocol}"] = self.protocol return body def as_shallow_dict(self) -> dict: """Serializes the OdbcParams into a shallow dictionary of its immediate attributes.""" body = {} if self.hostname is not None: - body["hostname"] = self.hostname + body["{hostname}"] = self.hostname if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.port is not None: - body["port"] = self.port + body["{port}"] = self.port if self.protocol is not None: - body["protocol"] = self.protocol + body["{protocol}"] = self.protocol return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OdbcParams: """Deserializes the OdbcParams from a dictionary.""" return cls( - hostname=d.get("hostname", None), - path=d.get("path", None), - port=d.get("port", None), - protocol=d.get("protocol", None), + hostname=d.get("{hostname}", None), + path=d.get("{path}", None), + port=d.get("{port}", None), + protocol=d.get("{protocol}", None), ) @@ -4768,51 +4767,51 @@ def as_dict(self) -> dict: """Serializes the Parameter into a dictionary suitable for use as a JSON request body.""" body = {} if self.enum_options is not None: - body["enumOptions"] = self.enum_options + body["{enum_options}"] = self.enum_options if self.multi_values_options: - body["multiValuesOptions"] = self.multi_values_options.as_dict() + body["{multi_values_options}"] = self.multi_values_options.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.query_id is not None: - body["queryId"] = self.query_id + body["{query_id}"] = self.query_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value if self.value: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the Parameter into a shallow dictionary of its immediate attributes.""" body = {} if self.enum_options is not None: - body["enumOptions"] = self.enum_options + body["{enum_options}"] = self.enum_options if self.multi_values_options: - body["multiValuesOptions"] = self.multi_values_options + body["{multi_values_options}"] = self.multi_values_options if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.query_id is not None: - body["queryId"] = self.query_id + body["{query_id}"] = self.query_id if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.value: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Parameter: """Deserializes the Parameter from a dictionary.""" return cls( - enum_options=d.get("enumOptions", None), - multi_values_options=_from_dict(d, "multiValuesOptions", MultiValuesOptions), - name=d.get("name", None), - query_id=d.get("queryId", None), - title=d.get("title", None), - type=_enum(d, "type", ParameterType), - value=d.get("value", None), + enum_options=d.get("{enum_options}", None), + multi_values_options=_from_dict(d, "{multi_values_options}", MultiValuesOptions), + name=d.get("{name}", None), + query_id=d.get("{query_id}", None), + title=d.get("{title}", None), + type=_enum(d, "{type}", ParameterType), + value=d.get("{value}", None), ) @@ -4903,101 +4902,101 @@ def as_dict(self) -> dict: """Serializes the Query into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_modifier_user_name is not None: - body["last_modifier_user_name"] = self.last_modifier_user_name + body["{last_modifier_user_name}"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state.value + body["{lifecycle_state}"] = self.lifecycle_state.value if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode.value + body["{run_as_mode}"] = self.run_as_mode.value if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the Query into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_modifier_user_name is not None: - body["last_modifier_user_name"] = self.last_modifier_user_name + body["{last_modifier_user_name}"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["lifecycle_state"] = self.lifecycle_state + body["{lifecycle_state}"] = self.lifecycle_state if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.parent_path is not None: - body["parent_path"] = self.parent_path + body["{parent_path}"] = self.parent_path if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode + body["{run_as_mode}"] = self.run_as_mode if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Query: """Deserializes the Query from a dictionary.""" return cls( - apply_auto_limit=d.get("apply_auto_limit", None), - catalog=d.get("catalog", None), - create_time=d.get("create_time", None), - description=d.get("description", None), - display_name=d.get("display_name", None), - id=d.get("id", None), - last_modifier_user_name=d.get("last_modifier_user_name", None), - lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), - owner_user_name=d.get("owner_user_name", None), - parameters=_repeated_dict(d, "parameters", QueryParameter), - parent_path=d.get("parent_path", None), - query_text=d.get("query_text", None), - run_as_mode=_enum(d, "run_as_mode", RunAsMode), - schema=d.get("schema", None), - tags=d.get("tags", None), - update_time=d.get("update_time", None), - warehouse_id=d.get("warehouse_id", None), + apply_auto_limit=d.get("{apply_auto_limit}", None), + catalog=d.get("{catalog}", None), + create_time=d.get("{create_time}", None), + description=d.get("{description}", None), + display_name=d.get("{display_name}", None), + id=d.get("{id}", None), + last_modifier_user_name=d.get("{last_modifier_user_name}", None), + lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), + owner_user_name=d.get("{owner_user_name}", None), + parameters=_repeated_dict(d, "{parameters}", QueryParameter), + parent_path=d.get("{parent_path}", None), + query_text=d.get("{query_text}", None), + run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), + schema=d.get("{schema}", None), + tags=d.get("{tags}", None), + update_time=d.get("{update_time}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -5016,31 +5015,31 @@ def as_dict(self) -> dict: """Serializes the QueryBackedValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.multi_values_options: - body["multi_values_options"] = self.multi_values_options.as_dict() + body["{multi_values_options}"] = self.multi_values_options.as_dict() if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.values: - body["values"] = [v for v in self.values] + body["{values}"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the QueryBackedValue into a shallow dictionary of its immediate attributes.""" body = {} if self.multi_values_options: - body["multi_values_options"] = self.multi_values_options + body["{multi_values_options}"] = self.multi_values_options if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryBackedValue: """Deserializes the QueryBackedValue from a dictionary.""" return cls( - multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions), - query_id=d.get("query_id", None), - values=d.get("values", None), + multi_values_options=_from_dict(d, "{multi_values_options}", MultiValuesOptions), + query_id=d.get("{query_id}", None), + values=d.get("{values}", None), ) @@ -5078,56 +5077,56 @@ def as_dict(self) -> dict: """Serializes the QueryEditContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role.value + body["{run_as_role}"] = self.run_as_role.value if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the QueryEditContent into a shallow dictionary of its immediate attributes.""" body = {} if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role + body["{run_as_role}"] = self.run_as_role if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryEditContent: """Deserializes the QueryEditContent from a dictionary.""" return cls( - data_source_id=d.get("data_source_id", None), - description=d.get("description", None), - name=d.get("name", None), - options=d.get("options", None), - query=d.get("query", None), - query_id=d.get("query_id", None), - run_as_role=_enum(d, "run_as_role", RunAsRole), - tags=d.get("tags", None), + data_source_id=d.get("{data_source_id}", None), + description=d.get("{description}", None), + name=d.get("{name}", None), + options=d.get("{options}", None), + query=d.get("{query}", None), + query_id=d.get("{query_id}", None), + run_as_role=_enum(d, "{run_as_role}", RunAsRole), + tags=d.get("{tags}", None), ) @@ -5151,41 +5150,41 @@ def as_dict(self) -> dict: """Serializes the QueryFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.query_start_time_range: - body["query_start_time_range"] = self.query_start_time_range.as_dict() + body["{query_start_time_range}"] = self.query_start_time_range.as_dict() if self.statement_ids: - body["statement_ids"] = [v for v in self.statement_ids] + body["{statement_ids}"] = [v for v in self.statement_ids] if self.statuses: - body["statuses"] = [v.value for v in self.statuses] + body["{statuses}"] = [v.value for v in self.statuses] if self.user_ids: - body["user_ids"] = [v for v in self.user_ids] + body["{user_ids}"] = [v for v in self.user_ids] if self.warehouse_ids: - body["warehouse_ids"] = [v for v in self.warehouse_ids] + body["{warehouse_ids}"] = [v for v in self.warehouse_ids] return body def as_shallow_dict(self) -> dict: """Serializes the QueryFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.query_start_time_range: - body["query_start_time_range"] = self.query_start_time_range + body["{query_start_time_range}"] = self.query_start_time_range if self.statement_ids: - body["statement_ids"] = self.statement_ids + body["{statement_ids}"] = self.statement_ids if self.statuses: - body["statuses"] = self.statuses + body["{statuses}"] = self.statuses if self.user_ids: - body["user_ids"] = self.user_ids + body["{user_ids}"] = self.user_ids if self.warehouse_ids: - body["warehouse_ids"] = self.warehouse_ids + body["{warehouse_ids}"] = self.warehouse_ids return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryFilter: """Deserializes the QueryFilter from a dictionary.""" return cls( - query_start_time_range=_from_dict(d, "query_start_time_range", TimeRange), - statement_ids=d.get("statement_ids", None), - statuses=_repeated_enum(d, "statuses", QueryStatus), - user_ids=d.get("user_ids", None), - warehouse_ids=d.get("warehouse_ids", None), + query_start_time_range=_from_dict(d, "{query_start_time_range}", TimeRange), + statement_ids=d.get("{statement_ids}", None), + statuses=_repeated_enum(d, "{statuses}", QueryStatus), + user_ids=d.get("{user_ids}", None), + warehouse_ids=d.get("{warehouse_ids}", None), ) @@ -5270,131 +5269,131 @@ def as_dict(self) -> dict: """Serializes the QueryInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.channel_used: - body["channel_used"] = self.channel_used.as_dict() + body["{channel_used}"] = self.channel_used.as_dict() if self.duration is not None: - body["duration"] = self.duration + body["{duration}"] = self.duration if self.endpoint_id is not None: - body["endpoint_id"] = self.endpoint_id + body["{endpoint_id}"] = self.endpoint_id if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.executed_as_user_id is not None: - body["executed_as_user_id"] = self.executed_as_user_id + body["{executed_as_user_id}"] = self.executed_as_user_id if self.executed_as_user_name is not None: - body["executed_as_user_name"] = self.executed_as_user_name + body["{executed_as_user_name}"] = self.executed_as_user_name if self.execution_end_time_ms is not None: - body["execution_end_time_ms"] = self.execution_end_time_ms + body["{execution_end_time_ms}"] = self.execution_end_time_ms if self.is_final is not None: - body["is_final"] = self.is_final + body["{is_final}"] = self.is_final if self.lookup_key is not None: - body["lookup_key"] = self.lookup_key + body["{lookup_key}"] = self.lookup_key if self.metrics: - body["metrics"] = self.metrics.as_dict() + body["{metrics}"] = self.metrics.as_dict() if self.plans_state is not None: - body["plans_state"] = self.plans_state.value + body["{plans_state}"] = self.plans_state.value if self.query_end_time_ms is not None: - body["query_end_time_ms"] = self.query_end_time_ms + body["{query_end_time_ms}"] = self.query_end_time_ms if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.query_source: - body["query_source"] = self.query_source.as_dict() + body["{query_source}"] = self.query_source.as_dict() if self.query_start_time_ms is not None: - body["query_start_time_ms"] = self.query_start_time_ms + body["{query_start_time_ms}"] = self.query_start_time_ms if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.rows_produced is not None: - body["rows_produced"] = self.rows_produced + body["{rows_produced}"] = self.rows_produced if self.spark_ui_url is not None: - body["spark_ui_url"] = self.spark_ui_url + body["{spark_ui_url}"] = self.spark_ui_url if self.statement_type is not None: - body["statement_type"] = self.statement_type.value + body["{statement_type}"] = self.statement_type.value if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the QueryInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.channel_used: - body["channel_used"] = self.channel_used + body["{channel_used}"] = self.channel_used if self.duration is not None: - body["duration"] = self.duration + body["{duration}"] = self.duration if self.endpoint_id is not None: - body["endpoint_id"] = self.endpoint_id + body["{endpoint_id}"] = self.endpoint_id if self.error_message is not None: - body["error_message"] = self.error_message + body["{error_message}"] = self.error_message if self.executed_as_user_id is not None: - body["executed_as_user_id"] = self.executed_as_user_id + body["{executed_as_user_id}"] = self.executed_as_user_id if self.executed_as_user_name is not None: - body["executed_as_user_name"] = self.executed_as_user_name + body["{executed_as_user_name}"] = self.executed_as_user_name if self.execution_end_time_ms is not None: - body["execution_end_time_ms"] = self.execution_end_time_ms + body["{execution_end_time_ms}"] = self.execution_end_time_ms if self.is_final is not None: - body["is_final"] = self.is_final + body["{is_final}"] = self.is_final if self.lookup_key is not None: - body["lookup_key"] = self.lookup_key + body["{lookup_key}"] = self.lookup_key if self.metrics: - body["metrics"] = self.metrics + body["{metrics}"] = self.metrics if self.plans_state is not None: - body["plans_state"] = self.plans_state + body["{plans_state}"] = self.plans_state if self.query_end_time_ms is not None: - body["query_end_time_ms"] = self.query_end_time_ms + body["{query_end_time_ms}"] = self.query_end_time_ms if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.query_source: - body["query_source"] = self.query_source + body["{query_source}"] = self.query_source if self.query_start_time_ms is not None: - body["query_start_time_ms"] = self.query_start_time_ms + body["{query_start_time_ms}"] = self.query_start_time_ms if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.rows_produced is not None: - body["rows_produced"] = self.rows_produced + body["{rows_produced}"] = self.rows_produced if self.spark_ui_url is not None: - body["spark_ui_url"] = self.spark_ui_url + body["{spark_ui_url}"] = self.spark_ui_url if self.statement_type is not None: - body["statement_type"] = self.statement_type + body["{statement_type}"] = self.statement_type if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status if self.user_id is not None: - body["user_id"] = self.user_id + body["{user_id}"] = self.user_id if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryInfo: """Deserializes the QueryInfo from a dictionary.""" return cls( - channel_used=_from_dict(d, "channel_used", ChannelInfo), - duration=d.get("duration", None), - endpoint_id=d.get("endpoint_id", None), - error_message=d.get("error_message", None), - executed_as_user_id=d.get("executed_as_user_id", None), - executed_as_user_name=d.get("executed_as_user_name", None), - execution_end_time_ms=d.get("execution_end_time_ms", None), - is_final=d.get("is_final", None), - lookup_key=d.get("lookup_key", None), - metrics=_from_dict(d, "metrics", QueryMetrics), - plans_state=_enum(d, "plans_state", PlansState), - query_end_time_ms=d.get("query_end_time_ms", None), - query_id=d.get("query_id", None), - query_source=_from_dict(d, "query_source", ExternalQuerySource), - query_start_time_ms=d.get("query_start_time_ms", None), - query_text=d.get("query_text", None), - rows_produced=d.get("rows_produced", None), - spark_ui_url=d.get("spark_ui_url", None), - statement_type=_enum(d, "statement_type", QueryStatementType), - status=_enum(d, "status", QueryStatus), - user_id=d.get("user_id", None), - user_name=d.get("user_name", None), - warehouse_id=d.get("warehouse_id", None), + channel_used=_from_dict(d, "{channel_used}", ChannelInfo), + duration=d.get("{duration}", None), + endpoint_id=d.get("{endpoint_id}", None), + error_message=d.get("{error_message}", None), + executed_as_user_id=d.get("{executed_as_user_id}", None), + executed_as_user_name=d.get("{executed_as_user_name}", None), + execution_end_time_ms=d.get("{execution_end_time_ms}", None), + is_final=d.get("{is_final}", None), + lookup_key=d.get("{lookup_key}", None), + metrics=_from_dict(d, "{metrics}", QueryMetrics), + plans_state=_enum(d, "{plans_state}", PlansState), + query_end_time_ms=d.get("{query_end_time_ms}", None), + query_id=d.get("{query_id}", None), + query_source=_from_dict(d, "{query_source}", ExternalQuerySource), + query_start_time_ms=d.get("{query_start_time_ms}", None), + query_text=d.get("{query_text}", None), + rows_produced=d.get("{rows_produced}", None), + spark_ui_url=d.get("{spark_ui_url}", None), + statement_type=_enum(d, "{statement_type}", QueryStatementType), + status=_enum(d, "{status}", QueryStatus), + user_id=d.get("{user_id}", None), + user_name=d.get("{user_name}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -5416,36 +5415,36 @@ def as_dict(self) -> dict: """Serializes the QueryList into a dictionary suitable for use as a JSON request body.""" body = {} if self.count is not None: - body["count"] = self.count + body["{count}"] = self.count if self.page is not None: - body["page"] = self.page + body["{page}"] = self.page if self.page_size is not None: - body["page_size"] = self.page_size + body["{page_size}"] = self.page_size if self.results: - body["results"] = [v.as_dict() for v in self.results] + body["{results}"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: """Serializes the QueryList into a shallow dictionary of its immediate attributes.""" body = {} if self.count is not None: - body["count"] = self.count + body["{count}"] = self.count if self.page is not None: - body["page"] = self.page + body["{page}"] = self.page if self.page_size is not None: - body["page_size"] = self.page_size + body["{page_size}"] = self.page_size if self.results: - body["results"] = self.results + body["{results}"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryList: """Deserializes the QueryList from a dictionary.""" return cls( - count=d.get("count", None), - page=d.get("page", None), - page_size=d.get("page_size", None), - results=_repeated_dict(d, "results", LegacyQuery), + count=d.get("{count}", None), + page=d.get("{page}", None), + page_size=d.get("{page_size}", None), + results=_repeated_dict(d, "{results}", LegacyQuery), ) @@ -5527,126 +5526,126 @@ def as_dict(self) -> dict: """Serializes the QueryMetrics into a dictionary suitable for use as a JSON request body.""" body = {} if self.compilation_time_ms is not None: - body["compilation_time_ms"] = self.compilation_time_ms + body["{compilation_time_ms}"] = self.compilation_time_ms if self.execution_time_ms is not None: - body["execution_time_ms"] = self.execution_time_ms + body["{execution_time_ms}"] = self.execution_time_ms if self.network_sent_bytes is not None: - body["network_sent_bytes"] = self.network_sent_bytes + body["{network_sent_bytes}"] = self.network_sent_bytes if self.overloading_queue_start_timestamp is not None: - body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp + body["{overloading_queue_start_timestamp}"] = self.overloading_queue_start_timestamp if self.photon_total_time_ms is not None: - body["photon_total_time_ms"] = self.photon_total_time_ms + body["{photon_total_time_ms}"] = self.photon_total_time_ms if self.provisioning_queue_start_timestamp is not None: - body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp + body["{provisioning_queue_start_timestamp}"] = self.provisioning_queue_start_timestamp if self.pruned_bytes is not None: - body["pruned_bytes"] = self.pruned_bytes + body["{pruned_bytes}"] = self.pruned_bytes if self.pruned_files_count is not None: - body["pruned_files_count"] = self.pruned_files_count + body["{pruned_files_count}"] = self.pruned_files_count if self.query_compilation_start_timestamp is not None: - body["query_compilation_start_timestamp"] = self.query_compilation_start_timestamp + body["{query_compilation_start_timestamp}"] = self.query_compilation_start_timestamp if self.read_bytes is not None: - body["read_bytes"] = self.read_bytes + body["{read_bytes}"] = self.read_bytes if self.read_cache_bytes is not None: - body["read_cache_bytes"] = self.read_cache_bytes + body["{read_cache_bytes}"] = self.read_cache_bytes if self.read_files_count is not None: - body["read_files_count"] = self.read_files_count + body["{read_files_count}"] = self.read_files_count if self.read_partitions_count is not None: - body["read_partitions_count"] = self.read_partitions_count + body["{read_partitions_count}"] = self.read_partitions_count if self.read_remote_bytes is not None: - body["read_remote_bytes"] = self.read_remote_bytes + body["{read_remote_bytes}"] = self.read_remote_bytes if self.result_fetch_time_ms is not None: - body["result_fetch_time_ms"] = self.result_fetch_time_ms + body["{result_fetch_time_ms}"] = self.result_fetch_time_ms if self.result_from_cache is not None: - body["result_from_cache"] = self.result_from_cache + body["{result_from_cache}"] = self.result_from_cache if self.rows_produced_count is not None: - body["rows_produced_count"] = self.rows_produced_count + body["{rows_produced_count}"] = self.rows_produced_count if self.rows_read_count is not None: - body["rows_read_count"] = self.rows_read_count + body["{rows_read_count}"] = self.rows_read_count if self.spill_to_disk_bytes is not None: - body["spill_to_disk_bytes"] = self.spill_to_disk_bytes + body["{spill_to_disk_bytes}"] = self.spill_to_disk_bytes if self.task_total_time_ms is not None: - body["task_total_time_ms"] = self.task_total_time_ms + body["{task_total_time_ms}"] = self.task_total_time_ms if self.total_time_ms is not None: - body["total_time_ms"] = self.total_time_ms + body["{total_time_ms}"] = self.total_time_ms if self.write_remote_bytes is not None: - body["write_remote_bytes"] = self.write_remote_bytes + body["{write_remote_bytes}"] = self.write_remote_bytes return body def as_shallow_dict(self) -> dict: """Serializes the QueryMetrics into a shallow dictionary of its immediate attributes.""" body = {} if self.compilation_time_ms is not None: - body["compilation_time_ms"] = self.compilation_time_ms + body["{compilation_time_ms}"] = self.compilation_time_ms if self.execution_time_ms is not None: - body["execution_time_ms"] = self.execution_time_ms + body["{execution_time_ms}"] = self.execution_time_ms if self.network_sent_bytes is not None: - body["network_sent_bytes"] = self.network_sent_bytes + body["{network_sent_bytes}"] = self.network_sent_bytes if self.overloading_queue_start_timestamp is not None: - body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp + body["{overloading_queue_start_timestamp}"] = self.overloading_queue_start_timestamp if self.photon_total_time_ms is not None: - body["photon_total_time_ms"] = self.photon_total_time_ms + body["{photon_total_time_ms}"] = self.photon_total_time_ms if self.provisioning_queue_start_timestamp is not None: - body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp + body["{provisioning_queue_start_timestamp}"] = self.provisioning_queue_start_timestamp if self.pruned_bytes is not None: - body["pruned_bytes"] = self.pruned_bytes + body["{pruned_bytes}"] = self.pruned_bytes if self.pruned_files_count is not None: - body["pruned_files_count"] = self.pruned_files_count + body["{pruned_files_count}"] = self.pruned_files_count if self.query_compilation_start_timestamp is not None: - body["query_compilation_start_timestamp"] = self.query_compilation_start_timestamp + body["{query_compilation_start_timestamp}"] = self.query_compilation_start_timestamp if self.read_bytes is not None: - body["read_bytes"] = self.read_bytes + body["{read_bytes}"] = self.read_bytes if self.read_cache_bytes is not None: - body["read_cache_bytes"] = self.read_cache_bytes + body["{read_cache_bytes}"] = self.read_cache_bytes if self.read_files_count is not None: - body["read_files_count"] = self.read_files_count + body["{read_files_count}"] = self.read_files_count if self.read_partitions_count is not None: - body["read_partitions_count"] = self.read_partitions_count + body["{read_partitions_count}"] = self.read_partitions_count if self.read_remote_bytes is not None: - body["read_remote_bytes"] = self.read_remote_bytes + body["{read_remote_bytes}"] = self.read_remote_bytes if self.result_fetch_time_ms is not None: - body["result_fetch_time_ms"] = self.result_fetch_time_ms + body["{result_fetch_time_ms}"] = self.result_fetch_time_ms if self.result_from_cache is not None: - body["result_from_cache"] = self.result_from_cache + body["{result_from_cache}"] = self.result_from_cache if self.rows_produced_count is not None: - body["rows_produced_count"] = self.rows_produced_count + body["{rows_produced_count}"] = self.rows_produced_count if self.rows_read_count is not None: - body["rows_read_count"] = self.rows_read_count + body["{rows_read_count}"] = self.rows_read_count if self.spill_to_disk_bytes is not None: - body["spill_to_disk_bytes"] = self.spill_to_disk_bytes + body["{spill_to_disk_bytes}"] = self.spill_to_disk_bytes if self.task_total_time_ms is not None: - body["task_total_time_ms"] = self.task_total_time_ms + body["{task_total_time_ms}"] = self.task_total_time_ms if self.total_time_ms is not None: - body["total_time_ms"] = self.total_time_ms + body["{total_time_ms}"] = self.total_time_ms if self.write_remote_bytes is not None: - body["write_remote_bytes"] = self.write_remote_bytes + body["{write_remote_bytes}"] = self.write_remote_bytes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryMetrics: """Deserializes the QueryMetrics from a dictionary.""" return cls( - compilation_time_ms=d.get("compilation_time_ms", None), - execution_time_ms=d.get("execution_time_ms", None), - network_sent_bytes=d.get("network_sent_bytes", None), - overloading_queue_start_timestamp=d.get("overloading_queue_start_timestamp", None), - photon_total_time_ms=d.get("photon_total_time_ms", None), - provisioning_queue_start_timestamp=d.get("provisioning_queue_start_timestamp", None), - pruned_bytes=d.get("pruned_bytes", None), - pruned_files_count=d.get("pruned_files_count", None), - query_compilation_start_timestamp=d.get("query_compilation_start_timestamp", None), - read_bytes=d.get("read_bytes", None), - read_cache_bytes=d.get("read_cache_bytes", None), - read_files_count=d.get("read_files_count", None), - read_partitions_count=d.get("read_partitions_count", None), - read_remote_bytes=d.get("read_remote_bytes", None), - result_fetch_time_ms=d.get("result_fetch_time_ms", None), - result_from_cache=d.get("result_from_cache", None), - rows_produced_count=d.get("rows_produced_count", None), - rows_read_count=d.get("rows_read_count", None), - spill_to_disk_bytes=d.get("spill_to_disk_bytes", None), - task_total_time_ms=d.get("task_total_time_ms", None), - total_time_ms=d.get("total_time_ms", None), - write_remote_bytes=d.get("write_remote_bytes", None), + compilation_time_ms=d.get("{compilation_time_ms}", None), + execution_time_ms=d.get("{execution_time_ms}", None), + network_sent_bytes=d.get("{network_sent_bytes}", None), + overloading_queue_start_timestamp=d.get("{overloading_queue_start_timestamp}", None), + photon_total_time_ms=d.get("{photon_total_time_ms}", None), + provisioning_queue_start_timestamp=d.get("{provisioning_queue_start_timestamp}", None), + pruned_bytes=d.get("{pruned_bytes}", None), + pruned_files_count=d.get("{pruned_files_count}", None), + query_compilation_start_timestamp=d.get("{query_compilation_start_timestamp}", None), + read_bytes=d.get("{read_bytes}", None), + read_cache_bytes=d.get("{read_cache_bytes}", None), + read_files_count=d.get("{read_files_count}", None), + read_partitions_count=d.get("{read_partitions_count}", None), + read_remote_bytes=d.get("{read_remote_bytes}", None), + result_fetch_time_ms=d.get("{result_fetch_time_ms}", None), + result_from_cache=d.get("{result_from_cache}", None), + rows_produced_count=d.get("{rows_produced_count}", None), + rows_read_count=d.get("{rows_read_count}", None), + spill_to_disk_bytes=d.get("{spill_to_disk_bytes}", None), + task_total_time_ms=d.get("{task_total_time_ms}", None), + total_time_ms=d.get("{total_time_ms}", None), + write_remote_bytes=d.get("{write_remote_bytes}", None), ) @@ -5668,36 +5667,36 @@ def as_dict(self) -> dict: """Serializes the QueryOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.moved_to_trash_at is not None: - body["moved_to_trash_at"] = self.moved_to_trash_at + body["{moved_to_trash_at}"] = self.moved_to_trash_at if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema return body def as_shallow_dict(self) -> dict: """Serializes the QueryOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.moved_to_trash_at is not None: - body["moved_to_trash_at"] = self.moved_to_trash_at + body["{moved_to_trash_at}"] = self.moved_to_trash_at if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryOptions: """Deserializes the QueryOptions from a dictionary.""" return cls( - catalog=d.get("catalog", None), - moved_to_trash_at=d.get("moved_to_trash_at", None), - parameters=_repeated_dict(d, "parameters", Parameter), - schema=d.get("schema", None), + catalog=d.get("{catalog}", None), + moved_to_trash_at=d.get("{moved_to_trash_at}", None), + parameters=_repeated_dict(d, "{parameters}", Parameter), + schema=d.get("{schema}", None), ) @@ -5732,56 +5731,56 @@ def as_dict(self) -> dict: """Serializes the QueryParameter into a dictionary suitable for use as a JSON request body.""" body = {} if self.date_range_value: - body["date_range_value"] = self.date_range_value.as_dict() + body["{date_range_value}"] = self.date_range_value.as_dict() if self.date_value: - body["date_value"] = self.date_value.as_dict() + body["{date_value}"] = self.date_value.as_dict() if self.enum_value: - body["enum_value"] = self.enum_value.as_dict() + body["{enum_value}"] = self.enum_value.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.numeric_value: - body["numeric_value"] = self.numeric_value.as_dict() + body["{numeric_value}"] = self.numeric_value.as_dict() if self.query_backed_value: - body["query_backed_value"] = self.query_backed_value.as_dict() + body["{query_backed_value}"] = self.query_backed_value.as_dict() if self.text_value: - body["text_value"] = self.text_value.as_dict() + body["{text_value}"] = self.text_value.as_dict() if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title return body def as_shallow_dict(self) -> dict: """Serializes the QueryParameter into a shallow dictionary of its immediate attributes.""" body = {} if self.date_range_value: - body["date_range_value"] = self.date_range_value + body["{date_range_value}"] = self.date_range_value if self.date_value: - body["date_value"] = self.date_value + body["{date_value}"] = self.date_value if self.enum_value: - body["enum_value"] = self.enum_value + body["{enum_value}"] = self.enum_value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.numeric_value: - body["numeric_value"] = self.numeric_value + body["{numeric_value}"] = self.numeric_value if self.query_backed_value: - body["query_backed_value"] = self.query_backed_value + body["{query_backed_value}"] = self.query_backed_value if self.text_value: - body["text_value"] = self.text_value + body["{text_value}"] = self.text_value if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryParameter: """Deserializes the QueryParameter from a dictionary.""" return cls( - date_range_value=_from_dict(d, "date_range_value", DateRangeValue), - date_value=_from_dict(d, "date_value", DateValue), - enum_value=_from_dict(d, "enum_value", EnumValue), - name=d.get("name", None), - numeric_value=_from_dict(d, "numeric_value", NumericValue), - query_backed_value=_from_dict(d, "query_backed_value", QueryBackedValue), - text_value=_from_dict(d, "text_value", TextValue), - title=d.get("title", None), + date_range_value=_from_dict(d, "{date_range_value}", DateRangeValue), + date_value=_from_dict(d, "{date_value}", DateValue), + enum_value=_from_dict(d, "{enum_value}", EnumValue), + name=d.get("{name}", None), + numeric_value=_from_dict(d, "{numeric_value}", NumericValue), + query_backed_value=_from_dict(d, "{query_backed_value}", QueryBackedValue), + text_value=_from_dict(d, "{text_value}", TextValue), + title=d.get("{title}", None), ) @@ -5820,56 +5819,56 @@ def as_dict(self) -> dict: """Serializes the QueryPostContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role.value + body["{run_as_role}"] = self.run_as_role.value if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: """Serializes the QueryPostContent into a shallow dictionary of its immediate attributes.""" body = {} if self.data_source_id is not None: - body["data_source_id"] = self.data_source_id + body["{data_source_id}"] = self.data_source_id if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.parent is not None: - body["parent"] = self.parent + body["{parent}"] = self.parent if self.query is not None: - body["query"] = self.query + body["{query}"] = self.query if self.run_as_role is not None: - body["run_as_role"] = self.run_as_role + body["{run_as_role}"] = self.run_as_role if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryPostContent: """Deserializes the QueryPostContent from a dictionary.""" return cls( - data_source_id=d.get("data_source_id", None), - description=d.get("description", None), - name=d.get("name", None), - options=d.get("options", None), - parent=d.get("parent", None), - query=d.get("query", None), - run_as_role=_enum(d, "run_as_role", RunAsRole), - tags=d.get("tags", None), + data_source_id=d.get("{data_source_id}", None), + description=d.get("{description}", None), + name=d.get("{name}", None), + options=d.get("{options}", None), + parent=d.get("{parent}", None), + query=d.get("{query}", None), + run_as_role=_enum(d, "{run_as_role}", RunAsRole), + tags=d.get("{tags}", None), ) @@ -5923,26 +5922,26 @@ def as_dict(self) -> dict: """Serializes the RepeatedEndpointConfPairs into a dictionary suitable for use as a JSON request body.""" body = {} if self.config_pair: - body["config_pair"] = [v.as_dict() for v in self.config_pair] + body["{config_pair}"] = [v.as_dict() for v in self.config_pair] if self.configuration_pairs: - body["configuration_pairs"] = [v.as_dict() for v in self.configuration_pairs] + body["{configuration_pairs}"] = [v.as_dict() for v in self.configuration_pairs] return body def as_shallow_dict(self) -> dict: """Serializes the RepeatedEndpointConfPairs into a shallow dictionary of its immediate attributes.""" body = {} if self.config_pair: - body["config_pair"] = self.config_pair + body["{config_pair}"] = self.config_pair if self.configuration_pairs: - body["configuration_pairs"] = self.configuration_pairs + body["{configuration_pairs}"] = self.configuration_pairs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepeatedEndpointConfPairs: """Deserializes the RepeatedEndpointConfPairs from a dictionary.""" return cls( - config_pair=_repeated_dict(d, "config_pair", EndpointConfPair), - configuration_pairs=_repeated_dict(d, "configuration_pairs", EndpointConfPair), + config_pair=_repeated_dict(d, "{config_pair}", EndpointConfPair), + configuration_pairs=_repeated_dict(d, "{configuration_pairs}", EndpointConfPair), ) @@ -5999,56 +5998,56 @@ def as_dict(self) -> dict: """Serializes the ResultData into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.data_array: - body["data_array"] = [v for v in self.data_array] + body["{data_array}"] = [v for v in self.data_array] if self.external_links: - body["external_links"] = [v.as_dict() for v in self.external_links] + body["{external_links}"] = [v.as_dict() for v in self.external_links] if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body def as_shallow_dict(self) -> dict: """Serializes the ResultData into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["byte_count"] = self.byte_count + body["{byte_count}"] = self.byte_count if self.chunk_index is not None: - body["chunk_index"] = self.chunk_index + body["{chunk_index}"] = self.chunk_index if self.data_array: - body["data_array"] = self.data_array + body["{data_array}"] = self.data_array if self.external_links: - body["external_links"] = self.external_links + body["{external_links}"] = self.external_links if self.next_chunk_index is not None: - body["next_chunk_index"] = self.next_chunk_index + body["{next_chunk_index}"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["next_chunk_internal_link"] = self.next_chunk_internal_link + body["{next_chunk_internal_link}"] = self.next_chunk_internal_link if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count if self.row_offset is not None: - body["row_offset"] = self.row_offset + body["{row_offset}"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultData: """Deserializes the ResultData from a dictionary.""" return cls( - byte_count=d.get("byte_count", None), - chunk_index=d.get("chunk_index", None), - data_array=d.get("data_array", None), - external_links=_repeated_dict(d, "external_links", ExternalLink), - next_chunk_index=d.get("next_chunk_index", None), - next_chunk_internal_link=d.get("next_chunk_internal_link", None), - row_count=d.get("row_count", None), - row_offset=d.get("row_offset", None), + byte_count=d.get("{byte_count}", None), + chunk_index=d.get("{chunk_index}", None), + data_array=d.get("{data_array}", None), + external_links=_repeated_dict(d, "{external_links}", ExternalLink), + next_chunk_index=d.get("{next_chunk_index}", None), + next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), + row_count=d.get("{row_count}", None), + row_offset=d.get("{row_offset}", None), ) @@ -6081,51 +6080,51 @@ def as_dict(self) -> dict: """Serializes the ResultManifest into a dictionary suitable for use as a JSON request body.""" body = {} if self.chunks: - body["chunks"] = [v.as_dict() for v in self.chunks] + body["{chunks}"] = [v.as_dict() for v in self.chunks] if self.format is not None: - body["format"] = self.format.value + body["{format}"] = self.format.value if self.schema: - body["schema"] = self.schema.as_dict() + body["{schema}"] = self.schema.as_dict() if self.total_byte_count is not None: - body["total_byte_count"] = self.total_byte_count + body["{total_byte_count}"] = self.total_byte_count if self.total_chunk_count is not None: - body["total_chunk_count"] = self.total_chunk_count + body["{total_chunk_count}"] = self.total_chunk_count if self.total_row_count is not None: - body["total_row_count"] = self.total_row_count + body["{total_row_count}"] = self.total_row_count if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body def as_shallow_dict(self) -> dict: """Serializes the ResultManifest into a shallow dictionary of its immediate attributes.""" body = {} if self.chunks: - body["chunks"] = self.chunks + body["{chunks}"] = self.chunks if self.format is not None: - body["format"] = self.format + body["{format}"] = self.format if self.schema: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.total_byte_count is not None: - body["total_byte_count"] = self.total_byte_count + body["{total_byte_count}"] = self.total_byte_count if self.total_chunk_count is not None: - body["total_chunk_count"] = self.total_chunk_count + body["{total_chunk_count}"] = self.total_chunk_count if self.total_row_count is not None: - body["total_row_count"] = self.total_row_count + body["{total_row_count}"] = self.total_row_count if self.truncated is not None: - body["truncated"] = self.truncated + body["{truncated}"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultManifest: """Deserializes the ResultManifest from a dictionary.""" return cls( - chunks=_repeated_dict(d, "chunks", BaseChunkInfo), - format=_enum(d, "format", Format), - schema=_from_dict(d, "schema", ResultSchema), - total_byte_count=d.get("total_byte_count", None), - total_chunk_count=d.get("total_chunk_count", None), - total_row_count=d.get("total_row_count", None), - truncated=d.get("truncated", None), + chunks=_repeated_dict(d, "{chunks}", BaseChunkInfo), + format=_enum(d, "{format}", Format), + schema=_from_dict(d, "{schema}", ResultSchema), + total_byte_count=d.get("{total_byte_count}", None), + total_chunk_count=d.get("{total_chunk_count}", None), + total_row_count=d.get("{total_row_count}", None), + truncated=d.get("{truncated}", None), ) @@ -6141,24 +6140,24 @@ def as_dict(self) -> dict: """Serializes the ResultSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.column_count is not None: - body["column_count"] = self.column_count + body["{column_count}"] = self.column_count if self.columns: - body["columns"] = [v.as_dict() for v in self.columns] + body["{columns}"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: """Serializes the ResultSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.column_count is not None: - body["column_count"] = self.column_count + body["{column_count}"] = self.column_count if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultSchema: """Deserializes the ResultSchema from a dictionary.""" - return cls(column_count=d.get("column_count", None), columns=_repeated_dict(d, "columns", ColumnInfo)) + return cls(column_count=d.get("{column_count}", None), columns=_repeated_dict(d, "{columns}", ColumnInfo)) class RunAsMode(Enum): @@ -6186,24 +6185,24 @@ def as_dict(self) -> dict: """Serializes the ServiceError into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_code is not None: - body["error_code"] = self.error_code.value + body["{error_code}"] = self.error_code.value if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body def as_shallow_dict(self) -> dict: """Serializes the ServiceError into a shallow dictionary of its immediate attributes.""" body = {} if self.error_code is not None: - body["error_code"] = self.error_code + body["{error_code}"] = self.error_code if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServiceError: """Deserializes the ServiceError from a dictionary.""" - return cls(error_code=_enum(d, "error_code", ServiceErrorCode), message=d.get("message", None)) + return cls(error_code=_enum(d, "{error_code}", ServiceErrorCode), message=d.get("{message}", None)) class ServiceErrorCode(Enum): @@ -6238,31 +6237,31 @@ def as_dict(self) -> dict: """Serializes the SetResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type.value + body["{object_type}"] = self.object_type.value return body def as_shallow_dict(self) -> dict: """Serializes the SetResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetResponse: """Deserializes the SetResponse from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", AccessControl), - object_id=d.get("object_id", None), - object_type=_enum(d, "object_type", ObjectType), + access_control_list=_repeated_dict(d, "{access_control_list}", AccessControl), + object_id=d.get("{object_id}", None), + object_type=_enum(d, "{object_type}", ObjectType), ) @@ -6304,61 +6303,61 @@ def as_dict(self) -> dict: """Serializes the SetWorkspaceWarehouseConfigRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.channel: - body["channel"] = self.channel.as_dict() + body["{channel}"] = self.channel.as_dict() if self.config_param: - body["config_param"] = self.config_param.as_dict() + body["{config_param}"] = self.config_param.as_dict() if self.data_access_config: - body["data_access_config"] = [v.as_dict() for v in self.data_access_config] + body["{data_access_config}"] = [v.as_dict() for v in self.data_access_config] if self.enabled_warehouse_types: - body["enabled_warehouse_types"] = [v.as_dict() for v in self.enabled_warehouse_types] + body["{enabled_warehouse_types}"] = [v.as_dict() for v in self.enabled_warehouse_types] if self.global_param: - body["global_param"] = self.global_param.as_dict() + body["{global_param}"] = self.global_param.as_dict() if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.security_policy is not None: - body["security_policy"] = self.security_policy.value + body["{security_policy}"] = self.security_policy.value if self.sql_configuration_parameters: - body["sql_configuration_parameters"] = self.sql_configuration_parameters.as_dict() + body["{sql_configuration_parameters}"] = self.sql_configuration_parameters.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the SetWorkspaceWarehouseConfigRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.channel: - body["channel"] = self.channel + body["{channel}"] = self.channel if self.config_param: - body["config_param"] = self.config_param + body["{config_param}"] = self.config_param if self.data_access_config: - body["data_access_config"] = self.data_access_config + body["{data_access_config}"] = self.data_access_config if self.enabled_warehouse_types: - body["enabled_warehouse_types"] = self.enabled_warehouse_types + body["{enabled_warehouse_types}"] = self.enabled_warehouse_types if self.global_param: - body["global_param"] = self.global_param + body["{global_param}"] = self.global_param if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account + body["{google_service_account}"] = self.google_service_account if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn + body["{instance_profile_arn}"] = self.instance_profile_arn if self.security_policy is not None: - body["security_policy"] = self.security_policy + body["{security_policy}"] = self.security_policy if self.sql_configuration_parameters: - body["sql_configuration_parameters"] = self.sql_configuration_parameters + body["{sql_configuration_parameters}"] = self.sql_configuration_parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetWorkspaceWarehouseConfigRequest: """Deserializes the SetWorkspaceWarehouseConfigRequest from a dictionary.""" return cls( - channel=_from_dict(d, "channel", Channel), - config_param=_from_dict(d, "config_param", RepeatedEndpointConfPairs), - data_access_config=_repeated_dict(d, "data_access_config", EndpointConfPair), - enabled_warehouse_types=_repeated_dict(d, "enabled_warehouse_types", WarehouseTypePair), - global_param=_from_dict(d, "global_param", RepeatedEndpointConfPairs), - google_service_account=d.get("google_service_account", None), - instance_profile_arn=d.get("instance_profile_arn", None), - security_policy=_enum(d, "security_policy", SetWorkspaceWarehouseConfigRequestSecurityPolicy), - sql_configuration_parameters=_from_dict(d, "sql_configuration_parameters", RepeatedEndpointConfPairs), + channel=_from_dict(d, "{channel}", Channel), + config_param=_from_dict(d, "{config_param}", RepeatedEndpointConfPairs), + data_access_config=_repeated_dict(d, "{data_access_config}", EndpointConfPair), + enabled_warehouse_types=_repeated_dict(d, "{enabled_warehouse_types}", WarehouseTypePair), + global_param=_from_dict(d, "{global_param}", RepeatedEndpointConfPairs), + google_service_account=d.get("{google_service_account}", None), + instance_profile_arn=d.get("{instance_profile_arn}", None), + security_policy=_enum(d, "{security_policy}", SetWorkspaceWarehouseConfigRequestSecurityPolicy), + sql_configuration_parameters=_from_dict(d, "{sql_configuration_parameters}", RepeatedEndpointConfPairs), ) @@ -6445,28 +6444,28 @@ def as_dict(self) -> dict: """Serializes the StatementParameterListItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the StatementParameterListItem into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementParameterListItem: """Deserializes the StatementParameterListItem from a dictionary.""" - return cls(name=d.get("name", None), type=d.get("type", None), value=d.get("value", None)) + return cls(name=d.get("{name}", None), type=d.get("{type}", None), value=d.get("{value}", None)) @dataclass @@ -6487,36 +6486,36 @@ def as_dict(self) -> dict: """Serializes the StatementResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.manifest: - body["manifest"] = self.manifest.as_dict() + body["{manifest}"] = self.manifest.as_dict() if self.result: - body["result"] = self.result.as_dict() + body["{result}"] = self.result.as_dict() if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the StatementResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.manifest: - body["manifest"] = self.manifest + body["{manifest}"] = self.manifest if self.result: - body["result"] = self.result + body["{result}"] = self.result if self.statement_id is not None: - body["statement_id"] = self.statement_id + body["{statement_id}"] = self.statement_id if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementResponse: """Deserializes the StatementResponse from a dictionary.""" return cls( - manifest=_from_dict(d, "manifest", ResultManifest), - result=_from_dict(d, "result", ResultData), - statement_id=d.get("statement_id", None), - status=_from_dict(d, "status", StatementStatus), + manifest=_from_dict(d, "{manifest}", ResultManifest), + result=_from_dict(d, "{result}", ResultData), + statement_id=d.get("{statement_id}", None), + status=_from_dict(d, "{status}", StatementStatus), ) @@ -6552,24 +6551,24 @@ def as_dict(self) -> dict: """Serializes the StatementStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.error: - body["error"] = self.error.as_dict() + body["{error}"] = self.error.as_dict() if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the StatementStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.error: - body["error"] = self.error + body["{error}"] = self.error if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementStatus: """Deserializes the StatementStatus from a dictionary.""" - return cls(error=_from_dict(d, "error", ServiceError), state=_enum(d, "state", StatementState)) + return cls(error=_from_dict(d, "{error}", ServiceError), state=_enum(d, "{state}", StatementState)) class Status(Enum): @@ -6607,20 +6606,20 @@ def as_dict(self) -> dict: """Serializes the Success into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message.value + body["{message}"] = self.message.value return body def as_shallow_dict(self) -> dict: """Serializes the Success into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Success: """Deserializes the Success from a dictionary.""" - return cls(message=_enum(d, "message", SuccessMessage)) + return cls(message=_enum(d, "{message}", SuccessMessage)) class SuccessMessage(Enum): @@ -6643,31 +6642,31 @@ def as_dict(self) -> dict: """Serializes the TerminationReason into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["code"] = self.code.value + body["{code}"] = self.code.value if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.type is not None: - body["type"] = self.type.value + body["{type}"] = self.type.value return body def as_shallow_dict(self) -> dict: """Serializes the TerminationReason into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["code"] = self.code + body["{code}"] = self.code if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TerminationReason: """Deserializes the TerminationReason from a dictionary.""" return cls( - code=_enum(d, "code", TerminationReasonCode), - parameters=d.get("parameters", None), - type=_enum(d, "type", TerminationReasonType), + code=_enum(d, "{code}", TerminationReasonCode), + parameters=d.get("{parameters}", None), + type=_enum(d, "{type}", TerminationReasonType), ) @@ -6772,20 +6771,20 @@ def as_dict(self) -> dict: """Serializes the TextValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the TextValue into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TextValue: """Deserializes the TextValue from a dictionary.""" - return cls(value=d.get("value", None)) + return cls(value=d.get("{value}", None)) @dataclass @@ -6800,24 +6799,24 @@ def as_dict(self) -> dict: """Serializes the TimeRange into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time_ms is not None: - body["end_time_ms"] = self.end_time_ms + body["{end_time_ms}"] = self.end_time_ms if self.start_time_ms is not None: - body["start_time_ms"] = self.start_time_ms + body["{start_time_ms}"] = self.start_time_ms return body def as_shallow_dict(self) -> dict: """Serializes the TimeRange into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time_ms is not None: - body["end_time_ms"] = self.end_time_ms + body["{end_time_ms}"] = self.end_time_ms if self.start_time_ms is not None: - body["start_time_ms"] = self.start_time_ms + body["{start_time_ms}"] = self.start_time_ms return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TimeRange: """Deserializes the TimeRange from a dictionary.""" - return cls(end_time_ms=d.get("end_time_ms", None), start_time_ms=d.get("start_time_ms", None)) + return cls(end_time_ms=d.get("{end_time_ms}", None), start_time_ms=d.get("{start_time_ms}", None)) @dataclass @@ -6829,20 +6828,20 @@ def as_dict(self) -> dict: """Serializes the TransferOwnershipObjectId into a dictionary suitable for use as a JSON request body.""" body = {} if self.new_owner is not None: - body["new_owner"] = self.new_owner + body["{new_owner}"] = self.new_owner return body def as_shallow_dict(self) -> dict: """Serializes the TransferOwnershipObjectId into a shallow dictionary of its immediate attributes.""" body = {} if self.new_owner is not None: - body["new_owner"] = self.new_owner + body["{new_owner}"] = self.new_owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransferOwnershipObjectId: """Deserializes the TransferOwnershipObjectId from a dictionary.""" - return cls(new_owner=d.get("new_owner", None)) + return cls(new_owner=d.get("{new_owner}", None)) @dataclass @@ -6866,31 +6865,31 @@ def as_dict(self) -> dict: """Serializes the UpdateAlertRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert: - body["alert"] = self.alert.as_dict() + body["{alert}"] = self.alert.as_dict() if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask return body def as_shallow_dict(self) -> dict: """Serializes the UpdateAlertRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.alert: - body["alert"] = self.alert + body["{alert}"] = self.alert if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAlertRequest: """Deserializes the UpdateAlertRequest from a dictionary.""" return cls( - alert=_from_dict(d, "alert", UpdateAlertRequestAlert), - id=d.get("id", None), - update_mask=d.get("update_mask", None), + alert=_from_dict(d, "{alert}", UpdateAlertRequestAlert), + id=d.get("{id}", None), + update_mask=d.get("{update_mask}", None), ) @@ -6930,56 +6929,56 @@ def as_dict(self) -> dict: """Serializes the UpdateAlertRequestAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["condition"] = self.condition.as_dict() + body["{condition}"] = self.condition.as_dict() if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger return body def as_shallow_dict(self) -> dict: """Serializes the UpdateAlertRequestAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["condition"] = self.condition + body["{condition}"] = self.condition if self.custom_body is not None: - body["custom_body"] = self.custom_body + body["{custom_body}"] = self.custom_body if self.custom_subject is not None: - body["custom_subject"] = self.custom_subject + body["{custom_subject}"] = self.custom_subject if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.notify_on_ok is not None: - body["notify_on_ok"] = self.notify_on_ok + body["{notify_on_ok}"] = self.notify_on_ok if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.seconds_to_retrigger is not None: - body["seconds_to_retrigger"] = self.seconds_to_retrigger + body["{seconds_to_retrigger}"] = self.seconds_to_retrigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAlertRequestAlert: """Deserializes the UpdateAlertRequestAlert from a dictionary.""" return cls( - condition=_from_dict(d, "condition", AlertCondition), - custom_body=d.get("custom_body", None), - custom_subject=d.get("custom_subject", None), - display_name=d.get("display_name", None), - notify_on_ok=d.get("notify_on_ok", None), - owner_user_name=d.get("owner_user_name", None), - query_id=d.get("query_id", None), - seconds_to_retrigger=d.get("seconds_to_retrigger", None), + condition=_from_dict(d, "{condition}", AlertCondition), + custom_body=d.get("{custom_body}", None), + custom_subject=d.get("{custom_subject}", None), + display_name=d.get("{display_name}", None), + notify_on_ok=d.get("{notify_on_ok}", None), + owner_user_name=d.get("{owner_user_name}", None), + query_id=d.get("{query_id}", None), + seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), ) @@ -7004,31 +7003,31 @@ def as_dict(self) -> dict: """Serializes the UpdateQueryRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.query: - body["query"] = self.query.as_dict() + body["{query}"] = self.query.as_dict() if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask return body def as_shallow_dict(self) -> dict: """Serializes the UpdateQueryRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.query: - body["query"] = self.query + body["{query}"] = self.query if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateQueryRequest: """Deserializes the UpdateQueryRequest from a dictionary.""" return cls( - id=d.get("id", None), - query=_from_dict(d, "query", UpdateQueryRequestQuery), - update_mask=d.get("update_mask", None), + id=d.get("{id}", None), + query=_from_dict(d, "{query}", UpdateQueryRequestQuery), + update_mask=d.get("{update_mask}", None), ) @@ -7070,71 +7069,71 @@ def as_dict(self) -> dict: """Serializes the UpdateQueryRequestQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parameters: - body["parameters"] = [v.as_dict() for v in self.parameters] + body["{parameters}"] = [v.as_dict() for v in self.parameters] if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode.value + body["{run_as_mode}"] = self.run_as_mode.value if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = [v for v in self.tags] + body["{tags}"] = [v for v in self.tags] if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the UpdateQueryRequestQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["apply_auto_limit"] = self.apply_auto_limit + body["{apply_auto_limit}"] = self.apply_auto_limit if self.catalog is not None: - body["catalog"] = self.catalog + body["{catalog}"] = self.catalog if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.owner_user_name is not None: - body["owner_user_name"] = self.owner_user_name + body["{owner_user_name}"] = self.owner_user_name if self.parameters: - body["parameters"] = self.parameters + body["{parameters}"] = self.parameters if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.run_as_mode is not None: - body["run_as_mode"] = self.run_as_mode + body["{run_as_mode}"] = self.run_as_mode if self.schema is not None: - body["schema"] = self.schema + body["{schema}"] = self.schema if self.tags: - body["tags"] = self.tags + body["{tags}"] = self.tags if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateQueryRequestQuery: """Deserializes the UpdateQueryRequestQuery from a dictionary.""" return cls( - apply_auto_limit=d.get("apply_auto_limit", None), - catalog=d.get("catalog", None), - description=d.get("description", None), - display_name=d.get("display_name", None), - owner_user_name=d.get("owner_user_name", None), - parameters=_repeated_dict(d, "parameters", QueryParameter), - query_text=d.get("query_text", None), - run_as_mode=_enum(d, "run_as_mode", RunAsMode), - schema=d.get("schema", None), - tags=d.get("tags", None), - warehouse_id=d.get("warehouse_id", None), + apply_auto_limit=d.get("{apply_auto_limit}", None), + catalog=d.get("{catalog}", None), + description=d.get("{description}", None), + display_name=d.get("{display_name}", None), + owner_user_name=d.get("{owner_user_name}", None), + parameters=_repeated_dict(d, "{parameters}", QueryParameter), + query_text=d.get("{query_text}", None), + run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), + schema=d.get("{schema}", None), + tags=d.get("{tags}", None), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -7177,31 +7176,31 @@ def as_dict(self) -> dict: """Serializes the UpdateVisualizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask if self.visualization: - body["visualization"] = self.visualization.as_dict() + body["{visualization}"] = self.visualization.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the UpdateVisualizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.update_mask is not None: - body["update_mask"] = self.update_mask + body["{update_mask}"] = self.update_mask if self.visualization: - body["visualization"] = self.visualization + body["{visualization}"] = self.visualization return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateVisualizationRequest: """Deserializes the UpdateVisualizationRequest from a dictionary.""" return cls( - id=d.get("id", None), - update_mask=d.get("update_mask", None), - visualization=_from_dict(d, "visualization", UpdateVisualizationRequestVisualization), + id=d.get("{id}", None), + update_mask=d.get("{update_mask}", None), + visualization=_from_dict(d, "{visualization}", UpdateVisualizationRequestVisualization), ) @@ -7225,36 +7224,36 @@ def as_dict(self) -> dict: """Serializes the UpdateVisualizationRequestVisualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.serialized_options is not None: - body["serialized_options"] = self.serialized_options + body["{serialized_options}"] = self.serialized_options if self.serialized_query_plan is not None: - body["serialized_query_plan"] = self.serialized_query_plan + body["{serialized_query_plan}"] = self.serialized_query_plan if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body def as_shallow_dict(self) -> dict: """Serializes the UpdateVisualizationRequestVisualization into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.serialized_options is not None: - body["serialized_options"] = self.serialized_options + body["{serialized_options}"] = self.serialized_options if self.serialized_query_plan is not None: - body["serialized_query_plan"] = self.serialized_query_plan + body["{serialized_query_plan}"] = self.serialized_query_plan if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateVisualizationRequestVisualization: """Deserializes the UpdateVisualizationRequestVisualization from a dictionary.""" return cls( - display_name=d.get("display_name", None), - serialized_options=d.get("serialized_options", None), - serialized_query_plan=d.get("serialized_query_plan", None), - type=d.get("type", None), + display_name=d.get("{display_name}", None), + serialized_options=d.get("{serialized_options}", None), + serialized_query_plan=d.get("{serialized_query_plan}", None), + type=d.get("{type}", None), ) @@ -7270,28 +7269,28 @@ def as_dict(self) -> dict: """Serializes the User into a dictionary suitable for use as a JSON request body.""" body = {} if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the User into a shallow dictionary of its immediate attributes.""" body = {} if self.email is not None: - body["email"] = self.email + body["{email}"] = self.email if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> User: """Deserializes the User from a dictionary.""" - return cls(email=d.get("email", None), id=d.get("id", None), name=d.get("name", None)) + return cls(email=d.get("{email}", None), id=d.get("{id}", None), name=d.get("{name}", None)) @dataclass @@ -7326,56 +7325,56 @@ def as_dict(self) -> dict: """Serializes the Visualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.serialized_options is not None: - body["serialized_options"] = self.serialized_options + body["{serialized_options}"] = self.serialized_options if self.serialized_query_plan is not None: - body["serialized_query_plan"] = self.serialized_query_plan + body["{serialized_query_plan}"] = self.serialized_query_plan if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body def as_shallow_dict(self) -> dict: """Serializes the Visualization into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["create_time"] = self.create_time + body["{create_time}"] = self.create_time if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.query_id is not None: - body["query_id"] = self.query_id + body["{query_id}"] = self.query_id if self.serialized_options is not None: - body["serialized_options"] = self.serialized_options + body["{serialized_options}"] = self.serialized_options if self.serialized_query_plan is not None: - body["serialized_query_plan"] = self.serialized_query_plan + body["{serialized_query_plan}"] = self.serialized_query_plan if self.type is not None: - body["type"] = self.type + body["{type}"] = self.type if self.update_time is not None: - body["update_time"] = self.update_time + body["{update_time}"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Visualization: """Deserializes the Visualization from a dictionary.""" return cls( - create_time=d.get("create_time", None), - display_name=d.get("display_name", None), - id=d.get("id", None), - query_id=d.get("query_id", None), - serialized_options=d.get("serialized_options", None), - serialized_query_plan=d.get("serialized_query_plan", None), - type=d.get("type", None), - update_time=d.get("update_time", None), + create_time=d.get("{create_time}", None), + display_name=d.get("{display_name}", None), + id=d.get("{id}", None), + query_id=d.get("{query_id}", None), + serialized_options=d.get("{serialized_options}", None), + serialized_query_plan=d.get("{serialized_query_plan}", None), + type=d.get("{type}", None), + update_time=d.get("{update_time}", None), ) @@ -7397,36 +7396,36 @@ def as_dict(self) -> dict: """Serializes the WarehouseAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the WarehouseAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehouseAccessControlRequest: """Deserializes the WarehouseAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", WarehousePermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", WarehousePermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -7451,41 +7450,41 @@ def as_dict(self) -> dict: """Serializes the WarehouseAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the WarehouseAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehouseAccessControlResponse: """Deserializes the WarehouseAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", WarehousePermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", WarehousePermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -7502,31 +7501,31 @@ def as_dict(self) -> dict: """Serializes the WarehousePermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the WarehousePermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermission: """Deserializes the WarehousePermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", WarehousePermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", WarehousePermissionLevel), ) @@ -7552,31 +7551,31 @@ def as_dict(self) -> dict: """Serializes the WarehousePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the WarehousePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissions: """Deserializes the WarehousePermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", WarehouseAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", WarehouseAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -7591,26 +7590,26 @@ def as_dict(self) -> dict: """Serializes the WarehousePermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the WarehousePermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissionsDescription: """Deserializes the WarehousePermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", WarehousePermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", WarehousePermissionLevel), ) @@ -7625,26 +7624,26 @@ def as_dict(self) -> dict: """Serializes the WarehousePermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: """Serializes the WarehousePermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.warehouse_id is not None: - body["warehouse_id"] = self.warehouse_id + body["{warehouse_id}"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissionsRequest: """Deserializes the WarehousePermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", WarehouseAccessControlRequest), - warehouse_id=d.get("warehouse_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", WarehouseAccessControlRequest), + warehouse_id=d.get("{warehouse_id}", None), ) @@ -7661,25 +7660,26 @@ def as_dict(self) -> dict: """Serializes the WarehouseTypePair into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type.value + body["{warehouse_type}"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: """Serializes the WarehouseTypePair into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["enabled"] = self.enabled + body["{enabled}"] = self.enabled if self.warehouse_type is not None: - body["warehouse_type"] = self.warehouse_type + body["{warehouse_type}"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehouseTypePair: """Deserializes the WarehouseTypePair from a dictionary.""" return cls( - enabled=d.get("enabled", None), warehouse_type=_enum(d, "warehouse_type", WarehouseTypePairWarehouseType) + enabled=d.get("{enabled}", None), + warehouse_type=_enum(d, "{warehouse_type}", WarehouseTypePairWarehouseType), ) @@ -7711,36 +7711,36 @@ def as_dict(self) -> dict: """Serializes the Widget into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.options: - body["options"] = self.options.as_dict() + body["{options}"] = self.options.as_dict() if self.visualization: - body["visualization"] = self.visualization.as_dict() + body["{visualization}"] = self.visualization.as_dict() if self.width is not None: - body["width"] = self.width + body["{width}"] = self.width return body def as_shallow_dict(self) -> dict: """Serializes the Widget into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.options: - body["options"] = self.options + body["{options}"] = self.options if self.visualization: - body["visualization"] = self.visualization + body["{visualization}"] = self.visualization if self.width is not None: - body["width"] = self.width + body["{width}"] = self.width return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Widget: """Deserializes the Widget from a dictionary.""" return cls( - id=d.get("id", None), - options=_from_dict(d, "options", WidgetOptions), - visualization=_from_dict(d, "visualization", LegacyVisualization), - width=d.get("width", None), + id=d.get("{id}", None), + options=_from_dict(d, "{options}", WidgetOptions), + visualization=_from_dict(d, "{visualization}", LegacyVisualization), + width=d.get("{width}", None), ) @@ -7773,51 +7773,51 @@ def as_dict(self) -> dict: """Serializes the WidgetOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.is_hidden is not None: - body["isHidden"] = self.is_hidden + body["{is_hidden}"] = self.is_hidden if self.parameter_mappings: - body["parameterMappings"] = self.parameter_mappings + body["{parameter_mappings}"] = self.parameter_mappings if self.position: - body["position"] = self.position.as_dict() + body["{position}"] = self.position.as_dict() if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body def as_shallow_dict(self) -> dict: """Serializes the WidgetOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.is_hidden is not None: - body["isHidden"] = self.is_hidden + body["{is_hidden}"] = self.is_hidden if self.parameter_mappings: - body["parameterMappings"] = self.parameter_mappings + body["{parameter_mappings}"] = self.parameter_mappings if self.position: - body["position"] = self.position + body["{position}"] = self.position if self.title is not None: - body["title"] = self.title + body["{title}"] = self.title if self.updated_at is not None: - body["updated_at"] = self.updated_at + body["{updated_at}"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WidgetOptions: """Deserializes the WidgetOptions from a dictionary.""" return cls( - created_at=d.get("created_at", None), - description=d.get("description", None), - is_hidden=d.get("isHidden", None), - parameter_mappings=d.get("parameterMappings", None), - position=_from_dict(d, "position", WidgetPosition), - title=d.get("title", None), - updated_at=d.get("updated_at", None), + created_at=d.get("{created_at}", None), + description=d.get("{description}", None), + is_hidden=d.get("{is_hidden}", None), + parameter_mappings=d.get("{parameter_mappings}", None), + position=_from_dict(d, "{position}", WidgetPosition), + title=d.get("{title}", None), + updated_at=d.get("{updated_at}", None), ) @@ -7845,41 +7845,41 @@ def as_dict(self) -> dict: """Serializes the WidgetPosition into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_height is not None: - body["autoHeight"] = self.auto_height + body["{auto_height}"] = self.auto_height if self.col is not None: - body["col"] = self.col + body["{col}"] = self.col if self.row is not None: - body["row"] = self.row + body["{row}"] = self.row if self.size_x is not None: - body["sizeX"] = self.size_x + body["{size_x}"] = self.size_x if self.size_y is not None: - body["sizeY"] = self.size_y + body["{size_y}"] = self.size_y return body def as_shallow_dict(self) -> dict: """Serializes the WidgetPosition into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_height is not None: - body["autoHeight"] = self.auto_height + body["{auto_height}"] = self.auto_height if self.col is not None: - body["col"] = self.col + body["{col}"] = self.col if self.row is not None: - body["row"] = self.row + body["{row}"] = self.row if self.size_x is not None: - body["sizeX"] = self.size_x + body["{size_x}"] = self.size_x if self.size_y is not None: - body["sizeY"] = self.size_y + body["{size_y}"] = self.size_y return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WidgetPosition: """Deserializes the WidgetPosition from a dictionary.""" return cls( - auto_height=d.get("autoHeight", None), - col=d.get("col", None), - row=d.get("row", None), - size_x=d.get("sizeX", None), - size_y=d.get("sizeY", None), + auto_height=d.get("{auto_height}", None), + col=d.get("{col}", None), + row=d.get("{row}", None), + size_x=d.get("{size_x}", None), + size_y=d.get("{size_y}", None), ) @@ -7903,10 +7903,10 @@ def create(self, *, alert: Optional[CreateAlertRequestAlert] = None) -> Alert: """ body = {} if alert is not None: - body["alert"] = alert.as_dict() + body["{alert}"] = alert.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/sql/alerts", body=body, headers=headers) @@ -7925,7 +7925,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/sql/alerts/{id}", headers=headers) @@ -7941,7 +7941,7 @@ def get(self, id: str) -> Alert: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/sql/alerts/{id}", headers=headers) @@ -7963,21 +7963,21 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/sql/alerts", query=query, headers=headers) - if "results" in json: - for v in json["results"]: + if "{results}" in json: + for v in json["{results}"]: yield ListAlertsResponseAlert.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, id: str, update_mask: str, *, alert: Optional[UpdateAlertRequestAlert] = None) -> Alert: """Update an alert. @@ -8001,12 +8001,12 @@ def update(self, id: str, update_mask: str, *, alert: Optional[UpdateAlertReques """ body = {} if alert is not None: - body["alert"] = alert.as_dict() + body["{alert}"] = alert.as_dict() if update_mask is not None: - body["update_mask"] = update_mask + body["{update_mask}"] = update_mask headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/sql/alerts/{id}", body=body, headers=headers) @@ -8062,18 +8062,18 @@ def create( """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options.as_dict() + body["{options}"] = options.as_dict() if parent is not None: - body["parent"] = parent + body["{parent}"] = parent if query_id is not None: - body["query_id"] = query_id + body["{query_id}"] = query_id if rearm is not None: - body["rearm"] = rearm + body["{rearm}"] = rearm headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/sql/alerts", body=body, headers=headers) @@ -8096,7 +8096,7 @@ def delete(self, alert_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/preview/sql/alerts/{alert_id}", headers=headers) @@ -8117,7 +8117,7 @@ def get(self, alert_id: str) -> LegacyAlert: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/preview/sql/alerts/{alert_id}", headers=headers) @@ -8137,7 +8137,7 @@ def list(self) -> Iterator[LegacyAlert]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/preview/sql/alerts", headers=headers) @@ -8168,16 +8168,16 @@ def update(self, alert_id: str, name: str, options: AlertOptions, query_id: str, """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options.as_dict() + body["{options}"] = options.as_dict() if query_id is not None: - body["query_id"] = query_id + body["{query_id}"] = query_id if rearm is not None: - body["rearm"] = rearm + body["{rearm}"] = rearm headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PUT", f"/api/2.0/preview/sql/alerts/{alert_id}", body=body, headers=headers) @@ -8216,18 +8216,18 @@ def create( """ body = {} if dashboard_id is not None: - body["dashboard_id"] = dashboard_id + body["{dashboard_id}"] = dashboard_id if options is not None: - body["options"] = options.as_dict() + body["{options}"] = options.as_dict() if text is not None: - body["text"] = text + body["{text}"] = text if visualization_id is not None: - body["visualization_id"] = visualization_id + body["{visualization_id}"] = visualization_id if width is not None: - body["width"] = width + body["{width}"] = width headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/sql/widgets", body=body, headers=headers) @@ -8243,7 +8243,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/preview/sql/widgets/{id}", headers=headers) @@ -8277,18 +8277,18 @@ def update( """ body = {} if dashboard_id is not None: - body["dashboard_id"] = dashboard_id + body["{dashboard_id}"] = dashboard_id if options is not None: - body["options"] = options.as_dict() + body["{options}"] = options.as_dict() if text is not None: - body["text"] = text + body["{text}"] = text if visualization_id is not None: - body["visualization_id"] = visualization_id + body["{visualization_id}"] = visualization_id if width is not None: - body["width"] = width + body["{width}"] = width headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/preview/sql/widgets/{id}", body=body, headers=headers) @@ -8334,20 +8334,20 @@ def create( """ body = {} if dashboard_filters_enabled is not None: - body["dashboard_filters_enabled"] = dashboard_filters_enabled + body["{dashboard_filters_enabled}"] = dashboard_filters_enabled if is_favorite is not None: - body["is_favorite"] = is_favorite + body["{is_favorite}"] = is_favorite if name is not None: - body["name"] = name + body["{name}"] = name if parent is not None: - body["parent"] = parent + body["{parent}"] = parent if run_as_role is not None: - body["run_as_role"] = run_as_role.value + body["{run_as_role}"] = run_as_role.value if tags is not None: - body["tags"] = [v for v in tags] + body["{tags}"] = [v for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/sql/dashboards", body=body, headers=headers) @@ -8365,7 +8365,7 @@ def delete(self, dashboard_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", headers=headers) @@ -8381,7 +8381,7 @@ def get(self, dashboard_id: str) -> Dashboard: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", headers=headers) @@ -8416,32 +8416,32 @@ def list( query = {} if order is not None: - query["order"] = order.value + query["{order}"] = order.value if page is not None: - query["page"] = page + query["{page}"] = page if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if q is not None: - query["q"] = q + query["{q}"] = q headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["page"] = 1 + query["{page}"] = 1 while True: json = self._api.do("GET", "/api/2.0/preview/sql/dashboards", query=query, headers=headers) - if "results" in json: - for v in json["results"]: - i = v["id"] + if "{results}" in json: + for v in json["{results}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield Dashboard.from_dict(v) - if "results" not in json or not json["results"]: + if "{results}" not in json or not json["{results}"]: return - query["page"] += 1 + query["{page}"] += 1 def restore(self, dashboard_id: str): """Restore a dashboard. @@ -8454,7 +8454,7 @@ def restore(self, dashboard_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("POST", f"/api/2.0/preview/sql/dashboards/trash/{dashboard_id}", headers=headers) @@ -8486,14 +8486,14 @@ def update( """ body = {} if name is not None: - body["name"] = name + body["{name}"] = name if run_as_role is not None: - body["run_as_role"] = run_as_role.value + body["{run_as_role}"] = run_as_role.value if tags is not None: - body["tags"] = [v for v in tags] + body["{tags}"] = [v for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", body=body, headers=headers) @@ -8532,7 +8532,7 @@ def list(self) -> Iterator[DataSource]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/preview/sql/data_sources", headers=headers) @@ -8578,7 +8578,7 @@ def get(self, object_type: ObjectTypePlural, object_id: str) -> GetResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}", headers=headers) @@ -8611,10 +8611,10 @@ def set( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -8645,10 +8645,10 @@ def transfer_ownership( """ body = {} if new_owner is not None: - body["new_owner"] = new_owner + body["{new_owner}"] = new_owner headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -8679,10 +8679,10 @@ def create(self, *, query: Optional[CreateQueryRequestQuery] = None) -> Query: """ body = {} if query is not None: - body["query"] = query.as_dict() + body["{query}"] = query.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/sql/queries", body=body, headers=headers) @@ -8701,7 +8701,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/sql/queries/{id}", headers=headers) @@ -8717,7 +8717,7 @@ def get(self, id: str) -> Query: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/sql/queries/{id}", headers=headers) @@ -8739,21 +8739,21 @@ def list( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/sql/queries", query=query, headers=headers) - if "results" in json: - for v in json["results"]: + if "{results}" in json: + for v in json["{results}"]: yield ListQueryObjectsResponseQuery.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def list_visualizations( self, id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -8771,21 +8771,21 @@ def list_visualizations( query = {} if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/sql/queries/{id}/visualizations", query=query, headers=headers) - if "results" in json: - for v in json["results"]: + if "{results}" in json: + for v in json["{results}"]: yield Visualization.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def update(self, id: str, update_mask: str, *, query: Optional[UpdateQueryRequestQuery] = None) -> Query: """Update a query. @@ -8809,12 +8809,12 @@ def update(self, id: str, update_mask: str, *, query: Optional[UpdateQueryReques """ body = {} if query is not None: - body["query"] = query.as_dict() + body["{query}"] = query.as_dict() if update_mask is not None: - body["update_mask"] = update_mask + body["{update_mask}"] = update_mask headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/sql/queries/{id}", body=body, headers=headers) @@ -8888,24 +8888,24 @@ def create( """ body = {} if data_source_id is not None: - body["data_source_id"] = data_source_id + body["{data_source_id}"] = data_source_id if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options + body["{options}"] = options if parent is not None: - body["parent"] = parent + body["{parent}"] = parent if query is not None: - body["query"] = query + body["{query}"] = query if run_as_role is not None: - body["run_as_role"] = run_as_role.value + body["{run_as_role}"] = run_as_role.value if tags is not None: - body["tags"] = [v for v in tags] + body["{tags}"] = [v for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/sql/queries", body=body, headers=headers) @@ -8928,7 +8928,7 @@ def delete(self, query_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/preview/sql/queries/{query_id}", headers=headers) @@ -8950,7 +8950,7 @@ def get(self, query_id: str) -> LegacyQuery: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/preview/sql/queries/{query_id}", headers=headers) @@ -9002,32 +9002,32 @@ def list( query = {} if order is not None: - query["order"] = order + query["{order}"] = order if page is not None: - query["page"] = page + query["{page}"] = page if page_size is not None: - query["page_size"] = page_size + query["{page_size}"] = page_size if q is not None: - query["q"] = q + query["{q}"] = q headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["page"] = 1 + query["{page}"] = 1 while True: json = self._api.do("GET", "/api/2.0/preview/sql/queries", query=query, headers=headers) - if "results" in json: - for v in json["results"]: - i = v["id"] + if "{results}" in json: + for v in json["{results}"]: + i = v["{id}"] if i in seen: continue seen.add(i) yield LegacyQuery.from_dict(v) - if "results" not in json or not json["results"]: + if "{results}" not in json or not json["{results}"]: return - query["page"] += 1 + query["{page}"] += 1 def restore(self, query_id: str): """Restore a query. @@ -9046,7 +9046,7 @@ def restore(self, query_id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("POST", f"/api/2.0/preview/sql/queries/trash/{query_id}", headers=headers) @@ -9099,22 +9099,22 @@ def update( """ body = {} if data_source_id is not None: - body["data_source_id"] = data_source_id + body["{data_source_id}"] = data_source_id if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options + body["{options}"] = options if query is not None: - body["query"] = query + body["{query}"] = query if run_as_role is not None: - body["run_as_role"] = run_as_role.value + body["{run_as_role}"] = run_as_role.value if tags is not None: - body["tags"] = [v for v in tags] + body["{tags}"] = [v for v in tags] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/preview/sql/queries/{query_id}", body=body, headers=headers) @@ -9161,15 +9161,15 @@ def list( query = {} if filter_by is not None: - query["filter_by"] = filter_by.as_dict() + query["{filter_by}"] = filter_by.as_dict() if include_metrics is not None: - query["include_metrics"] = include_metrics + query["{include_metrics}"] = include_metrics if max_results is not None: - query["max_results"] = max_results + query["{max_results}"] = max_results if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/sql/history/queries", query=query, headers=headers) @@ -9194,10 +9194,10 @@ def create(self, *, visualization: Optional[CreateVisualizationRequestVisualizat """ body = {} if visualization is not None: - body["visualization"] = visualization.as_dict() + body["{visualization}"] = visualization.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/sql/visualizations", body=body, headers=headers) @@ -9214,7 +9214,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/sql/visualizations/{id}", headers=headers) @@ -9243,12 +9243,12 @@ def update( """ body = {} if update_mask is not None: - body["update_mask"] = update_mask + body["{update_mask}"] = update_mask if visualization is not None: - body["visualization"] = visualization.as_dict() + body["{visualization}"] = visualization.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/sql/visualizations/{id}", body=body, headers=headers) @@ -9295,18 +9295,18 @@ def create( """ body = {} if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options + body["{options}"] = options if query_id is not None: - body["query_id"] = query_id + body["{query_id}"] = query_id if type is not None: - body["type"] = type + body["{type}"] = type headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/preview/sql/visualizations", body=body, headers=headers) @@ -9329,7 +9329,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/preview/sql/visualizations/{id}", headers=headers) @@ -9374,22 +9374,22 @@ def update( """ body = {} if created_at is not None: - body["created_at"] = created_at + body["{created_at}"] = created_at if description is not None: - body["description"] = description + body["{description}"] = description if name is not None: - body["name"] = name + body["{name}"] = name if options is not None: - body["options"] = options + body["{options}"] = options if query is not None: - body["query"] = query.as_dict() + body["{query}"] = query.as_dict() if type is not None: - body["type"] = type + body["{type}"] = type if updated_at is not None: - body["updated_at"] = updated_at + body["{updated_at}"] = updated_at headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/preview/sql/visualizations/{id}", body=body, headers=headers) @@ -9409,7 +9409,7 @@ def get_config(self) -> ClientConfig: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/redash-v2/config", headers=headers) @@ -9647,30 +9647,30 @@ def execute_statement( """ body = {} if byte_limit is not None: - body["byte_limit"] = byte_limit + body["{byte_limit}"] = byte_limit if catalog is not None: - body["catalog"] = catalog + body["{catalog}"] = catalog if disposition is not None: - body["disposition"] = disposition.value + body["{disposition}"] = disposition.value if format is not None: - body["format"] = format.value + body["{format}"] = format.value if on_wait_timeout is not None: - body["on_wait_timeout"] = on_wait_timeout.value + body["{on_wait_timeout}"] = on_wait_timeout.value if parameters is not None: - body["parameters"] = [v.as_dict() for v in parameters] + body["{parameters}"] = [v.as_dict() for v in parameters] if row_limit is not None: - body["row_limit"] = row_limit + body["{row_limit}"] = row_limit if schema is not None: - body["schema"] = schema + body["{schema}"] = schema if statement is not None: - body["statement"] = statement + body["{statement}"] = statement if wait_timeout is not None: - body["wait_timeout"] = wait_timeout + body["{wait_timeout}"] = wait_timeout if warehouse_id is not None: - body["warehouse_id"] = warehouse_id + body["{warehouse_id}"] = warehouse_id headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/sql/statements/", body=body, headers=headers) @@ -9695,7 +9695,7 @@ def get_statement(self, statement_id: str) -> StatementResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/sql/statements/{statement_id}", headers=headers) @@ -9720,7 +9720,7 @@ def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> R """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -9736,67 +9736,6 @@ class WarehousesAPI: def __init__(self, api_client): self._api = api_client - def wait_get_warehouse_running( - self, id: str, timeout=timedelta(minutes=20), callback: Optional[Callable[[GetWarehouseResponse], None]] = None - ) -> GetWarehouseResponse: - deadline = time.time() + timeout.total_seconds() - target_states = (State.RUNNING,) - failure_states = ( - State.STOPPED, - State.DELETED, - ) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(id=id) - status = poll.state - status_message = f"current status: {status}" - if poll.health: - status_message = poll.health.summary - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach RUNNING, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"id={id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - - def wait_get_warehouse_stopped( - self, id: str, timeout=timedelta(minutes=20), callback: Optional[Callable[[GetWarehouseResponse], None]] = None - ) -> GetWarehouseResponse: - deadline = time.time() + timeout.total_seconds() - target_states = (State.STOPPED,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get(id=id) - status = poll.state - status_message = f"current status: {status}" - if poll.health: - status_message = poll.health.summary - if status in target_states: - return poll - if callback: - callback(poll) - prefix = f"id={id}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create( self, *, @@ -9876,45 +9815,45 @@ def create( :returns: Long-running operation waiter for :class:`GetWarehouseResponse`. - See :method:wait_get_warehouse_running for more details. + See :method:WaitGetWarehouseRunning for more details. """ body = {} if auto_stop_mins is not None: - body["auto_stop_mins"] = auto_stop_mins + body["{auto_stop_mins}"] = auto_stop_mins if channel is not None: - body["channel"] = channel.as_dict() + body["{channel}"] = channel.as_dict() if cluster_size is not None: - body["cluster_size"] = cluster_size + body["{cluster_size}"] = cluster_size if creator_name is not None: - body["creator_name"] = creator_name + body["{creator_name}"] = creator_name if enable_photon is not None: - body["enable_photon"] = enable_photon + body["{enable_photon}"] = enable_photon if enable_serverless_compute is not None: - body["enable_serverless_compute"] = enable_serverless_compute + body["{enable_serverless_compute}"] = enable_serverless_compute if instance_profile_arn is not None: - body["instance_profile_arn"] = instance_profile_arn + body["{instance_profile_arn}"] = instance_profile_arn if max_num_clusters is not None: - body["max_num_clusters"] = max_num_clusters + body["{max_num_clusters}"] = max_num_clusters if min_num_clusters is not None: - body["min_num_clusters"] = min_num_clusters + body["{min_num_clusters}"] = min_num_clusters if name is not None: - body["name"] = name + body["{name}"] = name if spot_instance_policy is not None: - body["spot_instance_policy"] = spot_instance_policy.value + body["{spot_instance_policy}"] = spot_instance_policy.value if tags is not None: - body["tags"] = tags.as_dict() + body["{tags}"] = tags.as_dict() if warehouse_type is not None: - body["warehouse_type"] = warehouse_type.value + body["{warehouse_type}"] = warehouse_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.0/sql/warehouses", body=body, headers=headers) return Wait( - self.wait_get_warehouse_running, + self.WaitGetWarehouseRunning, response=CreateWarehouseResponse.from_dict(op_response), - id=op_response["id"], + id=op_response["{id}"], ) def create_and_wait( @@ -9963,7 +9902,7 @@ def delete(self, id: str): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/sql/warehouses/{id}", headers=headers) @@ -10049,42 +9988,42 @@ def edit( :returns: Long-running operation waiter for :class:`GetWarehouseResponse`. - See :method:wait_get_warehouse_running for more details. + See :method:WaitGetWarehouseRunning for more details. """ body = {} if auto_stop_mins is not None: - body["auto_stop_mins"] = auto_stop_mins + body["{auto_stop_mins}"] = auto_stop_mins if channel is not None: - body["channel"] = channel.as_dict() + body["{channel}"] = channel.as_dict() if cluster_size is not None: - body["cluster_size"] = cluster_size + body["{cluster_size}"] = cluster_size if creator_name is not None: - body["creator_name"] = creator_name + body["{creator_name}"] = creator_name if enable_photon is not None: - body["enable_photon"] = enable_photon + body["{enable_photon}"] = enable_photon if enable_serverless_compute is not None: - body["enable_serverless_compute"] = enable_serverless_compute + body["{enable_serverless_compute}"] = enable_serverless_compute if instance_profile_arn is not None: - body["instance_profile_arn"] = instance_profile_arn + body["{instance_profile_arn}"] = instance_profile_arn if max_num_clusters is not None: - body["max_num_clusters"] = max_num_clusters + body["{max_num_clusters}"] = max_num_clusters if min_num_clusters is not None: - body["min_num_clusters"] = min_num_clusters + body["{min_num_clusters}"] = min_num_clusters if name is not None: - body["name"] = name + body["{name}"] = name if spot_instance_policy is not None: - body["spot_instance_policy"] = spot_instance_policy.value + body["{spot_instance_policy}"] = spot_instance_policy.value if tags is not None: - body["tags"] = tags.as_dict() + body["{tags}"] = tags.as_dict() if warehouse_type is not None: - body["warehouse_type"] = warehouse_type.value + body["{warehouse_type}"] = warehouse_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/edit", body=body, headers=headers) - return Wait(self.wait_get_warehouse_running, response=EditWarehouseResponse.from_dict(op_response), id=id) + return Wait(self.WaitGetWarehouseRunning, response=EditWarehouseResponse.from_dict(op_response), id=id) def edit_and_wait( self, @@ -10134,7 +10073,7 @@ def get(self, id: str) -> GetWarehouseResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/sql/warehouses/{id}", headers=headers) @@ -10152,7 +10091,7 @@ def get_permission_levels(self, warehouse_id: str) -> GetWarehousePermissionLeve """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/warehouses/{warehouse_id}/permissionLevels", headers=headers) @@ -10171,7 +10110,7 @@ def get_permissions(self, warehouse_id: str) -> WarehousePermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/warehouses/{warehouse_id}", headers=headers) @@ -10186,7 +10125,7 @@ def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/sql/config/warehouses", headers=headers) @@ -10206,9 +10145,9 @@ def list(self, *, run_as_user_id: Optional[int] = None) -> Iterator[EndpointInfo query = {} if run_as_user_id is not None: - query["run_as_user_id"] = run_as_user_id + query["{run_as_user_id}"] = run_as_user_id headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/sql/warehouses", query=query, headers=headers) @@ -10231,10 +10170,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/warehouses/{warehouse_id}", body=body, headers=headers) @@ -10284,26 +10223,26 @@ def set_workspace_warehouse_config( """ body = {} if channel is not None: - body["channel"] = channel.as_dict() + body["{channel}"] = channel.as_dict() if config_param is not None: - body["config_param"] = config_param.as_dict() + body["{config_param}"] = config_param.as_dict() if data_access_config is not None: - body["data_access_config"] = [v.as_dict() for v in data_access_config] + body["{data_access_config}"] = [v.as_dict() for v in data_access_config] if enabled_warehouse_types is not None: - body["enabled_warehouse_types"] = [v.as_dict() for v in enabled_warehouse_types] + body["{enabled_warehouse_types}"] = [v.as_dict() for v in enabled_warehouse_types] if global_param is not None: - body["global_param"] = global_param.as_dict() + body["{global_param}"] = global_param.as_dict() if google_service_account is not None: - body["google_service_account"] = google_service_account + body["{google_service_account}"] = google_service_account if instance_profile_arn is not None: - body["instance_profile_arn"] = instance_profile_arn + body["{instance_profile_arn}"] = instance_profile_arn if security_policy is not None: - body["security_policy"] = security_policy.value + body["{security_policy}"] = security_policy.value if sql_configuration_parameters is not None: - body["sql_configuration_parameters"] = sql_configuration_parameters.as_dict() + body["{sql_configuration_parameters}"] = sql_configuration_parameters.as_dict() headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PUT", "/api/2.0/sql/config/warehouses", body=body, headers=headers) @@ -10318,15 +10257,15 @@ def start(self, id: str) -> Wait[GetWarehouseResponse]: :returns: Long-running operation waiter for :class:`GetWarehouseResponse`. - See :method:wait_get_warehouse_running for more details. + See :method:WaitGetWarehouseRunning for more details. """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", headers=headers) - return Wait(self.wait_get_warehouse_running, response=StartWarehouseResponse.from_dict(op_response), id=id) + return Wait(self.WaitGetWarehouseRunning, response=StartWarehouseResponse.from_dict(op_response), id=id) def start_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse: return self.start(id=id).result(timeout=timeout) @@ -10341,15 +10280,15 @@ def stop(self, id: str) -> Wait[GetWarehouseResponse]: :returns: Long-running operation waiter for :class:`GetWarehouseResponse`. - See :method:wait_get_warehouse_stopped for more details. + See :method:WaitGetWarehouseStopped for more details. """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", headers=headers) - return Wait(self.wait_get_warehouse_stopped, response=StopWarehouseResponse.from_dict(op_response), id=id) + return Wait(self.WaitGetWarehouseStopped, response=StopWarehouseResponse.from_dict(op_response), id=id) def stop_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse: return self.stop(id=id).result(timeout=timeout) @@ -10370,10 +10309,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/permissions/warehouses/{warehouse_id}", body=body, headers=headers) diff --git a/databricks/sdk/service/vectorsearch.py b/databricks/sdk/vectorsearch/v2/impl.py similarity index 71% rename from databricks/sdk/service/vectorsearch.py rename to databricks/sdk/vectorsearch/v2/impl.py index f8b8429c6..6f6e41f5d 100755 --- a/databricks/sdk/service/vectorsearch.py +++ b/databricks/sdk/vectorsearch/v2/impl.py @@ -3,19 +3,15 @@ from __future__ import annotations import logging -import random -import time from dataclasses import dataclass from datetime import timedelta from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Optional +from typing import Any, Dict, Iterator, List, Optional -from ..databricks.errors import OperationFailed -from ._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import Wait, _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -28,20 +24,20 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" - return cls(name=d.get("name", None)) + return cls(name=d.get("{name}", None)) @dataclass @@ -56,24 +52,24 @@ def as_dict(self) -> dict: """Serializes the CreateEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_type is not None: - body["endpoint_type"] = self.endpoint_type.value + body["{endpoint_type}"] = self.endpoint_type.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the CreateEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_type is not None: - body["endpoint_type"] = self.endpoint_type + body["{endpoint_type}"] = self.endpoint_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateEndpoint: """Deserializes the CreateEndpoint from a dictionary.""" - return cls(endpoint_type=_enum(d, "endpoint_type", EndpointType), name=d.get("name", None)) + return cls(endpoint_type=_enum(d, "{endpoint_type}", EndpointType), name=d.get("{name}", None)) @dataclass @@ -105,46 +101,46 @@ def as_dict(self) -> dict: """Serializes the CreateVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.delta_sync_index_spec: - body["delta_sync_index_spec"] = self.delta_sync_index_spec.as_dict() + body["{delta_sync_index_spec}"] = self.delta_sync_index_spec.as_dict() if self.direct_access_index_spec: - body["direct_access_index_spec"] = self.direct_access_index_spec.as_dict() + body["{direct_access_index_spec}"] = self.direct_access_index_spec.as_dict() if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_type is not None: - body["index_type"] = self.index_type.value + body["{index_type}"] = self.index_type.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.primary_key is not None: - body["primary_key"] = self.primary_key + body["{primary_key}"] = self.primary_key return body def as_shallow_dict(self) -> dict: """Serializes the CreateVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.delta_sync_index_spec: - body["delta_sync_index_spec"] = self.delta_sync_index_spec + body["{delta_sync_index_spec}"] = self.delta_sync_index_spec if self.direct_access_index_spec: - body["direct_access_index_spec"] = self.direct_access_index_spec + body["{direct_access_index_spec}"] = self.direct_access_index_spec if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_type is not None: - body["index_type"] = self.index_type + body["{index_type}"] = self.index_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.primary_key is not None: - body["primary_key"] = self.primary_key + body["{primary_key}"] = self.primary_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVectorIndexRequest: """Deserializes the CreateVectorIndexRequest from a dictionary.""" return cls( - delta_sync_index_spec=_from_dict(d, "delta_sync_index_spec", DeltaSyncVectorIndexSpecRequest), - direct_access_index_spec=_from_dict(d, "direct_access_index_spec", DirectAccessVectorIndexSpec), - endpoint_name=d.get("endpoint_name", None), - index_type=_enum(d, "index_type", VectorIndexType), - name=d.get("name", None), - primary_key=d.get("primary_key", None), + delta_sync_index_spec=_from_dict(d, "{delta_sync_index_spec}", DeltaSyncVectorIndexSpecRequest), + direct_access_index_spec=_from_dict(d, "{direct_access_index_spec}", DirectAccessVectorIndexSpec), + endpoint_name=d.get("{endpoint_name}", None), + index_type=_enum(d, "{index_type}", VectorIndexType), + name=d.get("{name}", None), + primary_key=d.get("{primary_key}", None), ) @@ -156,20 +152,20 @@ def as_dict(self) -> dict: """Serializes the CreateVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.vector_index: - body["vector_index"] = self.vector_index.as_dict() + body["{vector_index}"] = self.vector_index.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the CreateVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.vector_index: - body["vector_index"] = self.vector_index + body["{vector_index}"] = self.vector_index return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVectorIndexResponse: """Deserializes the CreateVectorIndexResponse from a dictionary.""" - return cls(vector_index=_from_dict(d, "vector_index", VectorIndex)) + return cls(vector_index=_from_dict(d, "{vector_index}", VectorIndex)) @dataclass @@ -186,25 +182,26 @@ def as_dict(self) -> dict: """Serializes the DeleteDataResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.failed_primary_keys: - body["failed_primary_keys"] = [v for v in self.failed_primary_keys] + body["{failed_primary_keys}"] = [v for v in self.failed_primary_keys] if self.success_row_count is not None: - body["success_row_count"] = self.success_row_count + body["{success_row_count}"] = self.success_row_count return body def as_shallow_dict(self) -> dict: """Serializes the DeleteDataResult into a shallow dictionary of its immediate attributes.""" body = {} if self.failed_primary_keys: - body["failed_primary_keys"] = self.failed_primary_keys + body["{failed_primary_keys}"] = self.failed_primary_keys if self.success_row_count is not None: - body["success_row_count"] = self.success_row_count + body["{success_row_count}"] = self.success_row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDataResult: """Deserializes the DeleteDataResult from a dictionary.""" return cls( - failed_primary_keys=d.get("failed_primary_keys", None), success_row_count=d.get("success_row_count", None) + failed_primary_keys=d.get("{failed_primary_keys}", None), + success_row_count=d.get("{success_row_count}", None), ) @@ -230,24 +227,24 @@ def as_dict(self) -> dict: """Serializes the DeleteDataVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.primary_keys: - body["primary_keys"] = [v for v in self.primary_keys] + body["{primary_keys}"] = [v for v in self.primary_keys] return body def as_shallow_dict(self) -> dict: """Serializes the DeleteDataVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.primary_keys: - body["primary_keys"] = self.primary_keys + body["{primary_keys}"] = self.primary_keys return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDataVectorIndexRequest: """Deserializes the DeleteDataVectorIndexRequest from a dictionary.""" - return cls(index_name=d.get("index_name", None), primary_keys=d.get("primary_keys", None)) + return cls(index_name=d.get("{index_name}", None), primary_keys=d.get("{primary_keys}", None)) @dataclass @@ -264,24 +261,24 @@ def as_dict(self) -> dict: """Serializes the DeleteDataVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.result: - body["result"] = self.result.as_dict() + body["{result}"] = self.result.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the DeleteDataVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.result: - body["result"] = self.result + body["{result}"] = self.result if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDataVectorIndexResponse: """Deserializes the DeleteDataVectorIndexResponse from a dictionary.""" - return cls(result=_from_dict(d, "result", DeleteDataResult), status=_enum(d, "status", DeleteDataStatus)) + return cls(result=_from_dict(d, "{result}", DeleteDataResult), status=_enum(d, "{status}", DeleteDataStatus)) @dataclass @@ -353,46 +350,46 @@ def as_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns_to_sync: - body["columns_to_sync"] = [v for v in self.columns_to_sync] + body["{columns_to_sync}"] = [v for v in self.columns_to_sync] if self.embedding_source_columns: - body["embedding_source_columns"] = [v.as_dict() for v in self.embedding_source_columns] + body["{embedding_source_columns}"] = [v.as_dict() for v in self.embedding_source_columns] if self.embedding_vector_columns: - body["embedding_vector_columns"] = [v.as_dict() for v in self.embedding_vector_columns] + body["{embedding_vector_columns}"] = [v.as_dict() for v in self.embedding_vector_columns] if self.embedding_writeback_table is not None: - body["embedding_writeback_table"] = self.embedding_writeback_table + body["{embedding_writeback_table}"] = self.embedding_writeback_table if self.pipeline_type is not None: - body["pipeline_type"] = self.pipeline_type.value + body["{pipeline_type}"] = self.pipeline_type.value if self.source_table is not None: - body["source_table"] = self.source_table + body["{source_table}"] = self.source_table return body def as_shallow_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.columns_to_sync: - body["columns_to_sync"] = self.columns_to_sync + body["{columns_to_sync}"] = self.columns_to_sync if self.embedding_source_columns: - body["embedding_source_columns"] = self.embedding_source_columns + body["{embedding_source_columns}"] = self.embedding_source_columns if self.embedding_vector_columns: - body["embedding_vector_columns"] = self.embedding_vector_columns + body["{embedding_vector_columns}"] = self.embedding_vector_columns if self.embedding_writeback_table is not None: - body["embedding_writeback_table"] = self.embedding_writeback_table + body["{embedding_writeback_table}"] = self.embedding_writeback_table if self.pipeline_type is not None: - body["pipeline_type"] = self.pipeline_type + body["{pipeline_type}"] = self.pipeline_type if self.source_table is not None: - body["source_table"] = self.source_table + body["{source_table}"] = self.source_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSyncVectorIndexSpecRequest: """Deserializes the DeltaSyncVectorIndexSpecRequest from a dictionary.""" return cls( - columns_to_sync=d.get("columns_to_sync", None), - embedding_source_columns=_repeated_dict(d, "embedding_source_columns", EmbeddingSourceColumn), - embedding_vector_columns=_repeated_dict(d, "embedding_vector_columns", EmbeddingVectorColumn), - embedding_writeback_table=d.get("embedding_writeback_table", None), - pipeline_type=_enum(d, "pipeline_type", PipelineType), - source_table=d.get("source_table", None), + columns_to_sync=d.get("{columns_to_sync}", None), + embedding_source_columns=_repeated_dict(d, "{embedding_source_columns}", EmbeddingSourceColumn), + embedding_vector_columns=_repeated_dict(d, "{embedding_vector_columns}", EmbeddingVectorColumn), + embedding_writeback_table=d.get("{embedding_writeback_table}", None), + pipeline_type=_enum(d, "{pipeline_type}", PipelineType), + source_table=d.get("{source_table}", None), ) @@ -426,46 +423,46 @@ def as_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_source_columns: - body["embedding_source_columns"] = [v.as_dict() for v in self.embedding_source_columns] + body["{embedding_source_columns}"] = [v.as_dict() for v in self.embedding_source_columns] if self.embedding_vector_columns: - body["embedding_vector_columns"] = [v.as_dict() for v in self.embedding_vector_columns] + body["{embedding_vector_columns}"] = [v.as_dict() for v in self.embedding_vector_columns] if self.embedding_writeback_table is not None: - body["embedding_writeback_table"] = self.embedding_writeback_table + body["{embedding_writeback_table}"] = self.embedding_writeback_table if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.pipeline_type is not None: - body["pipeline_type"] = self.pipeline_type.value + body["{pipeline_type}"] = self.pipeline_type.value if self.source_table is not None: - body["source_table"] = self.source_table + body["{source_table}"] = self.source_table return body def as_shallow_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_source_columns: - body["embedding_source_columns"] = self.embedding_source_columns + body["{embedding_source_columns}"] = self.embedding_source_columns if self.embedding_vector_columns: - body["embedding_vector_columns"] = self.embedding_vector_columns + body["{embedding_vector_columns}"] = self.embedding_vector_columns if self.embedding_writeback_table is not None: - body["embedding_writeback_table"] = self.embedding_writeback_table + body["{embedding_writeback_table}"] = self.embedding_writeback_table if self.pipeline_id is not None: - body["pipeline_id"] = self.pipeline_id + body["{pipeline_id}"] = self.pipeline_id if self.pipeline_type is not None: - body["pipeline_type"] = self.pipeline_type + body["{pipeline_type}"] = self.pipeline_type if self.source_table is not None: - body["source_table"] = self.source_table + body["{source_table}"] = self.source_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSyncVectorIndexSpecResponse: """Deserializes the DeltaSyncVectorIndexSpecResponse from a dictionary.""" return cls( - embedding_source_columns=_repeated_dict(d, "embedding_source_columns", EmbeddingSourceColumn), - embedding_vector_columns=_repeated_dict(d, "embedding_vector_columns", EmbeddingVectorColumn), - embedding_writeback_table=d.get("embedding_writeback_table", None), - pipeline_id=d.get("pipeline_id", None), - pipeline_type=_enum(d, "pipeline_type", PipelineType), - source_table=d.get("source_table", None), + embedding_source_columns=_repeated_dict(d, "{embedding_source_columns}", EmbeddingSourceColumn), + embedding_vector_columns=_repeated_dict(d, "{embedding_vector_columns}", EmbeddingVectorColumn), + embedding_writeback_table=d.get("{embedding_writeback_table}", None), + pipeline_id=d.get("{pipeline_id}", None), + pipeline_type=_enum(d, "{pipeline_type}", PipelineType), + source_table=d.get("{source_table}", None), ) @@ -488,31 +485,31 @@ def as_dict(self) -> dict: """Serializes the DirectAccessVectorIndexSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_source_columns: - body["embedding_source_columns"] = [v.as_dict() for v in self.embedding_source_columns] + body["{embedding_source_columns}"] = [v.as_dict() for v in self.embedding_source_columns] if self.embedding_vector_columns: - body["embedding_vector_columns"] = [v.as_dict() for v in self.embedding_vector_columns] + body["{embedding_vector_columns}"] = [v.as_dict() for v in self.embedding_vector_columns] if self.schema_json is not None: - body["schema_json"] = self.schema_json + body["{schema_json}"] = self.schema_json return body def as_shallow_dict(self) -> dict: """Serializes the DirectAccessVectorIndexSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_source_columns: - body["embedding_source_columns"] = self.embedding_source_columns + body["{embedding_source_columns}"] = self.embedding_source_columns if self.embedding_vector_columns: - body["embedding_vector_columns"] = self.embedding_vector_columns + body["{embedding_vector_columns}"] = self.embedding_vector_columns if self.schema_json is not None: - body["schema_json"] = self.schema_json + body["{schema_json}"] = self.schema_json return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DirectAccessVectorIndexSpec: """Deserializes the DirectAccessVectorIndexSpec from a dictionary.""" return cls( - embedding_source_columns=_repeated_dict(d, "embedding_source_columns", EmbeddingSourceColumn), - embedding_vector_columns=_repeated_dict(d, "embedding_vector_columns", EmbeddingVectorColumn), - schema_json=d.get("schema_json", None), + embedding_source_columns=_repeated_dict(d, "{embedding_source_columns}", EmbeddingSourceColumn), + embedding_vector_columns=_repeated_dict(d, "{embedding_vector_columns}", EmbeddingVectorColumn), + schema_json=d.get("{schema_json}", None), ) @@ -528,24 +525,26 @@ def as_dict(self) -> dict: """Serializes the EmbeddingSourceColumn into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_model_endpoint_name is not None: - body["embedding_model_endpoint_name"] = self.embedding_model_endpoint_name + body["{embedding_model_endpoint_name}"] = self.embedding_model_endpoint_name if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the EmbeddingSourceColumn into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_model_endpoint_name is not None: - body["embedding_model_endpoint_name"] = self.embedding_model_endpoint_name + body["{embedding_model_endpoint_name}"] = self.embedding_model_endpoint_name if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmbeddingSourceColumn: """Deserializes the EmbeddingSourceColumn from a dictionary.""" - return cls(embedding_model_endpoint_name=d.get("embedding_model_endpoint_name", None), name=d.get("name", None)) + return cls( + embedding_model_endpoint_name=d.get("{embedding_model_endpoint_name}", None), name=d.get("{name}", None) + ) @dataclass @@ -560,24 +559,24 @@ def as_dict(self) -> dict: """Serializes the EmbeddingVectorColumn into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_dimension is not None: - body["embedding_dimension"] = self.embedding_dimension + body["{embedding_dimension}"] = self.embedding_dimension if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the EmbeddingVectorColumn into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_dimension is not None: - body["embedding_dimension"] = self.embedding_dimension + body["{embedding_dimension}"] = self.embedding_dimension if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmbeddingVectorColumn: """Deserializes the EmbeddingVectorColumn from a dictionary.""" - return cls(embedding_dimension=d.get("embedding_dimension", None), name=d.get("name", None)) + return cls(embedding_dimension=d.get("{embedding_dimension}", None), name=d.get("{name}", None)) @dataclass @@ -613,61 +612,61 @@ def as_dict(self) -> dict: """Serializes the EndpointInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.endpoint_status: - body["endpoint_status"] = self.endpoint_status.as_dict() + body["{endpoint_status}"] = self.endpoint_status.as_dict() if self.endpoint_type is not None: - body["endpoint_type"] = self.endpoint_type.value + body["{endpoint_type}"] = self.endpoint_type.value if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.last_updated_user is not None: - body["last_updated_user"] = self.last_updated_user + body["{last_updated_user}"] = self.last_updated_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.num_indexes is not None: - body["num_indexes"] = self.num_indexes + body["{num_indexes}"] = self.num_indexes return body def as_shallow_dict(self) -> dict: """Serializes the EndpointInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["creation_timestamp"] = self.creation_timestamp + body["{creation_timestamp}"] = self.creation_timestamp if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.endpoint_status: - body["endpoint_status"] = self.endpoint_status + body["{endpoint_status}"] = self.endpoint_status if self.endpoint_type is not None: - body["endpoint_type"] = self.endpoint_type + body["{endpoint_type}"] = self.endpoint_type if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp if self.last_updated_user is not None: - body["last_updated_user"] = self.last_updated_user + body["{last_updated_user}"] = self.last_updated_user if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.num_indexes is not None: - body["num_indexes"] = self.num_indexes + body["{num_indexes}"] = self.num_indexes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointInfo: """Deserializes the EndpointInfo from a dictionary.""" return cls( - creation_timestamp=d.get("creation_timestamp", None), - creator=d.get("creator", None), - endpoint_status=_from_dict(d, "endpoint_status", EndpointStatus), - endpoint_type=_enum(d, "endpoint_type", EndpointType), - id=d.get("id", None), - last_updated_timestamp=d.get("last_updated_timestamp", None), - last_updated_user=d.get("last_updated_user", None), - name=d.get("name", None), - num_indexes=d.get("num_indexes", None), + creation_timestamp=d.get("{creation_timestamp}", None), + creator=d.get("{creator}", None), + endpoint_status=_from_dict(d, "{endpoint_status}", EndpointStatus), + endpoint_type=_enum(d, "{endpoint_type}", EndpointType), + id=d.get("{id}", None), + last_updated_timestamp=d.get("{last_updated_timestamp}", None), + last_updated_user=d.get("{last_updated_user}", None), + name=d.get("{name}", None), + num_indexes=d.get("{num_indexes}", None), ) @@ -685,24 +684,24 @@ def as_dict(self) -> dict: """Serializes the EndpointStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state.value + body["{state}"] = self.state.value return body def as_shallow_dict(self) -> dict: """Serializes the EndpointStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.state is not None: - body["state"] = self.state + body["{state}"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointStatus: """Deserializes the EndpointStatus from a dictionary.""" - return cls(message=d.get("message", None), state=_enum(d, "state", EndpointStatusState)) + return cls(message=d.get("{message}", None), state=_enum(d, "{state}", EndpointStatusState)) class EndpointStatusState(Enum): @@ -732,25 +731,25 @@ def as_dict(self) -> dict: """Serializes the ListEndpointResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoints: - body["endpoints"] = [v.as_dict() for v in self.endpoints] + body["{endpoints}"] = [v.as_dict() for v in self.endpoints] if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body def as_shallow_dict(self) -> dict: """Serializes the ListEndpointResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoints: - body["endpoints"] = self.endpoints + body["{endpoints}"] = self.endpoints if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListEndpointResponse: """Deserializes the ListEndpointResponse from a dictionary.""" return cls( - endpoints=_repeated_dict(d, "endpoints", EndpointInfo), next_page_token=d.get("next_page_token", None) + endpoints=_repeated_dict(d, "{endpoints}", EndpointInfo), next_page_token=d.get("{next_page_token}", None) ) @@ -762,20 +761,20 @@ def as_dict(self) -> dict: """Serializes the ListValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["values"] = [v.as_dict() for v in self.values] + body["{values}"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: """Serializes the ListValue into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["values"] = self.values + body["{values}"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListValue: """Deserializes the ListValue from a dictionary.""" - return cls(values=_repeated_dict(d, "values", Value)) + return cls(values=_repeated_dict(d, "{values}", Value)) @dataclass @@ -790,26 +789,26 @@ def as_dict(self) -> dict: """Serializes the ListVectorIndexesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.vector_indexes: - body["vector_indexes"] = [v.as_dict() for v in self.vector_indexes] + body["{vector_indexes}"] = [v.as_dict() for v in self.vector_indexes] return body def as_shallow_dict(self) -> dict: """Serializes the ListVectorIndexesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.vector_indexes: - body["vector_indexes"] = self.vector_indexes + body["{vector_indexes}"] = self.vector_indexes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListVectorIndexesResponse: """Deserializes the ListVectorIndexesResponse from a dictionary.""" return cls( - next_page_token=d.get("next_page_token", None), - vector_indexes=_repeated_dict(d, "vector_indexes", MiniVectorIndex), + next_page_token=d.get("{next_page_token}", None), + vector_indexes=_repeated_dict(d, "{vector_indexes}", MiniVectorIndex), ) @@ -827,24 +826,24 @@ def as_dict(self) -> dict: """Serializes the MapStringValueEntry into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value: - body["value"] = self.value.as_dict() + body["{value}"] = self.value.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the MapStringValueEntry into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MapStringValueEntry: """Deserializes the MapStringValueEntry from a dictionary.""" - return cls(key=d.get("key", None), value=_from_dict(d, "value", Value)) + return cls(key=d.get("{key}", None), value=_from_dict(d, "{value}", Value)) @dataclass @@ -873,41 +872,41 @@ def as_dict(self) -> dict: """Serializes the MiniVectorIndex into a dictionary suitable for use as a JSON request body.""" body = {} if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_type is not None: - body["index_type"] = self.index_type.value + body["{index_type}"] = self.index_type.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.primary_key is not None: - body["primary_key"] = self.primary_key + body["{primary_key}"] = self.primary_key return body def as_shallow_dict(self) -> dict: """Serializes the MiniVectorIndex into a shallow dictionary of its immediate attributes.""" body = {} if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_type is not None: - body["index_type"] = self.index_type + body["{index_type}"] = self.index_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.primary_key is not None: - body["primary_key"] = self.primary_key + body["{primary_key}"] = self.primary_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MiniVectorIndex: """Deserializes the MiniVectorIndex from a dictionary.""" return cls( - creator=d.get("creator", None), - endpoint_name=d.get("endpoint_name", None), - index_type=_enum(d, "index_type", VectorIndexType), - name=d.get("name", None), - primary_key=d.get("primary_key", None), + creator=d.get("{creator}", None), + endpoint_name=d.get("{endpoint_name}", None), + index_type=_enum(d, "{index_type}", VectorIndexType), + name=d.get("{name}", None), + primary_key=d.get("{primary_key}", None), ) @@ -941,31 +940,31 @@ def as_dict(self) -> dict: """Serializes the QueryVectorIndexNextPageRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.page_token is not None: - body["page_token"] = self.page_token + body["{page_token}"] = self.page_token return body def as_shallow_dict(self) -> dict: """Serializes the QueryVectorIndexNextPageRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.page_token is not None: - body["page_token"] = self.page_token + body["{page_token}"] = self.page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryVectorIndexNextPageRequest: """Deserializes the QueryVectorIndexNextPageRequest from a dictionary.""" return cls( - endpoint_name=d.get("endpoint_name", None), - index_name=d.get("index_name", None), - page_token=d.get("page_token", None), + endpoint_name=d.get("{endpoint_name}", None), + index_name=d.get("{index_name}", None), + page_token=d.get("{page_token}", None), ) @@ -1007,61 +1006,61 @@ def as_dict(self) -> dict: """Serializes the QueryVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["columns"] = [v for v in self.columns] + body["{columns}"] = [v for v in self.columns] if self.columns_to_rerank: - body["columns_to_rerank"] = [v for v in self.columns_to_rerank] + body["{columns_to_rerank}"] = [v for v in self.columns_to_rerank] if self.filters_json is not None: - body["filters_json"] = self.filters_json + body["{filters_json}"] = self.filters_json if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.num_results is not None: - body["num_results"] = self.num_results + body["{num_results}"] = self.num_results if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.query_type is not None: - body["query_type"] = self.query_type + body["{query_type}"] = self.query_type if self.query_vector: - body["query_vector"] = [v for v in self.query_vector] + body["{query_vector}"] = [v for v in self.query_vector] if self.score_threshold is not None: - body["score_threshold"] = self.score_threshold + body["{score_threshold}"] = self.score_threshold return body def as_shallow_dict(self) -> dict: """Serializes the QueryVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns if self.columns_to_rerank: - body["columns_to_rerank"] = self.columns_to_rerank + body["{columns_to_rerank}"] = self.columns_to_rerank if self.filters_json is not None: - body["filters_json"] = self.filters_json + body["{filters_json}"] = self.filters_json if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.num_results is not None: - body["num_results"] = self.num_results + body["{num_results}"] = self.num_results if self.query_text is not None: - body["query_text"] = self.query_text + body["{query_text}"] = self.query_text if self.query_type is not None: - body["query_type"] = self.query_type + body["{query_type}"] = self.query_type if self.query_vector: - body["query_vector"] = self.query_vector + body["{query_vector}"] = self.query_vector if self.score_threshold is not None: - body["score_threshold"] = self.score_threshold + body["{score_threshold}"] = self.score_threshold return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryVectorIndexRequest: """Deserializes the QueryVectorIndexRequest from a dictionary.""" return cls( - columns=d.get("columns", None), - columns_to_rerank=d.get("columns_to_rerank", None), - filters_json=d.get("filters_json", None), - index_name=d.get("index_name", None), - num_results=d.get("num_results", None), - query_text=d.get("query_text", None), - query_type=d.get("query_type", None), - query_vector=d.get("query_vector", None), - score_threshold=d.get("score_threshold", None), + columns=d.get("{columns}", None), + columns_to_rerank=d.get("{columns_to_rerank}", None), + filters_json=d.get("{filters_json}", None), + index_name=d.get("{index_name}", None), + num_results=d.get("{num_results}", None), + query_text=d.get("{query_text}", None), + query_type=d.get("{query_type}", None), + query_vector=d.get("{query_vector}", None), + score_threshold=d.get("{score_threshold}", None), ) @@ -1082,31 +1081,31 @@ def as_dict(self) -> dict: """Serializes the QueryVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.manifest: - body["manifest"] = self.manifest.as_dict() + body["{manifest}"] = self.manifest.as_dict() if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.result: - body["result"] = self.result.as_dict() + body["{result}"] = self.result.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the QueryVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.manifest: - body["manifest"] = self.manifest + body["{manifest}"] = self.manifest if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.result: - body["result"] = self.result + body["{result}"] = self.result return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryVectorIndexResponse: """Deserializes the QueryVectorIndexResponse from a dictionary.""" return cls( - manifest=_from_dict(d, "manifest", ResultManifest), - next_page_token=d.get("next_page_token", None), - result=_from_dict(d, "result", ResultData), + manifest=_from_dict(d, "{manifest}", ResultManifest), + next_page_token=d.get("{next_page_token}", None), + result=_from_dict(d, "{result}", ResultData), ) @@ -1124,24 +1123,24 @@ def as_dict(self) -> dict: """Serializes the ResultData into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_array: - body["data_array"] = [v for v in self.data_array] + body["{data_array}"] = [v for v in self.data_array] if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count return body def as_shallow_dict(self) -> dict: """Serializes the ResultData into a shallow dictionary of its immediate attributes.""" body = {} if self.data_array: - body["data_array"] = self.data_array + body["{data_array}"] = self.data_array if self.row_count is not None: - body["row_count"] = self.row_count + body["{row_count}"] = self.row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultData: """Deserializes the ResultData from a dictionary.""" - return cls(data_array=d.get("data_array", None), row_count=d.get("row_count", None)) + return cls(data_array=d.get("{data_array}", None), row_count=d.get("{row_count}", None)) @dataclass @@ -1158,24 +1157,24 @@ def as_dict(self) -> dict: """Serializes the ResultManifest into a dictionary suitable for use as a JSON request body.""" body = {} if self.column_count is not None: - body["column_count"] = self.column_count + body["{column_count}"] = self.column_count if self.columns: - body["columns"] = [v.as_dict() for v in self.columns] + body["{columns}"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: """Serializes the ResultManifest into a shallow dictionary of its immediate attributes.""" body = {} if self.column_count is not None: - body["column_count"] = self.column_count + body["{column_count}"] = self.column_count if self.columns: - body["columns"] = self.columns + body["{columns}"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultManifest: """Deserializes the ResultManifest from a dictionary.""" - return cls(column_count=d.get("column_count", None), columns=_repeated_dict(d, "columns", ColumnInfo)) + return cls(column_count=d.get("{column_count}", None), columns=_repeated_dict(d, "{columns}", ColumnInfo)) @dataclass @@ -1195,31 +1194,31 @@ def as_dict(self) -> dict: """Serializes the ScanVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.last_primary_key is not None: - body["last_primary_key"] = self.last_primary_key + body["{last_primary_key}"] = self.last_primary_key if self.num_results is not None: - body["num_results"] = self.num_results + body["{num_results}"] = self.num_results return body def as_shallow_dict(self) -> dict: """Serializes the ScanVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.last_primary_key is not None: - body["last_primary_key"] = self.last_primary_key + body["{last_primary_key}"] = self.last_primary_key if self.num_results is not None: - body["num_results"] = self.num_results + body["{num_results}"] = self.num_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ScanVectorIndexRequest: """Deserializes the ScanVectorIndexRequest from a dictionary.""" return cls( - index_name=d.get("index_name", None), - last_primary_key=d.get("last_primary_key", None), - num_results=d.get("num_results", None), + index_name=d.get("{index_name}", None), + last_primary_key=d.get("{last_primary_key}", None), + num_results=d.get("{num_results}", None), ) @@ -1237,24 +1236,24 @@ def as_dict(self) -> dict: """Serializes the ScanVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.data: - body["data"] = [v.as_dict() for v in self.data] + body["{data}"] = [v.as_dict() for v in self.data] if self.last_primary_key is not None: - body["last_primary_key"] = self.last_primary_key + body["{last_primary_key}"] = self.last_primary_key return body def as_shallow_dict(self) -> dict: """Serializes the ScanVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.data: - body["data"] = self.data + body["{data}"] = self.data if self.last_primary_key is not None: - body["last_primary_key"] = self.last_primary_key + body["{last_primary_key}"] = self.last_primary_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ScanVectorIndexResponse: """Deserializes the ScanVectorIndexResponse from a dictionary.""" - return cls(data=_repeated_dict(d, "data", Struct), last_primary_key=d.get("last_primary_key", None)) + return cls(data=_repeated_dict(d, "{data}", Struct), last_primary_key=d.get("{last_primary_key}", None)) @dataclass @@ -1266,20 +1265,20 @@ def as_dict(self) -> dict: """Serializes the Struct into a dictionary suitable for use as a JSON request body.""" body = {} if self.fields: - body["fields"] = [v.as_dict() for v in self.fields] + body["{fields}"] = [v.as_dict() for v in self.fields] return body def as_shallow_dict(self) -> dict: """Serializes the Struct into a shallow dictionary of its immediate attributes.""" body = {} if self.fields: - body["fields"] = self.fields + body["{fields}"] = self.fields return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Struct: """Deserializes the Struct from a dictionary.""" - return cls(fields=_repeated_dict(d, "fields", MapStringValueEntry)) + return cls(fields=_repeated_dict(d, "{fields}", MapStringValueEntry)) @dataclass @@ -1314,25 +1313,26 @@ def as_dict(self) -> dict: """Serializes the UpsertDataResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.failed_primary_keys: - body["failed_primary_keys"] = [v for v in self.failed_primary_keys] + body["{failed_primary_keys}"] = [v for v in self.failed_primary_keys] if self.success_row_count is not None: - body["success_row_count"] = self.success_row_count + body["{success_row_count}"] = self.success_row_count return body def as_shallow_dict(self) -> dict: """Serializes the UpsertDataResult into a shallow dictionary of its immediate attributes.""" body = {} if self.failed_primary_keys: - body["failed_primary_keys"] = self.failed_primary_keys + body["{failed_primary_keys}"] = self.failed_primary_keys if self.success_row_count is not None: - body["success_row_count"] = self.success_row_count + body["{success_row_count}"] = self.success_row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertDataResult: """Deserializes the UpsertDataResult from a dictionary.""" return cls( - failed_primary_keys=d.get("failed_primary_keys", None), success_row_count=d.get("success_row_count", None) + failed_primary_keys=d.get("{failed_primary_keys}", None), + success_row_count=d.get("{success_row_count}", None), ) @@ -1358,24 +1358,24 @@ def as_dict(self) -> dict: """Serializes the UpsertDataVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.inputs_json is not None: - body["inputs_json"] = self.inputs_json + body["{inputs_json}"] = self.inputs_json return body def as_shallow_dict(self) -> dict: """Serializes the UpsertDataVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.index_name is not None: - body["index_name"] = self.index_name + body["{index_name}"] = self.index_name if self.inputs_json is not None: - body["inputs_json"] = self.inputs_json + body["{inputs_json}"] = self.inputs_json return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertDataVectorIndexRequest: """Deserializes the UpsertDataVectorIndexRequest from a dictionary.""" - return cls(index_name=d.get("index_name", None), inputs_json=d.get("inputs_json", None)) + return cls(index_name=d.get("{index_name}", None), inputs_json=d.get("{inputs_json}", None)) @dataclass @@ -1392,24 +1392,24 @@ def as_dict(self) -> dict: """Serializes the UpsertDataVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.result: - body["result"] = self.result.as_dict() + body["{result}"] = self.result.as_dict() if self.status is not None: - body["status"] = self.status.value + body["{status}"] = self.status.value return body def as_shallow_dict(self) -> dict: """Serializes the UpsertDataVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.result: - body["result"] = self.result + body["{result}"] = self.result if self.status is not None: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertDataVectorIndexResponse: """Deserializes the UpsertDataVectorIndexResponse from a dictionary.""" - return cls(result=_from_dict(d, "result", UpsertDataResult), status=_enum(d, "status", UpsertDataStatus)) + return cls(result=_from_dict(d, "{result}", UpsertDataResult), status=_enum(d, "{status}", UpsertDataStatus)) @dataclass @@ -1430,46 +1430,46 @@ def as_dict(self) -> dict: """Serializes the Value into a dictionary suitable for use as a JSON request body.""" body = {} if self.bool_value is not None: - body["bool_value"] = self.bool_value + body["{bool_value}"] = self.bool_value if self.list_value: - body["list_value"] = self.list_value.as_dict() + body["{list_value}"] = self.list_value.as_dict() if self.null_value is not None: - body["null_value"] = self.null_value + body["{null_value}"] = self.null_value if self.number_value is not None: - body["number_value"] = self.number_value + body["{number_value}"] = self.number_value if self.string_value is not None: - body["string_value"] = self.string_value + body["{string_value}"] = self.string_value if self.struct_value: - body["struct_value"] = self.struct_value.as_dict() + body["{struct_value}"] = self.struct_value.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the Value into a shallow dictionary of its immediate attributes.""" body = {} if self.bool_value is not None: - body["bool_value"] = self.bool_value + body["{bool_value}"] = self.bool_value if self.list_value: - body["list_value"] = self.list_value + body["{list_value}"] = self.list_value if self.null_value is not None: - body["null_value"] = self.null_value + body["{null_value}"] = self.null_value if self.number_value is not None: - body["number_value"] = self.number_value + body["{number_value}"] = self.number_value if self.string_value is not None: - body["string_value"] = self.string_value + body["{string_value}"] = self.string_value if self.struct_value: - body["struct_value"] = self.struct_value + body["{struct_value}"] = self.struct_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Value: """Deserializes the Value from a dictionary.""" return cls( - bool_value=d.get("bool_value", None), - list_value=_from_dict(d, "list_value", ListValue), - null_value=d.get("null_value", None), - number_value=d.get("number_value", None), - string_value=d.get("string_value", None), - struct_value=_from_dict(d, "struct_value", Struct), + bool_value=d.get("{bool_value}", None), + list_value=_from_dict(d, "{list_value}", ListValue), + null_value=d.get("{null_value}", None), + number_value=d.get("{number_value}", None), + string_value=d.get("{string_value}", None), + struct_value=_from_dict(d, "{struct_value}", Struct), ) @@ -1505,56 +1505,56 @@ def as_dict(self) -> dict: """Serializes the VectorIndex into a dictionary suitable for use as a JSON request body.""" body = {} if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.delta_sync_index_spec: - body["delta_sync_index_spec"] = self.delta_sync_index_spec.as_dict() + body["{delta_sync_index_spec}"] = self.delta_sync_index_spec.as_dict() if self.direct_access_index_spec: - body["direct_access_index_spec"] = self.direct_access_index_spec.as_dict() + body["{direct_access_index_spec}"] = self.direct_access_index_spec.as_dict() if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_type is not None: - body["index_type"] = self.index_type.value + body["{index_type}"] = self.index_type.value if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.primary_key is not None: - body["primary_key"] = self.primary_key + body["{primary_key}"] = self.primary_key if self.status: - body["status"] = self.status.as_dict() + body["{status}"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: """Serializes the VectorIndex into a shallow dictionary of its immediate attributes.""" body = {} if self.creator is not None: - body["creator"] = self.creator + body["{creator}"] = self.creator if self.delta_sync_index_spec: - body["delta_sync_index_spec"] = self.delta_sync_index_spec + body["{delta_sync_index_spec}"] = self.delta_sync_index_spec if self.direct_access_index_spec: - body["direct_access_index_spec"] = self.direct_access_index_spec + body["{direct_access_index_spec}"] = self.direct_access_index_spec if self.endpoint_name is not None: - body["endpoint_name"] = self.endpoint_name + body["{endpoint_name}"] = self.endpoint_name if self.index_type is not None: - body["index_type"] = self.index_type + body["{index_type}"] = self.index_type if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name if self.primary_key is not None: - body["primary_key"] = self.primary_key + body["{primary_key}"] = self.primary_key if self.status: - body["status"] = self.status + body["{status}"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VectorIndex: """Deserializes the VectorIndex from a dictionary.""" return cls( - creator=d.get("creator", None), - delta_sync_index_spec=_from_dict(d, "delta_sync_index_spec", DeltaSyncVectorIndexSpecResponse), - direct_access_index_spec=_from_dict(d, "direct_access_index_spec", DirectAccessVectorIndexSpec), - endpoint_name=d.get("endpoint_name", None), - index_type=_enum(d, "index_type", VectorIndexType), - name=d.get("name", None), - primary_key=d.get("primary_key", None), - status=_from_dict(d, "status", VectorIndexStatus), + creator=d.get("{creator}", None), + delta_sync_index_spec=_from_dict(d, "{delta_sync_index_spec}", DeltaSyncVectorIndexSpecResponse), + direct_access_index_spec=_from_dict(d, "{direct_access_index_spec}", DirectAccessVectorIndexSpec), + endpoint_name=d.get("{endpoint_name}", None), + index_type=_enum(d, "{index_type}", VectorIndexType), + name=d.get("{name}", None), + primary_key=d.get("{primary_key}", None), + status=_from_dict(d, "{status}", VectorIndexStatus), ) @@ -1576,36 +1576,36 @@ def as_dict(self) -> dict: """Serializes the VectorIndexStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_url is not None: - body["index_url"] = self.index_url + body["{index_url}"] = self.index_url if self.indexed_row_count is not None: - body["indexed_row_count"] = self.indexed_row_count + body["{indexed_row_count}"] = self.indexed_row_count if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.ready is not None: - body["ready"] = self.ready + body["{ready}"] = self.ready return body def as_shallow_dict(self) -> dict: """Serializes the VectorIndexStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.index_url is not None: - body["index_url"] = self.index_url + body["{index_url}"] = self.index_url if self.indexed_row_count is not None: - body["indexed_row_count"] = self.indexed_row_count + body["{indexed_row_count}"] = self.indexed_row_count if self.message is not None: - body["message"] = self.message + body["{message}"] = self.message if self.ready is not None: - body["ready"] = self.ready + body["{ready}"] = self.ready return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VectorIndexStatus: """Deserializes the VectorIndexStatus from a dictionary.""" return cls( - index_url=d.get("index_url", None), - indexed_row_count=d.get("indexed_row_count", None), - message=d.get("message", None), - ready=d.get("ready", None), + index_url=d.get("{index_url}", None), + indexed_row_count=d.get("{indexed_row_count}", None), + message=d.get("{message}", None), + ready=d.get("{ready}", None), ) @@ -1627,40 +1627,6 @@ class VectorSearchEndpointsAPI: def __init__(self, api_client): self._api = api_client - def wait_get_endpoint_vector_search_endpoint_online( - self, - endpoint_name: str, - timeout=timedelta(minutes=20), - callback: Optional[Callable[[EndpointInfo], None]] = None, - ) -> EndpointInfo: - deadline = time.time() + timeout.total_seconds() - target_states = (EndpointStatusState.ONLINE,) - failure_states = (EndpointStatusState.OFFLINE,) - status_message = "polling..." - attempt = 1 - while time.time() < deadline: - poll = self.get_endpoint(endpoint_name=endpoint_name) - status = poll.endpoint_status.state - status_message = f"current status: {status}" - if poll.endpoint_status: - status_message = poll.endpoint_status.message - if status in target_states: - return poll - if callback: - callback(poll) - if status in failure_states: - msg = f"failed to reach ONLINE, got {status}: {status_message}" - raise OperationFailed(msg) - prefix = f"endpoint_name={endpoint_name}" - sleep = attempt - if sleep > 10: - # sleep 10s max per attempt - sleep = 10 - _LOG.debug(f"{prefix}: ({status}) {status_message} (sleeping ~{sleep}s)") - time.sleep(sleep + random.random()) - attempt += 1 - raise TimeoutError(f"timed out after {timeout}: {status_message}") - def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[EndpointInfo]: """Create an endpoint. @@ -1673,23 +1639,23 @@ def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[Endpoi :returns: Long-running operation waiter for :class:`EndpointInfo`. - See :method:wait_get_endpoint_vector_search_endpoint_online for more details. + See :method:WaitGetEndpointVectorSearchEndpointOnline for more details. """ body = {} if endpoint_type is not None: - body["endpoint_type"] = endpoint_type.value + body["{endpoint_type}"] = endpoint_type.value if name is not None: - body["name"] = name + body["{name}"] = name headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.0/vector-search/endpoints", body=body, headers=headers) return Wait( - self.wait_get_endpoint_vector_search_endpoint_online, + self.WaitGetEndpointVectorSearchEndpointOnline, response=EndpointInfo.from_dict(op_response), - endpoint_name=op_response["name"], + endpoint_name=op_response["{name}"], ) def create_endpoint_and_wait( @@ -1720,7 +1686,7 @@ def get_endpoint(self, endpoint_name: str) -> EndpointInfo: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/vector-search/endpoints/{endpoint_name}", headers=headers) @@ -1737,19 +1703,19 @@ def list_endpoints(self, *, page_token: Optional[str] = None) -> Iterator[Endpoi query = {} if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/vector-search/endpoints", query=query, headers=headers) - if "endpoints" in json: - for v in json["endpoints"]: + if "{endpoints}" in json: + for v in json["{endpoints}"]: yield EndpointInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] class VectorSearchIndexesAPI: @@ -1800,20 +1766,20 @@ def create_index( """ body = {} if delta_sync_index_spec is not None: - body["delta_sync_index_spec"] = delta_sync_index_spec.as_dict() + body["{delta_sync_index_spec}"] = delta_sync_index_spec.as_dict() if direct_access_index_spec is not None: - body["direct_access_index_spec"] = direct_access_index_spec.as_dict() + body["{direct_access_index_spec}"] = direct_access_index_spec.as_dict() if endpoint_name is not None: - body["endpoint_name"] = endpoint_name + body["{endpoint_name}"] = endpoint_name if index_type is not None: - body["index_type"] = index_type.value + body["{index_type}"] = index_type.value if name is not None: - body["name"] = name + body["{name}"] = name if primary_key is not None: - body["primary_key"] = primary_key + body["{primary_key}"] = primary_key headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/vector-search/indexes", body=body, headers=headers) @@ -1833,10 +1799,10 @@ def delete_data_vector_index(self, index_name: str, primary_keys: List[str]) -> """ body = {} if primary_keys is not None: - body["primary_keys"] = [v for v in primary_keys] + body["{primary_keys}"] = [v for v in primary_keys] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -1871,7 +1837,7 @@ def get_index(self, index_name: str) -> VectorIndex: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/vector-search/indexes/{index_name}", headers=headers) @@ -1892,21 +1858,21 @@ def list_indexes(self, endpoint_name: str, *, page_token: Optional[str] = None) query = {} if endpoint_name is not None: - query["endpoint_name"] = endpoint_name + query["{endpoint_name}"] = endpoint_name if page_token is not None: - query["page_token"] = page_token + query["{page_token}"] = page_token headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/vector-search/indexes", query=query, headers=headers) - if "vector_indexes" in json: - for v in json["vector_indexes"]: + if "{vector_indexes}" in json: + for v in json["{vector_indexes}"]: yield MiniVectorIndex.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["page_token"] = json["next_page_token"] + query["{page_token}"] = json["{next_page_token}"] def query_index( self, @@ -1953,24 +1919,24 @@ def query_index( """ body = {} if columns is not None: - body["columns"] = [v for v in columns] + body["{columns}"] = [v for v in columns] if columns_to_rerank is not None: - body["columns_to_rerank"] = [v for v in columns_to_rerank] + body["{columns_to_rerank}"] = [v for v in columns_to_rerank] if filters_json is not None: - body["filters_json"] = filters_json + body["{filters_json}"] = filters_json if num_results is not None: - body["num_results"] = num_results + body["{num_results}"] = num_results if query_text is not None: - body["query_text"] = query_text + body["{query_text}"] = query_text if query_type is not None: - body["query_type"] = query_type + body["{query_type}"] = query_type if query_vector is not None: - body["query_vector"] = [v for v in query_vector] + body["{query_vector}"] = [v for v in query_vector] if score_threshold is not None: - body["score_threshold"] = score_threshold + body["{score_threshold}"] = score_threshold headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/query", body=body, headers=headers) @@ -1995,12 +1961,12 @@ def query_next_page( """ body = {} if endpoint_name is not None: - body["endpoint_name"] = endpoint_name + body["{endpoint_name}"] = endpoint_name if page_token is not None: - body["page_token"] = page_token + body["{page_token}"] = page_token headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -2027,12 +1993,12 @@ def scan_index( """ body = {} if last_primary_key is not None: - body["last_primary_key"] = last_primary_key + body["{last_primary_key}"] = last_primary_key if num_results is not None: - body["num_results"] = num_results + body["{num_results}"] = num_results headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/scan", body=body, headers=headers) @@ -2067,10 +2033,10 @@ def upsert_data_vector_index(self, index_name: str, inputs_json: str) -> UpsertD """ body = {} if inputs_json is not None: - body["inputs_json"] = inputs_json + body["{inputs_json}"] = inputs_json headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( diff --git a/databricks/sdk/service/workspace.py b/databricks/sdk/workspace/v2/impl.py similarity index 78% rename from databricks/sdk/service/workspace.py rename to databricks/sdk/workspace/v2/impl.py index 6753ad880..6d6ef94de 100755 --- a/databricks/sdk/service/workspace.py +++ b/databricks/sdk/workspace/v2/impl.py @@ -7,11 +7,10 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ._internal import _enum, _from_dict, _repeated_dict +from ...service._internal import _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") - # all definitions in this file are in alphabetical order @@ -27,24 +26,24 @@ def as_dict(self) -> dict: """Serializes the AclItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission is not None: - body["permission"] = self.permission.value + body["{permission}"] = self.permission.value if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal return body def as_shallow_dict(self) -> dict: """Serializes the AclItem into a shallow dictionary of its immediate attributes.""" body = {} if self.permission is not None: - body["permission"] = self.permission + body["{permission}"] = self.permission if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AclItem: """Deserializes the AclItem from a dictionary.""" - return cls(permission=_enum(d, "permission", AclPermission), principal=d.get("principal", None)) + return cls(permission=_enum(d, "{permission}", AclPermission), principal=d.get("{principal}", None)) class AclPermission(Enum): @@ -66,24 +65,24 @@ def as_dict(self) -> dict: """Serializes the AzureKeyVaultSecretScopeMetadata into a dictionary suitable for use as a JSON request body.""" body = {} if self.dns_name is not None: - body["dns_name"] = self.dns_name + body["{dns_name}"] = self.dns_name if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id return body def as_shallow_dict(self) -> dict: """Serializes the AzureKeyVaultSecretScopeMetadata into a shallow dictionary of its immediate attributes.""" body = {} if self.dns_name is not None: - body["dns_name"] = self.dns_name + body["{dns_name}"] = self.dns_name if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureKeyVaultSecretScopeMetadata: """Deserializes the AzureKeyVaultSecretScopeMetadata from a dictionary.""" - return cls(dns_name=d.get("dns_name", None), resource_id=d.get("resource_id", None)) + return cls(dns_name=d.get("{dns_name}", None), resource_id=d.get("{resource_id}", None)) @dataclass @@ -110,31 +109,31 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username if self.personal_access_token is not None: - body["personal_access_token"] = self.personal_access_token + body["{personal_access_token}"] = self.personal_access_token return body def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username if self.personal_access_token is not None: - body["personal_access_token"] = self.personal_access_token + body["{personal_access_token}"] = self.personal_access_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialsRequest: """Deserializes the CreateCredentialsRequest from a dictionary.""" return cls( - git_provider=d.get("git_provider", None), - git_username=d.get("git_username", None), - personal_access_token=d.get("personal_access_token", None), + git_provider=d.get("{git_provider}", None), + git_username=d.get("{git_username}", None), + personal_access_token=d.get("{personal_access_token}", None), ) @@ -154,31 +153,31 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username return body def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialsResponse: """Deserializes the CreateCredentialsResponse from a dictionary.""" return cls( - credential_id=d.get("credential_id", None), - git_provider=d.get("git_provider", None), - git_username=d.get("git_username", None), + credential_id=d.get("{credential_id}", None), + git_provider=d.get("{git_provider}", None), + git_username=d.get("{git_username}", None), ) @@ -204,36 +203,36 @@ def as_dict(self) -> dict: """Serializes the CreateRepoRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout.as_dict() + body["{sparse_checkout}"] = self.sparse_checkout.as_dict() if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the CreateRepoRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout + body["{sparse_checkout}"] = self.sparse_checkout if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRepoRequest: """Deserializes the CreateRepoRequest from a dictionary.""" return cls( - path=d.get("path", None), - provider=d.get("provider", None), - sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), - url=d.get("url", None), + path=d.get("{path}", None), + provider=d.get("{provider}", None), + sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), + url=d.get("{url}", None), ) @@ -264,51 +263,51 @@ def as_dict(self) -> dict: """Serializes the CreateRepoResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.head_commit_id is not None: - body["head_commit_id"] = self.head_commit_id + body["{head_commit_id}"] = self.head_commit_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout.as_dict() + body["{sparse_checkout}"] = self.sparse_checkout.as_dict() if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the CreateRepoResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.head_commit_id is not None: - body["head_commit_id"] = self.head_commit_id + body["{head_commit_id}"] = self.head_commit_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout + body["{sparse_checkout}"] = self.sparse_checkout if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRepoResponse: """Deserializes the CreateRepoResponse from a dictionary.""" return cls( - branch=d.get("branch", None), - head_commit_id=d.get("head_commit_id", None), - id=d.get("id", None), - path=d.get("path", None), - provider=d.get("provider", None), - sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), - url=d.get("url", None), + branch=d.get("{branch}", None), + head_commit_id=d.get("{head_commit_id}", None), + id=d.get("{id}", None), + path=d.get("{path}", None), + provider=d.get("{provider}", None), + sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), + url=d.get("{url}", None), ) @@ -330,36 +329,36 @@ def as_dict(self) -> dict: """Serializes the CreateScope into a dictionary suitable for use as a JSON request body.""" body = {} if self.backend_azure_keyvault: - body["backend_azure_keyvault"] = self.backend_azure_keyvault.as_dict() + body["{backend_azure_keyvault}"] = self.backend_azure_keyvault.as_dict() if self.initial_manage_principal is not None: - body["initial_manage_principal"] = self.initial_manage_principal + body["{initial_manage_principal}"] = self.initial_manage_principal if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope if self.scope_backend_type is not None: - body["scope_backend_type"] = self.scope_backend_type.value + body["{scope_backend_type}"] = self.scope_backend_type.value return body def as_shallow_dict(self) -> dict: """Serializes the CreateScope into a shallow dictionary of its immediate attributes.""" body = {} if self.backend_azure_keyvault: - body["backend_azure_keyvault"] = self.backend_azure_keyvault + body["{backend_azure_keyvault}"] = self.backend_azure_keyvault if self.initial_manage_principal is not None: - body["initial_manage_principal"] = self.initial_manage_principal + body["{initial_manage_principal}"] = self.initial_manage_principal if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope if self.scope_backend_type is not None: - body["scope_backend_type"] = self.scope_backend_type + body["{scope_backend_type}"] = self.scope_backend_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateScope: """Deserializes the CreateScope from a dictionary.""" return cls( - backend_azure_keyvault=_from_dict(d, "backend_azure_keyvault", AzureKeyVaultSecretScopeMetadata), - initial_manage_principal=d.get("initial_manage_principal", None), - scope=d.get("scope", None), - scope_backend_type=_enum(d, "scope_backend_type", ScopeBackendType), + backend_azure_keyvault=_from_dict(d, "{backend_azure_keyvault}", AzureKeyVaultSecretScopeMetadata), + initial_manage_principal=d.get("{initial_manage_principal}", None), + scope=d.get("{scope}", None), + scope_backend_type=_enum(d, "{scope_backend_type}", ScopeBackendType), ) @@ -397,31 +396,31 @@ def as_dict(self) -> dict: """Serializes the CredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username return body def as_shallow_dict(self) -> dict: """Serializes the CredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CredentialInfo: """Deserializes the CredentialInfo from a dictionary.""" return cls( - credential_id=d.get("credential_id", None), - git_provider=d.get("git_provider", None), - git_username=d.get("git_username", None), + credential_id=d.get("{credential_id}", None), + git_provider=d.get("{git_provider}", None), + git_username=d.get("{git_username}", None), ) @@ -439,24 +438,24 @@ def as_dict(self) -> dict: """Serializes the Delete into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.recursive is not None: - body["recursive"] = self.recursive + body["{recursive}"] = self.recursive return body def as_shallow_dict(self) -> dict: """Serializes the Delete into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.recursive is not None: - body["recursive"] = self.recursive + body["{recursive}"] = self.recursive return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Delete: """Deserializes the Delete from a dictionary.""" - return cls(path=d.get("path", None), recursive=d.get("recursive", None)) + return cls(path=d.get("{path}", None), recursive=d.get("{recursive}", None)) @dataclass @@ -471,24 +470,24 @@ def as_dict(self) -> dict: """Serializes the DeleteAcl into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body def as_shallow_dict(self) -> dict: """Serializes the DeleteAcl into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAcl: """Deserializes the DeleteAcl from a dictionary.""" - return cls(principal=d.get("principal", None), scope=d.get("scope", None)) + return cls(principal=d.get("{principal}", None), scope=d.get("{scope}", None)) @dataclass @@ -572,20 +571,20 @@ def as_dict(self) -> dict: """Serializes the DeleteScope into a dictionary suitable for use as a JSON request body.""" body = {} if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body def as_shallow_dict(self) -> dict: """Serializes the DeleteScope into a shallow dictionary of its immediate attributes.""" body = {} if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteScope: """Deserializes the DeleteScope from a dictionary.""" - return cls(scope=d.get("scope", None)) + return cls(scope=d.get("{scope}", None)) @dataclass @@ -618,24 +617,24 @@ def as_dict(self) -> dict: """Serializes the DeleteSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body def as_shallow_dict(self) -> dict: """Serializes the DeleteSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteSecret: """Deserializes the DeleteSecret from a dictionary.""" - return cls(key=d.get("key", None), scope=d.get("scope", None)) + return cls(key=d.get("{key}", None), scope=d.get("{scope}", None)) @dataclass @@ -684,24 +683,24 @@ def as_dict(self) -> dict: """Serializes the ExportResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.file_type is not None: - body["file_type"] = self.file_type + body["{file_type}"] = self.file_type return body def as_shallow_dict(self) -> dict: """Serializes the ExportResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.file_type is not None: - body["file_type"] = self.file_type + body["{file_type}"] = self.file_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExportResponse: """Deserializes the ExportResponse from a dictionary.""" - return cls(content=d.get("content", None), file_type=d.get("file_type", None)) + return cls(content=d.get("{content}", None), file_type=d.get("{file_type}", None)) @dataclass @@ -720,31 +719,31 @@ def as_dict(self) -> dict: """Serializes the GetCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username return body def as_shallow_dict(self) -> dict: """Serializes the GetCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetCredentialsResponse: """Deserializes the GetCredentialsResponse from a dictionary.""" return cls( - credential_id=d.get("credential_id", None), - git_provider=d.get("git_provider", None), - git_username=d.get("git_username", None), + credential_id=d.get("{credential_id}", None), + git_provider=d.get("{git_provider}", None), + git_username=d.get("{git_username}", None), ) @@ -757,20 +756,20 @@ def as_dict(self) -> dict: """Serializes the GetRepoPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetRepoPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRepoPermissionLevelsResponse: """Deserializes the GetRepoPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", RepoPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", RepoPermissionsDescription)) @dataclass @@ -800,51 +799,51 @@ def as_dict(self) -> dict: """Serializes the GetRepoResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.head_commit_id is not None: - body["head_commit_id"] = self.head_commit_id + body["{head_commit_id}"] = self.head_commit_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout.as_dict() + body["{sparse_checkout}"] = self.sparse_checkout.as_dict() if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the GetRepoResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.head_commit_id is not None: - body["head_commit_id"] = self.head_commit_id + body["{head_commit_id}"] = self.head_commit_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout + body["{sparse_checkout}"] = self.sparse_checkout if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRepoResponse: """Deserializes the GetRepoResponse from a dictionary.""" return cls( - branch=d.get("branch", None), - head_commit_id=d.get("head_commit_id", None), - id=d.get("id", None), - path=d.get("path", None), - provider=d.get("provider", None), - sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), - url=d.get("url", None), + branch=d.get("{branch}", None), + head_commit_id=d.get("{head_commit_id}", None), + id=d.get("{id}", None), + path=d.get("{path}", None), + provider=d.get("{provider}", None), + sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), + url=d.get("{url}", None), ) @@ -860,24 +859,24 @@ def as_dict(self) -> dict: """Serializes the GetSecretResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body def as_shallow_dict(self) -> dict: """Serializes the GetSecretResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.value is not None: - body["value"] = self.value + body["{value}"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetSecretResponse: """Deserializes the GetSecretResponse from a dictionary.""" - return cls(key=d.get("key", None), value=d.get("value", None)) + return cls(key=d.get("{key}", None), value=d.get("{value}", None)) @dataclass @@ -889,20 +888,20 @@ def as_dict(self) -> dict: """Serializes the GetWorkspaceObjectPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["permission_levels"] = [v.as_dict() for v in self.permission_levels] + body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: """Serializes the GetWorkspaceObjectPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["permission_levels"] = self.permission_levels + body["{permission_levels}"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWorkspaceObjectPermissionLevelsResponse: """Deserializes the GetWorkspaceObjectPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "permission_levels", WorkspaceObjectPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "{permission_levels}", WorkspaceObjectPermissionsDescription)) @dataclass @@ -941,41 +940,41 @@ def as_dict(self) -> dict: """Serializes the Import into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.format is not None: - body["format"] = self.format.value + body["{format}"] = self.format.value if self.language is not None: - body["language"] = self.language.value + body["{language}"] = self.language.value if self.overwrite is not None: - body["overwrite"] = self.overwrite + body["{overwrite}"] = self.overwrite if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the Import into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["content"] = self.content + body["{content}"] = self.content if self.format is not None: - body["format"] = self.format + body["{format}"] = self.format if self.language is not None: - body["language"] = self.language + body["{language}"] = self.language if self.overwrite is not None: - body["overwrite"] = self.overwrite + body["{overwrite}"] = self.overwrite if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Import: """Deserializes the Import from a dictionary.""" return cls( - content=d.get("content", None), - format=_enum(d, "format", ImportFormat), - language=_enum(d, "language", Language), - overwrite=d.get("overwrite", None), - path=d.get("path", None), + content=d.get("{content}", None), + format=_enum(d, "{format}", ImportFormat), + language=_enum(d, "{language}", Language), + overwrite=d.get("{overwrite}", None), + path=d.get("{path}", None), ) @@ -1027,20 +1026,20 @@ def as_dict(self) -> dict: """Serializes the ListAclsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items: - body["items"] = [v.as_dict() for v in self.items] + body["{items}"] = [v.as_dict() for v in self.items] return body def as_shallow_dict(self) -> dict: """Serializes the ListAclsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items: - body["items"] = self.items + body["{items}"] = self.items return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAclsResponse: """Deserializes the ListAclsResponse from a dictionary.""" - return cls(items=_repeated_dict(d, "items", AclItem)) + return cls(items=_repeated_dict(d, "{items}", AclItem)) @dataclass @@ -1052,20 +1051,20 @@ def as_dict(self) -> dict: """Serializes the ListCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credentials: - body["credentials"] = [v.as_dict() for v in self.credentials] + body["{credentials}"] = [v.as_dict() for v in self.credentials] return body def as_shallow_dict(self) -> dict: """Serializes the ListCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credentials: - body["credentials"] = self.credentials + body["{credentials}"] = self.credentials return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCredentialsResponse: """Deserializes the ListCredentialsResponse from a dictionary.""" - return cls(credentials=_repeated_dict(d, "credentials", CredentialInfo)) + return cls(credentials=_repeated_dict(d, "{credentials}", CredentialInfo)) @dataclass @@ -1081,24 +1080,24 @@ def as_dict(self) -> dict: """Serializes the ListReposResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.repos: - body["repos"] = [v.as_dict() for v in self.repos] + body["{repos}"] = [v.as_dict() for v in self.repos] return body def as_shallow_dict(self) -> dict: """Serializes the ListReposResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["next_page_token"] = self.next_page_token + body["{next_page_token}"] = self.next_page_token if self.repos: - body["repos"] = self.repos + body["{repos}"] = self.repos return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListReposResponse: """Deserializes the ListReposResponse from a dictionary.""" - return cls(next_page_token=d.get("next_page_token", None), repos=_repeated_dict(d, "repos", RepoInfo)) + return cls(next_page_token=d.get("{next_page_token}", None), repos=_repeated_dict(d, "{repos}", RepoInfo)) @dataclass @@ -1110,20 +1109,20 @@ def as_dict(self) -> dict: """Serializes the ListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.objects: - body["objects"] = [v.as_dict() for v in self.objects] + body["{objects}"] = [v.as_dict() for v in self.objects] return body def as_shallow_dict(self) -> dict: """Serializes the ListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.objects: - body["objects"] = self.objects + body["{objects}"] = self.objects return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListResponse: """Deserializes the ListResponse from a dictionary.""" - return cls(objects=_repeated_dict(d, "objects", ObjectInfo)) + return cls(objects=_repeated_dict(d, "{objects}", ObjectInfo)) @dataclass @@ -1135,20 +1134,20 @@ def as_dict(self) -> dict: """Serializes the ListScopesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.scopes: - body["scopes"] = [v.as_dict() for v in self.scopes] + body["{scopes}"] = [v.as_dict() for v in self.scopes] return body def as_shallow_dict(self) -> dict: """Serializes the ListScopesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.scopes: - body["scopes"] = self.scopes + body["{scopes}"] = self.scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListScopesResponse: """Deserializes the ListScopesResponse from a dictionary.""" - return cls(scopes=_repeated_dict(d, "scopes", SecretScope)) + return cls(scopes=_repeated_dict(d, "{scopes}", SecretScope)) @dataclass @@ -1160,20 +1159,20 @@ def as_dict(self) -> dict: """Serializes the ListSecretsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.secrets: - body["secrets"] = [v.as_dict() for v in self.secrets] + body["{secrets}"] = [v.as_dict() for v in self.secrets] return body def as_shallow_dict(self) -> dict: """Serializes the ListSecretsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.secrets: - body["secrets"] = self.secrets + body["{secrets}"] = self.secrets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSecretsResponse: """Deserializes the ListSecretsResponse from a dictionary.""" - return cls(secrets=_repeated_dict(d, "secrets", SecretMetadata)) + return cls(secrets=_repeated_dict(d, "{secrets}", SecretMetadata)) @dataclass @@ -1186,20 +1185,20 @@ def as_dict(self) -> dict: """Serializes the Mkdirs into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body def as_shallow_dict(self) -> dict: """Serializes the Mkdirs into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Mkdirs: """Deserializes the Mkdirs from a dictionary.""" - return cls(path=d.get("path", None)) + return cls(path=d.get("{path}", None)) @dataclass @@ -1256,56 +1255,56 @@ def as_dict(self) -> dict: """Serializes the ObjectInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.language is not None: - body["language"] = self.language.value + body["{language}"] = self.language.value if self.modified_at is not None: - body["modified_at"] = self.modified_at + body["{modified_at}"] = self.modified_at if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type.value + body["{object_type}"] = self.object_type.value if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id if self.size is not None: - body["size"] = self.size + body["{size}"] = self.size return body def as_shallow_dict(self) -> dict: """Serializes the ObjectInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["created_at"] = self.created_at + body["{created_at}"] = self.created_at if self.language is not None: - body["language"] = self.language + body["{language}"] = self.language if self.modified_at is not None: - body["modified_at"] = self.modified_at + body["{modified_at}"] = self.modified_at if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.resource_id is not None: - body["resource_id"] = self.resource_id + body["{resource_id}"] = self.resource_id if self.size is not None: - body["size"] = self.size + body["{size}"] = self.size return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ObjectInfo: """Deserializes the ObjectInfo from a dictionary.""" return cls( - created_at=d.get("created_at", None), - language=_enum(d, "language", Language), - modified_at=d.get("modified_at", None), - object_id=d.get("object_id", None), - object_type=_enum(d, "object_type", ObjectType), - path=d.get("path", None), - resource_id=d.get("resource_id", None), - size=d.get("size", None), + created_at=d.get("{created_at}", None), + language=_enum(d, "{language}", Language), + modified_at=d.get("{modified_at}", None), + object_id=d.get("{object_id}", None), + object_type=_enum(d, "{object_type}", ObjectType), + path=d.get("{path}", None), + resource_id=d.get("{resource_id}", None), + size=d.get("{size}", None), ) @@ -1335,31 +1334,31 @@ def as_dict(self) -> dict: """Serializes the PutAcl into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission is not None: - body["permission"] = self.permission.value + body["{permission}"] = self.permission.value if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body def as_shallow_dict(self) -> dict: """Serializes the PutAcl into a shallow dictionary of its immediate attributes.""" body = {} if self.permission is not None: - body["permission"] = self.permission + body["{permission}"] = self.permission if self.principal is not None: - body["principal"] = self.principal + body["{principal}"] = self.principal if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutAcl: """Deserializes the PutAcl from a dictionary.""" return cls( - permission=_enum(d, "permission", AclPermission), - principal=d.get("principal", None), - scope=d.get("scope", None), + permission=_enum(d, "{permission}", AclPermission), + principal=d.get("{principal}", None), + scope=d.get("{scope}", None), ) @@ -1399,36 +1398,36 @@ def as_dict(self) -> dict: """Serializes the PutSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.bytes_value is not None: - body["bytes_value"] = self.bytes_value + body["{bytes_value}"] = self.bytes_value if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope if self.string_value is not None: - body["string_value"] = self.string_value + body["{string_value}"] = self.string_value return body def as_shallow_dict(self) -> dict: """Serializes the PutSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.bytes_value is not None: - body["bytes_value"] = self.bytes_value + body["{bytes_value}"] = self.bytes_value if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.scope is not None: - body["scope"] = self.scope + body["{scope}"] = self.scope if self.string_value is not None: - body["string_value"] = self.string_value + body["{string_value}"] = self.string_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutSecret: """Deserializes the PutSecret from a dictionary.""" return cls( - bytes_value=d.get("bytes_value", None), - key=d.get("key", None), - scope=d.get("scope", None), - string_value=d.get("string_value", None), + bytes_value=d.get("{bytes_value}", None), + key=d.get("{key}", None), + scope=d.get("{scope}", None), + string_value=d.get("{string_value}", None), ) @@ -1468,36 +1467,36 @@ def as_dict(self) -> dict: """Serializes the RepoAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the RepoAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoAccessControlRequest: """Deserializes the RepoAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", RepoPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", RepoPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -1522,41 +1521,41 @@ def as_dict(self) -> dict: """Serializes the RepoAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the RepoAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoAccessControlResponse: """Deserializes the RepoAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", RepoPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", RepoPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -1589,51 +1588,51 @@ def as_dict(self) -> dict: """Serializes the RepoInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.head_commit_id is not None: - body["head_commit_id"] = self.head_commit_id + body["{head_commit_id}"] = self.head_commit_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout.as_dict() + body["{sparse_checkout}"] = self.sparse_checkout.as_dict() if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body def as_shallow_dict(self) -> dict: """Serializes the RepoInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.head_commit_id is not None: - body["head_commit_id"] = self.head_commit_id + body["{head_commit_id}"] = self.head_commit_id if self.id is not None: - body["id"] = self.id + body["{id}"] = self.id if self.path is not None: - body["path"] = self.path + body["{path}"] = self.path if self.provider is not None: - body["provider"] = self.provider + body["{provider}"] = self.provider if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout + body["{sparse_checkout}"] = self.sparse_checkout if self.url is not None: - body["url"] = self.url + body["{url}"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoInfo: """Deserializes the RepoInfo from a dictionary.""" return cls( - branch=d.get("branch", None), - head_commit_id=d.get("head_commit_id", None), - id=d.get("id", None), - path=d.get("path", None), - provider=d.get("provider", None), - sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), - url=d.get("url", None), + branch=d.get("{branch}", None), + head_commit_id=d.get("{head_commit_id}", None), + id=d.get("{id}", None), + path=d.get("{path}", None), + provider=d.get("{provider}", None), + sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), + url=d.get("{url}", None), ) @@ -1650,31 +1649,31 @@ def as_dict(self) -> dict: """Serializes the RepoPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the RepoPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermission: """Deserializes the RepoPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", RepoPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", RepoPermissionLevel), ) @@ -1699,31 +1698,31 @@ def as_dict(self) -> dict: """Serializes the RepoPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the RepoPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermissions: """Deserializes the RepoPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", RepoAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", RepoAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -1738,25 +1737,26 @@ def as_dict(self) -> dict: """Serializes the RepoPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the RepoPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermissionsDescription: """Deserializes the RepoPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), permission_level=_enum(d, "permission_level", RepoPermissionLevel) + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", RepoPermissionLevel), ) @@ -1771,26 +1771,26 @@ def as_dict(self) -> dict: """Serializes the RepoPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.repo_id is not None: - body["repo_id"] = self.repo_id + body["{repo_id}"] = self.repo_id return body def as_shallow_dict(self) -> dict: """Serializes the RepoPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.repo_id is not None: - body["repo_id"] = self.repo_id + body["{repo_id}"] = self.repo_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermissionsRequest: """Deserializes the RepoPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", RepoAccessControlRequest), - repo_id=d.get("repo_id", None), + access_control_list=_repeated_dict(d, "{access_control_list}", RepoAccessControlRequest), + repo_id=d.get("{repo_id}", None), ) @@ -1812,24 +1812,24 @@ def as_dict(self) -> dict: """Serializes the SecretMetadata into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp return body def as_shallow_dict(self) -> dict: """Serializes the SecretMetadata into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["key"] = self.key + body["{key}"] = self.key if self.last_updated_timestamp is not None: - body["last_updated_timestamp"] = self.last_updated_timestamp + body["{last_updated_timestamp}"] = self.last_updated_timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecretMetadata: """Deserializes the SecretMetadata from a dictionary.""" - return cls(key=d.get("key", None), last_updated_timestamp=d.get("last_updated_timestamp", None)) + return cls(key=d.get("{key}", None), last_updated_timestamp=d.get("{last_updated_timestamp}", None)) @dataclass @@ -1847,31 +1847,31 @@ def as_dict(self) -> dict: """Serializes the SecretScope into a dictionary suitable for use as a JSON request body.""" body = {} if self.backend_type is not None: - body["backend_type"] = self.backend_type.value + body["{backend_type}"] = self.backend_type.value if self.keyvault_metadata: - body["keyvault_metadata"] = self.keyvault_metadata.as_dict() + body["{keyvault_metadata}"] = self.keyvault_metadata.as_dict() if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body def as_shallow_dict(self) -> dict: """Serializes the SecretScope into a shallow dictionary of its immediate attributes.""" body = {} if self.backend_type is not None: - body["backend_type"] = self.backend_type + body["{backend_type}"] = self.backend_type if self.keyvault_metadata: - body["keyvault_metadata"] = self.keyvault_metadata + body["{keyvault_metadata}"] = self.keyvault_metadata if self.name is not None: - body["name"] = self.name + body["{name}"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecretScope: """Deserializes the SecretScope from a dictionary.""" return cls( - backend_type=_enum(d, "backend_type", ScopeBackendType), - keyvault_metadata=_from_dict(d, "keyvault_metadata", AzureKeyVaultSecretScopeMetadata), - name=d.get("name", None), + backend_type=_enum(d, "{backend_type}", ScopeBackendType), + keyvault_metadata=_from_dict(d, "{keyvault_metadata}", AzureKeyVaultSecretScopeMetadata), + name=d.get("{name}", None), ) @@ -1888,20 +1888,20 @@ def as_dict(self) -> dict: """Serializes the SparseCheckout into a dictionary suitable for use as a JSON request body.""" body = {} if self.patterns: - body["patterns"] = [v for v in self.patterns] + body["{patterns}"] = [v for v in self.patterns] return body def as_shallow_dict(self) -> dict: """Serializes the SparseCheckout into a shallow dictionary of its immediate attributes.""" body = {} if self.patterns: - body["patterns"] = self.patterns + body["{patterns}"] = self.patterns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparseCheckout: """Deserializes the SparseCheckout from a dictionary.""" - return cls(patterns=d.get("patterns", None)) + return cls(patterns=d.get("{patterns}", None)) @dataclass @@ -1917,20 +1917,20 @@ def as_dict(self) -> dict: """Serializes the SparseCheckoutUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.patterns: - body["patterns"] = [v for v in self.patterns] + body["{patterns}"] = [v for v in self.patterns] return body def as_shallow_dict(self) -> dict: """Serializes the SparseCheckoutUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.patterns: - body["patterns"] = self.patterns + body["{patterns}"] = self.patterns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparseCheckoutUpdate: """Deserializes the SparseCheckoutUpdate from a dictionary.""" - return cls(patterns=d.get("patterns", None)) + return cls(patterns=d.get("{patterns}", None)) @dataclass @@ -1960,36 +1960,36 @@ def as_dict(self) -> dict: """Serializes the UpdateCredentialsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username if self.personal_access_token is not None: - body["personal_access_token"] = self.personal_access_token + body["{personal_access_token}"] = self.personal_access_token return body def as_shallow_dict(self) -> dict: """Serializes the UpdateCredentialsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["credential_id"] = self.credential_id + body["{credential_id}"] = self.credential_id if self.git_provider is not None: - body["git_provider"] = self.git_provider + body["{git_provider}"] = self.git_provider if self.git_username is not None: - body["git_username"] = self.git_username + body["{git_username}"] = self.git_username if self.personal_access_token is not None: - body["personal_access_token"] = self.personal_access_token + body["{personal_access_token}"] = self.personal_access_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCredentialsRequest: """Deserializes the UpdateCredentialsRequest from a dictionary.""" return cls( - credential_id=d.get("credential_id", None), - git_provider=d.get("git_provider", None), - git_username=d.get("git_username", None), - personal_access_token=d.get("personal_access_token", None), + credential_id=d.get("{credential_id}", None), + git_provider=d.get("{git_provider}", None), + git_username=d.get("{git_username}", None), + personal_access_token=d.get("{personal_access_token}", None), ) @@ -2032,36 +2032,36 @@ def as_dict(self) -> dict: """Serializes the UpdateRepoRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.repo_id is not None: - body["repo_id"] = self.repo_id + body["{repo_id}"] = self.repo_id if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout.as_dict() + body["{sparse_checkout}"] = self.sparse_checkout.as_dict() if self.tag is not None: - body["tag"] = self.tag + body["{tag}"] = self.tag return body def as_shallow_dict(self) -> dict: """Serializes the UpdateRepoRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["branch"] = self.branch + body["{branch}"] = self.branch if self.repo_id is not None: - body["repo_id"] = self.repo_id + body["{repo_id}"] = self.repo_id if self.sparse_checkout: - body["sparse_checkout"] = self.sparse_checkout + body["{sparse_checkout}"] = self.sparse_checkout if self.tag is not None: - body["tag"] = self.tag + body["{tag}"] = self.tag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRepoRequest: """Deserializes the UpdateRepoRequest from a dictionary.""" return cls( - branch=d.get("branch", None), - repo_id=d.get("repo_id", None), - sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckoutUpdate), - tag=d.get("tag", None), + branch=d.get("{branch}", None), + repo_id=d.get("{repo_id}", None), + sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckoutUpdate), + tag=d.get("{tag}", None), ) @@ -2101,36 +2101,36 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectAccessControlRequest: """Deserializes the WorkspaceObjectAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("group_name", None), - permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + group_name=d.get("{group_name}", None), + permission_level=_enum(d, "{permission_level}", WorkspaceObjectPermissionLevel), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -2155,41 +2155,41 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["all_permissions"] = [v.as_dict() for v in self.all_permissions] + body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["all_permissions"] = self.all_permissions + body["{all_permissions}"] = self.all_permissions if self.display_name is not None: - body["display_name"] = self.display_name + body["{display_name}"] = self.display_name if self.group_name is not None: - body["group_name"] = self.group_name + body["{group_name}"] = self.group_name if self.service_principal_name is not None: - body["service_principal_name"] = self.service_principal_name + body["{service_principal_name}"] = self.service_principal_name if self.user_name is not None: - body["user_name"] = self.user_name + body["{user_name}"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectAccessControlResponse: """Deserializes the WorkspaceObjectAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "all_permissions", WorkspaceObjectPermission), - display_name=d.get("display_name", None), - group_name=d.get("group_name", None), - service_principal_name=d.get("service_principal_name", None), - user_name=d.get("user_name", None), + all_permissions=_repeated_dict(d, "{all_permissions}", WorkspaceObjectPermission), + display_name=d.get("{display_name}", None), + group_name=d.get("{group_name}", None), + service_principal_name=d.get("{service_principal_name}", None), + user_name=d.get("{user_name}", None), ) @@ -2206,31 +2206,31 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = [v for v in self.inherited_from_object] + body["{inherited_from_object}"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["inherited"] = self.inherited + body["{inherited}"] = self.inherited if self.inherited_from_object: - body["inherited_from_object"] = self.inherited_from_object + body["{inherited_from_object}"] = self.inherited_from_object if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermission: """Deserializes the WorkspaceObjectPermission from a dictionary.""" return cls( - inherited=d.get("inherited", None), - inherited_from_object=d.get("inherited_from_object", None), - permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), + inherited=d.get("{inherited}", None), + inherited_from_object=d.get("{inherited_from_object}", None), + permission_level=_enum(d, "{permission_level}", WorkspaceObjectPermissionLevel), ) @@ -2255,31 +2255,31 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.object_id is not None: - body["object_id"] = self.object_id + body["{object_id}"] = self.object_id if self.object_type is not None: - body["object_type"] = self.object_type + body["{object_type}"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissions: """Deserializes the WorkspaceObjectPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", WorkspaceObjectAccessControlResponse), - object_id=d.get("object_id", None), - object_type=d.get("object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", WorkspaceObjectAccessControlResponse), + object_id=d.get("{object_id}", None), + object_type=d.get("{object_type}", None), ) @@ -2294,26 +2294,26 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level.value + body["{permission_level}"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["description"] = self.description + body["{description}"] = self.description if self.permission_level is not None: - body["permission_level"] = self.permission_level + body["{permission_level}"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissionsDescription: """Deserializes the WorkspaceObjectPermissionsDescription from a dictionary.""" return cls( - description=d.get("description", None), - permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), + description=d.get("{description}", None), + permission_level=_enum(d, "{permission_level}", WorkspaceObjectPermissionLevel), ) @@ -2331,31 +2331,31 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["access_control_list"] = [v.as_dict() for v in self.access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] if self.workspace_object_id is not None: - body["workspace_object_id"] = self.workspace_object_id + body["{workspace_object_id}"] = self.workspace_object_id if self.workspace_object_type is not None: - body["workspace_object_type"] = self.workspace_object_type + body["{workspace_object_type}"] = self.workspace_object_type return body def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["access_control_list"] = self.access_control_list + body["{access_control_list}"] = self.access_control_list if self.workspace_object_id is not None: - body["workspace_object_id"] = self.workspace_object_id + body["{workspace_object_id}"] = self.workspace_object_id if self.workspace_object_type is not None: - body["workspace_object_type"] = self.workspace_object_type + body["{workspace_object_type}"] = self.workspace_object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissionsRequest: """Deserializes the WorkspaceObjectPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "access_control_list", WorkspaceObjectAccessControlRequest), - workspace_object_id=d.get("workspace_object_id", None), - workspace_object_type=d.get("workspace_object_type", None), + access_control_list=_repeated_dict(d, "{access_control_list}", WorkspaceObjectAccessControlRequest), + workspace_object_id=d.get("{workspace_object_id}", None), + workspace_object_type=d.get("{workspace_object_type}", None), ) @@ -2398,14 +2398,14 @@ def create( """ body = {} if git_provider is not None: - body["git_provider"] = git_provider + body["{git_provider}"] = git_provider if git_username is not None: - body["git_username"] = git_username + body["{git_username}"] = git_username if personal_access_token is not None: - body["personal_access_token"] = personal_access_token + body["{personal_access_token}"] = personal_access_token headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/git-credentials", body=body, headers=headers) @@ -2423,7 +2423,7 @@ def delete(self, credential_id: int): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/git-credentials/{credential_id}", headers=headers) @@ -2440,7 +2440,7 @@ def get(self, credential_id: int) -> GetCredentialsResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/git-credentials/{credential_id}", headers=headers) @@ -2455,7 +2455,7 @@ def list(self) -> Iterator[CredentialInfo]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/git-credentials", headers=headers) @@ -2496,14 +2496,14 @@ def update( """ body = {} if git_provider is not None: - body["git_provider"] = git_provider + body["{git_provider}"] = git_provider if git_username is not None: - body["git_username"] = git_username + body["{git_username}"] = git_username if personal_access_token is not None: - body["personal_access_token"] = personal_access_token + body["{personal_access_token}"] = personal_access_token headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.0/git-credentials/{credential_id}", body=body, headers=headers) @@ -2548,16 +2548,16 @@ def create( """ body = {} if path is not None: - body["path"] = path + body["{path}"] = path if provider is not None: - body["provider"] = provider + body["{provider}"] = provider if sparse_checkout is not None: - body["sparse_checkout"] = sparse_checkout.as_dict() + body["{sparse_checkout}"] = sparse_checkout.as_dict() if url is not None: - body["url"] = url + body["{url}"] = url headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("POST", "/api/2.0/repos", body=body, headers=headers) @@ -2575,7 +2575,7 @@ def delete(self, repo_id: int): """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } self._api.do("DELETE", f"/api/2.0/repos/{repo_id}", headers=headers) @@ -2592,7 +2592,7 @@ def get(self, repo_id: int) -> GetRepoResponse: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/repos/{repo_id}", headers=headers) @@ -2610,7 +2610,7 @@ def get_permission_levels(self, repo_id: str) -> GetRepoPermissionLevelsResponse """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/repos/{repo_id}/permissionLevels", headers=headers) @@ -2628,7 +2628,7 @@ def get_permissions(self, repo_id: str) -> RepoPermissions: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", f"/api/2.0/permissions/repos/{repo_id}", headers=headers) @@ -2653,21 +2653,21 @@ def list(self, *, next_page_token: Optional[str] = None, path_prefix: Optional[s query = {} if next_page_token is not None: - query["next_page_token"] = next_page_token + query["{next_page_token}"] = next_page_token if path_prefix is not None: - query["path_prefix"] = path_prefix + query["{path_prefix}"] = path_prefix headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/repos", query=query, headers=headers) - if "repos" in json: - for v in json["repos"]: + if "{repos}" in json: + for v in json["{repos}"]: yield RepoInfo.from_dict(v) - if "next_page_token" not in json or not json["next_page_token"]: + if "{next_page_token}" not in json or not json["{next_page_token}"]: return - query["next_page_token"] = json["next_page_token"] + query["{next_page_token}"] = json["{next_page_token}"] def set_permissions( self, repo_id: str, *, access_control_list: Optional[List[RepoAccessControlRequest]] = None @@ -2685,10 +2685,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PUT", f"/api/2.0/permissions/repos/{repo_id}", body=body, headers=headers) @@ -2723,14 +2723,14 @@ def update( """ body = {} if branch is not None: - body["branch"] = branch + body["{branch}"] = branch if sparse_checkout is not None: - body["sparse_checkout"] = sparse_checkout.as_dict() + body["{sparse_checkout}"] = sparse_checkout.as_dict() if tag is not None: - body["tag"] = tag + body["{tag}"] = tag headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("PATCH", f"/api/2.0/repos/{repo_id}", body=body, headers=headers) @@ -2750,10 +2750,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do("PATCH", f"/api/2.0/permissions/repos/{repo_id}", body=body, headers=headers) @@ -2800,16 +2800,16 @@ def create_scope( """ body = {} if backend_azure_keyvault is not None: - body["backend_azure_keyvault"] = backend_azure_keyvault.as_dict() + body["{backend_azure_keyvault}"] = backend_azure_keyvault.as_dict() if initial_manage_principal is not None: - body["initial_manage_principal"] = initial_manage_principal + body["{initial_manage_principal}"] = initial_manage_principal if scope is not None: - body["scope"] = scope + body["{scope}"] = scope if scope_backend_type is not None: - body["scope_backend_type"] = scope_backend_type.value + body["{scope_backend_type}"] = scope_backend_type.value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/secrets/scopes/create", body=body, headers=headers) @@ -2832,12 +2832,12 @@ def delete_acl(self, scope: str, principal: str): """ body = {} if principal is not None: - body["principal"] = principal + body["{principal}"] = principal if scope is not None: - body["scope"] = scope + body["{scope}"] = scope headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/secrets/acls/delete", body=body, headers=headers) @@ -2857,10 +2857,10 @@ def delete_scope(self, scope: str): """ body = {} if scope is not None: - body["scope"] = scope + body["{scope}"] = scope headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/secrets/scopes/delete", body=body, headers=headers) @@ -2883,12 +2883,12 @@ def delete_secret(self, scope: str, key: str): """ body = {} if key is not None: - body["key"] = key + body["{key}"] = key if scope is not None: - body["scope"] = scope + body["{scope}"] = scope headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/secrets/delete", body=body, headers=headers) @@ -2912,11 +2912,11 @@ def get_acl(self, scope: str, principal: str) -> AclItem: query = {} if principal is not None: - query["principal"] = principal + query["{principal}"] = principal if scope is not None: - query["scope"] = scope + query["{scope}"] = scope headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/secrets/acls/get", query=query, headers=headers) @@ -2945,11 +2945,11 @@ def get_secret(self, scope: str, key: str) -> GetSecretResponse: query = {} if key is not None: - query["key"] = key + query["{key}"] = key if scope is not None: - query["scope"] = scope + query["{scope}"] = scope headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/secrets/get", query=query, headers=headers) @@ -2971,9 +2971,9 @@ def list_acls(self, scope: str) -> Iterator[AclItem]: query = {} if scope is not None: - query["scope"] = scope + query["{scope}"] = scope headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/secrets/acls/list", query=query, headers=headers) @@ -2991,7 +2991,7 @@ def list_scopes(self) -> Iterator[SecretScope]: """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/secrets/scopes/list", headers=headers) @@ -3016,9 +3016,9 @@ def list_secrets(self, scope: str) -> Iterator[SecretMetadata]: query = {} if scope is not None: - query["scope"] = scope + query["{scope}"] = scope headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/secrets/list", query=query, headers=headers) @@ -3064,14 +3064,14 @@ def put_acl(self, scope: str, principal: str, permission: AclPermission): """ body = {} if permission is not None: - body["permission"] = permission.value + body["{permission}"] = permission.value if principal is not None: - body["principal"] = principal + body["{principal}"] = principal if scope is not None: - body["scope"] = scope + body["{scope}"] = scope headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/secrets/acls/put", body=body, headers=headers) @@ -3110,16 +3110,16 @@ def put_secret( """ body = {} if bytes_value is not None: - body["bytes_value"] = bytes_value + body["{bytes_value}"] = bytes_value if key is not None: - body["key"] = key + body["{key}"] = key if scope is not None: - body["scope"] = scope + body["{scope}"] = scope if string_value is not None: - body["string_value"] = string_value + body["{string_value}"] = string_value headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/secrets/put", body=body, headers=headers) @@ -3155,12 +3155,12 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): """ body = {} if path is not None: - body["path"] = path + body["{path}"] = path if recursive is not None: - body["recursive"] = recursive + body["{recursive}"] = recursive headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/workspace/delete", body=body, headers=headers) @@ -3195,11 +3195,11 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR query = {} if format is not None: - query["format"] = format.value + query["{format}"] = format.value if path is not None: - query["path"] = path + query["{path}"] = path headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/workspace/export", query=query, headers=headers) @@ -3221,7 +3221,7 @@ def get_permission_levels( """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3246,7 +3246,7 @@ def get_permissions(self, workspace_object_type: str, workspace_object_id: str) """ headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do( @@ -3268,9 +3268,9 @@ def get_status(self, path: str) -> ObjectInfo: query = {} if path is not None: - query["path"] = path + query["{path}"] = path headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } res = self._api.do("GET", "/api/2.0/workspace/get-status", query=query, headers=headers) @@ -3322,18 +3322,18 @@ def import_( """ body = {} if content is not None: - body["content"] = content + body["{content}"] = content if format is not None: - body["format"] = format.value + body["{format}"] = format.value if language is not None: - body["language"] = language.value + body["{language}"] = language.value if overwrite is not None: - body["overwrite"] = overwrite + body["{overwrite}"] = overwrite if path is not None: - body["path"] = path + body["{path}"] = path headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/workspace/import", body=body, headers=headers) @@ -3354,11 +3354,11 @@ def list(self, path: str, *, notebooks_modified_after: Optional[int] = None) -> query = {} if notebooks_modified_after is not None: - query["notebooks_modified_after"] = notebooks_modified_after + query["{notebooks_modified_after}"] = notebooks_modified_after if path is not None: - query["path"] = path + query["{path}"] = path headers = { - "Accept": "application/json", + "0": "{Accept application/json}", } json = self._api.do("GET", "/api/2.0/workspace/list", query=query, headers=headers) @@ -3383,10 +3383,10 @@ def mkdirs(self, path: str): """ body = {} if path is not None: - body["path"] = path + body["{path}"] = path headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } self._api.do("POST", "/api/2.0/workspace/mkdirs", body=body, headers=headers) @@ -3414,10 +3414,10 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( @@ -3447,10 +3447,10 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["access_control_list"] = [v.as_dict() for v in access_control_list] + body["{access_control_list}"] = [v.as_dict() for v in access_control_list] headers = { - "Accept": "application/json", - "Content-Type": "application/json", + "0": "{Accept application/json}", + "1": "{Content-Type application/json}", } res = self._api.do( From d42da947230fe816ecb1fe5d494e89a445a463b5 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 10:41:17 +0000 Subject: [PATCH 04/20] update --- databricks/sdk/apps/v2/impl.py | 154 +- databricks/sdk/billing/v2/impl.py | 202 +-- databricks/sdk/catalog/v2/impl.py | 1544 ++++++++-------- databricks/sdk/cleanrooms/v2/impl.py | 220 +-- databricks/sdk/compute/v2/impl.py | 1310 +++++++------- databricks/sdk/dashboards/v2/impl.py | 336 ++-- databricks/sdk/files/v2/impl.py | 70 +- databricks/sdk/iam/v2/impl.py | 274 +-- databricks/sdk/jobs/v2/impl.py | 2285 +++++++----------------- databricks/sdk/marketplace/v2/impl.py | 516 +++--- databricks/sdk/ml/v2/impl.py | 750 ++++---- databricks/sdk/oauth2/v2/impl.py | 164 +- databricks/sdk/pipelines/v2/impl.py | 636 +++---- databricks/sdk/provisioning/v2/impl.py | 328 ++-- databricks/sdk/serving/v2/impl.py | 606 +++---- databricks/sdk/settings/v2/impl.py | 540 +++--- databricks/sdk/sharing/v2/impl.py | 422 ++--- databricks/sdk/sql/v2/impl.py | 1240 ++++++------- databricks/sdk/vectorsearch/v2/impl.py | 214 +-- databricks/sdk/workspace/v2/impl.py | 280 +-- 20 files changed, 5570 insertions(+), 6521 deletions(-) diff --git a/databricks/sdk/apps/v2/impl.py b/databricks/sdk/apps/v2/impl.py index 0fc522305..ff0a634f0 100755 --- a/databricks/sdk/apps/v2/impl.py +++ b/databricks/sdk/apps/v2/impl.py @@ -84,51 +84,51 @@ def as_dict(self) -> dict: """Serializes the App into a dictionary suitable for use as a JSON request body.""" body = {} if self.active_deployment: - body["{active_deployment}"] = self.active_deployment.as_dict() + body["active_deployment"] = self.active_deployment.as_dict() if self.app_status: - body["{app_status}"] = self.app_status.as_dict() + body["app_status"] = self.app_status.as_dict() if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.compute_status: - body["{compute_status}"] = self.compute_status.as_dict() + body["compute_status"] = self.compute_status.as_dict() if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.default_source_code_path is not None: - body["{default_source_code_path}"] = self.default_source_code_path + body["default_source_code_path"] = self.default_source_code_path if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.effective_user_api_scopes: - body["{effective_user_api_scopes}"] = [v for v in self.effective_user_api_scopes] + body["effective_user_api_scopes"] = [v for v in self.effective_user_api_scopes] if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.oauth2_app_client_id is not None: - body["{oauth2_app_client_id}"] = self.oauth2_app_client_id + body["oauth2_app_client_id"] = self.oauth2_app_client_id if self.oauth2_app_integration_id is not None: - body["{oauth2_app_integration_id}"] = self.oauth2_app_integration_id + body["oauth2_app_integration_id"] = self.oauth2_app_integration_id if self.pending_deployment: - body["{pending_deployment}"] = self.pending_deployment.as_dict() + body["pending_deployment"] = self.pending_deployment.as_dict() if self.resources: - body["{resources}"] = [v.as_dict() for v in self.resources] + body["resources"] = [v.as_dict() for v in self.resources] if self.service_principal_client_id is not None: - body["{service_principal_client_id}"] = self.service_principal_client_id + body["service_principal_client_id"] = self.service_principal_client_id if self.service_principal_id is not None: - body["{service_principal_id}"] = self.service_principal_id + body["service_principal_id"] = self.service_principal_id if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.updater is not None: - body["{updater}"] = self.updater + body["updater"] = self.updater if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.user_api_scopes: - body["{user_api_scopes}"] = [v for v in self.user_api_scopes] + body["user_api_scopes"] = [v for v in self.user_api_scopes] return body def as_shallow_dict(self) -> dict: @@ -230,13 +230,13 @@ def as_dict(self) -> dict: """Serializes the AppAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -284,15 +284,15 @@ def as_dict(self) -> dict: """Serializes the AppAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -356,21 +356,21 @@ def as_dict(self) -> dict: """Serializes the AppDeployment into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.deployment_artifacts: - body["{deployment_artifacts}"] = self.deployment_artifacts.as_dict() + body["deployment_artifacts"] = self.deployment_artifacts.as_dict() if self.deployment_id is not None: - body["{deployment_id}"] = self.deployment_id + body["deployment_id"] = self.deployment_id if self.mode is not None: - body["{mode}"] = self.mode.value + body["mode"] = self.mode.value if self.source_code_path is not None: - body["{source_code_path}"] = self.source_code_path + body["source_code_path"] = self.source_code_path if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -418,7 +418,7 @@ def as_dict(self) -> dict: """Serializes the AppDeploymentArtifacts into a dictionary suitable for use as a JSON request body.""" body = {} if self.source_code_path is not None: - body["{source_code_path}"] = self.source_code_path + body["source_code_path"] = self.source_code_path return body def as_shallow_dict(self) -> dict: @@ -460,9 +460,9 @@ def as_dict(self) -> dict: """Serializes the AppDeploymentStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -493,11 +493,11 @@ def as_dict(self) -> dict: """Serializes the AppPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -540,11 +540,11 @@ def as_dict(self) -> dict: """Serializes the AppPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -579,9 +579,9 @@ def as_dict(self) -> dict: """Serializes the AppPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -613,9 +613,9 @@ def as_dict(self) -> dict: """Serializes the AppPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.app_name is not None: - body["{app_name}"] = self.app_name + body["app_name"] = self.app_name return body def as_shallow_dict(self) -> dict: @@ -656,17 +656,17 @@ def as_dict(self) -> dict: """Serializes the AppResource into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.job: - body["{job}"] = self.job.as_dict() + body["job"] = self.job.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.secret: - body["{secret}"] = self.secret.as_dict() + body["secret"] = self.secret.as_dict() if self.serving_endpoint: - body["{serving_endpoint}"] = self.serving_endpoint.as_dict() + body["serving_endpoint"] = self.serving_endpoint.as_dict() if self.sql_warehouse: - body["{sql_warehouse}"] = self.sql_warehouse.as_dict() + body["sql_warehouse"] = self.sql_warehouse.as_dict() return body def as_shallow_dict(self) -> dict: @@ -712,9 +712,9 @@ def as_dict(self) -> dict: """Serializes the AppResourceJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.permission is not None: - body["{permission}"] = self.permission.value + body["permission"] = self.permission.value return body def as_shallow_dict(self) -> dict: @@ -756,11 +756,11 @@ def as_dict(self) -> dict: """Serializes the AppResourceSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.permission is not None: - body["{permission}"] = self.permission.value + body["permission"] = self.permission.value if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body def as_shallow_dict(self) -> dict: @@ -805,9 +805,9 @@ def as_dict(self) -> dict: """Serializes the AppResourceServingEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.permission is not None: - body["{permission}"] = self.permission.value + body["permission"] = self.permission.value return body def as_shallow_dict(self) -> dict: @@ -848,9 +848,9 @@ def as_dict(self) -> dict: """Serializes the AppResourceSqlWarehouse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.permission is not None: - body["{permission}"] = self.permission.value + body["permission"] = self.permission.value return body def as_shallow_dict(self) -> dict: @@ -897,9 +897,9 @@ def as_dict(self) -> dict: """Serializes the ApplicationStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -940,9 +940,9 @@ def as_dict(self) -> dict: """Serializes the ComputeStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -969,7 +969,7 @@ def as_dict(self) -> dict: """Serializes the GetAppPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -997,9 +997,9 @@ def as_dict(self) -> dict: """Serializes the ListAppDeploymentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_deployments: - body["{app_deployments}"] = [v.as_dict() for v in self.app_deployments] + body["app_deployments"] = [v.as_dict() for v in self.app_deployments] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1031,9 +1031,9 @@ def as_dict(self) -> dict: """Serializes the ListAppsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["{apps}"] = [v.as_dict() for v in self.apps] + body["apps"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/billing/v2/impl.py b/databricks/sdk/billing/v2/impl.py index 3fba90cb3..4452f4757 100755 --- a/databricks/sdk/billing/v2/impl.py +++ b/databricks/sdk/billing/v2/impl.py @@ -29,11 +29,11 @@ def as_dict(self) -> dict: """Serializes the ActionConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_configuration_id is not None: - body["{action_configuration_id}"] = self.action_configuration_id + body["action_configuration_id"] = self.action_configuration_id if self.action_type is not None: - body["{action_type}"] = self.action_type.value + body["action_type"] = self.action_type.value if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target return body def as_shallow_dict(self) -> dict: @@ -89,17 +89,17 @@ def as_dict(self) -> dict: """Serializes the AlertConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_configurations: - body["{action_configurations}"] = [v.as_dict() for v in self.action_configurations] + body["action_configurations"] = [v.as_dict() for v in self.action_configurations] if self.alert_configuration_id is not None: - body["{alert_configuration_id}"] = self.alert_configuration_id + body["alert_configuration_id"] = self.alert_configuration_id if self.quantity_threshold is not None: - body["{quantity_threshold}"] = self.quantity_threshold + body["quantity_threshold"] = self.quantity_threshold if self.quantity_type is not None: - body["{quantity_type}"] = self.quantity_type.value + body["quantity_type"] = self.quantity_type.value if self.time_period is not None: - body["{time_period}"] = self.time_period.value + body["time_period"] = self.time_period.value if self.trigger_type is not None: - body["{trigger_type}"] = self.trigger_type.value + body["trigger_type"] = self.trigger_type.value return body def as_shallow_dict(self) -> dict: @@ -177,19 +177,19 @@ def as_dict(self) -> dict: """Serializes the BudgetConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.alert_configurations: - body["{alert_configurations}"] = [v.as_dict() for v in self.alert_configurations] + body["alert_configurations"] = [v.as_dict() for v in self.alert_configurations] if self.budget_configuration_id is not None: - body["{budget_configuration_id}"] = self.budget_configuration_id + body["budget_configuration_id"] = self.budget_configuration_id if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.filter: - body["{filter}"] = self.filter.as_dict() + body["filter"] = self.filter.as_dict() if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -239,9 +239,9 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.workspace_id: - body["{workspace_id}"] = self.workspace_id.as_dict() + body["workspace_id"] = self.workspace_id.as_dict() return body def as_shallow_dict(self) -> dict: @@ -272,9 +272,9 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilterClause into a dictionary suitable for use as a JSON request body.""" body = {} if self.operator is not None: - body["{operator}"] = self.operator.value + body["operator"] = self.operator.value if self.values: - body["{values}"] = [v for v in self.values] + body["values"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -307,9 +307,9 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilterTagClause into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value: - body["{value}"] = self.value.as_dict() + body["value"] = self.value.as_dict() return body def as_shallow_dict(self) -> dict: @@ -337,9 +337,9 @@ def as_dict(self) -> dict: """Serializes the BudgetConfigurationFilterWorkspaceIdClause into a dictionary suitable for use as a JSON request body.""" body = {} if self.operator is not None: - body["{operator}"] = self.operator.value + body["operator"] = self.operator.value if self.values: - body["{values}"] = [v for v in self.values] + body["values"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -376,11 +376,11 @@ def as_dict(self) -> dict: """Serializes the BudgetPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_tags: - body["{custom_tags}"] = [v.as_dict() for v in self.custom_tags] + body["custom_tags"] = [v.as_dict() for v in self.custom_tags] if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.policy_name is not None: - body["{policy_name}"] = self.policy_name + body["policy_name"] = self.policy_name return body def as_shallow_dict(self) -> dict: @@ -417,9 +417,9 @@ def as_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_type is not None: - body["{dashboard_type}"] = self.dashboard_type.value + body["dashboard_type"] = self.dashboard_type.value if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -448,7 +448,7 @@ def as_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id return body def as_shallow_dict(self) -> dict: @@ -485,13 +485,13 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudget into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.alert_configurations: - body["{alert_configurations}"] = [v.as_dict() for v in self.alert_configurations] + body["alert_configurations"] = [v.as_dict() for v in self.alert_configurations] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.filter: - body["{filter}"] = self.filter.as_dict() + body["filter"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: @@ -532,9 +532,9 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetActionConfigurations into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_type is not None: - body["{action_type}"] = self.action_type.value + body["action_type"] = self.action_type.value if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target return body def as_shallow_dict(self) -> dict: @@ -576,15 +576,15 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetAlertConfigurations into a dictionary suitable for use as a JSON request body.""" body = {} if self.action_configurations: - body["{action_configurations}"] = [v.as_dict() for v in self.action_configurations] + body["action_configurations"] = [v.as_dict() for v in self.action_configurations] if self.quantity_threshold is not None: - body["{quantity_threshold}"] = self.quantity_threshold + body["quantity_threshold"] = self.quantity_threshold if self.quantity_type is not None: - body["{quantity_type}"] = self.quantity_type.value + body["quantity_type"] = self.quantity_type.value if self.time_period is not None: - body["{time_period}"] = self.time_period.value + body["time_period"] = self.time_period.value if self.trigger_type is not None: - body["{trigger_type}"] = self.trigger_type.value + body["trigger_type"] = self.trigger_type.value return body def as_shallow_dict(self) -> dict: @@ -625,7 +625,7 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["{budget}"] = self.budget.as_dict() + body["budget"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: @@ -650,7 +650,7 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetConfigurationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["{budget}"] = self.budget.as_dict() + body["budget"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: @@ -683,9 +683,9 @@ def as_dict(self) -> dict: """Serializes the CreateBudgetPolicyRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.policy: - body["{policy}"] = self.policy.as_dict() + body["policy"] = self.policy.as_dict() if self.request_id is not None: - body["{request_id}"] = self.request_id + body["request_id"] = self.request_id return body def as_shallow_dict(self) -> dict: @@ -778,23 +778,23 @@ def as_dict(self) -> dict: """Serializes the CreateLogDeliveryConfigurationParams into a dictionary suitable for use as a JSON request body.""" body = {} if self.config_name is not None: - body["{config_name}"] = self.config_name + body["config_name"] = self.config_name if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.delivery_path_prefix is not None: - body["{delivery_path_prefix}"] = self.delivery_path_prefix + body["delivery_path_prefix"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["{delivery_start_time}"] = self.delivery_start_time + body["delivery_start_time"] = self.delivery_start_time if self.log_type is not None: - body["{log_type}"] = self.log_type.value + body["log_type"] = self.log_type.value if self.output_format is not None: - body["{output_format}"] = self.output_format.value + body["output_format"] = self.output_format.value if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.workspace_ids_filter: - body["{workspace_ids_filter}"] = [v for v in self.workspace_ids_filter] + body["workspace_ids_filter"] = [v for v in self.workspace_ids_filter] return body def as_shallow_dict(self) -> dict: @@ -856,9 +856,9 @@ def as_dict(self) -> dict: """Serializes the CustomPolicyTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -936,7 +936,7 @@ def as_dict(self) -> dict: """Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body def as_shallow_dict(self) -> dict: @@ -970,11 +970,11 @@ def as_dict(self) -> dict: """Serializes the Filter into a dictionary suitable for use as a JSON request body.""" body = {} if self.creator_user_id is not None: - body["{creator_user_id}"] = self.creator_user_id + body["creator_user_id"] = self.creator_user_id if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.policy_name is not None: - body["{policy_name}"] = self.policy_name + body["policy_name"] = self.policy_name return body def as_shallow_dict(self) -> dict: @@ -1010,9 +1010,9 @@ def as_dict(self) -> dict: """Serializes the GetBillingUsageDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.dashboard_url is not None: - body["{dashboard_url}"] = self.dashboard_url + body["dashboard_url"] = self.dashboard_url return body def as_shallow_dict(self) -> dict: @@ -1038,7 +1038,7 @@ def as_dict(self) -> dict: """Serializes the GetBudgetConfigurationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["{budget}"] = self.budget.as_dict() + body["budget"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1087,9 +1087,9 @@ def as_dict(self) -> dict: """Serializes the ListBudgetConfigurationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budgets: - body["{budgets}"] = [v.as_dict() for v in self.budgets] + body["budgets"] = [v.as_dict() for v in self.budgets] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1128,11 +1128,11 @@ def as_dict(self) -> dict: """Serializes the ListBudgetPoliciesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.policies: - body["{policies}"] = [v.as_dict() for v in self.policies] + body["policies"] = [v.as_dict() for v in self.policies] if self.previous_page_token is not None: - body["{previous_page_token}"] = self.previous_page_token + body["previous_page_token"] = self.previous_page_token return body def as_shallow_dict(self) -> dict: @@ -1256,33 +1256,33 @@ def as_dict(self) -> dict: """Serializes the LogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.config_id is not None: - body["{config_id}"] = self.config_id + body["config_id"] = self.config_id if self.config_name is not None: - body["{config_name}"] = self.config_name + body["config_name"] = self.config_name if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.delivery_path_prefix is not None: - body["{delivery_path_prefix}"] = self.delivery_path_prefix + body["delivery_path_prefix"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["{delivery_start_time}"] = self.delivery_start_time + body["delivery_start_time"] = self.delivery_start_time if self.log_delivery_status: - body["{log_delivery_status}"] = self.log_delivery_status.as_dict() + body["log_delivery_status"] = self.log_delivery_status.as_dict() if self.log_type is not None: - body["{log_type}"] = self.log_type.value + body["log_type"] = self.log_type.value if self.output_format is not None: - body["{output_format}"] = self.output_format.value + body["output_format"] = self.output_format.value if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.workspace_ids_filter: - body["{workspace_ids_filter}"] = [v for v in self.workspace_ids_filter] + body["workspace_ids_filter"] = [v for v in self.workspace_ids_filter] return body def as_shallow_dict(self) -> dict: @@ -1366,13 +1366,13 @@ def as_dict(self) -> dict: """Serializes the LogDeliveryStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_attempt_time is not None: - body["{last_attempt_time}"] = self.last_attempt_time + body["last_attempt_time"] = self.last_attempt_time if self.last_successful_attempt_time is not None: - body["{last_successful_attempt_time}"] = self.last_successful_attempt_time + body["last_successful_attempt_time"] = self.last_successful_attempt_time if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -1463,9 +1463,9 @@ def as_dict(self) -> dict: """Serializes the SortSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.descending is not None: - body["{descending}"] = self.descending + body["descending"] = self.descending if self.field is not None: - body["{field}"] = self.field.value + body["field"] = self.field.value return body def as_shallow_dict(self) -> dict: @@ -1512,15 +1512,15 @@ def as_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationBudget into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.alert_configurations: - body["{alert_configurations}"] = [v.as_dict() for v in self.alert_configurations] + body["alert_configurations"] = [v.as_dict() for v in self.alert_configurations] if self.budget_configuration_id is not None: - body["{budget_configuration_id}"] = self.budget_configuration_id + body["budget_configuration_id"] = self.budget_configuration_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.filter: - body["{filter}"] = self.filter.as_dict() + body["filter"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1562,9 +1562,9 @@ def as_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["{budget}"] = self.budget.as_dict() + body["budget"] = self.budget.as_dict() if self.budget_id is not None: - body["{budget_id}"] = self.budget_id + body["budget_id"] = self.budget_id return body def as_shallow_dict(self) -> dict: @@ -1593,7 +1593,7 @@ def as_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget: - body["{budget}"] = self.budget.as_dict() + body["budget"] = self.budget.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1624,9 +1624,9 @@ def as_dict(self) -> dict: """Serializes the UpdateLogDeliveryConfigurationStatusRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configuration_id is not None: - body["{log_delivery_configuration_id}"] = self.log_delivery_configuration_id + body["log_delivery_configuration_id"] = self.log_delivery_configuration_id if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -1661,7 +1661,7 @@ def as_dict(self) -> dict: """Serializes the WrappedCreateLogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configuration: - body["{log_delivery_configuration}"] = self.log_delivery_configuration.as_dict() + body["log_delivery_configuration"] = self.log_delivery_configuration.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1689,7 +1689,7 @@ def as_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configuration: - body["{log_delivery_configuration}"] = self.log_delivery_configuration.as_dict() + body["log_delivery_configuration"] = self.log_delivery_configuration.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1713,7 +1713,7 @@ def as_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfigurations into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_delivery_configurations: - body["{log_delivery_configurations}"] = [v.as_dict() for v in self.log_delivery_configurations] + body["log_delivery_configurations"] = [v.as_dict() for v in self.log_delivery_configurations] return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/catalog/v2/impl.py b/databricks/sdk/catalog/v2/impl.py index 0ce616e6b..055821758 100755 --- a/databricks/sdk/catalog/v2/impl.py +++ b/databricks/sdk/catalog/v2/impl.py @@ -24,7 +24,7 @@ def as_dict(self) -> dict: """Serializes the AccountsCreateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_info: - body["{metastore_info}"] = self.metastore_info.as_dict() + body["metastore_info"] = self.metastore_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -54,11 +54,11 @@ def as_dict(self) -> dict: """Serializes the AccountsCreateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_assignment: - body["{metastore_assignment}"] = self.metastore_assignment.as_dict() + body["metastore_assignment"] = self.metastore_assignment.as_dict() if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -93,9 +93,9 @@ def as_dict(self) -> dict: """Serializes the AccountsCreateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_info: - body["{credential_info}"] = self.credential_info.as_dict() + body["credential_info"] = self.credential_info.as_dict() if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id return body def as_shallow_dict(self) -> dict: @@ -124,7 +124,7 @@ def as_dict(self) -> dict: """Serializes the AccountsMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_assignment: - body["{metastore_assignment}"] = self.metastore_assignment.as_dict() + body["metastore_assignment"] = self.metastore_assignment.as_dict() return body def as_shallow_dict(self) -> dict: @@ -148,7 +148,7 @@ def as_dict(self) -> dict: """Serializes the AccountsMetastoreInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_info: - body["{metastore_info}"] = self.metastore_info.as_dict() + body["metastore_info"] = self.metastore_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -172,7 +172,7 @@ def as_dict(self) -> dict: """Serializes the AccountsStorageCredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_info: - body["{credential_info}"] = self.credential_info.as_dict() + body["credential_info"] = self.credential_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -199,9 +199,9 @@ def as_dict(self) -> dict: """Serializes the AccountsUpdateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.metastore_info: - body["{metastore_info}"] = self.metastore_info.as_dict() + body["metastore_info"] = self.metastore_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -236,11 +236,11 @@ def as_dict(self) -> dict: """Serializes the AccountsUpdateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastore_assignment: - body["{metastore_assignment}"] = self.metastore_assignment.as_dict() + body["metastore_assignment"] = self.metastore_assignment.as_dict() if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -278,11 +278,11 @@ def as_dict(self) -> dict: """Serializes the AccountsUpdateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_info: - body["{credential_info}"] = self.credential_info.as_dict() + body["credential_info"] = self.credential_info.as_dict() if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.storage_credential_name is not None: - body["{storage_credential_name}"] = self.storage_credential_name + body["storage_credential_name"] = self.storage_credential_name return body def as_shallow_dict(self) -> dict: @@ -324,13 +324,13 @@ def as_dict(self) -> dict: """Serializes the ArtifactAllowlistInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_matchers: - body["{artifact_matchers}"] = [v.as_dict() for v in self.artifact_matchers] + body["artifact_matchers"] = [v.as_dict() for v in self.artifact_matchers] if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id return body def as_shallow_dict(self) -> dict: @@ -369,9 +369,9 @@ def as_dict(self) -> dict: """Serializes the ArtifactMatcher into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact is not None: - body["{artifact}"] = self.artifact + body["artifact"] = self.artifact if self.match_type is not None: - body["{match_type}"] = self.match_type.value + body["match_type"] = self.match_type.value return body def as_shallow_dict(self) -> dict: @@ -437,13 +437,13 @@ def as_dict(self) -> dict: """Serializes the AwsCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_key_id is not None: - body["{access_key_id}"] = self.access_key_id + body["access_key_id"] = self.access_key_id if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.secret_access_key is not None: - body["{secret_access_key}"] = self.secret_access_key + body["secret_access_key"] = self.secret_access_key if self.session_token is not None: - body["{session_token}"] = self.session_token + body["session_token"] = self.session_token return body def as_shallow_dict(self) -> dict: @@ -488,11 +488,11 @@ def as_dict(self) -> dict: """Serializes the AwsIamRole into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_id is not None: - body["{external_id}"] = self.external_id + body["external_id"] = self.external_id if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn + body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn return body def as_shallow_dict(self) -> dict: @@ -525,7 +525,7 @@ def as_dict(self) -> dict: """Serializes the AwsIamRoleRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn return body def as_shallow_dict(self) -> dict: @@ -557,11 +557,11 @@ def as_dict(self) -> dict: """Serializes the AwsIamRoleResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_id is not None: - body["{external_id}"] = self.external_id + body["external_id"] = self.external_id if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn + body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn return body def as_shallow_dict(self) -> dict: @@ -599,7 +599,7 @@ def as_dict(self) -> dict: """Serializes the AzureActiveDirectoryToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.aad_token is not None: - body["{aad_token}"] = self.aad_token + body["aad_token"] = self.aad_token return body def as_shallow_dict(self) -> dict: @@ -639,11 +639,11 @@ def as_dict(self) -> dict: """Serializes the AzureManagedIdentity into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_connector_id is not None: - body["{access_connector_id}"] = self.access_connector_id + body["access_connector_id"] = self.access_connector_id if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.managed_identity_id is not None: - body["{managed_identity_id}"] = self.managed_identity_id + body["managed_identity_id"] = self.managed_identity_id return body def as_shallow_dict(self) -> dict: @@ -684,9 +684,9 @@ def as_dict(self) -> dict: """Serializes the AzureManagedIdentityRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_connector_id is not None: - body["{access_connector_id}"] = self.access_connector_id + body["access_connector_id"] = self.access_connector_id if self.managed_identity_id is not None: - body["{managed_identity_id}"] = self.managed_identity_id + body["managed_identity_id"] = self.managed_identity_id return body def as_shallow_dict(self) -> dict: @@ -727,11 +727,11 @@ def as_dict(self) -> dict: """Serializes the AzureManagedIdentityResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_connector_id is not None: - body["{access_connector_id}"] = self.access_connector_id + body["access_connector_id"] = self.access_connector_id if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.managed_identity_id is not None: - body["{managed_identity_id}"] = self.managed_identity_id + body["managed_identity_id"] = self.managed_identity_id return body def as_shallow_dict(self) -> dict: @@ -772,11 +772,11 @@ def as_dict(self) -> dict: """Serializes the AzureServicePrincipal into a dictionary suitable for use as a JSON request body.""" body = {} if self.application_id is not None: - body["{application_id}"] = self.application_id + body["application_id"] = self.application_id if self.client_secret is not None: - body["{client_secret}"] = self.client_secret + body["client_secret"] = self.client_secret if self.directory_id is not None: - body["{directory_id}"] = self.directory_id + body["directory_id"] = self.directory_id return body def as_shallow_dict(self) -> dict: @@ -812,7 +812,7 @@ def as_dict(self) -> dict: """Serializes the AzureUserDelegationSas into a dictionary suitable for use as a JSON request body.""" body = {} if self.sas_token is not None: - body["{sas_token}"] = self.sas_token + body["sas_token"] = self.sas_token return body def as_shallow_dict(self) -> dict: @@ -922,51 +922,51 @@ def as_dict(self) -> dict: """Serializes the CatalogInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_type is not None: - body["{catalog_type}"] = self.catalog_type.value + body["catalog_type"] = self.catalog_type.value if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.effective_predictive_optimization_flag: - body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag.as_dict() + body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag.as_dict() if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value + body["enable_predictive_optimization"] = self.enable_predictive_optimization.value if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.provider_name is not None: - body["{provider_name}"] = self.provider_name + body["provider_name"] = self.provider_name if self.provisioning_info: - body["{provisioning_info}"] = self.provisioning_info.as_dict() + body["provisioning_info"] = self.provisioning_info.as_dict() if self.securable_type is not None: - body["{securable_type}"] = self.securable_type + body["securable_type"] = self.securable_type if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -1083,11 +1083,11 @@ def as_dict(self) -> dict: """Serializes the CloudflareApiToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_key_id is not None: - body["{access_key_id}"] = self.access_key_id + body["access_key_id"] = self.access_key_id if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.secret_access_key is not None: - body["{secret_access_key}"] = self.secret_access_key + body["secret_access_key"] = self.secret_access_key return body def as_shallow_dict(self) -> dict: @@ -1151,29 +1151,29 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.mask: - body["{mask}"] = self.mask.as_dict() + body["mask"] = self.mask.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.nullable is not None: - body["{nullable}"] = self.nullable + body["nullable"] = self.nullable if self.partition_index is not None: - body["{partition_index}"] = self.partition_index + body["partition_index"] = self.partition_index if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name.value + body["type_name"] = self.type_name.value if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body def as_shallow_dict(self) -> dict: @@ -1238,9 +1238,9 @@ def as_dict(self) -> dict: """Serializes the ColumnMask into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.using_column_names: - body["{using_column_names}"] = [v for v in self.using_column_names] + body["using_column_names"] = [v for v in self.using_column_names] return body def as_shallow_dict(self) -> dict: @@ -1343,41 +1343,41 @@ def as_dict(self) -> dict: """Serializes the ConnectionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_id is not None: - body["{connection_id}"] = self.connection_id + body["connection_id"] = self.connection_id if self.connection_type is not None: - body["{connection_type}"] = self.connection_type.value + body["connection_type"] = self.connection_type.value if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.credential_type is not None: - body["{credential_type}"] = self.credential_type.value + body["credential_type"] = self.credential_type.value if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.provisioning_info: - body["{provisioning_info}"] = self.provisioning_info.as_dict() + body["provisioning_info"] = self.provisioning_info.as_dict() if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.securable_type is not None: - body["{securable_type}"] = self.securable_type + body["securable_type"] = self.securable_type if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -1484,11 +1484,11 @@ def as_dict(self) -> dict: """Serializes the ContinuousUpdateStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.initial_pipeline_sync_progress: - body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress.as_dict() + body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress.as_dict() if self.last_processed_commit_version is not None: - body["{last_processed_commit_version}"] = self.last_processed_commit_version + body["last_processed_commit_version"] = self.last_processed_commit_version if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body def as_shallow_dict(self) -> dict: @@ -1544,21 +1544,21 @@ def as_dict(self) -> dict: """Serializes the CreateCatalog into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.provider_name is not None: - body["{provider_name}"] = self.provider_name + body["provider_name"] = self.provider_name if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body def as_shallow_dict(self) -> dict: @@ -1621,17 +1621,17 @@ def as_dict(self) -> dict: """Serializes the CreateConnection into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_type is not None: - body["{connection_type}"] = self.connection_type.value + body["connection_type"] = self.connection_type.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only return body def as_shallow_dict(self) -> dict: @@ -1699,23 +1699,23 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal.as_dict() + body["azure_service_principal"] = self.azure_service_principal.as_dict() if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.purpose is not None: - body["{purpose}"] = self.purpose.value + body["purpose"] = self.purpose.value if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body def as_shallow_dict(self) -> dict: @@ -1794,23 +1794,23 @@ def as_dict(self) -> dict: """Serializes the CreateExternalLocation into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.encryption_details: - body["{encryption_details}"] = self.encryption_details.as_dict() + body["encryption_details"] = self.encryption_details.as_dict() if self.fallback is not None: - body["{fallback}"] = self.fallback + body["fallback"] = self.fallback if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -1923,47 +1923,47 @@ def as_dict(self) -> dict: """Serializes the CreateFunction into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.data_type is not None: - body["{data_type}"] = self.data_type.value + body["data_type"] = self.data_type.value if self.external_language is not None: - body["{external_language}"] = self.external_language + body["external_language"] = self.external_language if self.external_name is not None: - body["{external_name}"] = self.external_name + body["external_name"] = self.external_name if self.full_data_type is not None: - body["{full_data_type}"] = self.full_data_type + body["full_data_type"] = self.full_data_type if self.input_params: - body["{input_params}"] = self.input_params.as_dict() + body["input_params"] = self.input_params.as_dict() if self.is_deterministic is not None: - body["{is_deterministic}"] = self.is_deterministic + body["is_deterministic"] = self.is_deterministic if self.is_null_call is not None: - body["{is_null_call}"] = self.is_null_call + body["is_null_call"] = self.is_null_call if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parameter_style is not None: - body["{parameter_style}"] = self.parameter_style.value + body["parameter_style"] = self.parameter_style.value if self.properties is not None: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.return_params: - body["{return_params}"] = self.return_params.as_dict() + body["return_params"] = self.return_params.as_dict() if self.routine_body is not None: - body["{routine_body}"] = self.routine_body.value + body["routine_body"] = self.routine_body.value if self.routine_definition is not None: - body["{routine_definition}"] = self.routine_definition + body["routine_definition"] = self.routine_definition if self.routine_dependencies: - body["{routine_dependencies}"] = self.routine_dependencies.as_dict() + body["routine_dependencies"] = self.routine_dependencies.as_dict() if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.security_type is not None: - body["{security_type}"] = self.security_type.value + body["security_type"] = self.security_type.value if self.specific_name is not None: - body["{specific_name}"] = self.specific_name + body["specific_name"] = self.specific_name if self.sql_data_access is not None: - body["{sql_data_access}"] = self.sql_data_access.value + body["sql_data_access"] = self.sql_data_access.value if self.sql_path is not None: - body["{sql_path}"] = self.sql_path + body["sql_path"] = self.sql_path return body def as_shallow_dict(self) -> dict: @@ -2056,7 +2056,7 @@ def as_dict(self) -> dict: """Serializes the CreateFunctionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_info: - body["{function_info}"] = self.function_info.as_dict() + body["function_info"] = self.function_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2113,11 +2113,11 @@ def as_dict(self) -> dict: """Serializes the CreateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body def as_shallow_dict(self) -> dict: @@ -2155,11 +2155,11 @@ def as_dict(self) -> dict: """Serializes the CreateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_catalog_name is not None: - body["{default_catalog_name}"] = self.default_catalog_name + body["default_catalog_name"] = self.default_catalog_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -2237,33 +2237,33 @@ def as_dict(self) -> dict: """Serializes the CreateMonitor into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets_dir is not None: - body["{assets_dir}"] = self.assets_dir + body["assets_dir"] = self.assets_dir if self.baseline_table_name is not None: - body["{baseline_table_name}"] = self.baseline_table_name + body["baseline_table_name"] = self.baseline_table_name if self.custom_metrics: - body["{custom_metrics}"] = [v.as_dict() for v in self.custom_metrics] + body["custom_metrics"] = [v.as_dict() for v in self.custom_metrics] if self.data_classification_config: - body["{data_classification_config}"] = self.data_classification_config.as_dict() + body["data_classification_config"] = self.data_classification_config.as_dict() if self.inference_log: - body["{inference_log}"] = self.inference_log.as_dict() + body["inference_log"] = self.inference_log.as_dict() if self.notifications: - body["{notifications}"] = self.notifications.as_dict() + body["notifications"] = self.notifications.as_dict() if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.schedule: - body["{schedule}"] = self.schedule.as_dict() + body["schedule"] = self.schedule.as_dict() if self.skip_builtin_dashboard is not None: - body["{skip_builtin_dashboard}"] = self.skip_builtin_dashboard + body["skip_builtin_dashboard"] = self.skip_builtin_dashboard if self.slicing_exprs: - body["{slicing_exprs}"] = [v for v in self.slicing_exprs] + body["slicing_exprs"] = [v for v in self.slicing_exprs] if self.snapshot: - body["{snapshot}"] = self.snapshot.as_dict() + body["snapshot"] = self.snapshot.as_dict() if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.time_series: - body["{time_series}"] = self.time_series.as_dict() + body["time_series"] = self.time_series.as_dict() if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -2341,15 +2341,15 @@ def as_dict(self) -> dict: """Serializes the CreateRegisteredModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location return body def as_shallow_dict(self) -> dict: @@ -2418,15 +2418,15 @@ def as_dict(self) -> dict: """Serializes the CreateSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body def as_shallow_dict(self) -> dict: @@ -2489,23 +2489,23 @@ def as_dict(self) -> dict: """Serializes the CreateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal.as_dict() + body["azure_service_principal"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() + body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body def as_shallow_dict(self) -> dict: @@ -2562,9 +2562,9 @@ def as_dict(self) -> dict: """Serializes the CreateTableConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.constraint: - body["{constraint}"] = self.constraint.as_dict() + body["constraint"] = self.constraint.as_dict() if self.full_name_arg is not None: - body["{full_name_arg}"] = self.full_name_arg + body["full_name_arg"] = self.full_name_arg return body def as_shallow_dict(self) -> dict: @@ -2612,17 +2612,17 @@ def as_dict(self) -> dict: """Serializes the CreateVolumeRequestContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.volume_type is not None: - body["{volume_type}"] = self.volume_type.value + body["volume_type"] = self.volume_type.value return body def as_shallow_dict(self) -> dict: @@ -2718,41 +2718,41 @@ def as_dict(self) -> dict: """Serializes the CredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal.as_dict() + body["azure_service_principal"] = self.azure_service_principal.as_dict() if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.purpose is not None: - body["{purpose}"] = self.purpose.value + body["purpose"] = self.purpose.value if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.used_for_managed_storage is not None: - body["{used_for_managed_storage}"] = self.used_for_managed_storage + body["used_for_managed_storage"] = self.used_for_managed_storage return body def as_shallow_dict(self) -> dict: @@ -2848,9 +2848,9 @@ def as_dict(self) -> dict: """Serializes the CredentialValidationResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.result is not None: - body["{result}"] = self.result.value + body["result"] = self.result.value return body def as_shallow_dict(self) -> dict: @@ -2879,7 +2879,7 @@ def as_dict(self) -> dict: """Serializes the CurrentWorkspaceBindings into a dictionary suitable for use as a JSON request body.""" body = {} if self.workspaces: - body["{workspaces}"] = [v for v in self.workspaces] + body["workspaces"] = [v for v in self.workspaces] return body def as_shallow_dict(self) -> dict: @@ -2942,11 +2942,11 @@ def as_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccount into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email if self.private_key_id is not None: - body["{private_key_id}"] = self.private_key_id + body["private_key_id"] = self.private_key_id return body def as_shallow_dict(self) -> dict: @@ -3000,9 +3000,9 @@ def as_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccountResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email return body def as_shallow_dict(self) -> dict: @@ -3086,7 +3086,7 @@ def as_dict(self) -> dict: """Serializes the DeltaRuntimePropertiesKvPairs into a dictionary suitable for use as a JSON request body.""" body = {} if self.delta_runtime_properties: - body["{delta_runtime_properties}"] = self.delta_runtime_properties + body["delta_runtime_properties"] = self.delta_runtime_properties return body def as_shallow_dict(self) -> dict: @@ -3117,9 +3117,9 @@ def as_dict(self) -> dict: """Serializes the Dependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function: - body["{function}"] = self.function.as_dict() + body["function"] = self.function.as_dict() if self.table: - body["{table}"] = self.table.as_dict() + body["table"] = self.table.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3150,7 +3150,7 @@ def as_dict(self) -> dict: """Serializes the DependencyList into a dictionary suitable for use as a JSON request body.""" body = {} if self.dependencies: - body["{dependencies}"] = [v.as_dict() for v in self.dependencies] + body["dependencies"] = [v.as_dict() for v in self.dependencies] return body def as_shallow_dict(self) -> dict: @@ -3193,7 +3193,7 @@ def as_dict(self) -> dict: """Serializes the EffectivePermissionsList into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] + body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: @@ -3226,11 +3226,11 @@ def as_dict(self) -> dict: """Serializes the EffectivePredictiveOptimizationFlag into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited_from_name is not None: - body["{inherited_from_name}"] = self.inherited_from_name + body["inherited_from_name"] = self.inherited_from_name if self.inherited_from_type is not None: - body["{inherited_from_type}"] = self.inherited_from_type.value + body["inherited_from_type"] = self.inherited_from_type.value if self.value is not None: - body["{value}"] = self.value.value + body["value"] = self.value.value return body def as_shallow_dict(self) -> dict: @@ -3279,11 +3279,11 @@ def as_dict(self) -> dict: """Serializes the EffectivePrivilege into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited_from_name is not None: - body["{inherited_from_name}"] = self.inherited_from_name + body["inherited_from_name"] = self.inherited_from_name if self.inherited_from_type is not None: - body["{inherited_from_type}"] = self.inherited_from_type.value + body["inherited_from_type"] = self.inherited_from_type.value if self.privilege is not None: - body["{privilege}"] = self.privilege.value + body["privilege"] = self.privilege.value return body def as_shallow_dict(self) -> dict: @@ -3319,9 +3319,9 @@ def as_dict(self) -> dict: """Serializes the EffectivePrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.privileges: - body["{privileges}"] = [v.as_dict() for v in self.privileges] + body["privileges"] = [v.as_dict() for v in self.privileges] return body def as_shallow_dict(self) -> dict: @@ -3378,7 +3378,7 @@ def as_dict(self) -> dict: """Serializes the EncryptionDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.sse_encryption_details: - body["{sse_encryption_details}"] = self.sse_encryption_details.as_dict() + body["sse_encryption_details"] = self.sse_encryption_details.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3453,39 +3453,39 @@ def as_dict(self) -> dict: """Serializes the ExternalLocationInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.encryption_details: - body["{encryption_details}"] = self.encryption_details.as_dict() + body["encryption_details"] = self.encryption_details.as_dict() if self.fallback is not None: - body["{fallback}"] = self.fallback + body["fallback"] = self.fallback if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -3569,9 +3569,9 @@ def as_dict(self) -> dict: """Serializes the FailedStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_processed_commit_version is not None: - body["{last_processed_commit_version}"] = self.last_processed_commit_version + body["last_processed_commit_version"] = self.last_processed_commit_version if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body def as_shallow_dict(self) -> dict: @@ -3610,13 +3610,13 @@ def as_dict(self) -> dict: """Serializes the ForeignKeyConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.child_columns: - body["{child_columns}"] = [v for v in self.child_columns] + body["child_columns"] = [v for v in self.child_columns] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parent_columns: - body["{parent_columns}"] = [v for v in self.parent_columns] + body["parent_columns"] = [v for v in self.parent_columns] if self.parent_table is not None: - body["{parent_table}"] = self.parent_table + body["parent_table"] = self.parent_table return body def as_shallow_dict(self) -> dict: @@ -3655,7 +3655,7 @@ def as_dict(self) -> dict: """Serializes the FunctionDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_full_name is not None: - body["{function_full_name}"] = self.function_full_name + body["function_full_name"] = self.function_full_name return body def as_shallow_dict(self) -> dict: @@ -3770,65 +3770,65 @@ def as_dict(self) -> dict: """Serializes the FunctionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_type is not None: - body["{data_type}"] = self.data_type.value + body["data_type"] = self.data_type.value if self.external_language is not None: - body["{external_language}"] = self.external_language + body["external_language"] = self.external_language if self.external_name is not None: - body["{external_name}"] = self.external_name + body["external_name"] = self.external_name if self.full_data_type is not None: - body["{full_data_type}"] = self.full_data_type + body["full_data_type"] = self.full_data_type if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.function_id is not None: - body["{function_id}"] = self.function_id + body["function_id"] = self.function_id if self.input_params: - body["{input_params}"] = self.input_params.as_dict() + body["input_params"] = self.input_params.as_dict() if self.is_deterministic is not None: - body["{is_deterministic}"] = self.is_deterministic + body["is_deterministic"] = self.is_deterministic if self.is_null_call is not None: - body["{is_null_call}"] = self.is_null_call + body["is_null_call"] = self.is_null_call if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.parameter_style is not None: - body["{parameter_style}"] = self.parameter_style.value + body["parameter_style"] = self.parameter_style.value if self.properties is not None: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.return_params: - body["{return_params}"] = self.return_params.as_dict() + body["return_params"] = self.return_params.as_dict() if self.routine_body is not None: - body["{routine_body}"] = self.routine_body.value + body["routine_body"] = self.routine_body.value if self.routine_definition is not None: - body["{routine_definition}"] = self.routine_definition + body["routine_definition"] = self.routine_definition if self.routine_dependencies: - body["{routine_dependencies}"] = self.routine_dependencies.as_dict() + body["routine_dependencies"] = self.routine_dependencies.as_dict() if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.security_type is not None: - body["{security_type}"] = self.security_type.value + body["security_type"] = self.security_type.value if self.specific_name is not None: - body["{specific_name}"] = self.specific_name + body["specific_name"] = self.specific_name if self.sql_data_access is not None: - body["{sql_data_access}"] = self.sql_data_access.value + body["sql_data_access"] = self.sql_data_access.value if self.sql_path is not None: - body["{sql_path}"] = self.sql_path + body["sql_path"] = self.sql_path if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -4004,29 +4004,29 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parameter_default is not None: - body["{parameter_default}"] = self.parameter_default + body["parameter_default"] = self.parameter_default if self.parameter_mode is not None: - body["{parameter_mode}"] = self.parameter_mode.value + body["parameter_mode"] = self.parameter_mode.value if self.parameter_type is not None: - body["{parameter_type}"] = self.parameter_type.value + body["parameter_type"] = self.parameter_type.value if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name.value + body["type_name"] = self.type_name.value if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body def as_shallow_dict(self) -> dict: @@ -4086,7 +4086,7 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfos into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] return body def as_shallow_dict(self) -> dict: @@ -4126,7 +4126,7 @@ def as_dict(self) -> dict: """Serializes the GcpOauthToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.oauth_token is not None: - body["{oauth_token}"] = self.oauth_token + body["oauth_token"] = self.oauth_token return body def as_shallow_dict(self) -> dict: @@ -4155,7 +4155,7 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialAzureOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.resources: - body["{resources}"] = [v for v in self.resources] + body["resources"] = [v for v in self.resources] return body def as_shallow_dict(self) -> dict: @@ -4184,7 +4184,7 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialGcpOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.scopes: - body["{scopes}"] = [v for v in self.scopes] + body["scopes"] = [v for v in self.scopes] return body def as_shallow_dict(self) -> dict: @@ -4215,11 +4215,11 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.azure_options: - body["{azure_options}"] = self.azure_options.as_dict() + body["azure_options"] = self.azure_options.as_dict() if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.gcp_options: - body["{gcp_options}"] = self.gcp_options.as_dict() + body["gcp_options"] = self.gcp_options.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4257,9 +4257,9 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.operation is not None: - body["{operation}"] = self.operation.value + body["operation"] = self.operation.value if self.table_id is not None: - body["{table_id}"] = self.table_id + body["table_id"] = self.table_id return body def as_shallow_dict(self) -> dict: @@ -4311,19 +4311,19 @@ def as_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_temp_credentials: - body["{aws_temp_credentials}"] = self.aws_temp_credentials.as_dict() + body["aws_temp_credentials"] = self.aws_temp_credentials.as_dict() if self.azure_aad: - body["{azure_aad}"] = self.azure_aad.as_dict() + body["azure_aad"] = self.azure_aad.as_dict() if self.azure_user_delegation_sas: - body["{azure_user_delegation_sas}"] = self.azure_user_delegation_sas.as_dict() + body["azure_user_delegation_sas"] = self.azure_user_delegation_sas.as_dict() if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.gcp_oauth_token: - body["{gcp_oauth_token}"] = self.gcp_oauth_token.as_dict() + body["gcp_oauth_token"] = self.gcp_oauth_token.as_dict() if self.r2_temp_credentials: - body["{r2_temp_credentials}"] = self.r2_temp_credentials.as_dict() + body["r2_temp_credentials"] = self.r2_temp_credentials.as_dict() if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -4431,45 +4431,45 @@ def as_dict(self) -> dict: """Serializes the GetMetastoreSummaryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.default_data_access_config_id is not None: - body["{default_data_access_config_id}"] = self.default_data_access_config_id + body["default_data_access_config_id"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name + body["delta_sharing_organization_name"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( + body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["{delta_sharing_scope}"] = self.delta_sharing_scope.value + body["delta_sharing_scope"] = self.delta_sharing_scope.value if self.external_access_enabled is not None: - body["{external_access_enabled}"] = self.external_access_enabled + body["external_access_enabled"] = self.external_access_enabled if self.global_metastore_id is not None: - body["{global_metastore_id}"] = self.global_metastore_id + body["global_metastore_id"] = self.global_metastore_id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.privilege_model_version is not None: - body["{privilege_model_version}"] = self.privilege_model_version + body["privilege_model_version"] = self.privilege_model_version if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.storage_root_credential_id is not None: - body["{storage_root_credential_id}"] = self.storage_root_credential_id + body["storage_root_credential_id"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["{storage_root_credential_name}"] = self.storage_root_credential_name + body["storage_root_credential_name"] = self.storage_root_credential_name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -4561,7 +4561,7 @@ def as_dict(self) -> dict: """Serializes the GetQuotaResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.quota_info: - body["{quota_info}"] = self.quota_info.as_dict() + body["quota_info"] = self.quota_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4593,7 +4593,7 @@ def as_dict(self) -> dict: """Serializes the ListAccountMetastoreAssignmentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.workspace_ids: - body["{workspace_ids}"] = [v for v in self.workspace_ids] + body["workspace_ids"] = [v for v in self.workspace_ids] return body def as_shallow_dict(self) -> dict: @@ -4618,7 +4618,7 @@ def as_dict(self) -> dict: """Serializes the ListAccountStorageCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.storage_credentials: - body["{storage_credentials}"] = [v.as_dict() for v in self.storage_credentials] + body["storage_credentials"] = [v.as_dict() for v in self.storage_credentials] return body def as_shallow_dict(self) -> dict: @@ -4647,9 +4647,9 @@ def as_dict(self) -> dict: """Serializes the ListCatalogsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalogs: - body["{catalogs}"] = [v.as_dict() for v in self.catalogs] + body["catalogs"] = [v.as_dict() for v in self.catalogs] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4682,9 +4682,9 @@ def as_dict(self) -> dict: """Serializes the ListConnectionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.connections: - body["{connections}"] = [v.as_dict() for v in self.connections] + body["connections"] = [v.as_dict() for v in self.connections] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4717,9 +4717,9 @@ def as_dict(self) -> dict: """Serializes the ListCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credentials: - body["{credentials}"] = [v.as_dict() for v in self.credentials] + body["credentials"] = [v.as_dict() for v in self.credentials] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4753,9 +4753,9 @@ def as_dict(self) -> dict: """Serializes the ListExternalLocationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_locations: - body["{external_locations}"] = [v.as_dict() for v in self.external_locations] + body["external_locations"] = [v.as_dict() for v in self.external_locations] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4789,9 +4789,9 @@ def as_dict(self) -> dict: """Serializes the ListFunctionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.functions: - body["{functions}"] = [v.as_dict() for v in self.functions] + body["functions"] = [v.as_dict() for v in self.functions] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4820,7 +4820,7 @@ def as_dict(self) -> dict: """Serializes the ListMetastoresResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.metastores: - body["{metastores}"] = [v.as_dict() for v in self.metastores] + body["metastores"] = [v.as_dict() for v in self.metastores] return body def as_shallow_dict(self) -> dict: @@ -4848,9 +4848,9 @@ def as_dict(self) -> dict: """Serializes the ListModelVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_versions: - body["{model_versions}"] = [v.as_dict() for v in self.model_versions] + body["model_versions"] = [v.as_dict() for v in self.model_versions] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4884,9 +4884,9 @@ def as_dict(self) -> dict: """Serializes the ListQuotasResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.quotas: - body["{quotas}"] = [v.as_dict() for v in self.quotas] + body["quotas"] = [v.as_dict() for v in self.quotas] return body def as_shallow_dict(self) -> dict: @@ -4916,9 +4916,9 @@ def as_dict(self) -> dict: """Serializes the ListRegisteredModelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.registered_models: - body["{registered_models}"] = [v.as_dict() for v in self.registered_models] + body["registered_models"] = [v.as_dict() for v in self.registered_models] return body def as_shallow_dict(self) -> dict: @@ -4952,9 +4952,9 @@ def as_dict(self) -> dict: """Serializes the ListSchemasResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.schemas: - body["{schemas}"] = [v.as_dict() for v in self.schemas] + body["schemas"] = [v.as_dict() for v in self.schemas] return body def as_shallow_dict(self) -> dict: @@ -4984,9 +4984,9 @@ def as_dict(self) -> dict: """Serializes the ListStorageCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.storage_credentials: - body["{storage_credentials}"] = [v.as_dict() for v in self.storage_credentials] + body["storage_credentials"] = [v.as_dict() for v in self.storage_credentials] return body def as_shallow_dict(self) -> dict: @@ -5020,9 +5020,9 @@ def as_dict(self) -> dict: """Serializes the ListSystemSchemasResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.schemas: - body["{schemas}"] = [v.as_dict() for v in self.schemas] + body["schemas"] = [v.as_dict() for v in self.schemas] return body def as_shallow_dict(self) -> dict: @@ -5055,9 +5055,9 @@ def as_dict(self) -> dict: """Serializes the ListTableSummariesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.tables: - body["{tables}"] = [v.as_dict() for v in self.tables] + body["tables"] = [v.as_dict() for v in self.tables] return body def as_shallow_dict(self) -> dict: @@ -5088,9 +5088,9 @@ def as_dict(self) -> dict: """Serializes the ListTablesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.tables: - body["{tables}"] = [v.as_dict() for v in self.tables] + body["tables"] = [v.as_dict() for v in self.tables] return body def as_shallow_dict(self) -> dict: @@ -5121,9 +5121,9 @@ def as_dict(self) -> dict: """Serializes the ListVolumesResponseContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.volumes: - body["{volumes}"] = [v.as_dict() for v in self.volumes] + body["volumes"] = [v.as_dict() for v in self.volumes] return body def as_shallow_dict(self) -> dict: @@ -5162,11 +5162,11 @@ def as_dict(self) -> dict: """Serializes the MetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_catalog_name is not None: - body["{default_catalog_name}"] = self.default_catalog_name + body["default_catalog_name"] = self.default_catalog_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -5254,45 +5254,45 @@ def as_dict(self) -> dict: """Serializes the MetastoreInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.default_data_access_config_id is not None: - body["{default_data_access_config_id}"] = self.default_data_access_config_id + body["default_data_access_config_id"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name + body["delta_sharing_organization_name"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( + body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["{delta_sharing_scope}"] = self.delta_sharing_scope.value + body["delta_sharing_scope"] = self.delta_sharing_scope.value if self.external_access_enabled is not None: - body["{external_access_enabled}"] = self.external_access_enabled + body["external_access_enabled"] = self.external_access_enabled if self.global_metastore_id is not None: - body["{global_metastore_id}"] = self.global_metastore_id + body["global_metastore_id"] = self.global_metastore_id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.privilege_model_version is not None: - body["{privilege_model_version}"] = self.privilege_model_version + body["privilege_model_version"] = self.privilege_model_version if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.storage_root_credential_id is not None: - body["{storage_root_credential_id}"] = self.storage_root_credential_id + body["storage_root_credential_id"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["{storage_root_credential_name}"] = self.storage_root_credential_name + body["storage_root_credential_name"] = self.storage_root_credential_name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -5441,43 +5441,43 @@ def as_dict(self) -> dict: """Serializes the ModelVersionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aliases: - body["{aliases}"] = [v.as_dict() for v in self.aliases] + body["aliases"] = [v.as_dict() for v in self.aliases] if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version_dependencies: - body["{model_version_dependencies}"] = self.model_version_dependencies.as_dict() + body["model_version_dependencies"] = self.model_version_dependencies.as_dict() if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_workspace_id is not None: - body["{run_workspace_id}"] = self.run_workspace_id + body["run_workspace_id"] = self.run_workspace_id if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -5576,11 +5576,11 @@ def as_dict(self) -> dict: """Serializes the MonitorCronSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.pause_status is not None: - body["{pause_status}"] = self.pause_status.value + body["pause_status"] = self.pause_status.value if self.quartz_cron_expression is not None: - body["{quartz_cron_expression}"] = self.quartz_cron_expression + body["quartz_cron_expression"] = self.quartz_cron_expression if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body def as_shallow_dict(self) -> dict: @@ -5620,7 +5620,7 @@ def as_dict(self) -> dict: """Serializes the MonitorDataClassificationConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body def as_shallow_dict(self) -> dict: @@ -5646,7 +5646,7 @@ def as_dict(self) -> dict: """Serializes the MonitorDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.email_addresses: - body["{email_addresses}"] = [v for v in self.email_addresses] + body["email_addresses"] = [v for v in self.email_addresses] return body def as_shallow_dict(self) -> dict: @@ -5699,19 +5699,19 @@ def as_dict(self) -> dict: """Serializes the MonitorInferenceLog into a dictionary suitable for use as a JSON request body.""" body = {} if self.granularities: - body["{granularities}"] = [v for v in self.granularities] + body["granularities"] = [v for v in self.granularities] if self.label_col is not None: - body["{label_col}"] = self.label_col + body["label_col"] = self.label_col if self.model_id_col is not None: - body["{model_id_col}"] = self.model_id_col + body["model_id_col"] = self.model_id_col if self.prediction_col is not None: - body["{prediction_col}"] = self.prediction_col + body["prediction_col"] = self.prediction_col if self.prediction_proba_col is not None: - body["{prediction_proba_col}"] = self.prediction_proba_col + body["prediction_proba_col"] = self.prediction_proba_col if self.problem_type is not None: - body["{problem_type}"] = self.problem_type.value + body["problem_type"] = self.problem_type.value if self.timestamp_col is not None: - body["{timestamp_col}"] = self.timestamp_col + body["timestamp_col"] = self.timestamp_col return body def as_shallow_dict(self) -> dict: @@ -5823,41 +5823,41 @@ def as_dict(self) -> dict: """Serializes the MonitorInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets_dir is not None: - body["{assets_dir}"] = self.assets_dir + body["assets_dir"] = self.assets_dir if self.baseline_table_name is not None: - body["{baseline_table_name}"] = self.baseline_table_name + body["baseline_table_name"] = self.baseline_table_name if self.custom_metrics: - body["{custom_metrics}"] = [v.as_dict() for v in self.custom_metrics] + body["custom_metrics"] = [v.as_dict() for v in self.custom_metrics] if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.data_classification_config: - body["{data_classification_config}"] = self.data_classification_config.as_dict() + body["data_classification_config"] = self.data_classification_config.as_dict() if self.drift_metrics_table_name is not None: - body["{drift_metrics_table_name}"] = self.drift_metrics_table_name + body["drift_metrics_table_name"] = self.drift_metrics_table_name if self.inference_log: - body["{inference_log}"] = self.inference_log.as_dict() + body["inference_log"] = self.inference_log.as_dict() if self.latest_monitor_failure_msg is not None: - body["{latest_monitor_failure_msg}"] = self.latest_monitor_failure_msg + body["latest_monitor_failure_msg"] = self.latest_monitor_failure_msg if self.monitor_version is not None: - body["{monitor_version}"] = self.monitor_version + body["monitor_version"] = self.monitor_version if self.notifications: - body["{notifications}"] = self.notifications.as_dict() + body["notifications"] = self.notifications.as_dict() if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.profile_metrics_table_name is not None: - body["{profile_metrics_table_name}"] = self.profile_metrics_table_name + body["profile_metrics_table_name"] = self.profile_metrics_table_name if self.schedule: - body["{schedule}"] = self.schedule.as_dict() + body["schedule"] = self.schedule.as_dict() if self.slicing_exprs: - body["{slicing_exprs}"] = [v for v in self.slicing_exprs] + body["slicing_exprs"] = [v for v in self.slicing_exprs] if self.snapshot: - body["{snapshot}"] = self.snapshot.as_dict() + body["snapshot"] = self.snapshot.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.time_series: - body["{time_series}"] = self.time_series.as_dict() + body["time_series"] = self.time_series.as_dict() return body def as_shallow_dict(self) -> dict: @@ -5967,15 +5967,15 @@ def as_dict(self) -> dict: """Serializes the MonitorMetric into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.input_columns: - body["{input_columns}"] = [v for v in self.input_columns] + body["input_columns"] = [v for v in self.input_columns] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.output_data_type is not None: - body["{output_data_type}"] = self.output_data_type + body["output_data_type"] = self.output_data_type if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -6031,9 +6031,9 @@ def as_dict(self) -> dict: """Serializes the MonitorNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.on_failure: - body["{on_failure}"] = self.on_failure.as_dict() + body["on_failure"] = self.on_failure.as_dict() if self.on_new_classification_tag_detected: - body["{on_new_classification_tag_detected}"] = self.on_new_classification_tag_detected.as_dict() + body["on_new_classification_tag_detected"] = self.on_new_classification_tag_detected.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6080,17 +6080,17 @@ def as_dict(self) -> dict: """Serializes the MonitorRefreshInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time_ms is not None: - body["{end_time_ms}"] = self.end_time_ms + body["end_time_ms"] = self.end_time_ms if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.refresh_id is not None: - body["{refresh_id}"] = self.refresh_id + body["refresh_id"] = self.refresh_id if self.start_time_ms is not None: - body["{start_time_ms}"] = self.start_time_ms + body["start_time_ms"] = self.start_time_ms if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.trigger is not None: - body["{trigger}"] = self.trigger.value + body["trigger"] = self.trigger.value return body def as_shallow_dict(self) -> dict: @@ -6149,7 +6149,7 @@ def as_dict(self) -> dict: """Serializes the MonitorRefreshListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.refreshes: - body["{refreshes}"] = [v.as_dict() for v in self.refreshes] + body["refreshes"] = [v.as_dict() for v in self.refreshes] return body def as_shallow_dict(self) -> dict: @@ -6201,9 +6201,9 @@ def as_dict(self) -> dict: """Serializes the MonitorTimeSeries into a dictionary suitable for use as a JSON request body.""" body = {} if self.granularities: - body["{granularities}"] = [v for v in self.granularities] + body["granularities"] = [v for v in self.granularities] if self.timestamp_col is not None: - body["{timestamp_col}"] = self.timestamp_col + body["timestamp_col"] = self.timestamp_col return body def as_shallow_dict(self) -> dict: @@ -6230,7 +6230,7 @@ def as_dict(self) -> dict: """Serializes the NamedTableConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -6271,15 +6271,15 @@ def as_dict(self) -> dict: """Serializes the OnlineTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.spec: - body["{spec}"] = self.spec.as_dict() + body["spec"] = self.spec.as_dict() if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() if self.table_serving_url is not None: - body["{table_serving_url}"] = self.table_serving_url + body["table_serving_url"] = self.table_serving_url if self.unity_catalog_provisioning_state is not None: - body["{unity_catalog_provisioning_state}"] = self.unity_catalog_provisioning_state.value + body["unity_catalog_provisioning_state"] = self.unity_catalog_provisioning_state.value return body def as_shallow_dict(self) -> dict: @@ -6344,19 +6344,19 @@ def as_dict(self) -> dict: """Serializes the OnlineTableSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.perform_full_copy is not None: - body["{perform_full_copy}"] = self.perform_full_copy + body["perform_full_copy"] = self.perform_full_copy if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.primary_key_columns: - body["{primary_key_columns}"] = [v for v in self.primary_key_columns] + body["primary_key_columns"] = [v for v in self.primary_key_columns] if self.run_continuously: - body["{run_continuously}"] = self.run_continuously.as_dict() + body["run_continuously"] = self.run_continuously.as_dict() if self.run_triggered: - body["{run_triggered}"] = self.run_triggered.as_dict() + body["run_triggered"] = self.run_triggered.as_dict() if self.source_table_full_name is not None: - body["{source_table_full_name}"] = self.source_table_full_name + body["source_table_full_name"] = self.source_table_full_name if self.timeseries_key is not None: - body["{timeseries_key}"] = self.timeseries_key + body["timeseries_key"] = self.timeseries_key return body def as_shallow_dict(self) -> dict: @@ -6474,17 +6474,17 @@ def as_dict(self) -> dict: """Serializes the OnlineTableStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.continuous_update_status: - body["{continuous_update_status}"] = self.continuous_update_status.as_dict() + body["continuous_update_status"] = self.continuous_update_status.as_dict() if self.detailed_state is not None: - body["{detailed_state}"] = self.detailed_state.value + body["detailed_state"] = self.detailed_state.value if self.failed_status: - body["{failed_status}"] = self.failed_status.as_dict() + body["failed_status"] = self.failed_status.as_dict() if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.provisioning_status: - body["{provisioning_status}"] = self.provisioning_status.as_dict() + body["provisioning_status"] = self.provisioning_status.as_dict() if self.triggered_update_status: - body["{triggered_update_status}"] = self.triggered_update_status.as_dict() + body["triggered_update_status"] = self.triggered_update_status.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6532,11 +6532,11 @@ def as_dict(self) -> dict: """Serializes the PermissionsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.add: - body["{add}"] = [v.value for v in self.add] + body["add"] = [v.value for v in self.add] if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.remove: - body["{remove}"] = [v.value for v in self.remove] + body["remove"] = [v.value for v in self.remove] return body def as_shallow_dict(self) -> dict: @@ -6569,7 +6569,7 @@ def as_dict(self) -> dict: """Serializes the PermissionsList into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] + body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: @@ -6609,15 +6609,15 @@ def as_dict(self) -> dict: """Serializes the PipelineProgress into a dictionary suitable for use as a JSON request body.""" body = {} if self.estimated_completion_time_seconds is not None: - body["{estimated_completion_time_seconds}"] = self.estimated_completion_time_seconds + body["estimated_completion_time_seconds"] = self.estimated_completion_time_seconds if self.latest_version_currently_processing is not None: - body["{latest_version_currently_processing}"] = self.latest_version_currently_processing + body["latest_version_currently_processing"] = self.latest_version_currently_processing if self.sync_progress_completion is not None: - body["{sync_progress_completion}"] = self.sync_progress_completion + body["sync_progress_completion"] = self.sync_progress_completion if self.synced_row_count is not None: - body["{synced_row_count}"] = self.synced_row_count + body["synced_row_count"] = self.synced_row_count if self.total_row_count is not None: - body["{total_row_count}"] = self.total_row_count + body["total_row_count"] = self.total_row_count return body def as_shallow_dict(self) -> dict: @@ -6659,9 +6659,9 @@ def as_dict(self) -> dict: """Serializes the PrimaryKeyConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.child_columns: - body["{child_columns}"] = [v for v in self.child_columns] + body["child_columns"] = [v for v in self.child_columns] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -6741,9 +6741,9 @@ def as_dict(self) -> dict: """Serializes the PrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.privileges: - body["{privileges}"] = [v.value for v in self.privileges] + body["privileges"] = [v.value for v in self.privileges] return body def as_shallow_dict(self) -> dict: @@ -6774,7 +6774,7 @@ def as_dict(self) -> dict: """Serializes the ProvisioningInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -6813,7 +6813,7 @@ def as_dict(self) -> dict: """Serializes the ProvisioningStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.initial_pipeline_sync_progress: - body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress.as_dict() + body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6853,17 +6853,17 @@ def as_dict(self) -> dict: """Serializes the QuotaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_refreshed_at is not None: - body["{last_refreshed_at}"] = self.last_refreshed_at + body["last_refreshed_at"] = self.last_refreshed_at if self.parent_full_name is not None: - body["{parent_full_name}"] = self.parent_full_name + body["parent_full_name"] = self.parent_full_name if self.parent_securable_type is not None: - body["{parent_securable_type}"] = self.parent_securable_type.value + body["parent_securable_type"] = self.parent_securable_type.value if self.quota_count is not None: - body["{quota_count}"] = self.quota_count + body["quota_count"] = self.quota_count if self.quota_limit is not None: - body["{quota_limit}"] = self.quota_limit + body["quota_limit"] = self.quota_limit if self.quota_name is not None: - body["{quota_name}"] = self.quota_name + body["quota_name"] = self.quota_name return body def as_shallow_dict(self) -> dict: @@ -6914,11 +6914,11 @@ def as_dict(self) -> dict: """Serializes the R2Credentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_key_id is not None: - body["{access_key_id}"] = self.access_key_id + body["access_key_id"] = self.access_key_id if self.secret_access_key is not None: - body["{secret_access_key}"] = self.secret_access_key + body["secret_access_key"] = self.secret_access_key if self.session_token is not None: - body["{session_token}"] = self.session_token + body["session_token"] = self.session_token return body def as_shallow_dict(self) -> dict: @@ -6955,9 +6955,9 @@ def as_dict(self) -> dict: """Serializes the RegenerateDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -6987,9 +6987,9 @@ def as_dict(self) -> dict: """Serializes the RegenerateDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.parent_folder is not None: - body["{parent_folder}"] = self.parent_folder + body["parent_folder"] = self.parent_folder return body def as_shallow_dict(self) -> dict: @@ -7021,9 +7021,9 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAlias into a dictionary suitable for use as a JSON request body.""" body = {} if self.alias_name is not None: - body["{alias_name}"] = self.alias_name + body["alias_name"] = self.alias_name if self.version_num is not None: - body["{version_num}"] = self.version_num + body["version_num"] = self.version_num return body def as_shallow_dict(self) -> dict: @@ -7090,33 +7090,33 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aliases: - body["{aliases}"] = [v.as_dict() for v in self.aliases] + body["aliases"] = [v.as_dict() for v in self.aliases] if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -7233,41 +7233,41 @@ def as_dict(self) -> dict: """Serializes the SchemaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.catalog_type is not None: - body["{catalog_type}"] = self.catalog_type + body["catalog_type"] = self.catalog_type if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.effective_predictive_optimization_flag: - body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag.as_dict() + body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag.as_dict() if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value + body["enable_predictive_optimization"] = self.enable_predictive_optimization.value if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.schema_id is not None: - body["{schema_id}"] = self.schema_id + body["schema_id"] = self.schema_id if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -7376,9 +7376,9 @@ def as_dict(self) -> dict: """Serializes the SetArtifactAllowlist into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_matchers: - body["{artifact_matchers}"] = [v.as_dict() for v in self.artifact_matchers] + body["artifact_matchers"] = [v.as_dict() for v in self.artifact_matchers] if self.artifact_type is not None: - body["{artifact_type}"] = self.artifact_type.value + body["artifact_type"] = self.artifact_type.value return body def as_shallow_dict(self) -> dict: @@ -7414,11 +7414,11 @@ def as_dict(self) -> dict: """Serializes the SetRegisteredModelAliasRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.alias is not None: - body["{alias}"] = self.alias + body["alias"] = self.alias if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.version_num is not None: - body["{version_num}"] = self.version_num + body["version_num"] = self.version_num return body def as_shallow_dict(self) -> dict: @@ -7454,9 +7454,9 @@ def as_dict(self) -> dict: """Serializes the SseEncryptionDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.algorithm is not None: - body["{algorithm}"] = self.algorithm.value + body["algorithm"] = self.algorithm.value if self.aws_kms_key_arn is not None: - body["{aws_kms_key_arn}"] = self.aws_kms_key_arn + body["aws_kms_key_arn"] = self.aws_kms_key_arn return body def as_shallow_dict(self) -> dict: @@ -7543,41 +7543,41 @@ def as_dict(self) -> dict: """Serializes the StorageCredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal.as_dict() + body["azure_service_principal"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() + body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.used_for_managed_storage is not None: - body["{used_for_managed_storage}"] = self.used_for_managed_storage + body["used_for_managed_storage"] = self.used_for_managed_storage return body def as_shallow_dict(self) -> dict: @@ -7661,9 +7661,9 @@ def as_dict(self) -> dict: """Serializes the SystemSchemaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -7707,11 +7707,11 @@ def as_dict(self) -> dict: """Serializes the TableConstraint into a dictionary suitable for use as a JSON request body.""" body = {} if self.foreign_key_constraint: - body["{foreign_key_constraint}"] = self.foreign_key_constraint.as_dict() + body["foreign_key_constraint"] = self.foreign_key_constraint.as_dict() if self.named_table_constraint: - body["{named_table_constraint}"] = self.named_table_constraint.as_dict() + body["named_table_constraint"] = self.named_table_constraint.as_dict() if self.primary_key_constraint: - body["{primary_key_constraint}"] = self.primary_key_constraint.as_dict() + body["primary_key_constraint"] = self.primary_key_constraint.as_dict() return body def as_shallow_dict(self) -> dict: @@ -7747,7 +7747,7 @@ def as_dict(self) -> dict: """Serializes the TableDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.table_full_name is not None: - body["{table_full_name}"] = self.table_full_name + body["table_full_name"] = self.table_full_name return body def as_shallow_dict(self) -> dict: @@ -7772,7 +7772,7 @@ def as_dict(self) -> dict: """Serializes the TableExistsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.table_exists is not None: - body["{table_exists}"] = self.table_exists + body["table_exists"] = self.table_exists return body def as_shallow_dict(self) -> dict: @@ -7894,69 +7894,69 @@ def as_dict(self) -> dict: """Serializes the TableInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.columns: - body["{columns}"] = [v.as_dict() for v in self.columns] + body["columns"] = [v.as_dict() for v in self.columns] if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_access_configuration_id is not None: - body["{data_access_configuration_id}"] = self.data_access_configuration_id + body["data_access_configuration_id"] = self.data_access_configuration_id if self.data_source_format is not None: - body["{data_source_format}"] = self.data_source_format.value + body["data_source_format"] = self.data_source_format.value if self.deleted_at is not None: - body["{deleted_at}"] = self.deleted_at + body["deleted_at"] = self.deleted_at if self.delta_runtime_properties_kvpairs: - body["{delta_runtime_properties_kvpairs}"] = self.delta_runtime_properties_kvpairs.as_dict() + body["delta_runtime_properties_kvpairs"] = self.delta_runtime_properties_kvpairs.as_dict() if self.effective_predictive_optimization_flag: - body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag.as_dict() + body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag.as_dict() if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value + body["enable_predictive_optimization"] = self.enable_predictive_optimization.value if self.encryption_details: - body["{encryption_details}"] = self.encryption_details.as_dict() + body["encryption_details"] = self.encryption_details.as_dict() if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.row_filter: - body["{row_filter}"] = self.row_filter.as_dict() + body["row_filter"] = self.row_filter.as_dict() if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.sql_path is not None: - body["{sql_path}"] = self.sql_path + body["sql_path"] = self.sql_path if self.storage_credential_name is not None: - body["{storage_credential_name}"] = self.storage_credential_name + body["storage_credential_name"] = self.storage_credential_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.table_constraints: - body["{table_constraints}"] = [v.as_dict() for v in self.table_constraints] + body["table_constraints"] = [v.as_dict() for v in self.table_constraints] if self.table_id is not None: - body["{table_id}"] = self.table_id + body["table_id"] = self.table_id if self.table_type is not None: - body["{table_type}"] = self.table_type.value + body["table_type"] = self.table_type.value if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.view_definition is not None: - body["{view_definition}"] = self.view_definition + body["view_definition"] = self.view_definition if self.view_dependencies: - body["{view_dependencies}"] = self.view_dependencies.as_dict() + body["view_dependencies"] = self.view_dependencies.as_dict() return body def as_shallow_dict(self) -> dict: @@ -8090,9 +8090,9 @@ def as_dict(self) -> dict: """Serializes the TableRowFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.input_column_names: - body["{input_column_names}"] = [v for v in self.input_column_names] + body["input_column_names"] = [v for v in self.input_column_names] return body def as_shallow_dict(self) -> dict: @@ -8121,9 +8121,9 @@ def as_dict(self) -> dict: """Serializes the TableSummary into a dictionary suitable for use as a JSON request body.""" body = {} if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.table_type is not None: - body["{table_type}"] = self.table_type.value + body["table_type"] = self.table_type.value return body def as_shallow_dict(self) -> dict: @@ -8176,13 +8176,13 @@ def as_dict(self) -> dict: """Serializes the TemporaryCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_temp_credentials: - body["{aws_temp_credentials}"] = self.aws_temp_credentials.as_dict() + body["aws_temp_credentials"] = self.aws_temp_credentials.as_dict() if self.azure_aad: - body["{azure_aad}"] = self.azure_aad.as_dict() + body["azure_aad"] = self.azure_aad.as_dict() if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.gcp_oauth_token: - body["{gcp_oauth_token}"] = self.gcp_oauth_token.as_dict() + body["gcp_oauth_token"] = self.gcp_oauth_token.as_dict() return body def as_shallow_dict(self) -> dict: @@ -8229,11 +8229,11 @@ def as_dict(self) -> dict: """Serializes the TriggeredUpdateStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_processed_commit_version is not None: - body["{last_processed_commit_version}"] = self.last_processed_commit_version + body["last_processed_commit_version"] = self.last_processed_commit_version if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.triggered_update_progress: - body["{triggered_update_progress}"] = self.triggered_update_progress.as_dict() + body["triggered_update_progress"] = self.triggered_update_progress.as_dict() return body def as_shallow_dict(self) -> dict: @@ -8331,21 +8331,21 @@ def as_dict(self) -> dict: """Serializes the UpdateCatalog into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value + body["enable_predictive_optimization"] = self.enable_predictive_optimization.value if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties return body def as_shallow_dict(self) -> dict: @@ -8402,13 +8402,13 @@ def as_dict(self) -> dict: """Serializes the UpdateConnection into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body def as_shallow_dict(self) -> dict: @@ -8479,29 +8479,29 @@ def as_dict(self) -> dict: """Serializes the UpdateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal.as_dict() + body["azure_service_principal"] = self.azure_service_principal.as_dict() if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.force is not None: - body["{force}"] = self.force + body["force"] = self.force if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.name_arg is not None: - body["{name_arg}"] = self.name_arg + body["name_arg"] = self.name_arg if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body def as_shallow_dict(self) -> dict: @@ -8600,31 +8600,31 @@ def as_dict(self) -> dict: """Serializes the UpdateExternalLocation into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.encryption_details: - body["{encryption_details}"] = self.encryption_details.as_dict() + body["encryption_details"] = self.encryption_details.as_dict() if self.fallback is not None: - body["{fallback}"] = self.fallback + body["fallback"] = self.fallback if self.force is not None: - body["{force}"] = self.force + body["force"] = self.force if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -8691,9 +8691,9 @@ def as_dict(self) -> dict: """Serializes the UpdateFunction into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body def as_shallow_dict(self) -> dict: @@ -8742,23 +8742,23 @@ def as_dict(self) -> dict: """Serializes the UpdateMetastore into a dictionary suitable for use as a JSON request body.""" body = {} if self.delta_sharing_organization_name is not None: - body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name + body["delta_sharing_organization_name"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( + body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["{delta_sharing_scope}"] = self.delta_sharing_scope.value + body["delta_sharing_scope"] = self.delta_sharing_scope.value if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.privilege_model_version is not None: - body["{privilege_model_version}"] = self.privilege_model_version + body["privilege_model_version"] = self.privilege_model_version if self.storage_root_credential_id is not None: - body["{storage_root_credential_id}"] = self.storage_root_credential_id + body["storage_root_credential_id"] = self.storage_root_credential_id return body def as_shallow_dict(self) -> dict: @@ -8817,11 +8817,11 @@ def as_dict(self) -> dict: """Serializes the UpdateMetastoreAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_catalog_name is not None: - body["{default_catalog_name}"] = self.default_catalog_name + body["default_catalog_name"] = self.default_catalog_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -8867,11 +8867,11 @@ def as_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -8941,29 +8941,29 @@ def as_dict(self) -> dict: """Serializes the UpdateMonitor into a dictionary suitable for use as a JSON request body.""" body = {} if self.baseline_table_name is not None: - body["{baseline_table_name}"] = self.baseline_table_name + body["baseline_table_name"] = self.baseline_table_name if self.custom_metrics: - body["{custom_metrics}"] = [v.as_dict() for v in self.custom_metrics] + body["custom_metrics"] = [v.as_dict() for v in self.custom_metrics] if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.data_classification_config: - body["{data_classification_config}"] = self.data_classification_config.as_dict() + body["data_classification_config"] = self.data_classification_config.as_dict() if self.inference_log: - body["{inference_log}"] = self.inference_log.as_dict() + body["inference_log"] = self.inference_log.as_dict() if self.notifications: - body["{notifications}"] = self.notifications.as_dict() + body["notifications"] = self.notifications.as_dict() if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.schedule: - body["{schedule}"] = self.schedule.as_dict() + body["schedule"] = self.schedule.as_dict() if self.slicing_exprs: - body["{slicing_exprs}"] = [v for v in self.slicing_exprs] + body["slicing_exprs"] = [v for v in self.slicing_exprs] if self.snapshot: - body["{snapshot}"] = self.snapshot.as_dict() + body["snapshot"] = self.snapshot.as_dict() if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.time_series: - body["{time_series}"] = self.time_series.as_dict() + body["time_series"] = self.time_series.as_dict() return body def as_shallow_dict(self) -> dict: @@ -9029,11 +9029,11 @@ def as_dict(self) -> dict: """Serializes the UpdatePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.changes: - body["{changes}"] = [v.as_dict() for v in self.changes] + body["changes"] = [v.as_dict() for v in self.changes] if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.securable_type is not None: - body["{securable_type}"] = self.securable_type.value + body["securable_type"] = self.securable_type.value return body def as_shallow_dict(self) -> dict: @@ -9075,13 +9075,13 @@ def as_dict(self) -> dict: """Serializes the UpdateRegisteredModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body def as_shallow_dict(self) -> dict: @@ -9150,17 +9150,17 @@ def as_dict(self) -> dict: """Serializes the UpdateSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization.value + body["enable_predictive_optimization"] = self.enable_predictive_optimization.value if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties return body def as_shallow_dict(self) -> dict: @@ -9237,31 +9237,31 @@ def as_dict(self) -> dict: """Serializes the UpdateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal.as_dict() + body["azure_service_principal"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() + body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.force is not None: - body["{force}"] = self.force + body["force"] = self.force if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode.value + body["isolation_mode"] = self.isolation_mode.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body def as_shallow_dict(self) -> dict: @@ -9335,13 +9335,13 @@ def as_dict(self) -> dict: """Serializes the UpdateVolumeRequestContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body def as_shallow_dict(self) -> dict: @@ -9383,11 +9383,11 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceBindings into a dictionary suitable for use as a JSON request body.""" body = {} if self.assign_workspaces: - body["{assign_workspaces}"] = [v for v in self.assign_workspaces] + body["assign_workspaces"] = [v for v in self.assign_workspaces] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.unassign_workspaces: - body["{unassign_workspaces}"] = [v for v in self.unassign_workspaces] + body["unassign_workspaces"] = [v for v in self.unassign_workspaces] return body def as_shallow_dict(self) -> dict: @@ -9429,13 +9429,13 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceBindingsParameters into a dictionary suitable for use as a JSON request body.""" body = {} if self.add: - body["{add}"] = [v.as_dict() for v in self.add] + body["add"] = [v.as_dict() for v in self.add] if self.remove: - body["{remove}"] = [v.as_dict() for v in self.remove] + body["remove"] = [v.as_dict() for v in self.remove] if self.securable_name is not None: - body["{securable_name}"] = self.securable_name + body["securable_name"] = self.securable_name if self.securable_type is not None: - body["{securable_type}"] = self.securable_type.value + body["securable_type"] = self.securable_type.value return body def as_shallow_dict(self) -> dict: @@ -9496,21 +9496,21 @@ def as_dict(self) -> dict: """Serializes the ValidateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.external_location_name is not None: - body["{external_location_name}"] = self.external_location_name + body["external_location_name"] = self.external_location_name if self.purpose is not None: - body["{purpose}"] = self.purpose.value + body["purpose"] = self.purpose.value if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -9564,9 +9564,9 @@ def as_dict(self) -> dict: """Serializes the ValidateCredentialResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["isDir"] = self.is_dir if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -9625,23 +9625,23 @@ def as_dict(self) -> dict: """Serializes the ValidateStorageCredential into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role.as_dict() + body["aws_iam_role"] = self.aws_iam_role.as_dict() if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity.as_dict() + body["azure_managed_identity"] = self.azure_managed_identity.as_dict() if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal.as_dict() + body["azure_service_principal"] = self.azure_service_principal.as_dict() if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token.as_dict() + body["cloudflare_api_token"] = self.cloudflare_api_token.as_dict() if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account.as_dict() if self.external_location_name is not None: - body["{external_location_name}"] = self.external_location_name + body["external_location_name"] = self.external_location_name if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.storage_credential_name is not None: - body["{storage_credential_name}"] = self.storage_credential_name + body["storage_credential_name"] = self.storage_credential_name if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -9697,9 +9697,9 @@ def as_dict(self) -> dict: """Serializes the ValidateStorageCredentialResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["isDir"] = self.is_dir if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -9732,11 +9732,11 @@ def as_dict(self) -> dict: """Serializes the ValidationResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.operation is not None: - body["{operation}"] = self.operation.value + body["operation"] = self.operation.value if self.result is not None: - body["{result}"] = self.result.value + body["result"] = self.result.value return body def as_shallow_dict(self) -> dict: @@ -9838,39 +9838,39 @@ def as_dict(self) -> dict: """Serializes the VolumeInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.encryption_details: - body["{encryption_details}"] = self.encryption_details.as_dict() + body["encryption_details"] = self.encryption_details.as_dict() if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.volume_id is not None: - body["{volume_id}"] = self.volume_id + body["volume_id"] = self.volume_id if self.volume_type is not None: - body["{volume_type}"] = self.volume_type.value + body["volume_type"] = self.volume_type.value return body def as_shallow_dict(self) -> dict: @@ -9957,9 +9957,9 @@ def as_dict(self) -> dict: """Serializes the WorkspaceBinding into a dictionary suitable for use as a JSON request body.""" body = {} if self.binding_type is not None: - body["{binding_type}"] = self.binding_type.value + body["binding_type"] = self.binding_type.value if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -10001,9 +10001,9 @@ def as_dict(self) -> dict: """Serializes the WorkspaceBindingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.bindings: - body["{bindings}"] = [v.as_dict() for v in self.bindings] + body["bindings"] = [v.as_dict() for v in self.bindings] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/cleanrooms/v2/impl.py b/databricks/sdk/cleanrooms/v2/impl.py index 1794005e2..23c592c20 100755 --- a/databricks/sdk/cleanrooms/v2/impl.py +++ b/databricks/sdk/cleanrooms/v2/impl.py @@ -57,25 +57,25 @@ def as_dict(self) -> dict: """Serializes the CleanRoom into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_restricted is not None: - body["{access_restricted}"] = self.access_restricted.value + body["access_restricted"] = self.access_restricted.value if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.local_collaborator_alias is not None: - body["{local_collaborator_alias}"] = self.local_collaborator_alias + body["local_collaborator_alias"] = self.local_collaborator_alias if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.output_catalog: - body["{output_catalog}"] = self.output_catalog.as_dict() + body["output_catalog"] = self.output_catalog.as_dict() if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.remote_detailed_info: - body["{remote_detailed_info}"] = self.remote_detailed_info.as_dict() + body["remote_detailed_info"] = self.remote_detailed_info.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body def as_shallow_dict(self) -> dict: @@ -187,31 +187,31 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAsset into a dictionary suitable for use as a JSON request body.""" body = {} if self.added_at is not None: - body["{added_at}"] = self.added_at + body["added_at"] = self.added_at if self.asset_type is not None: - body["{asset_type}"] = self.asset_type.value + body["asset_type"] = self.asset_type.value if self.foreign_table: - body["{foreign_table}"] = self.foreign_table.as_dict() + body["foreign_table"] = self.foreign_table.as_dict() if self.foreign_table_local_details: - body["{foreign_table_local_details}"] = self.foreign_table_local_details.as_dict() + body["foreign_table_local_details"] = self.foreign_table_local_details.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notebook: - body["{notebook}"] = self.notebook.as_dict() + body["notebook"] = self.notebook.as_dict() if self.owner_collaborator_alias is not None: - body["{owner_collaborator_alias}"] = self.owner_collaborator_alias + body["owner_collaborator_alias"] = self.owner_collaborator_alias if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.table: - body["{table}"] = self.table.as_dict() + body["table"] = self.table.as_dict() if self.table_local_details: - body["{table_local_details}"] = self.table_local_details.as_dict() + body["table_local_details"] = self.table_local_details.as_dict() if self.view: - body["{view}"] = self.view.as_dict() + body["view"] = self.view.as_dict() if self.view_local_details: - body["{view_local_details}"] = self.view_local_details.as_dict() + body["view_local_details"] = self.view_local_details.as_dict() if self.volume_local_details: - body["{volume_local_details}"] = self.volume_local_details.as_dict() + body["volume_local_details"] = self.volume_local_details.as_dict() return body def as_shallow_dict(self) -> dict: @@ -285,7 +285,7 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["{columns}"] = [v.as_dict() for v in self.columns] + body["columns"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: @@ -311,7 +311,7 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTableLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name return body def as_shallow_dict(self) -> dict: @@ -340,9 +340,9 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetNotebook into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.notebook_content is not None: - body["{notebook_content}"] = self.notebook_content + body["notebook_content"] = self.notebook_content return body def as_shallow_dict(self) -> dict: @@ -376,7 +376,7 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["{columns}"] = [v.as_dict() for v in self.columns] + body["columns"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: @@ -405,9 +405,9 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetTableLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name if self.partitions: - body["{partitions}"] = [v.as_dict() for v in self.partitions] + body["partitions"] = [v.as_dict() for v in self.partitions] return body def as_shallow_dict(self) -> dict: @@ -434,7 +434,7 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetView into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["{columns}"] = [v.as_dict() for v in self.columns] + body["columns"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: @@ -460,7 +460,7 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetViewLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name return body def as_shallow_dict(self) -> dict: @@ -486,7 +486,7 @@ def as_dict(self) -> dict: """Serializes the CleanRoomAssetVolumeLocalDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name return body def as_shallow_dict(self) -> dict: @@ -540,17 +540,17 @@ def as_dict(self) -> dict: """Serializes the CleanRoomCollaborator into a dictionary suitable for use as a JSON request body.""" body = {} if self.collaborator_alias is not None: - body["{collaborator_alias}"] = self.collaborator_alias + body["collaborator_alias"] = self.collaborator_alias if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.global_metastore_id is not None: - body["{global_metastore_id}"] = self.global_metastore_id + body["global_metastore_id"] = self.global_metastore_id if self.invite_recipient_email is not None: - body["{invite_recipient_email}"] = self.invite_recipient_email + body["invite_recipient_email"] = self.invite_recipient_email if self.invite_recipient_workspace_id is not None: - body["{invite_recipient_workspace_id}"] = self.invite_recipient_workspace_id + body["invite_recipient_workspace_id"] = self.invite_recipient_workspace_id if self.organization_name is not None: - body["{organization_name}"] = self.organization_name + body["organization_name"] = self.organization_name return body def as_shallow_dict(self) -> dict: @@ -614,19 +614,19 @@ def as_dict(self) -> dict: """Serializes the CleanRoomNotebookTaskRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.collaborator_job_run_info: - body["{collaborator_job_run_info}"] = self.collaborator_job_run_info.as_dict() + body["collaborator_job_run_info"] = self.collaborator_job_run_info.as_dict() if self.notebook_job_run_state: - body["{notebook_job_run_state}"] = self.notebook_job_run_state.as_dict() + body["notebook_job_run_state"] = self.notebook_job_run_state.as_dict() if self.notebook_name is not None: - body["{notebook_name}"] = self.notebook_name + body["notebook_name"] = self.notebook_name if self.output_schema_expiration_time is not None: - body["{output_schema_expiration_time}"] = self.output_schema_expiration_time + body["output_schema_expiration_time"] = self.output_schema_expiration_time if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time return body def as_shallow_dict(self) -> dict: @@ -676,9 +676,9 @@ def as_dict(self) -> dict: """Serializes the CleanRoomOutputCatalog into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -740,19 +740,19 @@ def as_dict(self) -> dict: """Serializes the CleanRoomRemoteDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.central_clean_room_id is not None: - body["{central_clean_room_id}"] = self.central_clean_room_id + body["central_clean_room_id"] = self.central_clean_room_id if self.cloud_vendor is not None: - body["{cloud_vendor}"] = self.cloud_vendor + body["cloud_vendor"] = self.cloud_vendor if self.collaborators: - body["{collaborators}"] = [v.as_dict() for v in self.collaborators] + body["collaborators"] = [v.as_dict() for v in self.collaborators] if self.compliance_security_profile: - body["{compliance_security_profile}"] = self.compliance_security_profile.as_dict() + body["compliance_security_profile"] = self.compliance_security_profile.as_dict() if self.creator: - body["{creator}"] = self.creator.as_dict() + body["creator"] = self.creator.as_dict() if self.egress_network_policy: - body["{egress_network_policy}"] = self.egress_network_policy.as_dict() + body["egress_network_policy"] = self.egress_network_policy.as_dict() if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -846,9 +846,9 @@ def as_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a dictionary suitable for use as a JSON request body.""" body = {} if self.life_cycle_state is not None: - body["{life_cycle_state}"] = self.life_cycle_state.value + body["life_cycle_state"] = self.life_cycle_state.value if self.result_state is not None: - body["{result_state}"] = self.result_state.value + body["result_state"] = self.result_state.value return body def as_shallow_dict(self) -> dict: @@ -890,15 +890,15 @@ def as_dict(self) -> dict: """Serializes the CollaboratorJobRunInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.collaborator_alias is not None: - body["{collaborator_alias}"] = self.collaborator_alias + body["collaborator_alias"] = self.collaborator_alias if self.collaborator_job_id is not None: - body["{collaborator_job_id}"] = self.collaborator_job_id + body["collaborator_job_id"] = self.collaborator_job_id if self.collaborator_job_run_id is not None: - body["{collaborator_job_run_id}"] = self.collaborator_job_run_id + body["collaborator_job_run_id"] = self.collaborator_job_run_id if self.collaborator_task_run_id is not None: - body["{collaborator_task_run_id}"] = self.collaborator_task_run_id + body["collaborator_task_run_id"] = self.collaborator_task_run_id if self.collaborator_workspace_id is not None: - body["{collaborator_workspace_id}"] = self.collaborator_workspace_id + body["collaborator_workspace_id"] = self.collaborator_workspace_id return body def as_shallow_dict(self) -> dict: @@ -968,29 +968,29 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.mask: - body["{mask}"] = self.mask.as_dict() + body["mask"] = self.mask.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.nullable is not None: - body["{nullable}"] = self.nullable + body["nullable"] = self.nullable if self.partition_index is not None: - body["{partition_index}"] = self.partition_index + body["partition_index"] = self.partition_index if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name.value + body["type_name"] = self.type_name.value if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body def as_shallow_dict(self) -> dict: @@ -1055,9 +1055,9 @@ def as_dict(self) -> dict: """Serializes the ColumnMask into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.using_column_names: - body["{using_column_names}"] = [v for v in self.using_column_names] + body["using_column_names"] = [v for v in self.using_column_names] return body def as_shallow_dict(self) -> dict: @@ -1115,9 +1115,9 @@ def as_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_standards: - body["{compliance_standards}"] = [v.value for v in self.compliance_standards] + body["compliance_standards"] = [v.value for v in self.compliance_standards] if self.is_enabled is not None: - body["{is_enabled}"] = self.is_enabled + body["is_enabled"] = self.is_enabled return body def as_shallow_dict(self) -> dict: @@ -1163,7 +1163,7 @@ def as_dict(self) -> dict: """Serializes the CreateCleanRoomOutputCatalogResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.output_catalog: - body["{output_catalog}"] = self.output_catalog.as_dict() + body["output_catalog"] = self.output_catalog.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1231,7 +1231,7 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.internet_access: - body["{internet_access}"] = self.internet_access.as_dict() + body["internet_access"] = self.internet_access.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1267,13 +1267,13 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_internet_destinations: - body["{allowed_internet_destinations}"] = [v.as_dict() for v in self.allowed_internet_destinations] + body["allowed_internet_destinations"] = [v.as_dict() for v in self.allowed_internet_destinations] if self.allowed_storage_destinations: - body["{allowed_storage_destinations}"] = [v.as_dict() for v in self.allowed_storage_destinations] + body["allowed_storage_destinations"] = [v.as_dict() for v in self.allowed_storage_destinations] if self.log_only_mode: - body["{log_only_mode}"] = self.log_only_mode.as_dict() + body["log_only_mode"] = self.log_only_mode.as_dict() if self.restriction_mode is not None: - body["{restriction_mode}"] = self.restriction_mode.value + body["restriction_mode"] = self.restriction_mode.value return body def as_shallow_dict(self) -> dict: @@ -1326,11 +1326,11 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination if self.protocol is not None: - body["{protocol}"] = self.protocol.value + body["protocol"] = self.protocol.value if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -1382,9 +1382,9 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_only_mode_type is not None: - body["{log_only_mode_type}"] = self.log_only_mode_type.value + body["log_only_mode_type"] = self.log_only_mode_type.value if self.workloads: - body["{workloads}"] = [v.value for v in self.workloads] + body["workloads"] = [v.value for v in self.workloads] return body def as_shallow_dict(self) -> dict: @@ -1456,21 +1456,21 @@ def as_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_paths: - body["{allowed_paths}"] = [v for v in self.allowed_paths] + body["allowed_paths"] = [v for v in self.allowed_paths] if self.azure_container is not None: - body["{azure_container}"] = self.azure_container + body["azure_container"] = self.azure_container if self.azure_dns_zone is not None: - body["{azure_dns_zone}"] = self.azure_dns_zone + body["azure_dns_zone"] = self.azure_dns_zone if self.azure_storage_account is not None: - body["{azure_storage_account}"] = self.azure_storage_account + body["azure_storage_account"] = self.azure_storage_account if self.azure_storage_service is not None: - body["{azure_storage_service}"] = self.azure_storage_service + body["azure_storage_service"] = self.azure_storage_service if self.bucket_name is not None: - body["{bucket_name}"] = self.bucket_name + body["bucket_name"] = self.bucket_name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -1530,9 +1530,9 @@ def as_dict(self) -> dict: """Serializes the ListCleanRoomAssetsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets: - body["{assets}"] = [v.as_dict() for v in self.assets] + body["assets"] = [v.as_dict() for v in self.assets] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1565,9 +1565,9 @@ def as_dict(self) -> dict: """Serializes the ListCleanRoomNotebookTaskRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.runs: - body["{runs}"] = [v.as_dict() for v in self.runs] + body["runs"] = [v.as_dict() for v in self.runs] return body def as_shallow_dict(self) -> dict: @@ -1599,9 +1599,9 @@ def as_dict(self) -> dict: """Serializes the ListCleanRoomsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms: - body["{clean_rooms}"] = [v.as_dict() for v in self.clean_rooms] + body["clean_rooms"] = [v.as_dict() for v in self.clean_rooms] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1630,7 +1630,7 @@ def as_dict(self) -> dict: """Serializes the Partition into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["{values}"] = [v.as_dict() for v in self.values] + body["values"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -1666,13 +1666,13 @@ def as_dict(self) -> dict: """Serializes the PartitionValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.op is not None: - body["{op}"] = self.op.value + body["op"] = self.op.value if self.recipient_property_key is not None: - body["{recipient_property_key}"] = self.recipient_property_key + body["recipient_property_key"] = self.recipient_property_key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -1716,9 +1716,9 @@ def as_dict(self) -> dict: """Serializes the UpdateCleanRoomRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_room: - body["{clean_room}"] = self.clean_room.as_dict() + body["clean_room"] = self.clean_room.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/compute/v2/impl.py b/databricks/sdk/compute/v2/impl.py index 813033c32..a5dfdafa0 100755 --- a/databricks/sdk/compute/v2/impl.py +++ b/databricks/sdk/compute/v2/impl.py @@ -47,13 +47,13 @@ def as_dict(self) -> dict: """Serializes the AddInstanceProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.iam_role_arn is not None: - body["{iam_role_arn}"] = self.iam_role_arn + body["iam_role_arn"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["{is_meta_instance_profile}"] = self.is_meta_instance_profile + body["is_meta_instance_profile"] = self.is_meta_instance_profile if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body def as_shallow_dict(self) -> dict: @@ -110,7 +110,7 @@ def as_dict(self) -> dict: """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -140,9 +140,9 @@ def as_dict(self) -> dict: """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" body = {} if self.max_workers is not None: - body["{max_workers}"] = self.max_workers + body["max_workers"] = self.max_workers if self.min_workers is not None: - body["{min_workers}"] = self.min_workers + body["min_workers"] = self.min_workers return body def as_shallow_dict(self) -> dict: @@ -244,25 +244,25 @@ def as_dict(self) -> dict: """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.ebs_volume_count is not None: - body["{ebs_volume_count}"] = self.ebs_volume_count + body["ebs_volume_count"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["{ebs_volume_iops}"] = self.ebs_volume_iops + body["ebs_volume_iops"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["{ebs_volume_size}"] = self.ebs_volume_size + body["ebs_volume_size"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["{ebs_volume_throughput}"] = self.ebs_volume_throughput + body["ebs_volume_throughput"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type.value + body["ebs_volume_type"] = self.ebs_volume_type.value if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent + body["spot_bid_price_percent"] = self.spot_bid_price_percent if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body def as_shallow_dict(self) -> dict: @@ -347,13 +347,13 @@ def as_dict(self) -> dict: """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.log_analytics_info: - body["{log_analytics_info}"] = self.log_analytics_info.as_dict() + body["log_analytics_info"] = self.log_analytics_info.as_dict() if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price + body["spot_bid_max_price"] = self.spot_bid_max_price return body def as_shallow_dict(self) -> dict: @@ -401,11 +401,11 @@ def as_dict(self) -> dict: """Serializes the CancelCommand into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.command_id is not None: - body["{command_id}"] = self.command_id + body["commandId"] = self.command_id if self.context_id is not None: - body["{context_id}"] = self.context_id + body["contextId"] = self.context_id return body def as_shallow_dict(self) -> dict: @@ -458,9 +458,9 @@ def as_dict(self) -> dict: """Serializes the ChangeClusterOwner into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.owner_username is not None: - body["{owner_username}"] = self.owner_username + body["owner_username"] = self.owner_username return body def as_shallow_dict(self) -> dict: @@ -508,9 +508,9 @@ def as_dict(self) -> dict: """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" body = {} if self.jobs is not None: - body["{jobs}"] = self.jobs + body["jobs"] = self.jobs if self.notebooks is not None: - body["{notebooks}"] = self.notebooks + body["notebooks"] = self.notebooks return body def as_shallow_dict(self) -> dict: @@ -537,7 +537,7 @@ def as_dict(self) -> dict: """Serializes the CloneCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.source_cluster_id is not None: - body["{source_cluster_id}"] = self.source_cluster_id + body["source_cluster_id"] = self.source_cluster_id return body def as_shallow_dict(self) -> dict: @@ -562,7 +562,7 @@ def as_dict(self) -> dict: """Serializes the CloudProviderNodeInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.status: - body["{status}"] = [v.value for v in self.status] + body["status"] = [v.value for v in self.status] return body def as_shallow_dict(self) -> dict: @@ -602,13 +602,13 @@ def as_dict(self) -> dict: """Serializes the ClusterAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -656,15 +656,15 @@ def as_dict(self) -> dict: """Serializes the ClusterAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -876,59 +876,59 @@ def as_dict(self) -> dict: """Serializes the ClusterAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode.value + body["data_security_mode"] = self.data_security_mode.value if self.docker_image: - body["{docker_image}"] = self.docker_image.as_dict() + body["docker_image"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine.value + body["runtime_engine"] = self.runtime_engine.value if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type.as_dict() + body["workload_type"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1041,11 +1041,11 @@ def as_dict(self) -> dict: """Serializes the ClusterCompliance into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body def as_shallow_dict(self) -> dict: @@ -1344,101 +1344,101 @@ def as_dict(self) -> dict: """Serializes the ClusterDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.cluster_cores is not None: - body["{cluster_cores}"] = self.cluster_cores + body["cluster_cores"] = self.cluster_cores if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.cluster_log_status: - body["{cluster_log_status}"] = self.cluster_log_status.as_dict() + body["cluster_log_status"] = self.cluster_log_status.as_dict() if self.cluster_memory_mb is not None: - body["{cluster_memory_mb}"] = self.cluster_memory_mb + body["cluster_memory_mb"] = self.cluster_memory_mb if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.cluster_source is not None: - body["{cluster_source}"] = self.cluster_source.value + body["cluster_source"] = self.cluster_source.value if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode.value + body["data_security_mode"] = self.data_security_mode.value if self.default_tags: - body["{default_tags}"] = self.default_tags + body["default_tags"] = self.default_tags if self.docker_image: - body["{docker_image}"] = self.docker_image.as_dict() + body["docker_image"] = self.docker_image.as_dict() if self.driver: - body["{driver}"] = self.driver.as_dict() + body["driver"] = self.driver.as_dict() if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.executors: - body["{executors}"] = [v.as_dict() for v in self.executors] + body["executors"] = [v.as_dict() for v in self.executors] if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.jdbc_port is not None: - body["{jdbc_port}"] = self.jdbc_port + body["jdbc_port"] = self.jdbc_port if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.last_restarted_time is not None: - body["{last_restarted_time}"] = self.last_restarted_time + body["last_restarted_time"] = self.last_restarted_time if self.last_state_loss_time is not None: - body["{last_state_loss_time}"] = self.last_state_loss_time + body["last_state_loss_time"] = self.last_state_loss_time if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine.value + body["runtime_engine"] = self.runtime_engine.value if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_context_id is not None: - body["{spark_context_id}"] = self.spark_context_id + body["spark_context_id"] = self.spark_context_id if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.spec: - body["{spec}"] = self.spec.as_dict() + body["spec"] = self.spec.as_dict() if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.state_message is not None: - body["{state_message}"] = self.state_message + body["state_message"] = self.state_message if self.terminated_time is not None: - body["{terminated_time}"] = self.terminated_time + body["terminated_time"] = self.terminated_time if self.termination_reason: - body["{termination_reason}"] = self.termination_reason.as_dict() + body["termination_reason"] = self.termination_reason.as_dict() if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type.as_dict() + body["workload_type"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1615,15 +1615,15 @@ def as_dict(self) -> dict: """Serializes the ClusterEvent into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.data_plane_event_details: - body["{data_plane_event_details}"] = self.data_plane_event_details.as_dict() + body["data_plane_event_details"] = self.data_plane_event_details.as_dict() if self.details: - body["{details}"] = self.details.as_dict() + body["details"] = self.details.as_dict() if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -1665,9 +1665,9 @@ def as_dict(self) -> dict: """Serializes the ClusterLibraryStatuses into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.library_statuses: - body["{library_statuses}"] = [v.as_dict() for v in self.library_statuses] + body["library_statuses"] = [v.as_dict() for v in self.library_statuses] return body def as_shallow_dict(self) -> dict: @@ -1710,11 +1710,11 @@ def as_dict(self) -> dict: """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbfs: - body["{dbfs}"] = self.dbfs.as_dict() + body["dbfs"] = self.dbfs.as_dict() if self.s3: - body["{s3}"] = self.s3.as_dict() + body["s3"] = self.s3.as_dict() if self.volumes: - body["{volumes}"] = self.volumes.as_dict() + body["volumes"] = self.volumes.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1751,11 +1751,11 @@ def as_dict(self) -> dict: """Serializes the ClusterPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1799,11 +1799,11 @@ def as_dict(self) -> dict: """Serializes the ClusterPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -1838,9 +1838,9 @@ def as_dict(self) -> dict: """Serializes the ClusterPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1872,9 +1872,9 @@ def as_dict(self) -> dict: """Serializes the ClusterPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body def as_shallow_dict(self) -> dict: @@ -1913,13 +1913,13 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -1967,15 +1967,15 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -2018,11 +2018,11 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -2064,11 +2064,11 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -2103,9 +2103,9 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -2137,9 +2137,9 @@ def as_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.cluster_policy_id is not None: - body["{cluster_policy_id}"] = self.cluster_policy_id + body["cluster_policy_id"] = self.cluster_policy_id return body def as_shallow_dict(self) -> dict: @@ -2182,11 +2182,11 @@ def as_dict(self) -> dict: """Serializes the ClusterSettingsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.field is not None: - body["{field}"] = self.field + body["field"] = self.field if self.new_value is not None: - body["{new_value}"] = self.new_value + body["new_value"] = self.new_value if self.previous_value is not None: - body["{previous_value}"] = self.previous_value + body["previous_value"] = self.previous_value return body def as_shallow_dict(self) -> dict: @@ -2230,9 +2230,9 @@ def as_dict(self) -> dict: """Serializes the ClusterSize into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers return body def as_shallow_dict(self) -> dict: @@ -2463,65 +2463,65 @@ def as_dict(self) -> dict: """Serializes the ClusterSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode.value + body["data_security_mode"] = self.data_security_mode.value if self.docker_image: - body["{docker_image}"] = self.docker_image.as_dict() + body["docker_image"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine.value + body["runtime_engine"] = self.runtime_engine.value if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type.as_dict() + body["workload_type"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2643,13 +2643,13 @@ def as_dict(self) -> dict: """Serializes the Command into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.command is not None: - body["{command}"] = self.command + body["command"] = self.command if self.context_id is not None: - body["{context_id}"] = self.context_id + body["contextId"] = self.context_id if self.language is not None: - body["{language}"] = self.language.value + body["language"] = self.language.value return body def as_shallow_dict(self) -> dict: @@ -2698,11 +2698,11 @@ def as_dict(self) -> dict: """Serializes the CommandStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.results: - body["{results}"] = self.results.as_dict() + body["results"] = self.results.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -2743,9 +2743,9 @@ def as_dict(self) -> dict: """Serializes the ContextStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -2964,67 +2964,67 @@ def as_dict(self) -> dict: """Serializes the CreateCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.clone_from: - body["{clone_from}"] = self.clone_from.as_dict() + body["clone_from"] = self.clone_from.as_dict() if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode.value + body["data_security_mode"] = self.data_security_mode.value if self.docker_image: - body["{docker_image}"] = self.docker_image.as_dict() + body["docker_image"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine.value + body["runtime_engine"] = self.runtime_engine.value if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type.as_dict() + body["workload_type"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3140,7 +3140,7 @@ def as_dict(self) -> dict: """Serializes the CreateClusterResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body def as_shallow_dict(self) -> dict: @@ -3167,9 +3167,9 @@ def as_dict(self) -> dict: """Serializes the CreateContext into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.language is not None: - body["{language}"] = self.language.value + body["language"] = self.language.value return body def as_shallow_dict(self) -> dict: @@ -3253,31 +3253,31 @@ def as_dict(self) -> dict: """Serializes the CreateInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.disk_spec: - body["{disk_spec}"] = self.disk_spec.as_dict() + body["disk_spec"] = self.disk_spec.as_dict() if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.preloaded_docker_images: - body["{preloaded_docker_images}"] = [v.as_dict() for v in self.preloaded_docker_images] + body["preloaded_docker_images"] = [v.as_dict() for v in self.preloaded_docker_images] if self.preloaded_spark_versions: - body["{preloaded_spark_versions}"] = [v for v in self.preloaded_spark_versions] + body["preloaded_spark_versions"] = [v for v in self.preloaded_spark_versions] return body def as_shallow_dict(self) -> dict: @@ -3340,7 +3340,7 @@ def as_dict(self) -> dict: """Serializes the CreateInstancePoolResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id return body def as_shallow_dict(self) -> dict: @@ -3398,19 +3398,19 @@ def as_dict(self) -> dict: """Serializes the CreatePolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = self.max_clusters_per_user + body["max_clusters_per_user"] = self.max_clusters_per_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides + body["policy_family_definition_overrides"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id return body def as_shallow_dict(self) -> dict: @@ -3455,7 +3455,7 @@ def as_dict(self) -> dict: """Serializes the CreatePolicyResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body def as_shallow_dict(self) -> dict: @@ -3480,7 +3480,7 @@ def as_dict(self) -> dict: """Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id return body def as_shallow_dict(self) -> dict: @@ -3504,7 +3504,7 @@ def as_dict(self) -> dict: """Serializes the Created into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -3534,13 +3534,13 @@ def as_dict(self) -> dict: """Serializes the DataPlaneEventDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.event_type is not None: - body["{event_type}"] = self.event_type.value + body["event_type"] = self.event_type.value if self.executor_failures is not None: - body["{executor_failures}"] = self.executor_failures + body["executor_failures"] = self.executor_failures if self.host_id is not None: - body["{host_id}"] = self.host_id + body["host_id"] = self.host_id if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body def as_shallow_dict(self) -> dict: @@ -3622,7 +3622,7 @@ def as_dict(self) -> dict: """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -3647,7 +3647,7 @@ def as_dict(self) -> dict: """Serializes the DeleteCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body def as_shallow_dict(self) -> dict: @@ -3690,7 +3690,7 @@ def as_dict(self) -> dict: """Serializes the DeleteInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id return body def as_shallow_dict(self) -> dict: @@ -3733,7 +3733,7 @@ def as_dict(self) -> dict: """Serializes the DeletePolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body def as_shallow_dict(self) -> dict: @@ -3795,9 +3795,9 @@ def as_dict(self) -> dict: """Serializes the DestroyContext into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.context_id is not None: - body["{context_id}"] = self.context_id + body["contextId"] = self.context_id return body def as_shallow_dict(self) -> dict: @@ -3873,15 +3873,15 @@ def as_dict(self) -> dict: """Serializes the DiskSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.disk_count is not None: - body["{disk_count}"] = self.disk_count + body["disk_count"] = self.disk_count if self.disk_iops is not None: - body["{disk_iops}"] = self.disk_iops + body["disk_iops"] = self.disk_iops if self.disk_size is not None: - body["{disk_size}"] = self.disk_size + body["disk_size"] = self.disk_size if self.disk_throughput is not None: - body["{disk_throughput}"] = self.disk_throughput + body["disk_throughput"] = self.disk_throughput if self.disk_type: - body["{disk_type}"] = self.disk_type.as_dict() + body["disk_type"] = self.disk_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3927,9 +3927,9 @@ def as_dict(self) -> dict: """Serializes the DiskType into a dictionary suitable for use as a JSON request body.""" body = {} if self.azure_disk_volume_type is not None: - body["{azure_disk_volume_type}"] = self.azure_disk_volume_type.value + body["azure_disk_volume_type"] = self.azure_disk_volume_type.value if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type.value + body["ebs_volume_type"] = self.ebs_volume_type.value return body def as_shallow_dict(self) -> dict: @@ -3978,9 +3978,9 @@ def as_dict(self) -> dict: """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" body = {} if self.password is not None: - body["{password}"] = self.password + body["password"] = self.password if self.username is not None: - body["{username}"] = self.username + body["username"] = self.username return body def as_shallow_dict(self) -> dict: @@ -4010,9 +4010,9 @@ def as_dict(self) -> dict: """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" body = {} if self.basic_auth: - body["{basic_auth}"] = self.basic_auth.as_dict() + body["basic_auth"] = self.basic_auth.as_dict() if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -4238,67 +4238,67 @@ def as_dict(self) -> dict: """Serializes the EditCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode.value + body["data_security_mode"] = self.data_security_mode.value if self.docker_image: - body["{docker_image}"] = self.docker_image.as_dict() + body["docker_image"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine.value + body["runtime_engine"] = self.runtime_engine.value if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type.as_dict() + body["workload_type"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4464,19 +4464,19 @@ def as_dict(self) -> dict: """Serializes the EditInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id return body def as_shallow_dict(self) -> dict: @@ -4575,21 +4575,21 @@ def as_dict(self) -> dict: """Serializes the EditPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = self.max_clusters_per_user + body["max_clusters_per_user"] = self.max_clusters_per_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides + body["policy_family_definition_overrides"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body def as_shallow_dict(self) -> dict: @@ -4677,9 +4677,9 @@ def as_dict(self) -> dict: """Serializes the EnforceClusterComplianceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body def as_shallow_dict(self) -> dict: @@ -4711,9 +4711,9 @@ def as_dict(self) -> dict: """Serializes the EnforceClusterComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.changes: - body["{changes}"] = [v.as_dict() for v in self.changes] + body["changes"] = [v.as_dict() for v in self.changes] if self.has_changes is not None: - body["{has_changes}"] = self.has_changes + body["has_changes"] = self.has_changes return body def as_shallow_dict(self) -> dict: @@ -4800,45 +4800,45 @@ def as_dict(self) -> dict: """Serializes the EventDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.attributes: - body["{attributes}"] = self.attributes.as_dict() + body["attributes"] = self.attributes.as_dict() if self.cause is not None: - body["{cause}"] = self.cause.value + body["cause"] = self.cause.value if self.cluster_size: - body["{cluster_size}"] = self.cluster_size.as_dict() + body["cluster_size"] = self.cluster_size.as_dict() if self.current_num_vcpus is not None: - body["{current_num_vcpus}"] = self.current_num_vcpus + body["current_num_vcpus"] = self.current_num_vcpus if self.current_num_workers is not None: - body["{current_num_workers}"] = self.current_num_workers + body["current_num_workers"] = self.current_num_workers if self.did_not_expand_reason is not None: - body["{did_not_expand_reason}"] = self.did_not_expand_reason + body["did_not_expand_reason"] = self.did_not_expand_reason if self.disk_size is not None: - body["{disk_size}"] = self.disk_size + body["disk_size"] = self.disk_size if self.driver_state_message is not None: - body["{driver_state_message}"] = self.driver_state_message + body["driver_state_message"] = self.driver_state_message if self.enable_termination_for_node_blocklisted is not None: - body["{enable_termination_for_node_blocklisted}"] = self.enable_termination_for_node_blocklisted + body["enable_termination_for_node_blocklisted"] = self.enable_termination_for_node_blocklisted if self.free_space is not None: - body["{free_space}"] = self.free_space + body["free_space"] = self.free_space if self.init_scripts: - body["{init_scripts}"] = self.init_scripts.as_dict() + body["init_scripts"] = self.init_scripts.as_dict() if self.instance_id is not None: - body["{instance_id}"] = self.instance_id + body["instance_id"] = self.instance_id if self.job_run_name is not None: - body["{job_run_name}"] = self.job_run_name + body["job_run_name"] = self.job_run_name if self.previous_attributes: - body["{previous_attributes}"] = self.previous_attributes.as_dict() + body["previous_attributes"] = self.previous_attributes.as_dict() if self.previous_cluster_size: - body["{previous_cluster_size}"] = self.previous_cluster_size.as_dict() + body["previous_cluster_size"] = self.previous_cluster_size.as_dict() if self.previous_disk_size is not None: - body["{previous_disk_size}"] = self.previous_disk_size + body["previous_disk_size"] = self.previous_disk_size if self.reason: - body["{reason}"] = self.reason.as_dict() + body["reason"] = self.reason.as_dict() if self.target_num_vcpus is not None: - body["{target_num_vcpus}"] = self.target_num_vcpus + body["target_num_vcpus"] = self.target_num_vcpus if self.target_num_workers is not None: - body["{target_num_workers}"] = self.target_num_workers + body["target_num_workers"] = self.target_num_workers if self.user is not None: - body["{user}"] = self.user + body["user"] = self.user return body def as_shallow_dict(self) -> dict: @@ -4994,17 +4994,17 @@ def as_dict(self) -> dict: """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.boot_disk_size is not None: - body["{boot_disk_size}"] = self.boot_disk_size + body["boot_disk_size"] = self.boot_disk_size if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count + body["local_ssd_count"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["{use_preemptible_executors}"] = self.use_preemptible_executors + body["use_preemptible_executors"] = self.use_preemptible_executors if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body def as_shallow_dict(self) -> dict: @@ -5057,7 +5057,7 @@ def as_dict(self) -> dict: """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -5088,9 +5088,9 @@ def as_dict(self) -> dict: """Serializes the GetClusterComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body def as_shallow_dict(self) -> dict: @@ -5117,7 +5117,7 @@ def as_dict(self) -> dict: """Serializes the GetClusterPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -5142,7 +5142,7 @@ def as_dict(self) -> dict: """Serializes the GetClusterPolicyPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -5188,19 +5188,19 @@ def as_dict(self) -> dict: """Serializes the GetEvents into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.event_types: - body["{event_types}"] = [v.value for v in self.event_types] + body["event_types"] = [v.value for v in self.event_types] if self.limit is not None: - body["{limit}"] = self.limit + body["limit"] = self.limit if self.offset is not None: - body["{offset}"] = self.offset + body["offset"] = self.offset if self.order is not None: - body["{order}"] = self.order.value + body["order"] = self.order.value if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time return body def as_shallow_dict(self) -> dict: @@ -5257,11 +5257,11 @@ def as_dict(self) -> dict: """Serializes the GetEventsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.events: - body["{events}"] = [v.as_dict() for v in self.events] + body["events"] = [v.as_dict() for v in self.events] if self.next_page: - body["{next_page}"] = self.next_page.as_dict() + body["next_page"] = self.next_page.as_dict() if self.total_count is not None: - body["{total_count}"] = self.total_count + body["total_count"] = self.total_count return body def as_shallow_dict(self) -> dict: @@ -5374,41 +5374,41 @@ def as_dict(self) -> dict: """Serializes the GetInstancePool into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.default_tags: - body["{default_tags}"] = self.default_tags + body["default_tags"] = self.default_tags if self.disk_spec: - body["{disk_spec}"] = self.disk_spec.as_dict() + body["disk_spec"] = self.disk_spec.as_dict() if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.preloaded_docker_images: - body["{preloaded_docker_images}"] = [v.as_dict() for v in self.preloaded_docker_images] + body["preloaded_docker_images"] = [v.as_dict() for v in self.preloaded_docker_images] if self.preloaded_spark_versions: - body["{preloaded_spark_versions}"] = [v for v in self.preloaded_spark_versions] + body["preloaded_spark_versions"] = [v for v in self.preloaded_spark_versions] if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.stats: - body["{stats}"] = self.stats.as_dict() + body["stats"] = self.stats.as_dict() if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: @@ -5486,7 +5486,7 @@ def as_dict(self) -> dict: """Serializes the GetInstancePoolPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -5511,7 +5511,7 @@ def as_dict(self) -> dict: """Serializes the GetSparkVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.versions: - body["{versions}"] = [v.as_dict() for v in self.versions] + body["versions"] = [v.as_dict() for v in self.versions] return body def as_shallow_dict(self) -> dict: @@ -5553,13 +5553,13 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptCreateRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script is not None: - body["{script}"] = self.script + body["script"] = self.script return body def as_shallow_dict(self) -> dict: @@ -5617,21 +5617,21 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -5704,23 +5704,23 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptDetailsWithContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script is not None: - body["{script}"] = self.script + body["script"] = self.script if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -5791,15 +5791,15 @@ def as_dict(self) -> dict: """Serializes the GlobalInitScriptUpdateRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script is not None: - body["{script}"] = self.script + body["script"] = self.script if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id return body def as_shallow_dict(self) -> dict: @@ -5848,11 +5848,11 @@ def as_dict(self) -> dict: """Serializes the InitScriptEventDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster: - body["{cluster}"] = [v.as_dict() for v in self.cluster] + body["cluster"] = [v.as_dict() for v in self.cluster] if self.global_: - body["{global}"] = [v.as_dict() for v in self.global_] + body["global"] = [v.as_dict() for v in self.global_] if self.reported_for_node is not None: - body["{reported_for_node}"] = self.reported_for_node + body["reported_for_node"] = self.reported_for_node return body def as_shallow_dict(self) -> dict: @@ -5924,19 +5924,19 @@ def as_dict(self) -> dict: """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.abfss: - body["{abfss}"] = self.abfss.as_dict() + body["abfss"] = self.abfss.as_dict() if self.dbfs: - body["{dbfs}"] = self.dbfs.as_dict() + body["dbfs"] = self.dbfs.as_dict() if self.file: - body["{file}"] = self.file.as_dict() + body["file"] = self.file.as_dict() if self.gcs: - body["{gcs}"] = self.gcs.as_dict() + body["gcs"] = self.gcs.as_dict() if self.s3: - body["{s3}"] = self.s3.as_dict() + body["s3"] = self.s3.as_dict() if self.volumes: - body["{volumes}"] = self.volumes.as_dict() + body["volumes"] = self.volumes.as_dict() if self.workspace: - body["{workspace}"] = self.workspace.as_dict() + body["workspace"] = self.workspace.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6017,25 +6017,25 @@ def as_dict(self) -> dict: """Serializes the InitScriptInfoAndExecutionDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.abfss: - body["{abfss}"] = self.abfss.as_dict() + body["abfss"] = self.abfss.as_dict() if self.dbfs: - body["{dbfs}"] = self.dbfs.as_dict() + body["dbfs"] = self.dbfs.as_dict() if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.execution_duration_seconds is not None: - body["{execution_duration_seconds}"] = self.execution_duration_seconds + body["execution_duration_seconds"] = self.execution_duration_seconds if self.file: - body["{file}"] = self.file.as_dict() + body["file"] = self.file.as_dict() if self.gcs: - body["{gcs}"] = self.gcs.as_dict() + body["gcs"] = self.gcs.as_dict() if self.s3: - body["{s3}"] = self.s3.as_dict() + body["s3"] = self.s3.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.volumes: - body["{volumes}"] = self.volumes.as_dict() + body["volumes"] = self.volumes.as_dict() if self.workspace: - body["{workspace}"] = self.workspace.as_dict() + body["workspace"] = self.workspace.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6092,9 +6092,9 @@ def as_dict(self) -> dict: """Serializes the InstallLibraries into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] return body def as_shallow_dict(self) -> dict: @@ -6148,13 +6148,13 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -6202,15 +6202,15 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -6329,41 +6329,41 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAndStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.default_tags: - body["{default_tags}"] = self.default_tags + body["default_tags"] = self.default_tags if self.disk_spec: - body["{disk_spec}"] = self.disk_spec.as_dict() + body["disk_spec"] = self.disk_spec.as_dict() if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.preloaded_docker_images: - body["{preloaded_docker_images}"] = [v.as_dict() for v in self.preloaded_docker_images] + body["preloaded_docker_images"] = [v.as_dict() for v in self.preloaded_docker_images] if self.preloaded_spark_versions: - body["{preloaded_spark_versions}"] = [v for v in self.preloaded_spark_versions] + body["preloaded_spark_versions"] = [v for v in self.preloaded_spark_versions] if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.stats: - body["{stats}"] = self.stats.as_dict() + body["stats"] = self.stats.as_dict() if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6460,11 +6460,11 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent + body["spot_bid_price_percent"] = self.spot_bid_price_percent if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body def as_shallow_dict(self) -> dict: @@ -6512,9 +6512,9 @@ def as_dict(self) -> dict: """Serializes the InstancePoolAzureAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price + body["spot_bid_max_price"] = self.spot_bid_max_price return body def as_shallow_dict(self) -> dict: @@ -6575,11 +6575,11 @@ def as_dict(self) -> dict: """Serializes the InstancePoolGcpAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.gcp_availability is not None: - body["{gcp_availability}"] = self.gcp_availability.value + body["gcp_availability"] = self.gcp_availability.value if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count + body["local_ssd_count"] = self.local_ssd_count if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body def as_shallow_dict(self) -> dict: @@ -6616,11 +6616,11 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -6663,11 +6663,11 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -6702,9 +6702,9 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -6736,9 +6736,9 @@ def as_dict(self) -> dict: """Serializes the InstancePoolPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id return body def as_shallow_dict(self) -> dict: @@ -6788,13 +6788,13 @@ def as_dict(self) -> dict: """Serializes the InstancePoolStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.idle_count is not None: - body["{idle_count}"] = self.idle_count + body["idle_count"] = self.idle_count if self.pending_idle_count is not None: - body["{pending_idle_count}"] = self.pending_idle_count + body["pending_idle_count"] = self.pending_idle_count if self.pending_used_count is not None: - body["{pending_used_count}"] = self.pending_used_count + body["pending_used_count"] = self.pending_used_count if self.used_count is not None: - body["{used_count}"] = self.used_count + body["used_count"] = self.used_count return body def as_shallow_dict(self) -> dict: @@ -6832,7 +6832,7 @@ def as_dict(self) -> dict: """Serializes the InstancePoolStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.pending_instance_errors: - body["{pending_instance_errors}"] = [v.as_dict() for v in self.pending_instance_errors] + body["pending_instance_errors"] = [v.as_dict() for v in self.pending_instance_errors] return body def as_shallow_dict(self) -> dict: @@ -6872,11 +6872,11 @@ def as_dict(self) -> dict: """Serializes the InstanceProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.iam_role_arn is not None: - body["{iam_role_arn}"] = self.iam_role_arn + body["iam_role_arn"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["{is_meta_instance_profile}"] = self.is_meta_instance_profile + body["is_meta_instance_profile"] = self.is_meta_instance_profile return body def as_shallow_dict(self) -> dict: @@ -6964,19 +6964,19 @@ def as_dict(self) -> dict: """Serializes the Library into a dictionary suitable for use as a JSON request body.""" body = {} if self.cran: - body["{cran}"] = self.cran.as_dict() + body["cran"] = self.cran.as_dict() if self.egg is not None: - body["{egg}"] = self.egg + body["egg"] = self.egg if self.jar is not None: - body["{jar}"] = self.jar + body["jar"] = self.jar if self.maven: - body["{maven}"] = self.maven.as_dict() + body["maven"] = self.maven.as_dict() if self.pypi: - body["{pypi}"] = self.pypi.as_dict() + body["pypi"] = self.pypi.as_dict() if self.requirements is not None: - body["{requirements}"] = self.requirements + body["requirements"] = self.requirements if self.whl is not None: - body["{whl}"] = self.whl + body["whl"] = self.whl return body def as_shallow_dict(self) -> dict: @@ -7032,13 +7032,13 @@ def as_dict(self) -> dict: """Serializes the LibraryFullStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_library_for_all_clusters is not None: - body["{is_library_for_all_clusters}"] = self.is_library_for_all_clusters + body["is_library_for_all_clusters"] = self.is_library_for_all_clusters if self.library: - body["{library}"] = self.library.as_dict() + body["library"] = self.library.as_dict() if self.messages: - body["{messages}"] = [v for v in self.messages] + body["messages"] = [v for v in self.messages] if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -7087,7 +7087,7 @@ def as_dict(self) -> dict: """Serializes the ListAllClusterLibraryStatusesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.statuses: - body["{statuses}"] = [v.as_dict() for v in self.statuses] + body["statuses"] = [v.as_dict() for v in self.statuses] return body def as_shallow_dict(self) -> dict: @@ -7115,9 +7115,9 @@ def as_dict(self) -> dict: """Serializes the ListAvailableZonesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_zone is not None: - body["{default_zone}"] = self.default_zone + body["default_zone"] = self.default_zone if self.zones: - body["{zones}"] = [v for v in self.zones] + body["zones"] = [v for v in self.zones] return body def as_shallow_dict(self) -> dict: @@ -7152,11 +7152,11 @@ def as_dict(self) -> dict: """Serializes the ListClusterCompliancesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.clusters: - body["{clusters}"] = [v.as_dict() for v in self.clusters] + body["clusters"] = [v.as_dict() for v in self.clusters] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: @@ -7198,13 +7198,13 @@ def as_dict(self) -> dict: """Serializes the ListClustersFilterBy into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_sources: - body["{cluster_sources}"] = [v.value for v in self.cluster_sources] + body["cluster_sources"] = [v.value for v in self.cluster_sources] if self.cluster_states: - body["{cluster_states}"] = [v.value for v in self.cluster_states] + body["cluster_states"] = [v.value for v in self.cluster_states] if self.is_pinned is not None: - body["{is_pinned}"] = self.is_pinned + body["is_pinned"] = self.is_pinned if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body def as_shallow_dict(self) -> dict: @@ -7247,11 +7247,11 @@ def as_dict(self) -> dict: """Serializes the ListClustersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.clusters: - body["{clusters}"] = [v.as_dict() for v in self.clusters] + body["clusters"] = [v.as_dict() for v in self.clusters] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: @@ -7288,9 +7288,9 @@ def as_dict(self) -> dict: """Serializes the ListClustersSortBy into a dictionary suitable for use as a JSON request body.""" body = {} if self.direction is not None: - body["{direction}"] = self.direction.value + body["direction"] = self.direction.value if self.field is not None: - body["{field}"] = self.field.value + body["field"] = self.field.value return body def as_shallow_dict(self) -> dict: @@ -7331,7 +7331,7 @@ def as_dict(self) -> dict: """Serializes the ListGlobalInitScriptsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.scripts: - body["{scripts}"] = [v.as_dict() for v in self.scripts] + body["scripts"] = [v.as_dict() for v in self.scripts] return body def as_shallow_dict(self) -> dict: @@ -7355,7 +7355,7 @@ def as_dict(self) -> dict: """Serializes the ListInstancePools into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_pools: - body["{instance_pools}"] = [v.as_dict() for v in self.instance_pools] + body["instance_pools"] = [v.as_dict() for v in self.instance_pools] return body def as_shallow_dict(self) -> dict: @@ -7380,7 +7380,7 @@ def as_dict(self) -> dict: """Serializes the ListInstanceProfilesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_profiles: - body["{instance_profiles}"] = [v.as_dict() for v in self.instance_profiles] + body["instance_profiles"] = [v.as_dict() for v in self.instance_profiles] return body def as_shallow_dict(self) -> dict: @@ -7405,7 +7405,7 @@ def as_dict(self) -> dict: """Serializes the ListNodeTypesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.node_types: - body["{node_types}"] = [v.as_dict() for v in self.node_types] + body["node_types"] = [v.as_dict() for v in self.node_types] return body def as_shallow_dict(self) -> dict: @@ -7430,7 +7430,7 @@ def as_dict(self) -> dict: """Serializes the ListPoliciesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.policies: - body["{policies}"] = [v.as_dict() for v in self.policies] + body["policies"] = [v.as_dict() for v in self.policies] return body def as_shallow_dict(self) -> dict: @@ -7459,9 +7459,9 @@ def as_dict(self) -> dict: """Serializes the ListPolicyFamiliesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.policy_families: - body["{policy_families}"] = [v.as_dict() for v in self.policy_families] + body["policy_families"] = [v.as_dict() for v in self.policy_families] return body def as_shallow_dict(self) -> dict: @@ -7503,7 +7503,7 @@ def as_dict(self) -> dict: """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -7529,9 +7529,9 @@ def as_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_analytics_primary_key is not None: - body["{log_analytics_primary_key}"] = self.log_analytics_primary_key + body["log_analytics_primary_key"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id return body def as_shallow_dict(self) -> dict: @@ -7568,9 +7568,9 @@ def as_dict(self) -> dict: """Serializes the LogSyncStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.last_attempted is not None: - body["{last_attempted}"] = self.last_attempted + body["last_attempted"] = self.last_attempted if self.last_exception is not None: - body["{last_exception}"] = self.last_exception + body["last_exception"] = self.last_exception return body def as_shallow_dict(self) -> dict: @@ -7607,11 +7607,11 @@ def as_dict(self) -> dict: """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.coordinates is not None: - body["{coordinates}"] = self.coordinates + body["coordinates"] = self.coordinates if self.exclusions: - body["{exclusions}"] = [v for v in self.exclusions] + body["exclusions"] = [v for v in self.exclusions] if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body def as_shallow_dict(self) -> dict: @@ -7658,15 +7658,15 @@ def as_dict(self) -> dict: """Serializes the NodeInstanceType into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_type_id is not None: - body["{instance_type_id}"] = self.instance_type_id + body["instance_type_id"] = self.instance_type_id if self.local_disk_size_gb is not None: - body["{local_disk_size_gb}"] = self.local_disk_size_gb + body["local_disk_size_gb"] = self.local_disk_size_gb if self.local_disks is not None: - body["{local_disks}"] = self.local_disks + body["local_disks"] = self.local_disks if self.local_nvme_disk_size_gb is not None: - body["{local_nvme_disk_size_gb}"] = self.local_nvme_disk_size_gb + body["local_nvme_disk_size_gb"] = self.local_nvme_disk_size_gb if self.local_nvme_disks is not None: - body["{local_nvme_disks}"] = self.local_nvme_disks + body["local_nvme_disks"] = self.local_nvme_disks return body def as_shallow_dict(self) -> dict: @@ -7769,45 +7769,45 @@ def as_dict(self) -> dict: """Serializes the NodeType into a dictionary suitable for use as a JSON request body.""" body = {} if self.category is not None: - body["{category}"] = self.category + body["category"] = self.category if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_order is not None: - body["{display_order}"] = self.display_order + body["display_order"] = self.display_order if self.instance_type_id is not None: - body["{instance_type_id}"] = self.instance_type_id + body["instance_type_id"] = self.instance_type_id if self.is_deprecated is not None: - body["{is_deprecated}"] = self.is_deprecated + body["is_deprecated"] = self.is_deprecated if self.is_encrypted_in_transit is not None: - body["{is_encrypted_in_transit}"] = self.is_encrypted_in_transit + body["is_encrypted_in_transit"] = self.is_encrypted_in_transit if self.is_graviton is not None: - body["{is_graviton}"] = self.is_graviton + body["is_graviton"] = self.is_graviton if self.is_hidden is not None: - body["{is_hidden}"] = self.is_hidden + body["is_hidden"] = self.is_hidden if self.is_io_cache_enabled is not None: - body["{is_io_cache_enabled}"] = self.is_io_cache_enabled + body["is_io_cache_enabled"] = self.is_io_cache_enabled if self.memory_mb is not None: - body["{memory_mb}"] = self.memory_mb + body["memory_mb"] = self.memory_mb if self.node_info: - body["{node_info}"] = self.node_info.as_dict() + body["node_info"] = self.node_info.as_dict() if self.node_instance_type: - body["{node_instance_type}"] = self.node_instance_type.as_dict() + body["node_instance_type"] = self.node_instance_type.as_dict() if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_cores is not None: - body["{num_cores}"] = self.num_cores + body["num_cores"] = self.num_cores if self.num_gpus is not None: - body["{num_gpus}"] = self.num_gpus + body["num_gpus"] = self.num_gpus if self.photon_driver_capable is not None: - body["{photon_driver_capable}"] = self.photon_driver_capable + body["photon_driver_capable"] = self.photon_driver_capable if self.photon_worker_capable is not None: - body["{photon_worker_capable}"] = self.photon_worker_capable + body["photon_worker_capable"] = self.photon_worker_capable if self.support_cluster_tags is not None: - body["{support_cluster_tags}"] = self.support_cluster_tags + body["support_cluster_tags"] = self.support_cluster_tags if self.support_ebs_volumes is not None: - body["{support_ebs_volumes}"] = self.support_ebs_volumes + body["support_ebs_volumes"] = self.support_ebs_volumes if self.support_port_forwarding is not None: - body["{support_port_forwarding}"] = self.support_port_forwarding + body["support_port_forwarding"] = self.support_port_forwarding return body def as_shallow_dict(self) -> dict: @@ -7894,9 +7894,9 @@ def as_dict(self) -> dict: """Serializes the PendingInstanceError into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_id is not None: - body["{instance_id}"] = self.instance_id + body["instance_id"] = self.instance_id if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body def as_shallow_dict(self) -> dict: @@ -7923,7 +7923,7 @@ def as_dict(self) -> dict: """Serializes the PermanentDeleteCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body def as_shallow_dict(self) -> dict: @@ -7965,7 +7965,7 @@ def as_dict(self) -> dict: """Serializes the PinCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body def as_shallow_dict(self) -> dict: @@ -8057,27 +8057,27 @@ def as_dict(self) -> dict: """Serializes the Policy into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at_timestamp is not None: - body["{created_at_timestamp}"] = self.created_at_timestamp + body["created_at_timestamp"] = self.created_at_timestamp if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.is_default is not None: - body["{is_default}"] = self.is_default + body["is_default"] = self.is_default if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = self.max_clusters_per_user + body["max_clusters_per_user"] = self.max_clusters_per_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides + body["policy_family_definition_overrides"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body def as_shallow_dict(self) -> dict: @@ -8145,13 +8145,13 @@ def as_dict(self) -> dict: """Serializes the PolicyFamily into a dictionary suitable for use as a JSON request body.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id return body def as_shallow_dict(self) -> dict: @@ -8191,9 +8191,9 @@ def as_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body def as_shallow_dict(self) -> dict: @@ -8223,9 +8223,9 @@ def as_dict(self) -> dict: """Serializes the RCranLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body def as_shallow_dict(self) -> dict: @@ -8252,7 +8252,7 @@ def as_dict(self) -> dict: """Serializes the RemoveInstanceProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn return body def as_shallow_dict(self) -> dict: @@ -8309,11 +8309,11 @@ def as_dict(self) -> dict: """Serializes the ResizeCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers return body def as_shallow_dict(self) -> dict: @@ -8366,9 +8366,9 @@ def as_dict(self) -> dict: """Serializes the RestartCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.restart_user is not None: - body["{restart_user}"] = self.restart_user + body["restart_user"] = self.restart_user return body def as_shallow_dict(self) -> dict: @@ -8446,25 +8446,25 @@ def as_dict(self) -> dict: """Serializes the Results into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause + body["cause"] = self.cause if self.data: - body["{data}"] = self.data + body["data"] = self.data if self.file_name is not None: - body["{file_name}"] = self.file_name + body["fileName"] = self.file_name if self.file_names: - body["{file_names}"] = [v for v in self.file_names] + body["fileNames"] = [v for v in self.file_names] if self.is_json_schema is not None: - body["{is_json_schema}"] = self.is_json_schema + body["isJsonSchema"] = self.is_json_schema if self.pos is not None: - body["{pos}"] = self.pos + body["pos"] = self.pos if self.result_type is not None: - body["{result_type}"] = self.result_type.value + body["resultType"] = self.result_type.value if self.schema: - body["{schema}"] = [v for v in self.schema] + body["schema"] = [v for v in self.schema] if self.summary is not None: - body["{summary}"] = self.summary + body["summary"] = self.summary if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body def as_shallow_dict(self) -> dict: @@ -8557,19 +8557,19 @@ def as_dict(self) -> dict: """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.canned_acl is not None: - body["{canned_acl}"] = self.canned_acl + body["canned_acl"] = self.canned_acl if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination if self.enable_encryption is not None: - body["{enable_encryption}"] = self.enable_encryption + body["enable_encryption"] = self.enable_encryption if self.encryption_type is not None: - body["{encryption_type}"] = self.encryption_type + body["encryption_type"] = self.encryption_type if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.kms_key is not None: - body["{kms_key}"] = self.kms_key + body["kms_key"] = self.kms_key if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -8637,19 +8637,19 @@ def as_dict(self) -> dict: """Serializes the SparkNode into a dictionary suitable for use as a JSON request body.""" body = {} if self.host_private_ip is not None: - body["{host_private_ip}"] = self.host_private_ip + body["host_private_ip"] = self.host_private_ip if self.instance_id is not None: - body["{instance_id}"] = self.instance_id + body["instance_id"] = self.instance_id if self.node_aws_attributes: - body["{node_aws_attributes}"] = self.node_aws_attributes.as_dict() + body["node_aws_attributes"] = self.node_aws_attributes.as_dict() if self.node_id is not None: - body["{node_id}"] = self.node_id + body["node_id"] = self.node_id if self.private_ip is not None: - body["{private_ip}"] = self.private_ip + body["private_ip"] = self.private_ip if self.public_dns is not None: - body["{public_dns}"] = self.public_dns + body["public_dns"] = self.public_dns if self.start_timestamp is not None: - body["{start_timestamp}"] = self.start_timestamp + body["start_timestamp"] = self.start_timestamp return body def as_shallow_dict(self) -> dict: @@ -8696,7 +8696,7 @@ def as_dict(self) -> dict: """Serializes the SparkNodeAwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_spot is not None: - body["{is_spot}"] = self.is_spot + body["is_spot"] = self.is_spot return body def as_shallow_dict(self) -> dict: @@ -8727,9 +8727,9 @@ def as_dict(self) -> dict: """Serializes the SparkVersion into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -8756,7 +8756,7 @@ def as_dict(self) -> dict: """Serializes the StartCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body def as_shallow_dict(self) -> dict: @@ -8823,11 +8823,11 @@ def as_dict(self) -> dict: """Serializes the TerminationReason into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["{code}"] = self.code.value + body["code"] = self.code.value if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -9035,9 +9035,9 @@ def as_dict(self) -> dict: """Serializes the UninstallLibraries into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] return body def as_shallow_dict(self) -> dict: @@ -9081,7 +9081,7 @@ def as_dict(self) -> dict: """Serializes the UnpinCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body def as_shallow_dict(self) -> dict: @@ -9141,11 +9141,11 @@ def as_dict(self) -> dict: """Serializes the UpdateCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster: - body["{cluster}"] = self.cluster.as_dict() + body["cluster"] = self.cluster.as_dict() if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask return body def as_shallow_dict(self) -> dict: @@ -9362,63 +9362,63 @@ def as_dict(self) -> dict: """Serializes the UpdateClusterResource into a dictionary suitable for use as a JSON request body.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode.value + body["data_security_mode"] = self.data_security_mode.value if self.docker_image: - body["{docker_image}"] = self.docker_image.as_dict() + body["docker_image"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine.value + body["runtime_engine"] = self.runtime_engine.value if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type.as_dict() + body["workload_type"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -9568,7 +9568,7 @@ def as_dict(self) -> dict: """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -9595,7 +9595,7 @@ def as_dict(self) -> dict: """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" body = {} if self.clients: - body["{clients}"] = self.clients.as_dict() + body["clients"] = self.clients.as_dict() return body def as_shallow_dict(self) -> dict: @@ -9622,7 +9622,7 @@ def as_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/dashboards/v2/impl.py b/databricks/sdk/dashboards/v2/impl.py index 2e5720786..4be02c843 100755 --- a/databricks/sdk/dashboards/v2/impl.py +++ b/databricks/sdk/dashboards/v2/impl.py @@ -37,13 +37,13 @@ def as_dict(self) -> dict: """Serializes the BaseChunkInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body def as_shallow_dict(self) -> dict: @@ -78,7 +78,7 @@ def as_dict(self) -> dict: """Serializes the CancelQueryExecutionResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.status: - body["{status}"] = [v.as_dict() for v in self.status] + body["status"] = [v.as_dict() for v in self.status] return body def as_shallow_dict(self) -> dict: @@ -112,11 +112,11 @@ def as_dict(self) -> dict: """Serializes the CancelQueryExecutionResponseStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_token is not None: - body["{data_token}"] = self.data_token + body["data_token"] = self.data_token if self.pending: - body["{pending}"] = self.pending.as_dict() + body["pending"] = self.pending.as_dict() if self.success: - body["{success}"] = self.success.as_dict() + body["success"] = self.success.as_dict() return body def as_shallow_dict(self) -> dict: @@ -169,19 +169,19 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_name is not None: - body["{type_name}"] = self.type_name.value + body["type_name"] = self.type_name.value if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body def as_shallow_dict(self) -> dict: @@ -260,9 +260,9 @@ def as_dict(self) -> dict: """Serializes the CronSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.quartz_cron_expression is not None: - body["{quartz_cron_expression}"] = self.quartz_cron_expression + body["quartz_cron_expression"] = self.quartz_cron_expression if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body def as_shallow_dict(self) -> dict: @@ -327,25 +327,25 @@ def as_dict(self) -> dict: """Serializes the Dashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state.value + body["lifecycle_state"] = self.lifecycle_state.value if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.serialized_dashboard is not None: - body["{serialized_dashboard}"] = self.serialized_dashboard + body["serialized_dashboard"] = self.serialized_dashboard if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -473,11 +473,11 @@ def as_dict(self) -> dict: """Serializes the ExecutePublishedDashboardQueryRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_name is not None: - body["{dashboard_name}"] = self.dashboard_name + body["dashboard_name"] = self.dashboard_name if self.dashboard_revision_id is not None: - body["{dashboard_revision_id}"] = self.dashboard_revision_id + body["dashboard_revision_id"] = self.dashboard_revision_id if self.override_warehouse_id is not None: - body["{override_warehouse_id}"] = self.override_warehouse_id + body["override_warehouse_id"] = self.override_warehouse_id return body def as_shallow_dict(self) -> dict: @@ -560,23 +560,23 @@ def as_dict(self) -> dict: """Serializes the ExternalLink into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.expiration is not None: - body["{expiration}"] = self.expiration + body["expiration"] = self.expiration if self.external_link is not None: - body["{external_link}"] = self.external_link + body["external_link"] = self.external_link if self.http_headers: - body["{http_headers}"] = self.http_headers + body["http_headers"] = self.http_headers if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body def as_shallow_dict(self) -> dict: @@ -642,11 +642,11 @@ def as_dict(self) -> dict: """Serializes the GenieAttachment into a dictionary suitable for use as a JSON request body.""" body = {} if self.attachment_id is not None: - body["{attachment_id}"] = self.attachment_id + body["attachment_id"] = self.attachment_id if self.query: - body["{query}"] = self.query.as_dict() + body["query"] = self.query.as_dict() if self.text: - body["{text}"] = self.text.as_dict() + body["text"] = self.text.as_dict() return body def as_shallow_dict(self) -> dict: @@ -697,19 +697,19 @@ def as_dict(self) -> dict: """Serializes the GenieConversation into a dictionary suitable for use as a JSON request body.""" body = {} if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.created_timestamp is not None: - body["{created_timestamp}"] = self.created_timestamp + body["created_timestamp"] = self.created_timestamp if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -760,11 +760,11 @@ def as_dict(self) -> dict: """Serializes the GenieCreateConversationMessageRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id return body def as_shallow_dict(self) -> dict: @@ -803,11 +803,11 @@ def as_dict(self) -> dict: """Serializes the GenieGenerateDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.transient_statement_id is not None: - body["{transient_statement_id}"] = self.transient_statement_id + body["transient_statement_id"] = self.transient_statement_id return body def as_shallow_dict(self) -> dict: @@ -844,9 +844,9 @@ def as_dict(self) -> dict: """Serializes the GenieGetDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.statement_response: - body["{statement_response}"] = self.statement_response.as_dict() + body["statement_response"] = self.statement_response.as_dict() if self.transient_statement_id is not None: - body["{transient_statement_id}"] = self.transient_statement_id + body["transient_statement_id"] = self.transient_statement_id return body def as_shallow_dict(self) -> dict: @@ -877,7 +877,7 @@ def as_dict(self) -> dict: """Serializes the GenieGetMessageQueryResultResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.statement_response: - body["{statement_response}"] = self.statement_response.as_dict() + body["statement_response"] = self.statement_response.as_dict() return body def as_shallow_dict(self) -> dict: @@ -949,29 +949,29 @@ def as_dict(self) -> dict: """Serializes the GenieMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.attachments: - body["{attachments}"] = [v.as_dict() for v in self.attachments] + body["attachments"] = [v.as_dict() for v in self.attachments] if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.created_timestamp is not None: - body["{created_timestamp}"] = self.created_timestamp + body["created_timestamp"] = self.created_timestamp if self.error: - body["{error}"] = self.error.as_dict() + body["error"] = self.error.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.message_id is not None: - body["{message_id}"] = self.message_id + body["message_id"] = self.message_id if self.query_result: - body["{query_result}"] = self.query_result.as_dict() + body["query_result"] = self.query_result.as_dict() if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -1049,19 +1049,19 @@ def as_dict(self) -> dict: """Serializes the GenieQueryAttachment into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.query_result_metadata: - body["{query_result_metadata}"] = self.query_result_metadata.as_dict() + body["query_result_metadata"] = self.query_result_metadata.as_dict() if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title return body def as_shallow_dict(self) -> dict: @@ -1109,9 +1109,9 @@ def as_dict(self) -> dict: """Serializes the GenieResultMetadata into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_truncated is not None: - body["{is_truncated}"] = self.is_truncated + body["is_truncated"] = self.is_truncated if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count return body def as_shallow_dict(self) -> dict: @@ -1144,11 +1144,11 @@ def as_dict(self) -> dict: """Serializes the GenieSpace into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title return body def as_shallow_dict(self) -> dict: @@ -1182,9 +1182,9 @@ def as_dict(self) -> dict: """Serializes the GenieStartConversationMessageRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id return body def as_shallow_dict(self) -> dict: @@ -1218,13 +1218,13 @@ def as_dict(self) -> dict: """Serializes the GenieStartConversationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.conversation: - body["{conversation}"] = self.conversation.as_dict() + body["conversation"] = self.conversation.as_dict() if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.message: - body["{message}"] = self.message.as_dict() + body["message"] = self.message.as_dict() if self.message_id is not None: - body["{message_id}"] = self.message_id + body["message_id"] = self.message_id return body def as_shallow_dict(self) -> dict: @@ -1287,9 +1287,9 @@ def as_dict(self) -> dict: """Serializes the ListDashboardsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboards: - body["{dashboards}"] = [v.as_dict() for v in self.dashboards] + body["dashboards"] = [v.as_dict() for v in self.dashboards] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1321,9 +1321,9 @@ def as_dict(self) -> dict: """Serializes the ListSchedulesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.schedules: - body["{schedules}"] = [v.as_dict() for v in self.schedules] + body["schedules"] = [v.as_dict() for v in self.schedules] return body def as_shallow_dict(self) -> dict: @@ -1355,9 +1355,9 @@ def as_dict(self) -> dict: """Serializes the ListSubscriptionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.subscriptions: - body["{subscriptions}"] = [v.as_dict() for v in self.subscriptions] + body["subscriptions"] = [v.as_dict() for v in self.subscriptions] return body def as_shallow_dict(self) -> dict: @@ -1388,9 +1388,9 @@ def as_dict(self) -> dict: """Serializes the MessageError into a dictionary suitable for use as a JSON request body.""" body = {} if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -1505,13 +1505,13 @@ def as_dict(self) -> dict: """Serializes the MigrateDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.source_dashboard_id is not None: - body["{source_dashboard_id}"] = self.source_dashboard_id + body["source_dashboard_id"] = self.source_dashboard_id if self.update_parameter_syntax is not None: - body["{update_parameter_syntax}"] = self.update_parameter_syntax + body["update_parameter_syntax"] = self.update_parameter_syntax return body def as_shallow_dict(self) -> dict: @@ -1548,7 +1548,7 @@ def as_dict(self) -> dict: """Serializes the PendingStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_token is not None: - body["{data_token}"] = self.data_token + body["data_token"] = self.data_token return body def as_shallow_dict(self) -> dict: @@ -1572,7 +1572,7 @@ def as_dict(self) -> dict: """Serializes the PollQueryStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.data: - body["{data}"] = [v.as_dict() for v in self.data] + body["data"] = [v.as_dict() for v in self.data] return body def as_shallow_dict(self) -> dict: @@ -1596,7 +1596,7 @@ def as_dict(self) -> dict: """Serializes the PollQueryStatusResponseData into a dictionary suitable for use as a JSON request body.""" body = {} if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1628,11 +1628,11 @@ def as_dict(self) -> dict: """Serializes the PublishRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.embed_credentials is not None: - body["{embed_credentials}"] = self.embed_credentials + body["embed_credentials"] = self.embed_credentials if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -1674,13 +1674,13 @@ def as_dict(self) -> dict: """Serializes the PublishedDashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.embed_credentials is not None: - body["{embed_credentials}"] = self.embed_credentials + body["embed_credentials"] = self.embed_credentials if self.revision_create_time is not None: - body["{revision_create_time}"] = self.revision_create_time + body["revision_create_time"] = self.revision_create_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -1730,15 +1730,15 @@ def as_dict(self) -> dict: """Serializes the QueryResponseStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.canceled: - body["{canceled}"] = self.canceled.as_dict() + body["canceled"] = self.canceled.as_dict() if self.closed: - body["{closed}"] = self.closed.as_dict() + body["closed"] = self.closed.as_dict() if self.pending: - body["{pending}"] = self.pending.as_dict() + body["pending"] = self.pending.as_dict() if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.success: - body["{success}"] = self.success.as_dict() + body["success"] = self.success.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1784,11 +1784,11 @@ def as_dict(self) -> dict: """Serializes the Result into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_truncated is not None: - body["{is_truncated}"] = self.is_truncated + body["is_truncated"] = self.is_truncated if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id return body def as_shallow_dict(self) -> dict: @@ -1847,21 +1847,21 @@ def as_dict(self) -> dict: """Serializes the ResultData into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.data_array: - body["{data_array}"] = [v for v in self.data_array] + body["data_array"] = [v for v in self.data_array] if self.external_links: - body["{external_links}"] = [v.as_dict() for v in self.external_links] + body["external_links"] = [v.as_dict() for v in self.external_links] if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body def as_shallow_dict(self) -> dict: @@ -1929,19 +1929,19 @@ def as_dict(self) -> dict: """Serializes the ResultManifest into a dictionary suitable for use as a JSON request body.""" body = {} if self.chunks: - body["{chunks}"] = [v.as_dict() for v in self.chunks] + body["chunks"] = [v.as_dict() for v in self.chunks] if self.format is not None: - body["{format}"] = self.format.value + body["format"] = self.format.value if self.schema: - body["{schema}"] = self.schema.as_dict() + body["schema"] = self.schema.as_dict() if self.total_byte_count is not None: - body["{total_byte_count}"] = self.total_byte_count + body["total_byte_count"] = self.total_byte_count if self.total_chunk_count is not None: - body["{total_chunk_count}"] = self.total_chunk_count + body["total_chunk_count"] = self.total_chunk_count if self.total_row_count is not None: - body["{total_row_count}"] = self.total_row_count + body["total_row_count"] = self.total_row_count if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body def as_shallow_dict(self) -> dict: @@ -1989,9 +1989,9 @@ def as_dict(self) -> dict: """Serializes the ResultSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.column_count is not None: - body["{column_count}"] = self.column_count + body["column_count"] = self.column_count if self.columns: - body["{columns}"] = [v.as_dict() for v in self.columns] + body["columns"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: @@ -2044,23 +2044,23 @@ def as_dict(self) -> dict: """Serializes the Schedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.cron_schedule: - body["{cron_schedule}"] = self.cron_schedule.as_dict() + body["cron_schedule"] = self.cron_schedule.as_dict() if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.pause_status is not None: - body["{pause_status}"] = self.pause_status.value + body["pause_status"] = self.pause_status.value if self.schedule_id is not None: - body["{schedule_id}"] = self.schedule_id + body["schedule_id"] = self.schedule_id if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -2119,9 +2119,9 @@ def as_dict(self) -> dict: """Serializes the ServiceError into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_code is not None: - body["{error_code}"] = self.error_code.value + body["error_code"] = self.error_code.value if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body def as_shallow_dict(self) -> dict: @@ -2175,13 +2175,13 @@ def as_dict(self) -> dict: """Serializes the StatementResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.manifest: - body["{manifest}"] = self.manifest.as_dict() + body["manifest"] = self.manifest.as_dict() if self.result: - body["{result}"] = self.result.as_dict() + body["result"] = self.result.as_dict() if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2240,9 +2240,9 @@ def as_dict(self) -> dict: """Serializes the StatementStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.error: - body["{error}"] = self.error.as_dict() + body["error"] = self.error.as_dict() if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -2274,9 +2274,9 @@ def as_dict(self) -> dict: """Serializes the Subscriber into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_subscriber: - body["{destination_subscriber}"] = self.destination_subscriber.as_dict() + body["destination_subscriber"] = self.destination_subscriber.as_dict() if self.user_subscriber: - body["{user_subscriber}"] = self.user_subscriber.as_dict() + body["user_subscriber"] = self.user_subscriber.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2329,21 +2329,21 @@ def as_dict(self) -> dict: """Serializes the Subscription into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.created_by_user_id is not None: - body["{created_by_user_id}"] = self.created_by_user_id + body["created_by_user_id"] = self.created_by_user_id if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.schedule_id is not None: - body["{schedule_id}"] = self.schedule_id + body["schedule_id"] = self.schedule_id if self.subscriber: - body["{subscriber}"] = self.subscriber.as_dict() + body["subscriber"] = self.subscriber.as_dict() if self.subscription_id is not None: - body["{subscription_id}"] = self.subscription_id + body["subscription_id"] = self.subscription_id if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -2391,7 +2391,7 @@ def as_dict(self) -> dict: """Serializes the SubscriptionSubscriberDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_id is not None: - body["{destination_id}"] = self.destination_id + body["destination_id"] = self.destination_id return body def as_shallow_dict(self) -> dict: @@ -2416,7 +2416,7 @@ def as_dict(self) -> dict: """Serializes the SubscriptionSubscriberUser into a dictionary suitable for use as a JSON request body.""" body = {} if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -2445,9 +2445,9 @@ def as_dict(self) -> dict: """Serializes the SuccessStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_token is not None: - body["{data_token}"] = self.data_token + body["data_token"] = self.data_token if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body def as_shallow_dict(self) -> dict: @@ -2476,9 +2476,9 @@ def as_dict(self) -> dict: """Serializes the TextAttachment into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/files/v2/impl.py b/databricks/sdk/files/v2/impl.py index 2b9c71317..6630b7c4b 100755 --- a/databricks/sdk/files/v2/impl.py +++ b/databricks/sdk/files/v2/impl.py @@ -26,9 +26,9 @@ def as_dict(self) -> dict: """Serializes the AddBlock into a dictionary suitable for use as a JSON request body.""" body = {} if self.data is not None: - body["{data}"] = self.data + body["data"] = self.data if self.handle is not None: - body["{handle}"] = self.handle + body["handle"] = self.handle return body def as_shallow_dict(self) -> dict: @@ -73,7 +73,7 @@ def as_dict(self) -> dict: """Serializes the Close into a dictionary suitable for use as a JSON request body.""" body = {} if self.handle is not None: - body["{handle}"] = self.handle + body["handle"] = self.handle return body def as_shallow_dict(self) -> dict: @@ -119,9 +119,9 @@ def as_dict(self) -> dict: """Serializes the Create into a dictionary suitable for use as a JSON request body.""" body = {} if self.overwrite is not None: - body["{overwrite}"] = self.overwrite + body["overwrite"] = self.overwrite if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -167,7 +167,7 @@ def as_dict(self) -> dict: """Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.handle is not None: - body["{handle}"] = self.handle + body["handle"] = self.handle return body def as_shallow_dict(self) -> dict: @@ -196,9 +196,9 @@ def as_dict(self) -> dict: """Serializes the Delete into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.recursive is not None: - body["{recursive}"] = self.recursive + body["recursive"] = self.recursive return body def as_shallow_dict(self) -> dict: @@ -273,15 +273,15 @@ def as_dict(self) -> dict: """Serializes the DirectoryEntry into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_size is not None: - body["{file_size}"] = self.file_size + body["file_size"] = self.file_size if self.is_directory is not None: - body["{is_directory}"] = self.is_directory + body["is_directory"] = self.is_directory if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last_modified"] = self.last_modified if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -327,13 +327,13 @@ def as_dict(self) -> dict: """Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.content_length is not None: - body["{content_length}"] = self.content_length + body["content-length"] = self.content_length if self.content_type is not None: - body["{content_type}"] = self.content_type + body["content-type"] = self.content_type if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last-modified"] = self.last_modified return body def as_shallow_dict(self) -> dict: @@ -378,13 +378,13 @@ def as_dict(self) -> dict: """Serializes the FileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_size is not None: - body["{file_size}"] = self.file_size + body["file_size"] = self.file_size if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["is_dir"] = self.is_dir if self.modification_time is not None: - body["{modification_time}"] = self.modification_time + body["modification_time"] = self.modification_time if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -443,11 +443,11 @@ def as_dict(self) -> dict: """Serializes the GetMetadataResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.content_length is not None: - body["{content_length}"] = self.content_length + body["content-length"] = self.content_length if self.content_type is not None: - body["{content_type}"] = self.content_type + body["content-type"] = self.content_type if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last-modified"] = self.last_modified return body def as_shallow_dict(self) -> dict: @@ -483,9 +483,9 @@ def as_dict(self) -> dict: """Serializes the ListDirectoryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["{contents}"] = [v.as_dict() for v in self.contents] + body["contents"] = [v.as_dict() for v in self.contents] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -514,7 +514,7 @@ def as_dict(self) -> dict: """Serializes the ListStatusResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.files: - body["{files}"] = [v.as_dict() for v in self.files] + body["files"] = [v.as_dict() for v in self.files] return body def as_shallow_dict(self) -> dict: @@ -539,7 +539,7 @@ def as_dict(self) -> dict: """Serializes the MkDirs into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -585,9 +585,9 @@ def as_dict(self) -> dict: """Serializes the Move into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_path is not None: - body["{destination_path}"] = self.destination_path + body["destination_path"] = self.destination_path if self.source_path is not None: - body["{source_path}"] = self.source_path + body["source_path"] = self.source_path return body def as_shallow_dict(self) -> dict: @@ -638,11 +638,11 @@ def as_dict(self) -> dict: """Serializes the Put into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents is not None: - body["{contents}"] = self.contents + body["contents"] = self.contents if self.overwrite is not None: - body["{overwrite}"] = self.overwrite + body["overwrite"] = self.overwrite if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -693,9 +693,9 @@ def as_dict(self) -> dict: """Serializes the ReadResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.bytes_read is not None: - body["{bytes_read}"] = self.bytes_read + body["bytes_read"] = self.bytes_read if self.data is not None: - body["{data}"] = self.data + body["data"] = self.data return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/iam/v2/impl.py b/databricks/sdk/iam/v2/impl.py index 88dab201f..90d91b55c 100755 --- a/databricks/sdk/iam/v2/impl.py +++ b/databricks/sdk/iam/v2/impl.py @@ -33,13 +33,13 @@ def as_dict(self) -> dict: """Serializes the AccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -87,15 +87,15 @@ def as_dict(self) -> dict: """Serializes the AccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -136,7 +136,7 @@ def as_dict(self) -> dict: """Serializes the Actor into a dictionary suitable for use as a JSON request body.""" body = {} if self.actor_id is not None: - body["{actor_id}"] = self.actor_id + body["actor_id"] = self.actor_id return body def as_shallow_dict(self) -> dict: @@ -162,9 +162,9 @@ def as_dict(self) -> dict: """Serializes the CheckPolicyResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.consistency_token: - body["{consistency_token}"] = self.consistency_token.as_dict() + body["consistency_token"] = self.consistency_token.as_dict() if self.is_permitted is not None: - body["{is_permitted}"] = self.is_permitted + body["is_permitted"] = self.is_permitted return body def as_shallow_dict(self) -> dict: @@ -201,15 +201,15 @@ def as_dict(self) -> dict: """Serializes the ComplexValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.display is not None: - body["{display}"] = self.display + body["display"] = self.display if self.primary is not None: - body["{primary}"] = self.primary + body["primary"] = self.primary if self.ref is not None: - body["{ref}"] = self.ref + body["$ref"] = self.ref if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -247,7 +247,7 @@ def as_dict(self) -> dict: """Serializes the ConsistencyToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -307,7 +307,7 @@ def as_dict(self) -> dict: """Serializes the GetAssignableRolesForResourceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.roles: - body["{roles}"] = [v.as_dict() for v in self.roles] + body["roles"] = [v.as_dict() for v in self.roles] return body def as_shallow_dict(self) -> dict: @@ -332,7 +332,7 @@ def as_dict(self) -> dict: """Serializes the GetPasswordPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -357,7 +357,7 @@ def as_dict(self) -> dict: """Serializes the GetPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -391,9 +391,9 @@ def as_dict(self) -> dict: """Serializes the GrantRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.principals: - body["{principals}"] = [v for v in self.principals] + body["principals"] = [v for v in self.principals] if self.role is not None: - body["{role}"] = self.role + body["role"] = self.role return body def as_shallow_dict(self) -> dict: @@ -444,23 +444,23 @@ def as_dict(self) -> dict: """Serializes the Group into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["displayName"] = self.display_name if self.entitlements: - body["{entitlements}"] = [v.as_dict() for v in self.entitlements] + body["entitlements"] = [v.as_dict() for v in self.entitlements] if self.external_id is not None: - body["{external_id}"] = self.external_id + body["externalId"] = self.external_id if self.groups: - body["{groups}"] = [v.as_dict() for v in self.groups] + body["groups"] = [v.as_dict() for v in self.groups] if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.members: - body["{members}"] = [v.as_dict() for v in self.members] + body["members"] = [v.as_dict() for v in self.members] if self.meta: - body["{meta}"] = self.meta.as_dict() + body["meta"] = self.meta.as_dict() if self.roles: - body["{roles}"] = [v.as_dict() for v in self.roles] + body["roles"] = [v.as_dict() for v in self.roles] if self.schemas: - body["{schemas}"] = [v.value for v in self.schemas] + body["schemas"] = [v.value for v in self.schemas] return body def as_shallow_dict(self) -> dict: @@ -528,15 +528,15 @@ def as_dict(self) -> dict: """Serializes the ListGroupsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items_per_page is not None: - body["{items_per_page}"] = self.items_per_page + body["itemsPerPage"] = self.items_per_page if self.resources: - body["{resources}"] = [v.as_dict() for v in self.resources] + body["Resources"] = [v.as_dict() for v in self.resources] if self.schemas: - body["{schemas}"] = [v.value for v in self.schemas] + body["schemas"] = [v.value for v in self.schemas] if self.start_index is not None: - body["{start_index}"] = self.start_index + body["startIndex"] = self.start_index if self.total_results is not None: - body["{total_results}"] = self.total_results + body["totalResults"] = self.total_results return body def as_shallow_dict(self) -> dict: @@ -592,15 +592,15 @@ def as_dict(self) -> dict: """Serializes the ListServicePrincipalResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items_per_page is not None: - body["{items_per_page}"] = self.items_per_page + body["itemsPerPage"] = self.items_per_page if self.resources: - body["{resources}"] = [v.as_dict() for v in self.resources] + body["Resources"] = [v.as_dict() for v in self.resources] if self.schemas: - body["{schemas}"] = [v.value for v in self.schemas] + body["schemas"] = [v.value for v in self.schemas] if self.start_index is not None: - body["{start_index}"] = self.start_index + body["startIndex"] = self.start_index if self.total_results is not None: - body["{total_results}"] = self.total_results + body["totalResults"] = self.total_results return body def as_shallow_dict(self) -> dict: @@ -657,15 +657,15 @@ def as_dict(self) -> dict: """Serializes the ListUsersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items_per_page is not None: - body["{items_per_page}"] = self.items_per_page + body["itemsPerPage"] = self.items_per_page if self.resources: - body["{resources}"] = [v.as_dict() for v in self.resources] + body["Resources"] = [v.as_dict() for v in self.resources] if self.schemas: - body["{schemas}"] = [v.value for v in self.schemas] + body["schemas"] = [v.value for v in self.schemas] if self.start_index is not None: - body["{start_index}"] = self.start_index + body["startIndex"] = self.start_index if self.total_results is not None: - body["{total_results}"] = self.total_results + body["totalResults"] = self.total_results return body def as_shallow_dict(self) -> dict: @@ -713,13 +713,13 @@ def as_dict(self) -> dict: """Serializes the MigratePermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.from_workspace_group_name is not None: - body["{from_workspace_group_name}"] = self.from_workspace_group_name + body["from_workspace_group_name"] = self.from_workspace_group_name if self.size is not None: - body["{size}"] = self.size + body["size"] = self.size if self.to_account_group_name is not None: - body["{to_account_group_name}"] = self.to_account_group_name + body["to_account_group_name"] = self.to_account_group_name if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -755,7 +755,7 @@ def as_dict(self) -> dict: """Serializes the MigratePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permissions_migrated is not None: - body["{permissions_migrated}"] = self.permissions_migrated + body["permissions_migrated"] = self.permissions_migrated return body def as_shallow_dict(self) -> dict: @@ -783,9 +783,9 @@ def as_dict(self) -> dict: """Serializes the Name into a dictionary suitable for use as a JSON request body.""" body = {} if self.family_name is not None: - body["{family_name}"] = self.family_name + body["familyName"] = self.family_name if self.given_name is not None: - body["{given_name}"] = self.given_name + body["givenName"] = self.given_name return body def as_shallow_dict(self) -> dict: @@ -815,11 +815,11 @@ def as_dict(self) -> dict: """Serializes the ObjectPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -857,11 +857,11 @@ def as_dict(self) -> dict: """Serializes the PartialUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.operations: - body["{operations}"] = [v.as_dict() for v in self.operations] + body["Operations"] = [v.as_dict() for v in self.operations] if self.schemas: - body["{schemas}"] = [v.value for v in self.schemas] + body["schemas"] = [v.value for v in self.schemas] return body def as_shallow_dict(self) -> dict: @@ -903,13 +903,13 @@ def as_dict(self) -> dict: """Serializes the PasswordAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -957,15 +957,15 @@ def as_dict(self) -> dict: """Serializes the PasswordAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -1008,11 +1008,11 @@ def as_dict(self) -> dict: """Serializes the PasswordPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1054,11 +1054,11 @@ def as_dict(self) -> dict: """Serializes the PasswordPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -1093,9 +1093,9 @@ def as_dict(self) -> dict: """Serializes the PasswordPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1124,7 +1124,7 @@ def as_dict(self) -> dict: """Serializes the PasswordPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] return body def as_shallow_dict(self) -> dict: @@ -1155,11 +1155,11 @@ def as_dict(self) -> dict: """Serializes the Patch into a dictionary suitable for use as a JSON request body.""" body = {} if self.op is not None: - body["{op}"] = self.op.value + body["op"] = self.op.value if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.value: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -1223,11 +1223,11 @@ def as_dict(self) -> dict: """Serializes the Permission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1269,11 +1269,11 @@ def as_dict(self) -> dict: """Serializes the PermissionAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.permissions: - body["{permissions}"] = [v.value for v in self.permissions] + body["permissions"] = [v.value for v in self.permissions] if self.principal: - body["{principal}"] = self.principal.as_dict() + body["principal"] = self.principal.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1306,7 +1306,7 @@ def as_dict(self) -> dict: """Serializes the PermissionAssignments into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_assignments: - body["{permission_assignments}"] = [v.as_dict() for v in self.permission_assignments] + body["permission_assignments"] = [v.as_dict() for v in self.permission_assignments] return body def as_shallow_dict(self) -> dict: @@ -1355,9 +1355,9 @@ def as_dict(self) -> dict: """Serializes the PermissionOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1389,9 +1389,9 @@ def as_dict(self) -> dict: """Serializes the PermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1427,11 +1427,11 @@ def as_dict(self) -> dict: """Serializes the PermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.request_object_id is not None: - body["{request_object_id}"] = self.request_object_id + body["request_object_id"] = self.request_object_id if self.request_object_type is not None: - body["{request_object_type}"] = self.request_object_type + body["request_object_type"] = self.request_object_type return body def as_shallow_dict(self) -> dict: @@ -1478,15 +1478,15 @@ def as_dict(self) -> dict: """Serializes the PrincipalOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.principal_id is not None: - body["{principal_id}"] = self.principal_id + body["principal_id"] = self.principal_id if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -1539,11 +1539,11 @@ def as_dict(self) -> dict: """Serializes the ResourceInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.legacy_acl_path is not None: - body["{legacy_acl_path}"] = self.legacy_acl_path + body["legacy_acl_path"] = self.legacy_acl_path if self.parent_resource_info: - body["{parent_resource_info}"] = self.parent_resource_info.as_dict() + body["parent_resource_info"] = self.parent_resource_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1577,7 +1577,7 @@ def as_dict(self) -> dict: """Serializes the ResourceMeta into a dictionary suitable for use as a JSON request body.""" body = {} if self.resource_type is not None: - body["{resource_type}"] = self.resource_type + body["resourceType"] = self.resource_type return body def as_shallow_dict(self) -> dict: @@ -1602,7 +1602,7 @@ def as_dict(self) -> dict: """Serializes the Role into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -1632,11 +1632,11 @@ def as_dict(self) -> dict: """Serializes the RuleSetResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.grant_rules: - body["{grant_rules}"] = [v.as_dict() for v in self.grant_rules] + body["grant_rules"] = [v.as_dict() for v in self.grant_rules] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -1675,11 +1675,11 @@ def as_dict(self) -> dict: """Serializes the RuleSetUpdateRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.grant_rules: - body["{grant_rules}"] = [v.as_dict() for v in self.grant_rules] + body["grant_rules"] = [v.as_dict() for v in self.grant_rules] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -1737,23 +1737,23 @@ def as_dict(self) -> dict: """Serializes the ServicePrincipal into a dictionary suitable for use as a JSON request body.""" body = {} if self.active is not None: - body["{active}"] = self.active + body["active"] = self.active if self.application_id is not None: - body["{application_id}"] = self.application_id + body["applicationId"] = self.application_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["displayName"] = self.display_name if self.entitlements: - body["{entitlements}"] = [v.as_dict() for v in self.entitlements] + body["entitlements"] = [v.as_dict() for v in self.entitlements] if self.external_id is not None: - body["{external_id}"] = self.external_id + body["externalId"] = self.external_id if self.groups: - body["{groups}"] = [v.as_dict() for v in self.groups] + body["groups"] = [v.as_dict() for v in self.groups] if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.roles: - body["{roles}"] = [v.as_dict() for v in self.roles] + body["roles"] = [v.as_dict() for v in self.roles] if self.schemas: - body["{schemas}"] = [v.value for v in self.schemas] + body["schemas"] = [v.value for v in self.schemas] return body def as_shallow_dict(self) -> dict: @@ -1829,9 +1829,9 @@ def as_dict(self) -> dict: """Serializes the UpdateRuleSetRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rule_set: - body["{rule_set}"] = self.rule_set.as_dict() + body["rule_set"] = self.rule_set.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1868,11 +1868,11 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceAssignments into a dictionary suitable for use as a JSON request body.""" body = {} if self.permissions: - body["{permissions}"] = [v.value for v in self.permissions] + body["permissions"] = [v.value for v in self.permissions] if self.principal_id is not None: - body["{principal_id}"] = self.principal_id + body["principal_id"] = self.principal_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -1940,27 +1940,27 @@ def as_dict(self) -> dict: """Serializes the User into a dictionary suitable for use as a JSON request body.""" body = {} if self.active is not None: - body["{active}"] = self.active + body["active"] = self.active if self.display_name is not None: - body["{display_name}"] = self.display_name + body["displayName"] = self.display_name if self.emails: - body["{emails}"] = [v.as_dict() for v in self.emails] + body["emails"] = [v.as_dict() for v in self.emails] if self.entitlements: - body["{entitlements}"] = [v.as_dict() for v in self.entitlements] + body["entitlements"] = [v.as_dict() for v in self.entitlements] if self.external_id is not None: - body["{external_id}"] = self.external_id + body["externalId"] = self.external_id if self.groups: - body["{groups}"] = [v.as_dict() for v in self.groups] + body["groups"] = [v.as_dict() for v in self.groups] if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name: - body["{name}"] = self.name.as_dict() + body["name"] = self.name.as_dict() if self.roles: - body["{roles}"] = [v.as_dict() for v in self.roles] + body["roles"] = [v.as_dict() for v in self.roles] if self.schemas: - body["{schemas}"] = [v.value for v in self.schemas] + body["schemas"] = [v.value for v in self.schemas] if self.user_name is not None: - body["{user_name}"] = self.user_name + body["userName"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -2032,7 +2032,7 @@ def as_dict(self) -> dict: """Serializes the WorkspacePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.permissions: - body["{permissions}"] = [v.as_dict() for v in self.permissions] + body["permissions"] = [v.as_dict() for v in self.permissions] return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/jobs/v2/impl.py b/databricks/sdk/jobs/v2/impl.py index 4c91e76c6..2075b8736 100755 --- a/databricks/sdk/jobs/v2/impl.py +++ b/databricks/sdk/jobs/v2/impl.py @@ -15,297 +15,6 @@ # all definitions in this file are in alphabetical order -@dataclass -class Adlsgen2Info: - """A storage location in Adls Gen2""" - - destination: str - """abfss destination, e.g. - `abfss://@.dfs.core.windows.net/`.""" - - def as_dict(self) -> dict: - """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: - """Deserializes the Adlsgen2Info from a dictionary.""" - return cls(destination=d.get("{destination}", None)) - - -@dataclass -class AutoScale: - max_workers: Optional[int] = None - """The maximum number of workers to which the cluster can scale up when overloaded. Note that - `max_workers` must be strictly greater than `min_workers`.""" - - min_workers: Optional[int] = None - """The minimum number of workers to which the cluster can scale down when underutilized. It is also - the initial number of workers the cluster will have after creation.""" - - def as_dict(self) -> dict: - """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.max_workers is not None: - body["{max_workers}"] = self.max_workers - if self.min_workers is not None: - body["{min_workers}"] = self.min_workers - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" - body = {} - if self.max_workers is not None: - body["{max_workers}"] = self.max_workers - if self.min_workers is not None: - body["{min_workers}"] = self.min_workers - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AutoScale: - """Deserializes the AutoScale from a dictionary.""" - return cls(max_workers=d.get("{max_workers}", None), min_workers=d.get("{min_workers}", None)) - - -@dataclass -class AwsAttributes: - """Attributes set during cluster creation which are related to Amazon Web Services.""" - - availability: Optional[AwsAvailability] = None - """Availability type used for all subsequent nodes past the `first_on_demand` ones. - - Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - ebs_volume_count: Optional[int] = None - """The number of volumes launched for each instance. Users can choose up to 10 volumes. This - feature is only enabled for supported node types. Legacy node types cannot specify custom EBS - volumes. For node types with no instance store, at least one EBS volume needs to be specified; - otherwise, cluster creation will fail. - - These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. Instance store volumes will be - mounted at `/local_disk0`, `/local_disk1`, and etc. - - If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for - scratch storage because heterogenously sized scratch devices can lead to inefficient disk - utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance - store volumes. - - Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` - will be overridden.""" - - ebs_volume_iops: Optional[int] = None - """If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance - of a gp2 volume with the same volume size will be used.""" - - ebs_volume_size: Optional[int] = None - """The size of each EBS volume (in GiB) launched for each instance. For general purpose SSD, this - value must be within the range 100 - 4096. For throughput optimized HDD, this value must be - within the range 500 - 4096.""" - - ebs_volume_throughput: Optional[int] = None - """If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum - performance of a gp2 volume with the same volume size will be used.""" - - ebs_volume_type: Optional[EbsVolumeType] = None - """The type of EBS volumes that will be launched with this cluster.""" - - first_on_demand: Optional[int] = None - """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. If this - value is greater than 0, the cluster driver node in particular will be placed on an on-demand - instance. If this value is greater than or equal to the current cluster size, all nodes will be - placed on on-demand instances. If this value is less than the current cluster size, - `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed - on `availability` instances. Note that this value does not affect cluster size and cannot - currently be mutated over the lifetime of a cluster.""" - - instance_profile_arn: Optional[str] = None - """Nodes for this cluster will only be placed on AWS instances with this instance profile. If - ommitted, nodes will be placed on instances without an IAM instance profile. The instance - profile must have previously been added to the Databricks environment by an account - administrator. - - This feature may only be available to certain customer plans.""" - - spot_bid_price_percent: Optional[int] = None - """The bid price for AWS spot instances, as a percentage of the corresponding instance type's - on-demand price. For example, if this field is set to 50, and the cluster needs a new - `r3.xlarge` spot instance, then the bid price is half of the price of on-demand `r3.xlarge` - instances. Similarly, if this field is set to 200, the bid price is twice the price of on-demand - `r3.xlarge` instances. If not specified, the default value is 100. When spot instances are - requested for this cluster, only spot instances whose bid price percentage matches this field - will be considered. Note that, for safety, we enforce this field to be no more than 10000.""" - - zone_id: Optional[str] = None - """Identifier for the availability zone/datacenter in which the cluster resides. This string will - be of a form like "us-west-2a". The provided availability zone must be in the same region as the - Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks - deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and - if not specified, a default zone will be used. If the zone specified is "auto", will try to - place cluster in a zone with high availability, and will retry placement in a different AZ if - there is not enough capacity. - - The list of available zones as well as the default value can be found by using the `List Zones` - method.""" - - def as_dict(self) -> dict: - """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.availability is not None: - body["{availability}"] = self.availability.value - if self.ebs_volume_count is not None: - body["{ebs_volume_count}"] = self.ebs_volume_count - if self.ebs_volume_iops is not None: - body["{ebs_volume_iops}"] = self.ebs_volume_iops - if self.ebs_volume_size is not None: - body["{ebs_volume_size}"] = self.ebs_volume_size - if self.ebs_volume_throughput is not None: - body["{ebs_volume_throughput}"] = self.ebs_volume_throughput - if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type.value - if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand - if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn - if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent - if self.zone_id is not None: - body["{zone_id}"] = self.zone_id - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.availability is not None: - body["{availability}"] = self.availability - if self.ebs_volume_count is not None: - body["{ebs_volume_count}"] = self.ebs_volume_count - if self.ebs_volume_iops is not None: - body["{ebs_volume_iops}"] = self.ebs_volume_iops - if self.ebs_volume_size is not None: - body["{ebs_volume_size}"] = self.ebs_volume_size - if self.ebs_volume_throughput is not None: - body["{ebs_volume_throughput}"] = self.ebs_volume_throughput - if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type - if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand - if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn - if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent - if self.zone_id is not None: - body["{zone_id}"] = self.zone_id - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: - """Deserializes the AwsAttributes from a dictionary.""" - return cls( - availability=_enum(d, "{availability}", AwsAvailability), - ebs_volume_count=d.get("{ebs_volume_count}", None), - ebs_volume_iops=d.get("{ebs_volume_iops}", None), - ebs_volume_size=d.get("{ebs_volume_size}", None), - ebs_volume_throughput=d.get("{ebs_volume_throughput}", None), - ebs_volume_type=_enum(d, "{ebs_volume_type}", EbsVolumeType), - first_on_demand=d.get("{first_on_demand}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), - zone_id=d.get("{zone_id}", None), - ) - - -class AwsAvailability(Enum): - """Availability type used for all subsequent nodes past the `first_on_demand` ones. - - Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - ON_DEMAND = "ON_DEMAND" - SPOT = "SPOT" - SPOT_WITH_FALLBACK = "SPOT_WITH_FALLBACK" - - -@dataclass -class AzureAttributes: - """Attributes set during cluster creation which are related to Microsoft Azure.""" - - availability: Optional[AzureAvailability] = None - """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If - `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - first_on_demand: Optional[int] = None - """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This - value should be greater than 0, to make sure the cluster driver node is placed on an on-demand - instance. If this value is greater than or equal to the current cluster size, all nodes will be - placed on on-demand instances. If this value is less than the current cluster size, - `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed - on `availability` instances. Note that this value does not affect cluster size and cannot - currently be mutated over the lifetime of a cluster.""" - - log_analytics_info: Optional[LogAnalyticsInfo] = None - """Defines values necessary to configure and run Azure Log Analytics agent""" - - spot_bid_max_price: Optional[float] = None - """The max bid price to be used for Azure spot instances. The Max price for the bid cannot be - higher than the on-demand price of the instance. If not specified, the default value is -1, - which specifies that the instance cannot be evicted on the basis of price, and only on the basis - of availability. Further, the value should > 0 or -1.""" - - def as_dict(self) -> dict: - """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.availability is not None: - body["{availability}"] = self.availability.value - if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand - if self.log_analytics_info: - body["{log_analytics_info}"] = self.log_analytics_info.as_dict() - if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.availability is not None: - body["{availability}"] = self.availability - if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand - if self.log_analytics_info: - body["{log_analytics_info}"] = self.log_analytics_info - if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: - """Deserializes the AzureAttributes from a dictionary.""" - return cls( - availability=_enum(d, "{availability}", AzureAvailability), - first_on_demand=d.get("{first_on_demand}", None), - log_analytics_info=_from_dict(d, "{log_analytics_info}", LogAnalyticsInfo), - spot_bid_max_price=d.get("{spot_bid_max_price}", None), - ) - - -class AzureAvailability(Enum): - """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If - `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - ON_DEMAND_AZURE = "ON_DEMAND_AZURE" - SPOT_AZURE = "SPOT_AZURE" - SPOT_WITH_FALLBACK_AZURE = "SPOT_WITH_FALLBACK_AZURE" - - @dataclass class BaseJob: created_time: Optional[int] = None @@ -337,17 +46,17 @@ def as_dict(self) -> dict: """Serializes the BaseJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_time is not None: - body["{created_time}"] = self.created_time + body["created_time"] = self.created_time if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.settings: - body["{settings}"] = self.settings.as_dict() + body["settings"] = self.settings.as_dict() return body def as_shallow_dict(self) -> dict: @@ -538,71 +247,71 @@ def as_dict(self) -> dict: """Serializes the BaseRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.attempt_number is not None: - body["{attempt_number}"] = self.attempt_number + body["attempt_number"] = self.attempt_number if self.cleanup_duration is not None: - body["{cleanup_duration}"] = self.cleanup_duration + body["cleanup_duration"] = self.cleanup_duration if self.cluster_instance: - body["{cluster_instance}"] = self.cluster_instance.as_dict() + body["cluster_instance"] = self.cluster_instance.as_dict() if self.cluster_spec: - body["{cluster_spec}"] = self.cluster_spec.as_dict() + body["cluster_spec"] = self.cluster_spec.as_dict() if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.effective_performance_target is not None: - body["{effective_performance_target}"] = self.effective_performance_target.value + body["effective_performance_target"] = self.effective_performance_target.value if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.execution_duration is not None: - body["{execution_duration}"] = self.execution_duration + body["execution_duration"] = self.execution_duration if self.git_source: - body["{git_source}"] = self.git_source.as_dict() + body["git_source"] = self.git_source.as_dict() if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.job_clusters: - body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] + body["job_clusters"] = [v.as_dict() for v in self.job_clusters] if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = [v.as_dict() for v in self.job_parameters] + body["job_parameters"] = [v.as_dict() for v in self.job_parameters] if self.job_run_id is not None: - body["{job_run_id}"] = self.job_run_id + body["job_run_id"] = self.job_run_id if self.number_in_job is not None: - body["{number_in_job}"] = self.number_in_job + body["number_in_job"] = self.number_in_job if self.original_attempt_run_id is not None: - body["{original_attempt_run_id}"] = self.original_attempt_run_id + body["original_attempt_run_id"] = self.original_attempt_run_id if self.overriding_parameters: - body["{overriding_parameters}"] = self.overriding_parameters.as_dict() + body["overriding_parameters"] = self.overriding_parameters.as_dict() if self.queue_duration is not None: - body["{queue_duration}"] = self.queue_duration + body["queue_duration"] = self.queue_duration if self.repair_history: - body["{repair_history}"] = [v.as_dict() for v in self.repair_history] + body["repair_history"] = [v.as_dict() for v in self.repair_history] if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_page_url is not None: - body["{run_page_url}"] = self.run_page_url + body["run_page_url"] = self.run_page_url if self.run_type is not None: - body["{run_type}"] = self.run_type.value + body["run_type"] = self.run_type.value if self.schedule: - body["{schedule}"] = self.schedule.as_dict() + body["schedule"] = self.schedule.as_dict() if self.setup_duration is not None: - body["{setup_duration}"] = self.setup_duration + body["setup_duration"] = self.setup_duration if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() if self.tasks: - body["{tasks}"] = [v.as_dict() for v in self.tasks] + body["tasks"] = [v.as_dict() for v in self.tasks] if self.trigger is not None: - body["{trigger}"] = self.trigger.value + body["trigger"] = self.trigger.value if self.trigger_info: - body["{trigger_info}"] = self.trigger_info.as_dict() + body["trigger_info"] = self.trigger_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -729,9 +438,9 @@ def as_dict(self) -> dict: """Serializes the CancelAllRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_queued_runs is not None: - body["{all_queued_runs}"] = self.all_queued_runs + body["all_queued_runs"] = self.all_queued_runs if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body def as_shallow_dict(self) -> dict: @@ -776,7 +485,7 @@ def as_dict(self) -> dict: """Serializes the CancelRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -860,9 +569,9 @@ def as_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a dictionary suitable for use as a JSON request body.""" body = {} if self.life_cycle_state is not None: - body["{life_cycle_state}"] = self.life_cycle_state.value + body["life_cycle_state"] = self.life_cycle_state.value if self.result_state is not None: - body["{result_state}"] = self.result_state.value + body["result_state"] = self.result_state.value return body def as_shallow_dict(self) -> dict: @@ -902,13 +611,13 @@ def as_dict(self) -> dict: """Serializes the CleanRoomsNotebookTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_room_name is not None: - body["{clean_room_name}"] = self.clean_room_name + body["clean_room_name"] = self.clean_room_name if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.notebook_base_parameters: - body["{notebook_base_parameters}"] = self.notebook_base_parameters + body["notebook_base_parameters"] = self.notebook_base_parameters if self.notebook_name is not None: - body["{notebook_name}"] = self.notebook_name + body["notebook_name"] = self.notebook_name return body def as_shallow_dict(self) -> dict: @@ -950,11 +659,11 @@ def as_dict(self) -> dict: """Serializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_room_job_run_state: - body["{clean_room_job_run_state}"] = self.clean_room_job_run_state.as_dict() + body["clean_room_job_run_state"] = self.clean_room_job_run_state.as_dict() if self.notebook_output: - body["{notebook_output}"] = self.notebook_output.as_dict() + body["notebook_output"] = self.notebook_output.as_dict() if self.output_schema_info: - body["{output_schema_info}"] = self.output_schema_info.as_dict() + body["output_schema_info"] = self.output_schema_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -978,38 +687,6 @@ def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTaskCleanRoomsNoteboo ) -@dataclass -class ClientsTypes: - jobs: Optional[bool] = None - """With jobs set, the cluster can be used for jobs""" - - notebooks: Optional[bool] = None - """With notebooks set, this cluster can be used for notebooks""" - - def as_dict(self) -> dict: - """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.jobs is not None: - body["{jobs}"] = self.jobs - if self.notebooks is not None: - body["{notebooks}"] = self.notebooks - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.jobs is not None: - body["{jobs}"] = self.jobs - if self.notebooks is not None: - body["{notebooks}"] = self.notebooks - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: - """Deserializes the ClientsTypes from a dictionary.""" - return cls(jobs=d.get("{jobs}", None), notebooks=d.get("{notebooks}", None)) - - @dataclass class ClusterInstance: cluster_id: Optional[str] = None @@ -1033,9 +710,9 @@ def as_dict(self) -> dict: """Serializes the ClusterInstance into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.spark_context_id is not None: - body["{spark_context_id}"] = self.spark_context_id + body["spark_context_id"] = self.spark_context_id return body def as_shallow_dict(self) -> dict: @@ -1053,56 +730,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterInstance: return cls(cluster_id=d.get("{cluster_id}", None), spark_context_id=d.get("{spark_context_id}", None)) -@dataclass -class ClusterLogConf: - """Cluster log delivery config""" - - dbfs: Optional[DbfsStorageInfo] = None - """destination needs to be provided. e.g. `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } - }`""" - - s3: Optional[S3StorageInfo] = None - """destination and either the region or endpoint need to be provided. e.g. `{ "s3": { "destination" - : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` Cluster iam role is used to - access s3, please make sure the cluster iam role in `instance_profile_arn` has permission to - write data to the s3 destination.""" - - volumes: Optional[VolumesStorageInfo] = None - """destination needs to be provided, e.g. `{ "volumes": { "destination": - "/Volumes/catalog/schema/volume/cluster_log" } }`""" - - def as_dict(self) -> dict: - """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.dbfs: - body["{dbfs}"] = self.dbfs.as_dict() - if self.s3: - body["{s3}"] = self.s3.as_dict() - if self.volumes: - body["{volumes}"] = self.volumes.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" - body = {} - if self.dbfs: - body["{dbfs}"] = self.dbfs - if self.s3: - body["{s3}"] = self.s3 - if self.volumes: - body["{volumes}"] = self.volumes - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: - """Deserializes the ClusterLogConf from a dictionary.""" - return cls( - dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), - s3=_from_dict(d, "{s3}", S3StorageInfo), - volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), - ) - - @dataclass class ClusterSpec: existing_cluster_id: Optional[str] = None @@ -1125,13 +752,13 @@ def as_dict(self) -> dict: """Serializes the ClusterSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.new_cluster: - body["{new_cluster}"] = self.new_cluster.as_dict() + body["new_cluster"] = self.new_cluster.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1175,11 +802,11 @@ def as_dict(self) -> dict: """Serializes the ComputeConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.gpu_node_pool_id is not None: - body["{gpu_node_pool_id}"] = self.gpu_node_pool_id + body["gpu_node_pool_id"] = self.gpu_node_pool_id if self.gpu_type is not None: - body["{gpu_type}"] = self.gpu_type + body["gpu_type"] = self.gpu_type if self.num_gpus is not None: - body["{num_gpus}"] = self.num_gpus + body["num_gpus"] = self.num_gpus return body def as_shallow_dict(self) -> dict: @@ -1234,11 +861,11 @@ def as_dict(self) -> dict: """Serializes the ConditionTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.left is not None: - body["{left}"] = self.left + body["left"] = self.left if self.op is not None: - body["{op}"] = self.op.value + body["op"] = self.op.value if self.right is not None: - body["{right}"] = self.right + body["right"] = self.right return body def as_shallow_dict(self) -> dict: @@ -1286,7 +913,7 @@ def as_dict(self) -> dict: """Serializes the Continuous into a dictionary suitable for use as a JSON request body.""" body = {} if self.pause_status is not None: - body["{pause_status}"] = self.pause_status.value + body["pause_status"] = self.pause_status.value return body def as_shallow_dict(self) -> dict: @@ -1424,55 +1051,55 @@ def as_dict(self) -> dict: """Serializes the CreateJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.continuous: - body["{continuous}"] = self.continuous.as_dict() + body["continuous"] = self.continuous.as_dict() if self.deployment: - body["{deployment}"] = self.deployment.as_dict() + body["deployment"] = self.deployment.as_dict() if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.edit_mode is not None: - body["{edit_mode}"] = self.edit_mode.value + body["edit_mode"] = self.edit_mode.value if self.email_notifications: - body["{email_notifications}"] = self.email_notifications.as_dict() + body["email_notifications"] = self.email_notifications.as_dict() if self.environments: - body["{environments}"] = [v.as_dict() for v in self.environments] + body["environments"] = [v.as_dict() for v in self.environments] if self.format is not None: - body["{format}"] = self.format.value + body["format"] = self.format.value if self.git_source: - body["{git_source}"] = self.git_source.as_dict() + body["git_source"] = self.git_source.as_dict() if self.health: - body["{health}"] = self.health.as_dict() + body["health"] = self.health.as_dict() if self.job_clusters: - body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] + body["job_clusters"] = [v.as_dict() for v in self.job_clusters] if self.max_concurrent_runs is not None: - body["{max_concurrent_runs}"] = self.max_concurrent_runs + body["max_concurrent_runs"] = self.max_concurrent_runs if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notification_settings: - body["{notification_settings}"] = self.notification_settings.as_dict() + body["notification_settings"] = self.notification_settings.as_dict() if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.performance_target is not None: - body["{performance_target}"] = self.performance_target.value + body["performance_target"] = self.performance_target.value if self.queue: - body["{queue}"] = self.queue.as_dict() + body["queue"] = self.queue.as_dict() if self.run_as: - body["{run_as}"] = self.run_as.as_dict() + body["run_as"] = self.run_as.as_dict() if self.schedule: - body["{schedule}"] = self.schedule.as_dict() + body["schedule"] = self.schedule.as_dict() if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.tasks: - body["{tasks}"] = [v.as_dict() for v in self.tasks] + body["tasks"] = [v.as_dict() for v in self.tasks] if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.trigger: - body["{trigger}"] = self.trigger.as_dict() + body["trigger"] = self.trigger.as_dict() if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications.as_dict() + body["webhook_notifications"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1573,7 +1200,7 @@ def as_dict(self) -> dict: """Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body def as_shallow_dict(self) -> dict: @@ -1610,11 +1237,11 @@ def as_dict(self) -> dict: """Serializes the CronSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.pause_status is not None: - body["{pause_status}"] = self.pause_status.value + body["pause_status"] = self.pause_status.value if self.quartz_cron_expression is not None: - body["{quartz_cron_expression}"] = self.quartz_cron_expression + body["quartz_cron_expression"] = self.quartz_cron_expression if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body def as_shallow_dict(self) -> dict: @@ -1638,71 +1265,6 @@ def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: ) -class DataSecurityMode(Enum): - """Data security mode decides what data governance model to use when accessing data from a cluster. - - The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: - Databricks will choose the most appropriate access mode depending on your compute configuration. - * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: - Alias for `SINGLE_USER`. - - The following modes can be used regardless of `kind`. * `NONE`: No security isolation for - multiple users sharing the cluster. Data governance features are not available in this mode. * - `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in - `single_user_name`. Most programming languages, cluster features and data governance features - are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple - users. Cluster users are fully isolated so that they cannot see each other's data and - credentials. Most data governance features are supported in this mode. But programming languages - and cluster features might be limited. - - The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for - future Databricks Runtime versions: - - * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * - `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high - concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that - doesn’t have UC nor passthrough enabled.""" - - DATA_SECURITY_MODE_AUTO = "DATA_SECURITY_MODE_AUTO" - DATA_SECURITY_MODE_DEDICATED = "DATA_SECURITY_MODE_DEDICATED" - DATA_SECURITY_MODE_STANDARD = "DATA_SECURITY_MODE_STANDARD" - LEGACY_PASSTHROUGH = "LEGACY_PASSTHROUGH" - LEGACY_SINGLE_USER = "LEGACY_SINGLE_USER" - LEGACY_SINGLE_USER_STANDARD = "LEGACY_SINGLE_USER_STANDARD" - LEGACY_TABLE_ACL = "LEGACY_TABLE_ACL" - NONE = "NONE" - SINGLE_USER = "SINGLE_USER" - USER_ISOLATION = "USER_ISOLATION" - - -@dataclass -class DbfsStorageInfo: - """A storage location in DBFS""" - - destination: str - """dbfs destination, e.g. `dbfs:/my/path`""" - - def as_dict(self) -> dict: - """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: - """Deserializes the DbfsStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) - - @dataclass class DbtOutput: artifacts_headers: Optional[Dict[str, str]] = None @@ -1716,9 +1278,9 @@ def as_dict(self) -> dict: """Serializes the DbtOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifacts_headers: - body["{artifacts_headers}"] = self.artifacts_headers + body["artifacts_headers"] = self.artifacts_headers if self.artifacts_link is not None: - body["{artifacts_link}"] = self.artifacts_link + body["artifacts_link"] = self.artifacts_link return body def as_shallow_dict(self) -> dict: @@ -1777,19 +1339,19 @@ def as_dict(self) -> dict: """Serializes the DbtTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.commands: - body["{commands}"] = [v for v in self.commands] + body["commands"] = [v for v in self.commands] if self.profiles_directory is not None: - body["{profiles_directory}"] = self.profiles_directory + body["profiles_directory"] = self.profiles_directory if self.project_directory is not None: - body["{project_directory}"] = self.project_directory + body["project_directory"] = self.project_directory if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.source is not None: - body["{source}"] = self.source.value + body["source"] = self.source.value if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -1834,7 +1396,7 @@ def as_dict(self) -> dict: """Serializes the DeleteJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body def as_shallow_dict(self) -> dict: @@ -1877,7 +1439,7 @@ def as_dict(self) -> dict: """Serializes the DeleteRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -1911,78 +1473,6 @@ def from_dict(cls, d: Dict[str, Any]) -> DeleteRunResponse: return cls() -@dataclass -class DockerBasicAuth: - password: Optional[str] = None - """Password of the user""" - - username: Optional[str] = None - """Name of the user""" - - def as_dict(self) -> dict: - """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.password is not None: - body["{password}"] = self.password - if self.username is not None: - body["{username}"] = self.username - return body - - def as_shallow_dict(self) -> dict: - """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" - body = {} - if self.password is not None: - body["{password}"] = self.password - if self.username is not None: - body["{username}"] = self.username - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: - """Deserializes the DockerBasicAuth from a dictionary.""" - return cls(password=d.get("{password}", None), username=d.get("{username}", None)) - - -@dataclass -class DockerImage: - basic_auth: Optional[DockerBasicAuth] = None - """Basic auth with username and password""" - - url: Optional[str] = None - """URL of the docker image.""" - - def as_dict(self) -> dict: - """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.basic_auth: - body["{basic_auth}"] = self.basic_auth.as_dict() - if self.url is not None: - body["{url}"] = self.url - return body - - def as_shallow_dict(self) -> dict: - """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" - body = {} - if self.basic_auth: - body["{basic_auth}"] = self.basic_auth - if self.url is not None: - body["{url}"] = self.url - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> DockerImage: - """Deserializes the DockerImage from a dictionary.""" - return cls(basic_auth=_from_dict(d, "{basic_auth}", DockerBasicAuth), url=d.get("{url}", None)) - - -class EbsVolumeType(Enum): - """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for - details.""" - - GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" - THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" - - @dataclass class EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Represents a change to the job cluster's settings that would be required for the job clusters to @@ -2005,11 +1495,11 @@ def as_dict(self) -> dict: """Serializes the EnforcePolicyComplianceForJobResponseJobClusterSettingsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.field is not None: - body["{field}"] = self.field + body["field"] = self.field if self.new_value is not None: - body["{new_value}"] = self.new_value + body["new_value"] = self.new_value if self.previous_value is not None: - body["{previous_value}"] = self.previous_value + body["previous_value"] = self.previous_value return body def as_shallow_dict(self) -> dict: @@ -2045,9 +1535,9 @@ def as_dict(self) -> dict: """Serializes the EnforcePolicyComplianceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body def as_shallow_dict(self) -> dict: @@ -2085,11 +1575,11 @@ def as_dict(self) -> dict: """Serializes the EnforcePolicyComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_changes is not None: - body["{has_changes}"] = self.has_changes + body["has_changes"] = self.has_changes if self.job_cluster_changes: - body["{job_cluster_changes}"] = [v.as_dict() for v in self.job_cluster_changes] + body["job_cluster_changes"] = [v.as_dict() for v in self.job_cluster_changes] if self.settings: - body["{settings}"] = self.settings.as_dict() + body["settings"] = self.settings.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2137,9 +1627,9 @@ def as_dict(self) -> dict: """Serializes the Environment into a dictionary suitable for use as a JSON request body.""" body = {} if self.client is not None: - body["{client}"] = self.client + body["client"] = self.client if self.dependencies: - body["{dependencies}"] = [v for v in self.dependencies] + body["dependencies"] = [v for v in self.dependencies] return body def as_shallow_dict(self) -> dict: @@ -2171,7 +1661,7 @@ def as_dict(self) -> dict: """Serializes the ExportRunOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.views: - body["{views}"] = [v.as_dict() for v in self.views] + body["views"] = [v.as_dict() for v in self.views] return body def as_shallow_dict(self) -> dict: @@ -2206,11 +1696,11 @@ def as_dict(self) -> dict: """Serializes the FileArrivalTriggerConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.min_time_between_triggers_seconds is not None: - body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds + body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.wait_after_last_change_seconds is not None: - body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds + body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds return body def as_shallow_dict(self) -> dict: @@ -2246,9 +1736,9 @@ def as_dict(self) -> dict: """Serializes the ForEachStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_message_stats: - body["{error_message_stats}"] = [v.as_dict() for v in self.error_message_stats] + body["error_message_stats"] = [v.as_dict() for v in self.error_message_stats] if self.task_run_stats: - body["{task_run_stats}"] = self.task_run_stats.as_dict() + body["task_run_stats"] = self.task_run_stats.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2285,11 +1775,11 @@ def as_dict(self) -> dict: """Serializes the ForEachTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.concurrency is not None: - body["{concurrency}"] = self.concurrency + body["concurrency"] = self.concurrency if self.inputs is not None: - body["{inputs}"] = self.inputs + body["inputs"] = self.inputs if self.task: - body["{task}"] = self.task.as_dict() + body["task"] = self.task.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2326,11 +1816,11 @@ def as_dict(self) -> dict: """Serializes the ForEachTaskErrorMessageStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.count is not None: - body["{count}"] = self.count + body["count"] = self.count if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.termination_category is not None: - body["{termination_category}"] = self.termination_category + body["termination_category"] = self.termination_category return body def as_shallow_dict(self) -> dict: @@ -2378,17 +1868,17 @@ def as_dict(self) -> dict: """Serializes the ForEachTaskTaskRunStats into a dictionary suitable for use as a JSON request body.""" body = {} if self.active_iterations is not None: - body["{active_iterations}"] = self.active_iterations + body["active_iterations"] = self.active_iterations if self.completed_iterations is not None: - body["{completed_iterations}"] = self.completed_iterations + body["completed_iterations"] = self.completed_iterations if self.failed_iterations is not None: - body["{failed_iterations}"] = self.failed_iterations + body["failed_iterations"] = self.failed_iterations if self.scheduled_iterations is not None: - body["{scheduled_iterations}"] = self.scheduled_iterations + body["scheduled_iterations"] = self.scheduled_iterations if self.succeeded_iterations is not None: - body["{succeeded_iterations}"] = self.succeeded_iterations + body["succeeded_iterations"] = self.succeeded_iterations if self.total_iterations is not None: - body["{total_iterations}"] = self.total_iterations + body["total_iterations"] = self.total_iterations return body def as_shallow_dict(self) -> dict: @@ -2427,124 +1917,6 @@ class Format(Enum): SINGLE_TASK = "SINGLE_TASK" -@dataclass -class GcpAttributes: - """Attributes set during cluster creation which are related to GCP.""" - - availability: Optional[GcpAvailability] = None - """This field determines whether the spark executors will be scheduled to run on preemptible VMs, - on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" - - boot_disk_size: Optional[int] = None - """Boot disk size in GB""" - - google_service_account: Optional[str] = None - """If provided, the cluster will impersonate the google service account when accessing gcloud - services (like GCS). The google service account must have previously been added to the - Databricks environment by an account administrator.""" - - local_ssd_count: Optional[int] = None - """If provided, each node (workers and driver) in the cluster will have this number of local SSDs - attached. Each local SSD is 375GB in size. Refer to [GCP documentation] for the supported number - of local SSDs for each instance type. - - [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds""" - - use_preemptible_executors: Optional[bool] = None - """This field determines whether the spark executors will be scheduled to run on preemptible VMs - (when set to true) versus standard compute engine VMs (when set to false; default). Note: Soon - to be deprecated, use the 'availability' field instead.""" - - zone_id: Optional[str] = None - """Identifier for the availability zone in which the cluster resides. This can be one of the - following: - "HA" => High availability, spread nodes across availability zones for a Databricks - deployment region [default]. - "AUTO" => Databricks picks an availability zone to schedule the - cluster on. - A GCP availability zone => Pick One of the available zones for (machine type + - region) from https://cloud.google.com/compute/docs/regions-zones.""" - - def as_dict(self) -> dict: - """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.availability is not None: - body["{availability}"] = self.availability.value - if self.boot_disk_size is not None: - body["{boot_disk_size}"] = self.boot_disk_size - if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account - if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count - if self.use_preemptible_executors is not None: - body["{use_preemptible_executors}"] = self.use_preemptible_executors - if self.zone_id is not None: - body["{zone_id}"] = self.zone_id - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.availability is not None: - body["{availability}"] = self.availability - if self.boot_disk_size is not None: - body["{boot_disk_size}"] = self.boot_disk_size - if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account - if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count - if self.use_preemptible_executors is not None: - body["{use_preemptible_executors}"] = self.use_preemptible_executors - if self.zone_id is not None: - body["{zone_id}"] = self.zone_id - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: - """Deserializes the GcpAttributes from a dictionary.""" - return cls( - availability=_enum(d, "{availability}", GcpAvailability), - boot_disk_size=d.get("{boot_disk_size}", None), - google_service_account=d.get("{google_service_account}", None), - local_ssd_count=d.get("{local_ssd_count}", None), - use_preemptible_executors=d.get("{use_preemptible_executors}", None), - zone_id=d.get("{zone_id}", None), - ) - - -class GcpAvailability(Enum): - """This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or - preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" - - ON_DEMAND_GCP = "ON_DEMAND_GCP" - PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" - PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" - - -@dataclass -class GcsStorageInfo: - """A storage location in Google Cloud Platform's GCS""" - - destination: str - """GCS destination/URI, e.g. `gs://my-bucket/some-prefix`""" - - def as_dict(self) -> dict: - """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: - """Deserializes the GcsStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) - - @dataclass class GenAiComputeTask: """Next field: 9""" @@ -2586,21 +1958,21 @@ def as_dict(self) -> dict: """Serializes the GenAiComputeTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.command is not None: - body["{command}"] = self.command + body["command"] = self.command if self.compute: - body["{compute}"] = self.compute.as_dict() + body["compute"] = self.compute.as_dict() if self.dl_runtime_image is not None: - body["{dl_runtime_image}"] = self.dl_runtime_image + body["dl_runtime_image"] = self.dl_runtime_image if self.mlflow_experiment_name is not None: - body["{mlflow_experiment_name}"] = self.mlflow_experiment_name + body["mlflow_experiment_name"] = self.mlflow_experiment_name if self.source is not None: - body["{source}"] = self.source.value + body["source"] = self.source.value if self.training_script_path is not None: - body["{training_script_path}"] = self.training_script_path + body["training_script_path"] = self.training_script_path if self.yaml_parameters is not None: - body["{yaml_parameters}"] = self.yaml_parameters + body["yaml_parameters"] = self.yaml_parameters if self.yaml_parameters_file_path is not None: - body["{yaml_parameters_file_path}"] = self.yaml_parameters_file_path + body["yaml_parameters_file_path"] = self.yaml_parameters_file_path return body def as_shallow_dict(self) -> dict: @@ -2648,7 +2020,7 @@ def as_dict(self) -> dict: """Serializes the GetJobPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -2681,9 +2053,9 @@ def as_dict(self) -> dict: """Serializes the GetPolicyComplianceResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body def as_shallow_dict(self) -> dict: @@ -2727,7 +2099,7 @@ def as_dict(self) -> dict: """Serializes the GitSnapshot into a dictionary suitable for use as a JSON request body.""" body = {} if self.used_commit is not None: - body["{used_commit}"] = self.used_commit + body["used_commit"] = self.used_commit return body def as_shallow_dict(self) -> dict: @@ -2783,19 +2155,19 @@ def as_dict(self) -> dict: """Serializes the GitSource into a dictionary suitable for use as a JSON request body.""" body = {} if self.git_branch is not None: - body["{git_branch}"] = self.git_branch + body["git_branch"] = self.git_branch if self.git_commit is not None: - body["{git_commit}"] = self.git_commit + body["git_commit"] = self.git_commit if self.git_provider is not None: - body["{git_provider}"] = self.git_provider.value + body["git_provider"] = self.git_provider.value if self.git_snapshot: - body["{git_snapshot}"] = self.git_snapshot.as_dict() + body["git_snapshot"] = self.git_snapshot.as_dict() if self.git_tag is not None: - body["{git_tag}"] = self.git_tag + body["git_tag"] = self.git_tag if self.git_url is not None: - body["{git_url}"] = self.git_url + body["git_url"] = self.git_url if self.job_source: - body["{job_source}"] = self.job_source.as_dict() + body["job_source"] = self.job_source.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2831,90 +2203,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GitSource: ) -@dataclass -class InitScriptInfo: - """Config for an individual init script Next ID: 11""" - - abfss: Optional[Adlsgen2Info] = None - """destination needs to be provided, e.g. - `abfss://@.dfs.core.windows.net/`""" - - dbfs: Optional[DbfsStorageInfo] = None - """destination needs to be provided. e.g. `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } - }`""" - - file: Optional[LocalFileInfo] = None - """destination needs to be provided, e.g. `{ "file": { "destination": "file:/my/local/file.sh" } }`""" - - gcs: Optional[GcsStorageInfo] = None - """destination needs to be provided, e.g. `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }`""" - - s3: Optional[S3StorageInfo] = None - """destination and either the region or endpoint need to be provided. e.g. `{ \"s3\": { - \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` Cluster iam - role is used to access s3, please make sure the cluster iam role in `instance_profile_arn` has - permission to write data to the s3 destination.""" - - volumes: Optional[VolumesStorageInfo] = None - """destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" : - \"/Volumes/my-init.sh\" } }`""" - - workspace: Optional[WorkspaceStorageInfo] = None - """destination needs to be provided, e.g. `{ "workspace": { "destination": - "/cluster-init-scripts/setup-datadog.sh" } }`""" - - def as_dict(self) -> dict: - """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.abfss: - body["{abfss}"] = self.abfss.as_dict() - if self.dbfs: - body["{dbfs}"] = self.dbfs.as_dict() - if self.file: - body["{file}"] = self.file.as_dict() - if self.gcs: - body["{gcs}"] = self.gcs.as_dict() - if self.s3: - body["{s3}"] = self.s3.as_dict() - if self.volumes: - body["{volumes}"] = self.volumes.as_dict() - if self.workspace: - body["{workspace}"] = self.workspace.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.abfss: - body["{abfss}"] = self.abfss - if self.dbfs: - body["{dbfs}"] = self.dbfs - if self.file: - body["{file}"] = self.file - if self.gcs: - body["{gcs}"] = self.gcs - if self.s3: - body["{s3}"] = self.s3 - if self.volumes: - body["{volumes}"] = self.volumes - if self.workspace: - body["{workspace}"] = self.workspace - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: - """Deserializes the InitScriptInfo from a dictionary.""" - return cls( - abfss=_from_dict(d, "{abfss}", Adlsgen2Info), - dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), - file=_from_dict(d, "{file}", LocalFileInfo), - gcs=_from_dict(d, "{gcs}", GcsStorageInfo), - s3=_from_dict(d, "{s3}", S3StorageInfo), - volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), - workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), - ) - - @dataclass class Job: """Job was retrieved successfully.""" @@ -2960,21 +2248,21 @@ def as_dict(self) -> dict: """Serializes the Job into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_time is not None: - body["{created_time}"] = self.created_time + body["created_time"] = self.created_time if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.run_as_user_name is not None: - body["{run_as_user_name}"] = self.run_as_user_name + body["run_as_user_name"] = self.run_as_user_name if self.settings: - body["{settings}"] = self.settings.as_dict() + body["settings"] = self.settings.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3031,13 +2319,13 @@ def as_dict(self) -> dict: """Serializes the JobAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3085,15 +2373,15 @@ def as_dict(self) -> dict: """Serializes the JobAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3130,16 +2418,16 @@ class JobCluster: `JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution.""" - new_cluster: JobsClusterSpec + new_cluster: ClusterSpec """If new_cluster, a description of a cluster that is created for each task.""" def as_dict(self) -> dict: """Serializes the JobCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.new_cluster: - body["{new_cluster}"] = self.new_cluster.as_dict() + body["new_cluster"] = self.new_cluster.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3155,8 +2443,7 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> JobCluster: """Deserializes the JobCluster from a dictionary.""" return cls( - job_cluster_key=d.get("{job_cluster_key}", None), - new_cluster=_from_dict(d, "{new_cluster}", JobsClusterSpec), + job_cluster_key=d.get("{job_cluster_key}", None), new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec) ) @@ -3178,11 +2465,11 @@ def as_dict(self) -> dict: """Serializes the JobCompliance into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body def as_shallow_dict(self) -> dict: @@ -3220,9 +2507,9 @@ def as_dict(self) -> dict: """Serializes the JobDeployment into a dictionary suitable for use as a JSON request body.""" body = {} if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.metadata_file_path is not None: - body["{metadata_file_path}"] = self.metadata_file_path + body["metadata_file_path"] = self.metadata_file_path return body def as_shallow_dict(self) -> dict: @@ -3295,17 +2582,17 @@ def as_dict(self) -> dict: """Serializes the JobEmailNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["{on_duration_warning_threshold_exceeded}"] = [v for v in self.on_duration_warning_threshold_exceeded] + body["on_duration_warning_threshold_exceeded"] = [v for v in self.on_duration_warning_threshold_exceeded] if self.on_failure: - body["{on_failure}"] = [v for v in self.on_failure] + body["on_failure"] = [v for v in self.on_failure] if self.on_start: - body["{on_start}"] = [v for v in self.on_start] + body["on_start"] = [v for v in self.on_start] if self.on_streaming_backlog_exceeded: - body["{on_streaming_backlog_exceeded}"] = [v for v in self.on_streaming_backlog_exceeded] + body["on_streaming_backlog_exceeded"] = [v for v in self.on_streaming_backlog_exceeded] if self.on_success: - body["{on_success}"] = [v for v in self.on_success] + body["on_success"] = [v for v in self.on_success] return body def as_shallow_dict(self) -> dict: @@ -3351,9 +2638,9 @@ def as_dict(self) -> dict: """Serializes the JobEnvironment into a dictionary suitable for use as a JSON request body.""" body = {} if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.spec: - body["{spec}"] = self.spec.as_dict() + body["spec"] = self.spec.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3385,9 +2672,9 @@ def as_dict(self) -> dict: """Serializes the JobNotificationSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.no_alert_for_canceled_runs is not None: - body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs + body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs return body def as_shallow_dict(self) -> dict: @@ -3423,11 +2710,11 @@ def as_dict(self) -> dict: """Serializes the JobParameter into a dictionary suitable for use as a JSON request body.""" body = {} if self.default is not None: - body["{default}"] = self.default + body["default"] = self.default if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -3459,9 +2746,9 @@ def as_dict(self) -> dict: """Serializes the JobParameterDefinition into a dictionary suitable for use as a JSON request body.""" body = {} if self.default is not None: - body["{default}"] = self.default + body["default"] = self.default if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -3492,11 +2779,11 @@ def as_dict(self) -> dict: """Serializes the JobPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -3541,11 +2828,11 @@ def as_dict(self) -> dict: """Serializes the JobPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -3580,9 +2867,9 @@ def as_dict(self) -> dict: """Serializes the JobPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -3614,9 +2901,9 @@ def as_dict(self) -> dict: """Serializes the JobPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body def as_shallow_dict(self) -> dict: @@ -3656,9 +2943,9 @@ def as_dict(self) -> dict: """Serializes the JobRunAs into a dictionary suitable for use as a JSON request body.""" body = {} if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3795,53 +3082,53 @@ def as_dict(self) -> dict: """Serializes the JobSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.continuous: - body["{continuous}"] = self.continuous.as_dict() + body["continuous"] = self.continuous.as_dict() if self.deployment: - body["{deployment}"] = self.deployment.as_dict() + body["deployment"] = self.deployment.as_dict() if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.edit_mode is not None: - body["{edit_mode}"] = self.edit_mode.value + body["edit_mode"] = self.edit_mode.value if self.email_notifications: - body["{email_notifications}"] = self.email_notifications.as_dict() + body["email_notifications"] = self.email_notifications.as_dict() if self.environments: - body["{environments}"] = [v.as_dict() for v in self.environments] + body["environments"] = [v.as_dict() for v in self.environments] if self.format is not None: - body["{format}"] = self.format.value + body["format"] = self.format.value if self.git_source: - body["{git_source}"] = self.git_source.as_dict() + body["git_source"] = self.git_source.as_dict() if self.health: - body["{health}"] = self.health.as_dict() + body["health"] = self.health.as_dict() if self.job_clusters: - body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] + body["job_clusters"] = [v.as_dict() for v in self.job_clusters] if self.max_concurrent_runs is not None: - body["{max_concurrent_runs}"] = self.max_concurrent_runs + body["max_concurrent_runs"] = self.max_concurrent_runs if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notification_settings: - body["{notification_settings}"] = self.notification_settings.as_dict() + body["notification_settings"] = self.notification_settings.as_dict() if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.performance_target is not None: - body["{performance_target}"] = self.performance_target.value + body["performance_target"] = self.performance_target.value if self.queue: - body["{queue}"] = self.queue.as_dict() + body["queue"] = self.queue.as_dict() if self.run_as: - body["{run_as}"] = self.run_as.as_dict() + body["run_as"] = self.run_as.as_dict() if self.schedule: - body["{schedule}"] = self.schedule.as_dict() + body["schedule"] = self.schedule.as_dict() if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.tasks: - body["{tasks}"] = [v.as_dict() for v in self.tasks] + body["tasks"] = [v.as_dict() for v in self.tasks] if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.trigger: - body["{trigger}"] = self.trigger.as_dict() + body["trigger"] = self.trigger.as_dict() if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications.as_dict() + body["webhook_notifications"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3952,11 +3239,11 @@ def as_dict(self) -> dict: """Serializes the JobSource into a dictionary suitable for use as a JSON request body.""" body = {} if self.dirty_state is not None: - body["{dirty_state}"] = self.dirty_state.value + body["dirty_state"] = self.dirty_state.value if self.import_from_git_branch is not None: - body["{import_from_git_branch}"] = self.import_from_git_branch + body["import_from_git_branch"] = self.import_from_git_branch if self.job_config_path is not None: - body["{job_config_path}"] = self.job_config_path + body["job_config_path"] = self.job_config_path return body def as_shallow_dict(self) -> dict: @@ -4194,65 +3481,65 @@ def as_dict(self) -> dict: """Serializes the JobsClusterSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode.value + body["data_security_mode"] = self.data_security_mode.value if self.docker_image: - body["{docker_image}"] = self.docker_image.as_dict() + body["docker_image"] = self.docker_image.as_dict() if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine.value + body["runtime_engine"] = self.runtime_engine.value if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type.as_dict() + body["workload_type"] = self.workload_type.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4404,11 +3691,11 @@ def as_dict(self) -> dict: """Serializes the JobsHealthRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.metric is not None: - body["{metric}"] = self.metric.value + body["metric"] = self.metric.value if self.op is not None: - body["{op}"] = self.op.value + body["op"] = self.op.value if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -4442,7 +3729,7 @@ def as_dict(self) -> dict: """Serializes the JobsHealthRules into a dictionary suitable for use as a JSON request body.""" body = {} if self.rules: - body["{rules}"] = [v.as_dict() for v in self.rules] + body["rules"] = [v.as_dict() for v in self.rules] return body def as_shallow_dict(self) -> dict: @@ -4515,19 +3802,19 @@ def as_dict(self) -> dict: """Serializes the Library into a dictionary suitable for use as a JSON request body.""" body = {} if self.cran: - body["{cran}"] = self.cran.as_dict() + body["cran"] = self.cran.as_dict() if self.egg is not None: - body["{egg}"] = self.egg + body["egg"] = self.egg if self.jar is not None: - body["{jar}"] = self.jar + body["jar"] = self.jar if self.maven: - body["{maven}"] = self.maven.as_dict() + body["maven"] = self.maven.as_dict() if self.pypi: - body["{pypi}"] = self.pypi.as_dict() + body["pypi"] = self.pypi.as_dict() if self.requirements is not None: - body["{requirements}"] = self.requirements + body["requirements"] = self.requirements if self.whl is not None: - body["{whl}"] = self.whl + body["whl"] = self.whl return body def as_shallow_dict(self) -> dict: @@ -4580,11 +3867,11 @@ def as_dict(self) -> dict: """Serializes the ListJobComplianceForPolicyResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.jobs: - body["{jobs}"] = [v.as_dict() for v in self.jobs] + body["jobs"] = [v.as_dict() for v in self.jobs] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: @@ -4628,13 +3915,13 @@ def as_dict(self) -> dict: """Serializes the ListJobsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.jobs: - body["{jobs}"] = [v.as_dict() for v in self.jobs] + body["jobs"] = [v.as_dict() for v in self.jobs] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: @@ -4682,94 +3969,36 @@ def as_dict(self) -> dict: """Serializes the ListRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token if self.runs: - body["{runs}"] = [v.as_dict() for v in self.runs] + body["runs"] = [v.as_dict() for v in self.runs] return body def as_shallow_dict(self) -> dict: """Serializes the ListRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_more is not None: - body["{has_more}"] = self.has_more - if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token - if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token - if self.runs: - body["{runs}"] = self.runs - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: - """Deserializes the ListRunsResponse from a dictionary.""" - return cls( - has_more=d.get("{has_more}", None), - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), - runs=_repeated_dict(d, "{runs}", BaseRun), - ) - - -@dataclass -class LocalFileInfo: - destination: str - """local file destination, e.g. `file:/my/local/file.sh`""" - - def as_dict(self) -> dict: - """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: - """Deserializes the LocalFileInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) - - -@dataclass -class LogAnalyticsInfo: - log_analytics_primary_key: Optional[str] = None - - log_analytics_workspace_id: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.log_analytics_primary_key is not None: - body["{log_analytics_primary_key}"] = self.log_analytics_primary_key - if self.log_analytics_workspace_id is not None: - body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id - return body - - def as_shallow_dict(self) -> dict: - """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.log_analytics_primary_key is not None: - body["{log_analytics_primary_key}"] = self.log_analytics_primary_key - if self.log_analytics_workspace_id is not None: - body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id + body["{has_more}"] = self.has_more + if self.next_page_token is not None: + body["{next_page_token}"] = self.next_page_token + if self.prev_page_token is not None: + body["{prev_page_token}"] = self.prev_page_token + if self.runs: + body["{runs}"] = self.runs return body @classmethod - def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: - """Deserializes the LogAnalyticsInfo from a dictionary.""" + def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: + """Deserializes the ListRunsResponse from a dictionary.""" return cls( - log_analytics_primary_key=d.get("{log_analytics_primary_key}", None), - log_analytics_workspace_id=d.get("{log_analytics_workspace_id}", None), + has_more=d.get("{has_more}", None), + next_page_token=d.get("{next_page_token}", None), + prev_page_token=d.get("{prev_page_token}", None), + runs=_repeated_dict(d, "{runs}", BaseRun), ) @@ -4792,11 +4021,11 @@ def as_dict(self) -> dict: """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.coordinates is not None: - body["{coordinates}"] = self.coordinates + body["coordinates"] = self.coordinates if self.exclusions: - body["{exclusions}"] = [v for v in self.exclusions] + body["exclusions"] = [v for v in self.exclusions] if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body def as_shallow_dict(self) -> dict: @@ -4834,9 +4063,9 @@ def as_dict(self) -> dict: """Serializes the NotebookOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.result is not None: - body["{result}"] = self.result + body["result"] = self.result if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body def as_shallow_dict(self) -> dict: @@ -4895,13 +4124,13 @@ def as_dict(self) -> dict: """Serializes the NotebookTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.base_parameters: - body["{base_parameters}"] = self.base_parameters + body["base_parameters"] = self.base_parameters if self.notebook_path is not None: - body["{notebook_path}"] = self.notebook_path + body["notebook_path"] = self.notebook_path if self.source is not None: - body["{source}"] = self.source.value + body["source"] = self.source.value if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -4944,11 +4173,11 @@ def as_dict(self) -> dict: """Serializes the OutputSchemaInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name return body def as_shallow_dict(self) -> dict: @@ -5000,9 +4229,9 @@ def as_dict(self) -> dict: """Serializes the PeriodicTriggerConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.interval is not None: - body["{interval}"] = self.interval + body["interval"] = self.interval if self.unit is not None: - body["{unit}"] = self.unit.value + body["unit"] = self.unit.value return body def as_shallow_dict(self) -> dict: @@ -5036,7 +4265,7 @@ def as_dict(self) -> dict: """Serializes the PipelineParams into a dictionary suitable for use as a JSON request body.""" body = {} if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh return body def as_shallow_dict(self) -> dict: @@ -5064,9 +4293,9 @@ def as_dict(self) -> dict: """Serializes the PipelineTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id return body def as_shallow_dict(self) -> dict: @@ -5097,9 +4326,9 @@ def as_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body def as_shallow_dict(self) -> dict: @@ -5138,13 +4367,13 @@ def as_dict(self) -> dict: """Serializes the PythonWheelTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.entry_point is not None: - body["{entry_point}"] = self.entry_point + body["entry_point"] = self.entry_point if self.named_parameters: - body["{named_parameters}"] = self.named_parameters + body["named_parameters"] = self.named_parameters if self.package_name is not None: - body["{package_name}"] = self.package_name + body["package_name"] = self.package_name if self.parameters: - body["{parameters}"] = [v for v in self.parameters] + body["parameters"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: @@ -5188,9 +4417,9 @@ def as_dict(self) -> dict: """Serializes the QueueDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["{code}"] = self.code.value + body["code"] = self.code.value if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body def as_shallow_dict(self) -> dict: @@ -5229,7 +4458,7 @@ def as_dict(self) -> dict: """Serializes the QueueSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body def as_shallow_dict(self) -> dict: @@ -5257,9 +4486,9 @@ def as_dict(self) -> dict: """Serializes the RCranLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body def as_shallow_dict(self) -> dict: @@ -5304,19 +4533,19 @@ def as_dict(self) -> dict: """Serializes the RepairHistoryItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() if self.task_run_ids: - body["{task_run_ids}"] = [v for v in self.task_run_ids] + body["task_run_ids"] = [v for v in self.task_run_ids] if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -5460,33 +4689,33 @@ def as_dict(self) -> dict: """Serializes the RepairRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = [v for v in self.dbt_commands] + body["dbt_commands"] = [v for v in self.dbt_commands] if self.jar_params: - body["{jar_params}"] = [v for v in self.jar_params] + body["jar_params"] = [v for v in self.jar_params] if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.latest_repair_id is not None: - body["{latest_repair_id}"] = self.latest_repair_id + body["latest_repair_id"] = self.latest_repair_id if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params.as_dict() + body["pipeline_params"] = self.pipeline_params.as_dict() if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = [v for v in self.python_params] + body["python_params"] = [v for v in self.python_params] if self.rerun_all_failed_tasks is not None: - body["{rerun_all_failed_tasks}"] = self.rerun_all_failed_tasks + body["rerun_all_failed_tasks"] = self.rerun_all_failed_tasks if self.rerun_dependent_tasks is not None: - body["{rerun_dependent_tasks}"] = self.rerun_dependent_tasks + body["rerun_dependent_tasks"] = self.rerun_dependent_tasks if self.rerun_tasks: - body["{rerun_tasks}"] = [v for v in self.rerun_tasks] + body["rerun_tasks"] = [v for v in self.rerun_tasks] if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.spark_submit_params: - body["{spark_submit_params}"] = [v for v in self.spark_submit_params] + body["spark_submit_params"] = [v for v in self.spark_submit_params] if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body def as_shallow_dict(self) -> dict: @@ -5555,7 +4784,7 @@ def as_dict(self) -> dict: """Serializes the RepairRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.repair_id is not None: - body["{repair_id}"] = self.repair_id + body["repair_id"] = self.repair_id return body def as_shallow_dict(self) -> dict: @@ -5586,9 +4815,9 @@ def as_dict(self) -> dict: """Serializes the ResetJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.new_settings: - body["{new_settings}"] = self.new_settings.as_dict() + body["new_settings"] = self.new_settings.as_dict() return body def as_shallow_dict(self) -> dict: @@ -5634,9 +4863,9 @@ def as_dict(self) -> dict: """Serializes the ResolvedConditionTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.left is not None: - body["{left}"] = self.left + body["left"] = self.left if self.right is not None: - body["{right}"] = self.right + body["right"] = self.right return body def as_shallow_dict(self) -> dict: @@ -5662,7 +4891,7 @@ def as_dict(self) -> dict: """Serializes the ResolvedDbtTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.commands: - body["{commands}"] = [v for v in self.commands] + body["commands"] = [v for v in self.commands] return body def as_shallow_dict(self) -> dict: @@ -5686,7 +4915,7 @@ def as_dict(self) -> dict: """Serializes the ResolvedNotebookTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.base_parameters: - body["{base_parameters}"] = self.base_parameters + body["base_parameters"] = self.base_parameters return body def as_shallow_dict(self) -> dict: @@ -5710,7 +4939,7 @@ def as_dict(self) -> dict: """Serializes the ResolvedParamPairValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body def as_shallow_dict(self) -> dict: @@ -5736,9 +4965,9 @@ def as_dict(self) -> dict: """Serializes the ResolvedPythonWheelTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.named_parameters: - body["{named_parameters}"] = self.named_parameters + body["named_parameters"] = self.named_parameters if self.parameters: - body["{parameters}"] = [v for v in self.parameters] + body["parameters"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: @@ -5766,9 +4995,9 @@ def as_dict(self) -> dict: """Serializes the ResolvedRunJobTaskValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body def as_shallow_dict(self) -> dict: @@ -5794,7 +5023,7 @@ def as_dict(self) -> dict: """Serializes the ResolvedStringParamsValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["{parameters}"] = [v for v in self.parameters] + body["parameters"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: @@ -5836,25 +5065,25 @@ def as_dict(self) -> dict: """Serializes the ResolvedValues into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition_task: - body["{condition_task}"] = self.condition_task.as_dict() + body["condition_task"] = self.condition_task.as_dict() if self.dbt_task: - body["{dbt_task}"] = self.dbt_task.as_dict() + body["dbt_task"] = self.dbt_task.as_dict() if self.notebook_task: - body["{notebook_task}"] = self.notebook_task.as_dict() + body["notebook_task"] = self.notebook_task.as_dict() if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task.as_dict() + body["python_wheel_task"] = self.python_wheel_task.as_dict() if self.run_job_task: - body["{run_job_task}"] = self.run_job_task.as_dict() + body["run_job_task"] = self.run_job_task.as_dict() if self.simulation_task: - body["{simulation_task}"] = self.simulation_task.as_dict() + body["simulation_task"] = self.simulation_task.as_dict() if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task.as_dict() + body["spark_jar_task"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task.as_dict() + body["spark_python_task"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task.as_dict() + body["spark_submit_task"] = self.spark_submit_task.as_dict() if self.sql_task: - body["{sql_task}"] = self.sql_task.as_dict() + body["sql_task"] = self.sql_task.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6065,75 +5294,75 @@ def as_dict(self) -> dict: """Serializes the Run into a dictionary suitable for use as a JSON request body.""" body = {} if self.attempt_number is not None: - body["{attempt_number}"] = self.attempt_number + body["attempt_number"] = self.attempt_number if self.cleanup_duration is not None: - body["{cleanup_duration}"] = self.cleanup_duration + body["cleanup_duration"] = self.cleanup_duration if self.cluster_instance: - body["{cluster_instance}"] = self.cluster_instance.as_dict() + body["cluster_instance"] = self.cluster_instance.as_dict() if self.cluster_spec: - body["{cluster_spec}"] = self.cluster_spec.as_dict() + body["cluster_spec"] = self.cluster_spec.as_dict() if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.effective_performance_target is not None: - body["{effective_performance_target}"] = self.effective_performance_target.value + body["effective_performance_target"] = self.effective_performance_target.value if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.execution_duration is not None: - body["{execution_duration}"] = self.execution_duration + body["execution_duration"] = self.execution_duration if self.git_source: - body["{git_source}"] = self.git_source.as_dict() + body["git_source"] = self.git_source.as_dict() if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.iterations: - body["{iterations}"] = [v.as_dict() for v in self.iterations] + body["iterations"] = [v.as_dict() for v in self.iterations] if self.job_clusters: - body["{job_clusters}"] = [v.as_dict() for v in self.job_clusters] + body["job_clusters"] = [v.as_dict() for v in self.job_clusters] if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = [v.as_dict() for v in self.job_parameters] + body["job_parameters"] = [v.as_dict() for v in self.job_parameters] if self.job_run_id is not None: - body["{job_run_id}"] = self.job_run_id + body["job_run_id"] = self.job_run_id if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.number_in_job is not None: - body["{number_in_job}"] = self.number_in_job + body["number_in_job"] = self.number_in_job if self.original_attempt_run_id is not None: - body["{original_attempt_run_id}"] = self.original_attempt_run_id + body["original_attempt_run_id"] = self.original_attempt_run_id if self.overriding_parameters: - body["{overriding_parameters}"] = self.overriding_parameters.as_dict() + body["overriding_parameters"] = self.overriding_parameters.as_dict() if self.queue_duration is not None: - body["{queue_duration}"] = self.queue_duration + body["queue_duration"] = self.queue_duration if self.repair_history: - body["{repair_history}"] = [v.as_dict() for v in self.repair_history] + body["repair_history"] = [v.as_dict() for v in self.repair_history] if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_page_url is not None: - body["{run_page_url}"] = self.run_page_url + body["run_page_url"] = self.run_page_url if self.run_type is not None: - body["{run_type}"] = self.run_type.value + body["run_type"] = self.run_type.value if self.schedule: - body["{schedule}"] = self.schedule.as_dict() + body["schedule"] = self.schedule.as_dict() if self.setup_duration is not None: - body["{setup_duration}"] = self.setup_duration + body["setup_duration"] = self.setup_duration if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() if self.tasks: - body["{tasks}"] = [v.as_dict() for v in self.tasks] + body["tasks"] = [v.as_dict() for v in self.tasks] if self.trigger is not None: - body["{trigger}"] = self.trigger.value + body["trigger"] = self.trigger.value if self.trigger_info: - body["{trigger_info}"] = self.trigger_info.as_dict() + body["trigger_info"] = self.trigger_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6282,13 +5511,13 @@ def as_dict(self) -> dict: """Serializes the RunConditionTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.left is not None: - body["{left}"] = self.left + body["left"] = self.left if self.op is not None: - body["{op}"] = self.op.value + body["op"] = self.op.value if self.outcome is not None: - body["{outcome}"] = self.outcome + body["outcome"] = self.outcome if self.right is not None: - body["{right}"] = self.right + body["right"] = self.right return body def as_shallow_dict(self) -> dict: @@ -6335,13 +5564,13 @@ def as_dict(self) -> dict: """Serializes the RunForEachTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.concurrency is not None: - body["{concurrency}"] = self.concurrency + body["concurrency"] = self.concurrency if self.inputs is not None: - body["{inputs}"] = self.inputs + body["inputs"] = self.inputs if self.stats: - body["{stats}"] = self.stats.as_dict() + body["stats"] = self.stats.as_dict() if self.task: - body["{task}"] = self.task.as_dict() + body["task"] = self.task.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6395,7 +5624,7 @@ def as_dict(self) -> dict: """Serializes the RunJobOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -6497,25 +5726,25 @@ def as_dict(self) -> dict: """Serializes the RunJobTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = [v for v in self.dbt_commands] + body["dbt_commands"] = [v for v in self.dbt_commands] if self.jar_params: - body["{jar_params}"] = [v for v in self.jar_params] + body["jar_params"] = [v for v in self.jar_params] if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params.as_dict() + body["pipeline_params"] = self.pipeline_params.as_dict() if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = [v for v in self.python_params] + body["python_params"] = [v for v in self.python_params] if self.spark_submit_params: - body["{spark_submit_params}"] = [v for v in self.spark_submit_params] + body["spark_submit_params"] = [v for v in self.spark_submit_params] if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body def as_shallow_dict(self) -> dict: @@ -6708,33 +5937,33 @@ def as_dict(self) -> dict: """Serializes the RunNow into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = [v for v in self.dbt_commands] + body["dbt_commands"] = [v for v in self.dbt_commands] if self.idempotency_token is not None: - body["{idempotency_token}"] = self.idempotency_token + body["idempotency_token"] = self.idempotency_token if self.jar_params: - body["{jar_params}"] = [v for v in self.jar_params] + body["jar_params"] = [v for v in self.jar_params] if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.only: - body["{only}"] = [v for v in self.only] + body["only"] = [v for v in self.only] if self.performance_target is not None: - body["{performance_target}"] = self.performance_target.value + body["performance_target"] = self.performance_target.value if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params.as_dict() + body["pipeline_params"] = self.pipeline_params.as_dict() if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = [v for v in self.python_params] + body["python_params"] = [v for v in self.python_params] if self.queue: - body["{queue}"] = self.queue.as_dict() + body["queue"] = self.queue.as_dict() if self.spark_submit_params: - body["{spark_submit_params}"] = [v for v in self.spark_submit_params] + body["spark_submit_params"] = [v for v in self.spark_submit_params] if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body def as_shallow_dict(self) -> dict: @@ -6805,9 +6034,9 @@ def as_dict(self) -> dict: """Serializes the RunNowResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.number_in_job is not None: - body["{number_in_job}"] = self.number_in_job + body["number_in_job"] = self.number_in_job if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -6877,27 +6106,27 @@ def as_dict(self) -> dict: """Serializes the RunOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms_notebook_output: - body["{clean_rooms_notebook_output}"] = self.clean_rooms_notebook_output.as_dict() + body["clean_rooms_notebook_output"] = self.clean_rooms_notebook_output.as_dict() if self.dbt_output: - body["{dbt_output}"] = self.dbt_output.as_dict() + body["dbt_output"] = self.dbt_output.as_dict() if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.error_trace is not None: - body["{error_trace}"] = self.error_trace + body["error_trace"] = self.error_trace if self.info is not None: - body["{info}"] = self.info + body["info"] = self.info if self.logs is not None: - body["{logs}"] = self.logs + body["logs"] = self.logs if self.logs_truncated is not None: - body["{logs_truncated}"] = self.logs_truncated + body["logs_truncated"] = self.logs_truncated if self.metadata: - body["{metadata}"] = self.metadata.as_dict() + body["metadata"] = self.metadata.as_dict() if self.notebook_output: - body["{notebook_output}"] = self.notebook_output.as_dict() + body["notebook_output"] = self.notebook_output.as_dict() if self.run_job_output: - body["{run_job_output}"] = self.run_job_output.as_dict() + body["run_job_output"] = self.run_job_output.as_dict() if self.sql_output: - body["{sql_output}"] = self.sql_output.as_dict() + body["sql_output"] = self.sql_output.as_dict() return body def as_shallow_dict(self) -> dict: @@ -7027,21 +6256,21 @@ def as_dict(self) -> dict: """Serializes the RunParameters into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = [v for v in self.dbt_commands] + body["dbt_commands"] = [v for v in self.dbt_commands] if self.jar_params: - body["{jar_params}"] = [v for v in self.jar_params] + body["jar_params"] = [v for v in self.jar_params] if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params.as_dict() + body["pipeline_params"] = self.pipeline_params.as_dict() if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = [v for v in self.python_params] + body["python_params"] = [v for v in self.python_params] if self.spark_submit_params: - body["{spark_submit_params}"] = [v for v in self.spark_submit_params] + body["spark_submit_params"] = [v for v in self.spark_submit_params] if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body def as_shallow_dict(self) -> dict: @@ -7129,15 +6358,15 @@ def as_dict(self) -> dict: """Serializes the RunState into a dictionary suitable for use as a JSON request body.""" body = {} if self.life_cycle_state is not None: - body["{life_cycle_state}"] = self.life_cycle_state.value + body["life_cycle_state"] = self.life_cycle_state.value if self.queue_reason is not None: - body["{queue_reason}"] = self.queue_reason + body["queue_reason"] = self.queue_reason if self.result_state is not None: - body["{result_state}"] = self.result_state.value + body["result_state"] = self.result_state.value if self.state_message is not None: - body["{state_message}"] = self.state_message + body["state_message"] = self.state_message if self.user_cancelled_or_timedout is not None: - body["{user_cancelled_or_timedout}"] = self.user_cancelled_or_timedout + body["user_cancelled_or_timedout"] = self.user_cancelled_or_timedout return body def as_shallow_dict(self) -> dict: @@ -7185,11 +6414,11 @@ def as_dict(self) -> dict: """Serializes the RunStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.queue_details: - body["{queue_details}"] = self.queue_details.as_dict() + body["queue_details"] = self.queue_details.as_dict() if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.termination_details: - body["{termination_details}"] = self.termination_details.as_dict() + body["termination_details"] = self.termination_details.as_dict() return body def as_shallow_dict(self) -> dict: @@ -7413,91 +6642,91 @@ def as_dict(self) -> dict: """Serializes the RunTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.attempt_number is not None: - body["{attempt_number}"] = self.attempt_number + body["attempt_number"] = self.attempt_number if self.clean_rooms_notebook_task: - body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task.as_dict() + body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() if self.cleanup_duration is not None: - body["{cleanup_duration}"] = self.cleanup_duration + body["cleanup_duration"] = self.cleanup_duration if self.cluster_instance: - body["{cluster_instance}"] = self.cluster_instance.as_dict() + body["cluster_instance"] = self.cluster_instance.as_dict() if self.condition_task: - body["{condition_task}"] = self.condition_task.as_dict() + body["condition_task"] = self.condition_task.as_dict() if self.dbt_task: - body["{dbt_task}"] = self.dbt_task.as_dict() + body["dbt_task"] = self.dbt_task.as_dict() if self.depends_on: - body["{depends_on}"] = [v.as_dict() for v in self.depends_on] + body["depends_on"] = [v.as_dict() for v in self.depends_on] if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.disabled is not None: - body["{disabled}"] = self.disabled + body["disabled"] = self.disabled if self.effective_performance_target is not None: - body["{effective_performance_target}"] = self.effective_performance_target.value + body["effective_performance_target"] = self.effective_performance_target.value if self.email_notifications: - body["{email_notifications}"] = self.email_notifications.as_dict() + body["email_notifications"] = self.email_notifications.as_dict() if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.execution_duration is not None: - body["{execution_duration}"] = self.execution_duration + body["execution_duration"] = self.execution_duration if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.for_each_task: - body["{for_each_task}"] = self.for_each_task.as_dict() + body["for_each_task"] = self.for_each_task.as_dict() if self.gen_ai_compute_task: - body["{gen_ai_compute_task}"] = self.gen_ai_compute_task.as_dict() + body["gen_ai_compute_task"] = self.gen_ai_compute_task.as_dict() if self.git_source: - body["{git_source}"] = self.git_source.as_dict() + body["git_source"] = self.git_source.as_dict() if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.new_cluster: - body["{new_cluster}"] = self.new_cluster.as_dict() + body["new_cluster"] = self.new_cluster.as_dict() if self.notebook_task: - body["{notebook_task}"] = self.notebook_task.as_dict() + body["notebook_task"] = self.notebook_task.as_dict() if self.notification_settings: - body["{notification_settings}"] = self.notification_settings.as_dict() + body["notification_settings"] = self.notification_settings.as_dict() if self.pipeline_task: - body["{pipeline_task}"] = self.pipeline_task.as_dict() + body["pipeline_task"] = self.pipeline_task.as_dict() if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task.as_dict() + body["python_wheel_task"] = self.python_wheel_task.as_dict() if self.queue_duration is not None: - body["{queue_duration}"] = self.queue_duration + body["queue_duration"] = self.queue_duration if self.resolved_values: - body["{resolved_values}"] = self.resolved_values.as_dict() + body["resolved_values"] = self.resolved_values.as_dict() if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_if is not None: - body["{run_if}"] = self.run_if.value + body["run_if"] = self.run_if.value if self.run_job_task: - body["{run_job_task}"] = self.run_job_task.as_dict() + body["run_job_task"] = self.run_job_task.as_dict() if self.run_page_url is not None: - body["{run_page_url}"] = self.run_page_url + body["run_page_url"] = self.run_page_url if self.setup_duration is not None: - body["{setup_duration}"] = self.setup_duration + body["setup_duration"] = self.setup_duration if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task.as_dict() + body["spark_jar_task"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task.as_dict() + body["spark_python_task"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task.as_dict() + body["spark_submit_task"] = self.spark_submit_task.as_dict() if self.sql_task: - body["{sql_task}"] = self.sql_task.as_dict() + body["sql_task"] = self.sql_task.as_dict() if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications.as_dict() + body["webhook_notifications"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: @@ -7653,102 +6882,6 @@ class RunType(Enum): WORKFLOW_RUN = "WORKFLOW_RUN" -class RuntimeEngine(Enum): - - NULL = "NULL" - PHOTON = "PHOTON" - STANDARD = "STANDARD" - - -@dataclass -class S3StorageInfo: - """A storage location in Amazon S3""" - - destination: str - """S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using cluster - iam role, please make sure you set cluster iam role and the role has write access to the - destination. Please also note that you cannot use AWS keys to deliver logs.""" - - canned_acl: Optional[str] = None - """(Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. If - `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on - the destination bucket and prefix. The full list of possible canned acl can be found at - http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. Please also note - that by default only the object owner gets full controls. If you are using cross account role - for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to - read the logs.""" - - enable_encryption: Optional[bool] = None - """(Optional) Flag to enable server side encryption, `false` by default.""" - - encryption_type: Optional[str] = None - """(Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when - encryption is enabled and the default type is `sse-s3`.""" - - endpoint: Optional[str] = None - """S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be - set. If both are set, endpoint will be used.""" - - kms_key: Optional[str] = None - """(Optional) Kms key which will be used if encryption is enabled and encryption type is set to - `sse-kms`.""" - - region: Optional[str] = None - """S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, - endpoint will be used.""" - - def as_dict(self) -> dict: - """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.canned_acl is not None: - body["{canned_acl}"] = self.canned_acl - if self.destination is not None: - body["{destination}"] = self.destination - if self.enable_encryption is not None: - body["{enable_encryption}"] = self.enable_encryption - if self.encryption_type is not None: - body["{encryption_type}"] = self.encryption_type - if self.endpoint is not None: - body["{endpoint}"] = self.endpoint - if self.kms_key is not None: - body["{kms_key}"] = self.kms_key - if self.region is not None: - body["{region}"] = self.region - return body - - def as_shallow_dict(self) -> dict: - """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.canned_acl is not None: - body["{canned_acl}"] = self.canned_acl - if self.destination is not None: - body["{destination}"] = self.destination - if self.enable_encryption is not None: - body["{enable_encryption}"] = self.enable_encryption - if self.encryption_type is not None: - body["{encryption_type}"] = self.encryption_type - if self.endpoint is not None: - body["{endpoint}"] = self.endpoint - if self.kms_key is not None: - body["{kms_key}"] = self.kms_key - if self.region is not None: - body["{region}"] = self.region - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: - """Deserializes the S3StorageInfo from a dictionary.""" - return cls( - canned_acl=d.get("{canned_acl}", None), - destination=d.get("{destination}", None), - enable_encryption=d.get("{enable_encryption}", None), - encryption_type=d.get("{encryption_type}", None), - endpoint=d.get("{endpoint}", None), - kms_key=d.get("{kms_key}", None), - region=d.get("{region}", None), - ) - - class Source(Enum): """Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\ from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a @@ -7789,13 +6922,13 @@ def as_dict(self) -> dict: """Serializes the SparkJarTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.jar_uri is not None: - body["{jar_uri}"] = self.jar_uri + body["jar_uri"] = self.jar_uri if self.main_class_name is not None: - body["{main_class_name}"] = self.main_class_name + body["main_class_name"] = self.main_class_name if self.parameters: - body["{parameters}"] = [v for v in self.parameters] + body["parameters"] = [v for v in self.parameters] if self.run_as_repl is not None: - body["{run_as_repl}"] = self.run_as_repl + body["run_as_repl"] = self.run_as_repl return body def as_shallow_dict(self) -> dict: @@ -7850,11 +6983,11 @@ def as_dict(self) -> dict: """Serializes the SparkPythonTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["{parameters}"] = [v for v in self.parameters] + body["parameters"] = [v for v in self.parameters] if self.python_file is not None: - body["{python_file}"] = self.python_file + body["python_file"] = self.python_file if self.source is not None: - body["{source}"] = self.source.value + body["source"] = self.source.value return body def as_shallow_dict(self) -> dict: @@ -7891,7 +7024,7 @@ def as_dict(self) -> dict: """Serializes the SparkSubmitTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["{parameters}"] = [v for v in self.parameters] + body["parameters"] = [v for v in self.parameters] return body def as_shallow_dict(self) -> dict: @@ -7932,15 +7065,15 @@ def as_dict(self) -> dict: """Serializes the SqlAlertOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_state is not None: - body["{alert_state}"] = self.alert_state.value + body["alert_state"] = self.alert_state.value if self.output_link is not None: - body["{output_link}"] = self.output_link + body["output_link"] = self.output_link if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.sql_statements: - body["{sql_statements}"] = [v.as_dict() for v in self.sql_statements] + body["sql_statements"] = [v.as_dict() for v in self.sql_statements] if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -7993,9 +7126,9 @@ def as_dict(self) -> dict: """Serializes the SqlDashboardOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id if self.widgets: - body["{widgets}"] = [v.as_dict() for v in self.widgets] + body["widgets"] = [v.as_dict() for v in self.widgets] return body def as_shallow_dict(self) -> dict: @@ -8042,19 +7175,19 @@ def as_dict(self) -> dict: """Serializes the SqlDashboardWidgetOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.error: - body["{error}"] = self.error.as_dict() + body["error"] = self.error.as_dict() if self.output_link is not None: - body["{output_link}"] = self.output_link + body["output_link"] = self.output_link if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.widget_id is not None: - body["{widget_id}"] = self.widget_id + body["widget_id"] = self.widget_id if self.widget_title is not None: - body["{widget_title}"] = self.widget_title + body["widget_title"] = self.widget_title return body def as_shallow_dict(self) -> dict: @@ -8114,11 +7247,11 @@ def as_dict(self) -> dict: """Serializes the SqlOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_output: - body["{alert_output}"] = self.alert_output.as_dict() + body["alert_output"] = self.alert_output.as_dict() if self.dashboard_output: - body["{dashboard_output}"] = self.dashboard_output.as_dict() + body["dashboard_output"] = self.dashboard_output.as_dict() if self.query_output: - body["{query_output}"] = self.query_output.as_dict() + body["query_output"] = self.query_output.as_dict() return body def as_shallow_dict(self) -> dict: @@ -8151,7 +7284,7 @@ def as_dict(self) -> dict: """Serializes the SqlOutputError into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body def as_shallow_dict(self) -> dict: @@ -8187,15 +7320,15 @@ def as_dict(self) -> dict: """Serializes the SqlQueryOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_id is not None: - body["{endpoint_id}"] = self.endpoint_id + body["endpoint_id"] = self.endpoint_id if self.output_link is not None: - body["{output_link}"] = self.output_link + body["output_link"] = self.output_link if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.sql_statements: - body["{sql_statements}"] = [v.as_dict() for v in self.sql_statements] + body["sql_statements"] = [v.as_dict() for v in self.sql_statements] if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -8234,7 +7367,7 @@ def as_dict(self) -> dict: """Serializes the SqlStatementOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.lookup_key is not None: - body["{lookup_key}"] = self.lookup_key + body["lookup_key"] = self.lookup_key return body def as_shallow_dict(self) -> dict: @@ -8277,17 +7410,17 @@ def as_dict(self) -> dict: """Serializes the SqlTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert: - body["{alert}"] = self.alert.as_dict() + body["alert"] = self.alert.as_dict() if self.dashboard: - body["{dashboard}"] = self.dashboard.as_dict() + body["dashboard"] = self.dashboard.as_dict() if self.file: - body["{file}"] = self.file.as_dict() + body["file"] = self.file.as_dict() if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.query: - body["{query}"] = self.query.as_dict() + body["query"] = self.query.as_dict() if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -8335,11 +7468,11 @@ def as_dict(self) -> dict: """Serializes the SqlTaskAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_id is not None: - body["{alert_id}"] = self.alert_id + body["alert_id"] = self.alert_id if self.pause_subscriptions is not None: - body["{pause_subscriptions}"] = self.pause_subscriptions + body["pause_subscriptions"] = self.pause_subscriptions if self.subscriptions: - body["{subscriptions}"] = [v.as_dict() for v in self.subscriptions] + body["subscriptions"] = [v.as_dict() for v in self.subscriptions] return body def as_shallow_dict(self) -> dict: @@ -8381,13 +7514,13 @@ def as_dict(self) -> dict: """Serializes the SqlTaskDashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.pause_subscriptions is not None: - body["{pause_subscriptions}"] = self.pause_subscriptions + body["pause_subscriptions"] = self.pause_subscriptions if self.subscriptions: - body["{subscriptions}"] = [v.as_dict() for v in self.subscriptions] + body["subscriptions"] = [v.as_dict() for v in self.subscriptions] return body def as_shallow_dict(self) -> dict: @@ -8433,9 +7566,9 @@ def as_dict(self) -> dict: """Serializes the SqlTaskFile into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.source is not None: - body["{source}"] = self.source.value + body["source"] = self.source.value return body def as_shallow_dict(self) -> dict: @@ -8462,7 +7595,7 @@ def as_dict(self) -> dict: """Serializes the SqlTaskQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id return body def as_shallow_dict(self) -> dict: @@ -8493,9 +7626,9 @@ def as_dict(self) -> dict: """Serializes the SqlTaskSubscription into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_id is not None: - body["{destination_id}"] = self.destination_id + body["destination_id"] = self.destination_id if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -8581,33 +7714,33 @@ def as_dict(self) -> dict: """Serializes the SubmitRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.email_notifications: - body["{email_notifications}"] = self.email_notifications.as_dict() + body["email_notifications"] = self.email_notifications.as_dict() if self.environments: - body["{environments}"] = [v.as_dict() for v in self.environments] + body["environments"] = [v.as_dict() for v in self.environments] if self.git_source: - body["{git_source}"] = self.git_source.as_dict() + body["git_source"] = self.git_source.as_dict() if self.health: - body["{health}"] = self.health.as_dict() + body["health"] = self.health.as_dict() if self.idempotency_token is not None: - body["{idempotency_token}"] = self.idempotency_token + body["idempotency_token"] = self.idempotency_token if self.notification_settings: - body["{notification_settings}"] = self.notification_settings.as_dict() + body["notification_settings"] = self.notification_settings.as_dict() if self.queue: - body["{queue}"] = self.queue.as_dict() + body["queue"] = self.queue.as_dict() if self.run_as: - body["{run_as}"] = self.run_as.as_dict() + body["run_as"] = self.run_as.as_dict() if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.tasks: - body["{tasks}"] = [v.as_dict() for v in self.tasks] + body["tasks"] = [v.as_dict() for v in self.tasks] if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications.as_dict() + body["webhook_notifications"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: @@ -8675,7 +7808,7 @@ def as_dict(self) -> dict: """Serializes the SubmitRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -8811,57 +7944,57 @@ def as_dict(self) -> dict: """Serializes the SubmitTask into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms_notebook_task: - body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task.as_dict() + body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() if self.condition_task: - body["{condition_task}"] = self.condition_task.as_dict() + body["condition_task"] = self.condition_task.as_dict() if self.dbt_task: - body["{dbt_task}"] = self.dbt_task.as_dict() + body["dbt_task"] = self.dbt_task.as_dict() if self.depends_on: - body["{depends_on}"] = [v.as_dict() for v in self.depends_on] + body["depends_on"] = [v.as_dict() for v in self.depends_on] if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.email_notifications: - body["{email_notifications}"] = self.email_notifications.as_dict() + body["email_notifications"] = self.email_notifications.as_dict() if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.for_each_task: - body["{for_each_task}"] = self.for_each_task.as_dict() + body["for_each_task"] = self.for_each_task.as_dict() if self.gen_ai_compute_task: - body["{gen_ai_compute_task}"] = self.gen_ai_compute_task.as_dict() + body["gen_ai_compute_task"] = self.gen_ai_compute_task.as_dict() if self.health: - body["{health}"] = self.health.as_dict() + body["health"] = self.health.as_dict() if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.new_cluster: - body["{new_cluster}"] = self.new_cluster.as_dict() + body["new_cluster"] = self.new_cluster.as_dict() if self.notebook_task: - body["{notebook_task}"] = self.notebook_task.as_dict() + body["notebook_task"] = self.notebook_task.as_dict() if self.notification_settings: - body["{notification_settings}"] = self.notification_settings.as_dict() + body["notification_settings"] = self.notification_settings.as_dict() if self.pipeline_task: - body["{pipeline_task}"] = self.pipeline_task.as_dict() + body["pipeline_task"] = self.pipeline_task.as_dict() if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task.as_dict() + body["python_wheel_task"] = self.python_wheel_task.as_dict() if self.run_if is not None: - body["{run_if}"] = self.run_if.value + body["run_if"] = self.run_if.value if self.run_job_task: - body["{run_job_task}"] = self.run_job_task.as_dict() + body["run_job_task"] = self.run_job_task.as_dict() if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task.as_dict() + body["spark_jar_task"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task.as_dict() + body["spark_python_task"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task.as_dict() + body["spark_submit_task"] = self.spark_submit_task.as_dict() if self.sql_task: - body["{sql_task}"] = self.sql_task.as_dict() + body["sql_task"] = self.sql_task.as_dict() if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications.as_dict() + body["webhook_notifications"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: @@ -8976,13 +8109,13 @@ def as_dict(self) -> dict: """Serializes the TableUpdateTriggerConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition is not None: - body["{condition}"] = self.condition.value + body["condition"] = self.condition.value if self.min_time_between_triggers_seconds is not None: - body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds + body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds if self.table_names: - body["{table_names}"] = [v for v in self.table_names] + body["table_names"] = [v for v in self.table_names] if self.wait_after_last_change_seconds is not None: - body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds + body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds return body def as_shallow_dict(self) -> dict: @@ -9083,7 +8216,7 @@ class Task: """An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.""" - new_cluster: Optional[JobsClusterSpec] = None + new_cluster: Optional[ClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -9154,67 +8287,67 @@ def as_dict(self) -> dict: """Serializes the Task into a dictionary suitable for use as a JSON request body.""" body = {} if self.clean_rooms_notebook_task: - body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task.as_dict() + body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() if self.condition_task: - body["{condition_task}"] = self.condition_task.as_dict() + body["condition_task"] = self.condition_task.as_dict() if self.dbt_task: - body["{dbt_task}"] = self.dbt_task.as_dict() + body["dbt_task"] = self.dbt_task.as_dict() if self.depends_on: - body["{depends_on}"] = [v.as_dict() for v in self.depends_on] + body["depends_on"] = [v.as_dict() for v in self.depends_on] if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.disable_auto_optimization is not None: - body["{disable_auto_optimization}"] = self.disable_auto_optimization + body["disable_auto_optimization"] = self.disable_auto_optimization if self.email_notifications: - body["{email_notifications}"] = self.email_notifications.as_dict() + body["email_notifications"] = self.email_notifications.as_dict() if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.for_each_task: - body["{for_each_task}"] = self.for_each_task.as_dict() + body["for_each_task"] = self.for_each_task.as_dict() if self.gen_ai_compute_task: - body["{gen_ai_compute_task}"] = self.gen_ai_compute_task.as_dict() + body["gen_ai_compute_task"] = self.gen_ai_compute_task.as_dict() if self.health: - body["{health}"] = self.health.as_dict() + body["health"] = self.health.as_dict() if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.max_retries is not None: - body["{max_retries}"] = self.max_retries + body["max_retries"] = self.max_retries if self.min_retry_interval_millis is not None: - body["{min_retry_interval_millis}"] = self.min_retry_interval_millis + body["min_retry_interval_millis"] = self.min_retry_interval_millis if self.new_cluster: - body["{new_cluster}"] = self.new_cluster.as_dict() + body["new_cluster"] = self.new_cluster.as_dict() if self.notebook_task: - body["{notebook_task}"] = self.notebook_task.as_dict() + body["notebook_task"] = self.notebook_task.as_dict() if self.notification_settings: - body["{notification_settings}"] = self.notification_settings.as_dict() + body["notification_settings"] = self.notification_settings.as_dict() if self.pipeline_task: - body["{pipeline_task}"] = self.pipeline_task.as_dict() + body["pipeline_task"] = self.pipeline_task.as_dict() if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task.as_dict() + body["python_wheel_task"] = self.python_wheel_task.as_dict() if self.retry_on_timeout is not None: - body["{retry_on_timeout}"] = self.retry_on_timeout + body["retry_on_timeout"] = self.retry_on_timeout if self.run_if is not None: - body["{run_if}"] = self.run_if.value + body["run_if"] = self.run_if.value if self.run_job_task: - body["{run_job_task}"] = self.run_job_task.as_dict() + body["run_job_task"] = self.run_job_task.as_dict() if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task.as_dict() + body["spark_jar_task"] = self.spark_jar_task.as_dict() if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task.as_dict() + body["spark_python_task"] = self.spark_python_task.as_dict() if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task.as_dict() + body["spark_submit_task"] = self.spark_submit_task.as_dict() if self.sql_task: - body["{sql_task}"] = self.sql_task.as_dict() + body["sql_task"] = self.sql_task.as_dict() if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications.as_dict() + body["webhook_notifications"] = self.webhook_notifications.as_dict() return body def as_shallow_dict(self) -> dict: @@ -9304,7 +8437,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Task: libraries=_repeated_dict(d, "{libraries}", Library), max_retries=d.get("{max_retries}", None), min_retry_interval_millis=d.get("{min_retry_interval_millis}", None), - new_cluster=_from_dict(d, "{new_cluster}", JobsClusterSpec), + new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), notebook_task=_from_dict(d, "{notebook_task}", NotebookTask), notification_settings=_from_dict(d, "{notification_settings}", TaskNotificationSettings), pipeline_task=_from_dict(d, "{pipeline_task}", PipelineTask), @@ -9335,9 +8468,9 @@ def as_dict(self) -> dict: """Serializes the TaskDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.outcome is not None: - body["{outcome}"] = self.outcome + body["outcome"] = self.outcome if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key return body def as_shallow_dict(self) -> dict: @@ -9394,17 +8527,17 @@ def as_dict(self) -> dict: """Serializes the TaskEmailNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["{on_duration_warning_threshold_exceeded}"] = [v for v in self.on_duration_warning_threshold_exceeded] + body["on_duration_warning_threshold_exceeded"] = [v for v in self.on_duration_warning_threshold_exceeded] if self.on_failure: - body["{on_failure}"] = [v for v in self.on_failure] + body["on_failure"] = [v for v in self.on_failure] if self.on_start: - body["{on_start}"] = [v for v in self.on_start] + body["on_start"] = [v for v in self.on_start] if self.on_streaming_backlog_exceeded: - body["{on_streaming_backlog_exceeded}"] = [v for v in self.on_streaming_backlog_exceeded] + body["on_streaming_backlog_exceeded"] = [v for v in self.on_streaming_backlog_exceeded] if self.on_success: - body["{on_success}"] = [v for v in self.on_success] + body["on_success"] = [v for v in self.on_success] return body def as_shallow_dict(self) -> dict: @@ -9456,11 +8589,11 @@ def as_dict(self) -> dict: """Serializes the TaskNotificationSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_on_last_attempt is not None: - body["{alert_on_last_attempt}"] = self.alert_on_last_attempt + body["alert_on_last_attempt"] = self.alert_on_last_attempt if self.no_alert_for_canceled_runs is not None: - body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs + body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs return body def as_shallow_dict(self) -> dict: @@ -9602,11 +8735,11 @@ def as_dict(self) -> dict: """Serializes the TerminationDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["{code}"] = self.code.value + body["code"] = self.code.value if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -9656,7 +8789,7 @@ def as_dict(self) -> dict: """Serializes the TriggerInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -9692,15 +8825,15 @@ def as_dict(self) -> dict: """Serializes the TriggerSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_arrival: - body["{file_arrival}"] = self.file_arrival.as_dict() + body["file_arrival"] = self.file_arrival.as_dict() if self.pause_status is not None: - body["{pause_status}"] = self.pause_status.value + body["pause_status"] = self.pause_status.value if self.periodic: - body["{periodic}"] = self.periodic.as_dict() + body["periodic"] = self.periodic.as_dict() if self.table: - body["{table}"] = self.table.as_dict() + body["table"] = self.table.as_dict() if self.table_update: - body["{table_update}"] = self.table_update.as_dict() + body["table_update"] = self.table_update.as_dict() return body def as_shallow_dict(self) -> dict: @@ -9775,11 +8908,11 @@ def as_dict(self) -> dict: """Serializes the UpdateJob into a dictionary suitable for use as a JSON request body.""" body = {} if self.fields_to_remove: - body["{fields_to_remove}"] = [v for v in self.fields_to_remove] + body["fields_to_remove"] = [v for v in self.fields_to_remove] if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.new_settings: - body["{new_settings}"] = self.new_settings.as_dict() + body["new_settings"] = self.new_settings.as_dict() return body def as_shallow_dict(self) -> dict: @@ -9837,11 +8970,11 @@ def as_dict(self) -> dict: """Serializes the ViewItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -9877,34 +9010,6 @@ class ViewsToExport(Enum): DASHBOARDS = "DASHBOARDS" -@dataclass -class VolumesStorageInfo: - """A storage location back by UC Volumes.""" - - destination: str - """UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` or - `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`""" - - def as_dict(self) -> dict: - """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: - """Deserializes the VolumesStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) - - @dataclass class Webhook: id: str @@ -9913,7 +9018,7 @@ def as_dict(self) -> dict: """Serializes the Webhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -9960,17 +9065,17 @@ def as_dict(self) -> dict: """Serializes the WebhookNotifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.on_duration_warning_threshold_exceeded: - body["{on_duration_warning_threshold_exceeded}"] = [ + body["on_duration_warning_threshold_exceeded"] = [ v.as_dict() for v in self.on_duration_warning_threshold_exceeded ] if self.on_failure: - body["{on_failure}"] = [v.as_dict() for v in self.on_failure] + body["on_failure"] = [v.as_dict() for v in self.on_failure] if self.on_start: - body["{on_start}"] = [v.as_dict() for v in self.on_start] + body["on_start"] = [v.as_dict() for v in self.on_start] if self.on_streaming_backlog_exceeded: - body["{on_streaming_backlog_exceeded}"] = [v.as_dict() for v in self.on_streaming_backlog_exceeded] + body["on_streaming_backlog_exceeded"] = [v.as_dict() for v in self.on_streaming_backlog_exceeded] if self.on_success: - body["{on_success}"] = [v.as_dict() for v in self.on_success] + body["on_success"] = [v.as_dict() for v in self.on_success] return body def as_shallow_dict(self) -> dict: @@ -10002,60 +9107,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WebhookNotifications: ) -@dataclass -class WorkloadType: - """Cluster Attributes showing for clusters workload types.""" - - clients: ClientsTypes - """defined what type of clients can use the cluster. E.g. Notebooks, Jobs""" - - def as_dict(self) -> dict: - """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.clients: - body["{clients}"] = self.clients.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" - body = {} - if self.clients: - body["{clients}"] = self.clients - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: - """Deserializes the WorkloadType from a dictionary.""" - return cls(clients=_from_dict(d, "{clients}", ClientsTypes)) - - -@dataclass -class WorkspaceStorageInfo: - """A storage location in Workspace Filesystem (WSFS)""" - - destination: str - """wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh`""" - - def as_dict(self) -> dict: - """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["{destination}"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: - """Deserializes the WorkspaceStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) - - class JobsAPI: """The Jobs API allows you to create, edit, and delete jobs. diff --git a/databricks/sdk/marketplace/v2/impl.py b/databricks/sdk/marketplace/v2/impl.py index a3c2425ad..d0f2b650b 100755 --- a/databricks/sdk/marketplace/v2/impl.py +++ b/databricks/sdk/marketplace/v2/impl.py @@ -25,9 +25,9 @@ def as_dict(self) -> dict: """Serializes the AddExchangeForListingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id return body def as_shallow_dict(self) -> dict: @@ -53,7 +53,7 @@ def as_dict(self) -> dict: """Serializes the AddExchangeForListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_for_listing: - body["{exchange_for_listing}"] = self.exchange_for_listing.as_dict() + body["exchange_for_listing"] = self.exchange_for_listing.as_dict() return body def as_shallow_dict(self) -> dict: @@ -88,7 +88,7 @@ def as_dict(self) -> dict: """Serializes the BatchGetListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["{listings}"] = [v.as_dict() for v in self.listings] + body["listings"] = [v.as_dict() for v in self.listings] return body def as_shallow_dict(self) -> dict: @@ -112,7 +112,7 @@ def as_dict(self) -> dict: """Serializes the BatchGetProvidersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.providers: - body["{providers}"] = [v.as_dict() for v in self.providers] + body["providers"] = [v.as_dict() for v in self.providers] return body def as_shallow_dict(self) -> dict: @@ -162,7 +162,7 @@ def as_dict(self) -> dict: """Serializes the ConsumerTerms into a dictionary suitable for use as a JSON request body.""" body = {} if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -194,13 +194,13 @@ def as_dict(self) -> dict: """Serializes the ContactInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.company is not None: - body["{company}"] = self.company + body["company"] = self.company if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email if self.first_name is not None: - body["{first_name}"] = self.first_name + body["first_name"] = self.first_name if self.last_name is not None: - body["{last_name}"] = self.last_name + body["last_name"] = self.last_name return body def as_shallow_dict(self) -> dict: @@ -241,7 +241,7 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeFilterRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter: - body["{filter}"] = self.filter.as_dict() + body["filter"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: @@ -265,7 +265,7 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeFilterResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter_id is not None: - body["{filter_id}"] = self.filter_id + body["filter_id"] = self.filter_id return body def as_shallow_dict(self) -> dict: @@ -289,7 +289,7 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange.as_dict() + body["exchange"] = self.exchange.as_dict() return body def as_shallow_dict(self) -> dict: @@ -313,7 +313,7 @@ def as_dict(self) -> dict: """Serializes the CreateExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id return body def as_shallow_dict(self) -> dict: @@ -343,13 +343,13 @@ def as_dict(self) -> dict: """Serializes the CreateFileRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.file_parent: - body["{file_parent}"] = self.file_parent.as_dict() + body["file_parent"] = self.file_parent.as_dict() if self.marketplace_file_type is not None: - body["{marketplace_file_type}"] = self.marketplace_file_type.value + body["marketplace_file_type"] = self.marketplace_file_type.value if self.mime_type is not None: - body["{mime_type}"] = self.mime_type + body["mime_type"] = self.mime_type return body def as_shallow_dict(self) -> dict: @@ -387,9 +387,9 @@ def as_dict(self) -> dict: """Serializes the CreateFileResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_info: - body["{file_info}"] = self.file_info.as_dict() + body["file_info"] = self.file_info.as_dict() if self.upload_url is not None: - body["{upload_url}"] = self.upload_url + body["upload_url"] = self.upload_url return body def as_shallow_dict(self) -> dict: @@ -426,17 +426,17 @@ def as_dict(self) -> dict: """Serializes the CreateInstallationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.accepted_consumer_terms: - body["{accepted_consumer_terms}"] = self.accepted_consumer_terms.as_dict() + body["accepted_consumer_terms"] = self.accepted_consumer_terms.as_dict() if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type.value + body["recipient_type"] = self.recipient_type.value if self.repo_detail: - body["{repo_detail}"] = self.repo_detail.as_dict() + body["repo_detail"] = self.repo_detail.as_dict() if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name return body def as_shallow_dict(self) -> dict: @@ -477,7 +477,7 @@ def as_dict(self) -> dict: """Serializes the CreateListingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing: - body["{listing}"] = self.listing.as_dict() + body["listing"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: @@ -501,7 +501,7 @@ def as_dict(self) -> dict: """Serializes the CreateListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id return body def as_shallow_dict(self) -> dict: @@ -543,23 +543,23 @@ def as_dict(self) -> dict: """Serializes the CreatePersonalizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.accepted_consumer_terms: - body["{accepted_consumer_terms}"] = self.accepted_consumer_terms.as_dict() + body["accepted_consumer_terms"] = self.accepted_consumer_terms.as_dict() if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.company is not None: - body["{company}"] = self.company + body["company"] = self.company if self.first_name is not None: - body["{first_name}"] = self.first_name + body["first_name"] = self.first_name if self.intended_use is not None: - body["{intended_use}"] = self.intended_use + body["intended_use"] = self.intended_use if self.is_from_lighthouse is not None: - body["{is_from_lighthouse}"] = self.is_from_lighthouse + body["is_from_lighthouse"] = self.is_from_lighthouse if self.last_name is not None: - body["{last_name}"] = self.last_name + body["last_name"] = self.last_name if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type.value + body["recipient_type"] = self.recipient_type.value return body def as_shallow_dict(self) -> dict: @@ -609,7 +609,7 @@ def as_dict(self) -> dict: """Serializes the CreatePersonalizationRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -633,7 +633,7 @@ def as_dict(self) -> dict: """Serializes the CreateProviderRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.provider: - body["{provider}"] = self.provider.as_dict() + body["provider"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: @@ -657,7 +657,7 @@ def as_dict(self) -> dict: """Serializes the CreateProviderResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -696,9 +696,9 @@ def as_dict(self) -> dict: """Serializes the DataRefreshInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.interval is not None: - body["{interval}"] = self.interval + body["interval"] = self.interval if self.unit is not None: - body["{unit}"] = self.unit.value + body["unit"] = self.unit.value return body def as_shallow_dict(self) -> dict: @@ -854,23 +854,23 @@ def as_dict(self) -> dict: """Serializes the Exchange into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.filters: - body["{filters}"] = [v.as_dict() for v in self.filters] + body["filters"] = [v.as_dict() for v in self.filters] if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.linked_listings: - body["{linked_listings}"] = [v.as_dict() for v in self.linked_listings] + body["linked_listings"] = [v.as_dict() for v in self.linked_listings] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -936,23 +936,23 @@ def as_dict(self) -> dict: """Serializes the ExchangeFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id if self.filter_type is not None: - body["{filter_type}"] = self.filter_type.value + body["filter_type"] = self.filter_type.value if self.filter_value is not None: - body["{filter_value}"] = self.filter_value + body["filter_value"] = self.filter_value if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -1019,19 +1019,19 @@ def as_dict(self) -> dict: """Serializes the ExchangeListing into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id if self.exchange_name is not None: - body["{exchange_name}"] = self.exchange_name + body["exchange_name"] = self.exchange_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.listing_name is not None: - body["{listing_name}"] = self.listing_name + body["listing_name"] = self.listing_name return body def as_shallow_dict(self) -> dict: @@ -1095,25 +1095,25 @@ def as_dict(self) -> dict: """Serializes the FileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.download_link is not None: - body["{download_link}"] = self.download_link + body["download_link"] = self.download_link if self.file_parent: - body["{file_parent}"] = self.file_parent.as_dict() + body["file_parent"] = self.file_parent.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.marketplace_file_type is not None: - body["{marketplace_file_type}"] = self.marketplace_file_type.value + body["marketplace_file_type"] = self.marketplace_file_type.value if self.mime_type is not None: - body["{mime_type}"] = self.mime_type + body["mime_type"] = self.mime_type if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body def as_shallow_dict(self) -> dict: @@ -1169,9 +1169,9 @@ def as_dict(self) -> dict: """Serializes the FileParent into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_parent_type is not None: - body["{file_parent_type}"] = self.file_parent_type.value + body["file_parent_type"] = self.file_parent_type.value if self.parent_id is not None: - body["{parent_id}"] = self.parent_id + body["parent_id"] = self.parent_id return body def as_shallow_dict(self) -> dict: @@ -1220,7 +1220,7 @@ def as_dict(self) -> dict: """Serializes the GetExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange.as_dict() + body["exchange"] = self.exchange.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1244,7 +1244,7 @@ def as_dict(self) -> dict: """Serializes the GetFileResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_info: - body["{file_info}"] = self.file_info.as_dict() + body["file_info"] = self.file_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1269,7 +1269,7 @@ def as_dict(self) -> dict: """Serializes the GetLatestVersionProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -1295,9 +1295,9 @@ def as_dict(self) -> dict: """Serializes the GetListingContentMetadataResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.shared_data_objects: - body["{shared_data_objects}"] = [v.as_dict() for v in self.shared_data_objects] + body["shared_data_objects"] = [v.as_dict() for v in self.shared_data_objects] return body def as_shallow_dict(self) -> dict: @@ -1326,7 +1326,7 @@ def as_dict(self) -> dict: """Serializes the GetListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing: - body["{listing}"] = self.listing.as_dict() + body["listing"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1352,9 +1352,9 @@ def as_dict(self) -> dict: """Serializes the GetListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["{listings}"] = [v.as_dict() for v in self.listings] + body["listings"] = [v.as_dict() for v in self.listings] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1380,7 +1380,7 @@ def as_dict(self) -> dict: """Serializes the GetPersonalizationRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.personalization_requests: - body["{personalization_requests}"] = [v.as_dict() for v in self.personalization_requests] + body["personalization_requests"] = [v.as_dict() for v in self.personalization_requests] return body def as_shallow_dict(self) -> dict: @@ -1404,7 +1404,7 @@ def as_dict(self) -> dict: """Serializes the GetProviderResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.provider: - body["{provider}"] = self.provider.as_dict() + body["provider"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1428,7 +1428,7 @@ def as_dict(self) -> dict: """Serializes the Installation into a dictionary suitable for use as a JSON request body.""" body = {} if self.installation: - body["{installation}"] = self.installation.as_dict() + body["installation"] = self.installation.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1476,31 +1476,31 @@ def as_dict(self) -> dict: """Serializes the InstallationDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.installed_on is not None: - body["{installed_on}"] = self.installed_on + body["installed_on"] = self.installed_on if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.listing_name is not None: - body["{listing_name}"] = self.listing_name + body["listing_name"] = self.listing_name if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type.value + body["recipient_type"] = self.recipient_type.value if self.repo_name is not None: - body["{repo_name}"] = self.repo_name + body["repo_name"] = self.repo_name if self.repo_path is not None: - body["{repo_path}"] = self.repo_path + body["repo_path"] = self.repo_path if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.token_detail: - body["{token_detail}"] = self.token_detail.as_dict() + body["token_detail"] = self.token_detail.as_dict() if self.tokens: - body["{tokens}"] = [v.as_dict() for v in self.tokens] + body["tokens"] = [v.as_dict() for v in self.tokens] return body def as_shallow_dict(self) -> dict: @@ -1570,9 +1570,9 @@ def as_dict(self) -> dict: """Serializes the ListAllInstallationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.installations: - body["{installations}"] = [v.as_dict() for v in self.installations] + body["installations"] = [v.as_dict() for v in self.installations] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1603,9 +1603,9 @@ def as_dict(self) -> dict: """Serializes the ListAllPersonalizationRequestsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.personalization_requests: - body["{personalization_requests}"] = [v.as_dict() for v in self.personalization_requests] + body["personalization_requests"] = [v.as_dict() for v in self.personalization_requests] return body def as_shallow_dict(self) -> dict: @@ -1636,9 +1636,9 @@ def as_dict(self) -> dict: """Serializes the ListExchangeFiltersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.filters: - body["{filters}"] = [v.as_dict() for v in self.filters] + body["filters"] = [v.as_dict() for v in self.filters] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1668,9 +1668,9 @@ def as_dict(self) -> dict: """Serializes the ListExchangesForListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_listing: - body["{exchange_listing}"] = [v.as_dict() for v in self.exchange_listing] + body["exchange_listing"] = [v.as_dict() for v in self.exchange_listing] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1701,9 +1701,9 @@ def as_dict(self) -> dict: """Serializes the ListExchangesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchanges: - body["{exchanges}"] = [v.as_dict() for v in self.exchanges] + body["exchanges"] = [v.as_dict() for v in self.exchanges] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1733,9 +1733,9 @@ def as_dict(self) -> dict: """Serializes the ListFilesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_infos: - body["{file_infos}"] = [v.as_dict() for v in self.file_infos] + body["file_infos"] = [v.as_dict() for v in self.file_infos] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1765,9 +1765,9 @@ def as_dict(self) -> dict: """Serializes the ListFulfillmentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.fulfillments: - body["{fulfillments}"] = [v.as_dict() for v in self.fulfillments] + body["fulfillments"] = [v.as_dict() for v in self.fulfillments] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1798,9 +1798,9 @@ def as_dict(self) -> dict: """Serializes the ListInstallationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.installations: - body["{installations}"] = [v.as_dict() for v in self.installations] + body["installations"] = [v.as_dict() for v in self.installations] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1831,9 +1831,9 @@ def as_dict(self) -> dict: """Serializes the ListListingsForExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange_listings: - body["{exchange_listings}"] = [v.as_dict() for v in self.exchange_listings] + body["exchange_listings"] = [v.as_dict() for v in self.exchange_listings] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1864,9 +1864,9 @@ def as_dict(self) -> dict: """Serializes the ListListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["{listings}"] = [v.as_dict() for v in self.listings] + body["listings"] = [v.as_dict() for v in self.listings] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -1897,11 +1897,11 @@ def as_dict(self) -> dict: """Serializes the ListProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -1931,9 +1931,9 @@ def as_dict(self) -> dict: """Serializes the ListProvidersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.providers: - body["{providers}"] = [v.as_dict() for v in self.providers] + body["providers"] = [v.as_dict() for v in self.providers] return body def as_shallow_dict(self) -> dict: @@ -1965,11 +1965,11 @@ def as_dict(self) -> dict: """Serializes the Listing into a dictionary suitable for use as a JSON request body.""" body = {} if self.detail: - body["{detail}"] = self.detail.as_dict() + body["detail"] = self.detail.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.summary: - body["{summary}"] = self.summary.as_dict() + body["summary"] = self.summary.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2056,43 +2056,43 @@ def as_dict(self) -> dict: """Serializes the ListingDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.assets: - body["{assets}"] = [v.value for v in self.assets] + body["assets"] = [v.value for v in self.assets] if self.collection_date_end is not None: - body["{collection_date_end}"] = self.collection_date_end + body["collection_date_end"] = self.collection_date_end if self.collection_date_start is not None: - body["{collection_date_start}"] = self.collection_date_start + body["collection_date_start"] = self.collection_date_start if self.collection_granularity: - body["{collection_granularity}"] = self.collection_granularity.as_dict() + body["collection_granularity"] = self.collection_granularity.as_dict() if self.cost is not None: - body["{cost}"] = self.cost.value + body["cost"] = self.cost.value if self.data_source is not None: - body["{data_source}"] = self.data_source + body["data_source"] = self.data_source if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.documentation_link is not None: - body["{documentation_link}"] = self.documentation_link + body["documentation_link"] = self.documentation_link if self.embedded_notebook_file_infos: - body["{embedded_notebook_file_infos}"] = [v.as_dict() for v in self.embedded_notebook_file_infos] + body["embedded_notebook_file_infos"] = [v.as_dict() for v in self.embedded_notebook_file_infos] if self.file_ids: - body["{file_ids}"] = [v for v in self.file_ids] + body["file_ids"] = [v for v in self.file_ids] if self.geographical_coverage is not None: - body["{geographical_coverage}"] = self.geographical_coverage + body["geographical_coverage"] = self.geographical_coverage if self.license is not None: - body["{license}"] = self.license + body["license"] = self.license if self.pricing_model is not None: - body["{pricing_model}"] = self.pricing_model + body["pricing_model"] = self.pricing_model if self.privacy_policy_link is not None: - body["{privacy_policy_link}"] = self.privacy_policy_link + body["privacy_policy_link"] = self.privacy_policy_link if self.size is not None: - body["{size}"] = self.size + body["size"] = self.size if self.support_link is not None: - body["{support_link}"] = self.support_link + body["support_link"] = self.support_link if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.terms_of_service is not None: - body["{terms_of_service}"] = self.terms_of_service + body["terms_of_service"] = self.terms_of_service if self.update_frequency: - body["{update_frequency}"] = self.update_frequency.as_dict() + body["update_frequency"] = self.update_frequency.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2180,15 +2180,15 @@ def as_dict(self) -> dict: """Serializes the ListingFulfillment into a dictionary suitable for use as a JSON request body.""" body = {} if self.fulfillment_type is not None: - body["{fulfillment_type}"] = self.fulfillment_type.value + body["fulfillment_type"] = self.fulfillment_type.value if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type.value + body["recipient_type"] = self.recipient_type.value if self.repo_info: - body["{repo_info}"] = self.repo_info.as_dict() + body["repo_info"] = self.repo_info.as_dict() if self.share_info: - body["{share_info}"] = self.share_info.as_dict() + body["share_info"] = self.share_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2226,7 +2226,7 @@ def as_dict(self) -> dict: """Serializes the ListingSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.visibility is not None: - body["{visibility}"] = self.visibility.value + body["visibility"] = self.visibility.value return body def as_shallow_dict(self) -> dict: @@ -2304,43 +2304,43 @@ def as_dict(self) -> dict: """Serializes the ListingSummary into a dictionary suitable for use as a JSON request body.""" body = {} if self.categories: - body["{categories}"] = [v.value for v in self.categories] + body["categories"] = [v.value for v in self.categories] if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.created_by_id is not None: - body["{created_by_id}"] = self.created_by_id + body["created_by_id"] = self.created_by_id if self.exchange_ids: - body["{exchange_ids}"] = [v for v in self.exchange_ids] + body["exchange_ids"] = [v for v in self.exchange_ids] if self.git_repo: - body["{git_repo}"] = self.git_repo.as_dict() + body["git_repo"] = self.git_repo.as_dict() if self.listing_type is not None: - body["{listing_type}"] = self.listing_type.value + body["listingType"] = self.listing_type.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.provider_id is not None: - body["{provider_id}"] = self.provider_id + body["provider_id"] = self.provider_id if self.provider_region: - body["{provider_region}"] = self.provider_region.as_dict() + body["provider_region"] = self.provider_region.as_dict() if self.published_at is not None: - body["{published_at}"] = self.published_at + body["published_at"] = self.published_at if self.published_by is not None: - body["{published_by}"] = self.published_by + body["published_by"] = self.published_by if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() if self.share: - body["{share}"] = self.share.as_dict() + body["share"] = self.share.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.subtitle is not None: - body["{subtitle}"] = self.subtitle + body["subtitle"] = self.subtitle if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.updated_by_id is not None: - body["{updated_by_id}"] = self.updated_by_id + body["updated_by_id"] = self.updated_by_id return body def as_shallow_dict(self) -> dict: @@ -2424,9 +2424,9 @@ def as_dict(self) -> dict: """Serializes the ListingTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.tag_name is not None: - body["{tag_name}"] = self.tag_name.value + body["tag_name"] = self.tag_name.value if self.tag_values: - body["{tag_values}"] = [v for v in self.tag_values] + body["tag_values"] = [v for v in self.tag_values] return body def as_shallow_dict(self) -> dict: @@ -2502,37 +2502,37 @@ def as_dict(self) -> dict: """Serializes the PersonalizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.consumer_region: - body["{consumer_region}"] = self.consumer_region.as_dict() + body["consumer_region"] = self.consumer_region.as_dict() if self.contact_info: - body["{contact_info}"] = self.contact_info.as_dict() + body["contact_info"] = self.contact_info.as_dict() if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.intended_use is not None: - body["{intended_use}"] = self.intended_use + body["intended_use"] = self.intended_use if self.is_from_lighthouse is not None: - body["{is_from_lighthouse}"] = self.is_from_lighthouse + body["is_from_lighthouse"] = self.is_from_lighthouse if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.listing_name is not None: - body["{listing_name}"] = self.listing_name + body["listing_name"] = self.listing_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.provider_id is not None: - body["{provider_id}"] = self.provider_id + body["provider_id"] = self.provider_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type.value + body["recipient_type"] = self.recipient_type.value if self.share: - body["{share}"] = self.share.as_dict() + body["share"] = self.share.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body def as_shallow_dict(self) -> dict: @@ -2611,7 +2611,7 @@ def as_dict(self) -> dict: """Serializes the ProviderAnalyticsDashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -2663,33 +2663,33 @@ def as_dict(self) -> dict: """Serializes the ProviderInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.business_contact_email is not None: - body["{business_contact_email}"] = self.business_contact_email + body["business_contact_email"] = self.business_contact_email if self.company_website_link is not None: - body["{company_website_link}"] = self.company_website_link + body["company_website_link"] = self.company_website_link if self.dark_mode_icon_file_id is not None: - body["{dark_mode_icon_file_id}"] = self.dark_mode_icon_file_id + body["dark_mode_icon_file_id"] = self.dark_mode_icon_file_id if self.dark_mode_icon_file_path is not None: - body["{dark_mode_icon_file_path}"] = self.dark_mode_icon_file_path + body["dark_mode_icon_file_path"] = self.dark_mode_icon_file_path if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.icon_file_id is not None: - body["{icon_file_id}"] = self.icon_file_id + body["icon_file_id"] = self.icon_file_id if self.icon_file_path is not None: - body["{icon_file_path}"] = self.icon_file_path + body["icon_file_path"] = self.icon_file_path if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_featured is not None: - body["{is_featured}"] = self.is_featured + body["is_featured"] = self.is_featured if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.privacy_policy_link is not None: - body["{privacy_policy_link}"] = self.privacy_policy_link + body["privacy_policy_link"] = self.privacy_policy_link if self.published_by is not None: - body["{published_by}"] = self.published_by + body["published_by"] = self.published_by if self.support_contact_email is not None: - body["{support_contact_email}"] = self.support_contact_email + body["support_contact_email"] = self.support_contact_email if self.term_of_service_link is not None: - body["{term_of_service_link}"] = self.term_of_service_link + body["term_of_service_link"] = self.term_of_service_link return body def as_shallow_dict(self) -> dict: @@ -2756,9 +2756,9 @@ def as_dict(self) -> dict: """Serializes the RegionInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -2803,7 +2803,7 @@ def as_dict(self) -> dict: """Serializes the RepoInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.git_repo_url is not None: - body["{git_repo_url}"] = self.git_repo_url + body["git_repo_url"] = self.git_repo_url return body def as_shallow_dict(self) -> dict: @@ -2832,9 +2832,9 @@ def as_dict(self) -> dict: """Serializes the RepoInstallation into a dictionary suitable for use as a JSON request body.""" body = {} if self.repo_name is not None: - body["{repo_name}"] = self.repo_name + body["repo_name"] = self.repo_name if self.repo_path is not None: - body["{repo_path}"] = self.repo_path + body["repo_path"] = self.repo_path return body def as_shallow_dict(self) -> dict: @@ -2862,9 +2862,9 @@ def as_dict(self) -> dict: """Serializes the SearchListingsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listings: - body["{listings}"] = [v.as_dict() for v in self.listings] + body["listings"] = [v.as_dict() for v in self.listings] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -2892,9 +2892,9 @@ def as_dict(self) -> dict: """Serializes the ShareInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -2924,9 +2924,9 @@ def as_dict(self) -> dict: """Serializes the SharedDataObject into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_object_type is not None: - body["{data_object_type}"] = self.data_object_type + body["data_object_type"] = self.data_object_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -2960,13 +2960,13 @@ def as_dict(self) -> dict: """Serializes the TokenDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.bearer_token is not None: - body["{bearer_token}"] = self.bearer_token + body["bearerToken"] = self.bearer_token if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expirationTime"] = self.expiration_time if self.share_credentials_version is not None: - body["{share_credentials_version}"] = self.share_credentials_version + body["shareCredentialsVersion"] = self.share_credentials_version return body def as_shallow_dict(self) -> dict: @@ -3021,19 +3021,19 @@ def as_dict(self) -> dict: """Serializes the TokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.activation_url is not None: - body["{activation_url}"] = self.activation_url + body["activation_url"] = self.activation_url if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -3079,9 +3079,9 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeFilterRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter: - body["{filter}"] = self.filter.as_dict() + body["filter"] = self.filter.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -3107,7 +3107,7 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeFilterResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter: - body["{filter}"] = self.filter.as_dict() + body["filter"] = self.filter.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3133,9 +3133,9 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange.as_dict() + body["exchange"] = self.exchange.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -3161,7 +3161,7 @@ def as_dict(self) -> dict: """Serializes the UpdateExchangeResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange.as_dict() + body["exchange"] = self.exchange.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3191,13 +3191,13 @@ def as_dict(self) -> dict: """Serializes the UpdateInstallationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.installation: - body["{installation}"] = self.installation.as_dict() + body["installation"] = self.installation.as_dict() if self.installation_id is not None: - body["{installation_id}"] = self.installation_id + body["installation_id"] = self.installation_id if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.rotate_token is not None: - body["{rotate_token}"] = self.rotate_token + body["rotate_token"] = self.rotate_token return body def as_shallow_dict(self) -> dict: @@ -3232,7 +3232,7 @@ def as_dict(self) -> dict: """Serializes the UpdateInstallationResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.installation: - body["{installation}"] = self.installation.as_dict() + body["installation"] = self.installation.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3258,9 +3258,9 @@ def as_dict(self) -> dict: """Serializes the UpdateListingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.listing: - body["{listing}"] = self.listing.as_dict() + body["listing"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3286,7 +3286,7 @@ def as_dict(self) -> dict: """Serializes the UpdateListingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing: - body["{listing}"] = self.listing.as_dict() + body["listing"] = self.listing.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3318,15 +3318,15 @@ def as_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.reason is not None: - body["{reason}"] = self.reason + body["reason"] = self.reason if self.request_id is not None: - body["{request_id}"] = self.request_id + body["request_id"] = self.request_id if self.share: - body["{share}"] = self.share.as_dict() + body["share"] = self.share.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -3364,7 +3364,7 @@ def as_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.request: - body["{request}"] = self.request.as_dict() + body["request"] = self.request.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3393,9 +3393,9 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -3427,11 +3427,11 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -3461,9 +3461,9 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.provider: - body["{provider}"] = self.provider.as_dict() + body["provider"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3489,7 +3489,7 @@ def as_dict(self) -> dict: """Serializes the UpdateProviderResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.provider: - body["{provider}"] = self.provider.as_dict() + body["provider"] = self.provider.as_dict() return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/ml/v2/impl.py b/databricks/sdk/ml/v2/impl.py index 597386986..d4a08bbc5 100755 --- a/databricks/sdk/ml/v2/impl.py +++ b/databricks/sdk/ml/v2/impl.py @@ -81,23 +81,23 @@ def as_dict(self) -> dict: """Serializes the Activity into a dictionary suitable for use as a JSON request body.""" body = {} if self.activity_type is not None: - body["{activity_type}"] = self.activity_type.value + body["activity_type"] = self.activity_type.value if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.from_stage is not None: - body["{from_stage}"] = self.from_stage.value + body["from_stage"] = self.from_stage.value if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.system_comment is not None: - body["{system_comment}"] = self.system_comment + body["system_comment"] = self.system_comment if self.to_stage is not None: - body["{to_stage}"] = self.to_stage.value + body["to_stage"] = self.to_stage.value if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -205,15 +205,15 @@ def as_dict(self) -> dict: """Serializes the ApproveTransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.archive_existing_versions is not None: - body["{archive_existing_versions}"] = self.archive_existing_versions + body["archive_existing_versions"] = self.archive_existing_versions if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage.value + body["stage"] = self.stage.value if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -252,7 +252,7 @@ def as_dict(self) -> dict: """Serializes the ApproveTransitionRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.activity: - body["{activity}"] = self.activity.as_dict() + body["activity"] = self.activity.as_dict() return body def as_shallow_dict(self) -> dict: @@ -304,17 +304,17 @@ def as_dict(self) -> dict: """Serializes the CommentObject into a dictionary suitable for use as a JSON request body.""" body = {} if self.available_actions: - body["{available_actions}"] = [v.value for v in self.available_actions] + body["available_actions"] = [v.value for v in self.available_actions] if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -362,11 +362,11 @@ def as_dict(self) -> dict: """Serializes the CreateComment into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -395,7 +395,7 @@ def as_dict(self) -> dict: """Serializes the CreateCommentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment: - body["{comment}"] = self.comment.as_dict() + body["comment"] = self.comment.as_dict() return body def as_shallow_dict(self) -> dict: @@ -430,11 +430,11 @@ def as_dict(self) -> dict: """Serializes the CreateExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_location is not None: - body["{artifact_location}"] = self.artifact_location + body["artifact_location"] = self.artifact_location if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -467,7 +467,7 @@ def as_dict(self) -> dict: """Serializes the CreateExperimentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body def as_shallow_dict(self) -> dict: @@ -545,35 +545,35 @@ def as_dict(self) -> dict: """Serializes the CreateForecastingExperimentRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_weights_column is not None: - body["{custom_weights_column}"] = self.custom_weights_column + body["custom_weights_column"] = self.custom_weights_column if self.experiment_path is not None: - body["{experiment_path}"] = self.experiment_path + body["experiment_path"] = self.experiment_path if self.forecast_granularity is not None: - body["{forecast_granularity}"] = self.forecast_granularity + body["forecast_granularity"] = self.forecast_granularity if self.forecast_horizon is not None: - body["{forecast_horizon}"] = self.forecast_horizon + body["forecast_horizon"] = self.forecast_horizon if self.holiday_regions: - body["{holiday_regions}"] = [v for v in self.holiday_regions] + body["holiday_regions"] = [v for v in self.holiday_regions] if self.max_runtime is not None: - body["{max_runtime}"] = self.max_runtime + body["max_runtime"] = self.max_runtime if self.prediction_data_path is not None: - body["{prediction_data_path}"] = self.prediction_data_path + body["prediction_data_path"] = self.prediction_data_path if self.primary_metric is not None: - body["{primary_metric}"] = self.primary_metric + body["primary_metric"] = self.primary_metric if self.register_to is not None: - body["{register_to}"] = self.register_to + body["register_to"] = self.register_to if self.split_column is not None: - body["{split_column}"] = self.split_column + body["split_column"] = self.split_column if self.target_column is not None: - body["{target_column}"] = self.target_column + body["target_column"] = self.target_column if self.time_column is not None: - body["{time_column}"] = self.time_column + body["time_column"] = self.time_column if self.timeseries_identifier_columns: - body["{timeseries_identifier_columns}"] = [v for v in self.timeseries_identifier_columns] + body["timeseries_identifier_columns"] = [v for v in self.timeseries_identifier_columns] if self.train_data_path is not None: - body["{train_data_path}"] = self.train_data_path + body["train_data_path"] = self.train_data_path if self.training_frameworks: - body["{training_frameworks}"] = [v for v in self.training_frameworks] + body["training_frameworks"] = [v for v in self.training_frameworks] return body def as_shallow_dict(self) -> dict: @@ -642,7 +642,7 @@ def as_dict(self) -> dict: """Serializes the CreateForecastingExperimentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body def as_shallow_dict(self) -> dict: @@ -673,11 +673,11 @@ def as_dict(self) -> dict: """Serializes the CreateModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -709,7 +709,7 @@ def as_dict(self) -> dict: """Serializes the CreateModelResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.registered_model: - body["{registered_model}"] = self.registered_model.as_dict() + body["registered_model"] = self.registered_model.as_dict() return body def as_shallow_dict(self) -> dict: @@ -751,17 +751,17 @@ def as_dict(self) -> dict: """Serializes the CreateModelVersionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_link is not None: - body["{run_link}"] = self.run_link + body["run_link"] = self.run_link if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -803,7 +803,7 @@ def as_dict(self) -> dict: """Serializes the CreateModelVersionResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_version: - body["{model_version}"] = self.model_version.as_dict() + body["model_version"] = self.model_version.as_dict() return body def as_shallow_dict(self) -> dict: @@ -874,17 +874,17 @@ def as_dict(self) -> dict: """Serializes the CreateRegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.events: - body["{events}"] = [v.value for v in self.events] + body["events"] = [v.value for v in self.events] if self.http_url_spec: - body["{http_url_spec}"] = self.http_url_spec.as_dict() + body["http_url_spec"] = self.http_url_spec.as_dict() if self.job_spec: - body["{job_spec}"] = self.job_spec.as_dict() + body["job_spec"] = self.job_spec.as_dict() if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -939,15 +939,15 @@ def as_dict(self) -> dict: """Serializes the CreateRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -986,7 +986,7 @@ def as_dict(self) -> dict: """Serializes the CreateRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run: - body["{run}"] = self.run.as_dict() + body["run"] = self.run.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1028,13 +1028,13 @@ def as_dict(self) -> dict: """Serializes the CreateTransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage.value + body["stage"] = self.stage.value if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -1070,7 +1070,7 @@ def as_dict(self) -> dict: """Serializes the CreateTransitionRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.request: - body["{request}"] = self.request.as_dict() + body["request"] = self.request.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1094,7 +1094,7 @@ def as_dict(self) -> dict: """Serializes the CreateWebhookResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.webhook: - body["{webhook}"] = self.webhook.as_dict() + body["webhook"] = self.webhook.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1141,17 +1141,17 @@ def as_dict(self) -> dict: """Serializes the Dataset into a dictionary suitable for use as a JSON request body.""" body = {} if self.digest is not None: - body["{digest}"] = self.digest + body["digest"] = self.digest if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.profile is not None: - body["{profile}"] = self.profile + body["profile"] = self.profile if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.source_type is not None: - body["{source_type}"] = self.source_type + body["source_type"] = self.source_type return body def as_shallow_dict(self) -> dict: @@ -1198,9 +1198,9 @@ def as_dict(self) -> dict: """Serializes the DatasetInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset: - body["{dataset}"] = self.dataset.as_dict() + body["dataset"] = self.dataset.as_dict() if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -1245,7 +1245,7 @@ def as_dict(self) -> dict: """Serializes the DeleteExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body def as_shallow_dict(self) -> dict: @@ -1360,7 +1360,7 @@ def as_dict(self) -> dict: """Serializes the DeleteRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -1411,11 +1411,11 @@ def as_dict(self) -> dict: """Serializes the DeleteRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.max_runs is not None: - body["{max_runs}"] = self.max_runs + body["max_runs"] = self.max_runs if self.max_timestamp_millis is not None: - body["{max_timestamp_millis}"] = self.max_timestamp_millis + body["max_timestamp_millis"] = self.max_timestamp_millis return body def as_shallow_dict(self) -> dict: @@ -1448,7 +1448,7 @@ def as_dict(self) -> dict: """Serializes the DeleteRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.runs_deleted is not None: - body["{runs_deleted}"] = self.runs_deleted + body["runs_deleted"] = self.runs_deleted return body def as_shallow_dict(self) -> dict: @@ -1476,9 +1476,9 @@ def as_dict(self) -> dict: """Serializes the DeleteTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -1588,19 +1588,19 @@ def as_dict(self) -> dict: """Serializes the Experiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_location is not None: - body["{artifact_location}"] = self.artifact_location + body["artifact_location"] = self.artifact_location if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.last_update_time is not None: - body["{last_update_time}"] = self.last_update_time + body["last_update_time"] = self.last_update_time if self.lifecycle_stage is not None: - body["{lifecycle_stage}"] = self.lifecycle_stage + body["lifecycle_stage"] = self.lifecycle_stage if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -1654,13 +1654,13 @@ def as_dict(self) -> dict: """Serializes the ExperimentAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -1708,15 +1708,15 @@ def as_dict(self) -> dict: """Serializes the ExperimentAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -1759,11 +1759,11 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1807,11 +1807,11 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -1846,9 +1846,9 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1880,9 +1880,9 @@ def as_dict(self) -> dict: """Serializes the ExperimentPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body def as_shallow_dict(self) -> dict: @@ -1917,9 +1917,9 @@ def as_dict(self) -> dict: """Serializes the ExperimentTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -1954,11 +1954,11 @@ def as_dict(self) -> dict: """Serializes the FileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.file_size is not None: - body["{file_size}"] = self.file_size + body["file_size"] = self.file_size if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["is_dir"] = self.is_dir if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -1995,11 +1995,11 @@ def as_dict(self) -> dict: """Serializes the ForecastingExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.experiment_page_url is not None: - body["{experiment_page_url}"] = self.experiment_page_url + body["experiment_page_url"] = self.experiment_page_url if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -2041,7 +2041,7 @@ def as_dict(self) -> dict: """Serializes the GetExperimentByNameResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment: - body["{experiment}"] = self.experiment.as_dict() + body["experiment"] = self.experiment.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2066,7 +2066,7 @@ def as_dict(self) -> dict: """Serializes the GetExperimentPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -2091,7 +2091,7 @@ def as_dict(self) -> dict: """Serializes the GetExperimentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment: - body["{experiment}"] = self.experiment.as_dict() + body["experiment"] = self.experiment.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2119,9 +2119,9 @@ def as_dict(self) -> dict: """Serializes the GetLatestVersionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stages: - body["{stages}"] = [v for v in self.stages] + body["stages"] = [v for v in self.stages] return body def as_shallow_dict(self) -> dict: @@ -2149,7 +2149,7 @@ def as_dict(self) -> dict: """Serializes the GetLatestVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_versions: - body["{model_versions}"] = [v.as_dict() for v in self.model_versions] + body["model_versions"] = [v.as_dict() for v in self.model_versions] return body def as_shallow_dict(self) -> dict: @@ -2180,9 +2180,9 @@ def as_dict(self) -> dict: """Serializes the GetMetricHistoryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.metrics: - body["{metrics}"] = [v.as_dict() for v in self.metrics] + body["metrics"] = [v.as_dict() for v in self.metrics] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -2208,7 +2208,7 @@ def as_dict(self) -> dict: """Serializes the GetModelResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.registered_model_databricks: - body["{registered_model_databricks}"] = self.registered_model_databricks.as_dict() + body["registered_model_databricks"] = self.registered_model_databricks.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2233,7 +2233,7 @@ def as_dict(self) -> dict: """Serializes the GetModelVersionDownloadUriResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_uri is not None: - body["{artifact_uri}"] = self.artifact_uri + body["artifact_uri"] = self.artifact_uri return body def as_shallow_dict(self) -> dict: @@ -2257,7 +2257,7 @@ def as_dict(self) -> dict: """Serializes the GetModelVersionResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_version: - body["{model_version}"] = self.model_version.as_dict() + body["model_version"] = self.model_version.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2282,7 +2282,7 @@ def as_dict(self) -> dict: """Serializes the GetRegisteredModelPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -2307,7 +2307,7 @@ def as_dict(self) -> dict: """Serializes the GetRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run: - body["{run}"] = self.run.as_dict() + body["run"] = self.run.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2348,13 +2348,13 @@ def as_dict(self) -> dict: """Serializes the HttpUrlSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.authorization is not None: - body["{authorization}"] = self.authorization + body["authorization"] = self.authorization if self.enable_ssl_verification is not None: - body["{enable_ssl_verification}"] = self.enable_ssl_verification + body["enable_ssl_verification"] = self.enable_ssl_verification if self.secret is not None: - body["{secret}"] = self.secret + body["secret"] = self.secret if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -2397,9 +2397,9 @@ def as_dict(self) -> dict: """Serializes the HttpUrlSpecWithoutSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.enable_ssl_verification is not None: - body["{enable_ssl_verification}"] = self.enable_ssl_verification + body["enable_ssl_verification"] = self.enable_ssl_verification if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -2431,9 +2431,9 @@ def as_dict(self) -> dict: """Serializes the InputTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -2467,11 +2467,11 @@ def as_dict(self) -> dict: """Serializes the JobSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_token is not None: - body["{access_token}"] = self.access_token + body["access_token"] = self.access_token if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.workspace_url is not None: - body["{workspace_url}"] = self.workspace_url + body["workspace_url"] = self.workspace_url return body def as_shallow_dict(self) -> dict: @@ -2509,9 +2509,9 @@ def as_dict(self) -> dict: """Serializes the JobSpecWithoutSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.workspace_url is not None: - body["{workspace_url}"] = self.workspace_url + body["workspace_url"] = self.workspace_url return body def as_shallow_dict(self) -> dict: @@ -2544,11 +2544,11 @@ def as_dict(self) -> dict: """Serializes the ListArtifactsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.files: - body["{files}"] = [v.as_dict() for v in self.files] + body["files"] = [v.as_dict() for v in self.files] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.root_uri is not None: - body["{root_uri}"] = self.root_uri + body["root_uri"] = self.root_uri return body def as_shallow_dict(self) -> dict: @@ -2585,9 +2585,9 @@ def as_dict(self) -> dict: """Serializes the ListExperimentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiments: - body["{experiments}"] = [v.as_dict() for v in self.experiments] + body["experiments"] = [v.as_dict() for v in self.experiments] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -2618,9 +2618,9 @@ def as_dict(self) -> dict: """Serializes the ListModelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.registered_models: - body["{registered_models}"] = [v.as_dict() for v in self.registered_models] + body["registered_models"] = [v.as_dict() for v in self.registered_models] return body def as_shallow_dict(self) -> dict: @@ -2653,9 +2653,9 @@ def as_dict(self) -> dict: """Serializes the ListRegistryWebhooks into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.webhooks: - body["{webhooks}"] = [v.as_dict() for v in self.webhooks] + body["webhooks"] = [v.as_dict() for v in self.webhooks] return body def as_shallow_dict(self) -> dict: @@ -2684,7 +2684,7 @@ def as_dict(self) -> dict: """Serializes the ListTransitionRequestsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.requests: - body["{requests}"] = [v.as_dict() for v in self.requests] + body["requests"] = [v.as_dict() for v in self.requests] return body def as_shallow_dict(self) -> dict: @@ -2721,13 +2721,13 @@ def as_dict(self) -> dict: """Serializes the LogBatch into a dictionary suitable for use as a JSON request body.""" body = {} if self.metrics: - body["{metrics}"] = [v.as_dict() for v in self.metrics] + body["metrics"] = [v.as_dict() for v in self.metrics] if self.params: - body["{params}"] = [v.as_dict() for v in self.params] + body["params"] = [v.as_dict() for v in self.params] if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -2787,11 +2787,11 @@ def as_dict(self) -> dict: """Serializes the LogInputs into a dictionary suitable for use as a JSON request body.""" body = {} if self.datasets: - body["{datasets}"] = [v.as_dict() for v in self.datasets] + body["datasets"] = [v.as_dict() for v in self.datasets] if self.models: - body["{models}"] = [v.as_dict() for v in self.models] + body["models"] = [v.as_dict() for v in self.models] if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -2869,23 +2869,23 @@ def as_dict(self) -> dict: """Serializes the LogMetric into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset_digest is not None: - body["{dataset_digest}"] = self.dataset_digest + body["dataset_digest"] = self.dataset_digest if self.dataset_name is not None: - body["{dataset_name}"] = self.dataset_name + body["dataset_name"] = self.dataset_name if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.model_id is not None: - body["{model_id}"] = self.model_id + body["model_id"] = self.model_id if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.step is not None: - body["{step}"] = self.step + body["step"] = self.step if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -2957,9 +2957,9 @@ def as_dict(self) -> dict: """Serializes the LogModel into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_json is not None: - body["{model_json}"] = self.model_json + body["model_json"] = self.model_json if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -3007,9 +3007,9 @@ def as_dict(self) -> dict: """Serializes the LogOutputsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.models: - body["{models}"] = [v.as_dict() for v in self.models] + body["models"] = [v.as_dict() for v in self.models] if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -3046,13 +3046,13 @@ def as_dict(self) -> dict: """Serializes the LogParam into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -3132,21 +3132,21 @@ def as_dict(self) -> dict: """Serializes the Metric into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset_digest is not None: - body["{dataset_digest}"] = self.dataset_digest + body["dataset_digest"] = self.dataset_digest if self.dataset_name is not None: - body["{dataset_name}"] = self.dataset_name + body["dataset_name"] = self.dataset_name if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.model_id is not None: - body["{model_id}"] = self.model_id + body["model_id"] = self.model_id if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.step is not None: - body["{step}"] = self.step + body["step"] = self.step if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -3213,19 +3213,19 @@ def as_dict(self) -> dict: """Serializes the Model into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.latest_versions: - body["{latest_versions}"] = [v.as_dict() for v in self.latest_versions] + body["latest_versions"] = [v.as_dict() for v in self.latest_versions] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -3295,23 +3295,23 @@ def as_dict(self) -> dict: """Serializes the ModelDatabricks into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.latest_versions: - body["{latest_versions}"] = [v.as_dict() for v in self.latest_versions] + body["latest_versions"] = [v.as_dict() for v in self.latest_versions] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -3364,7 +3364,7 @@ def as_dict(self) -> dict: """Serializes the ModelInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_id is not None: - body["{model_id}"] = self.model_id + body["model_id"] = self.model_id return body def as_shallow_dict(self) -> dict: @@ -3392,9 +3392,9 @@ def as_dict(self) -> dict: """Serializes the ModelTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -3458,31 +3458,31 @@ def as_dict(self) -> dict: """Serializes the ModelVersion into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.current_stage is not None: - body["{current_stage}"] = self.current_stage + body["current_stage"] = self.current_stage if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_link is not None: - body["{run_link}"] = self.run_link + body["run_link"] = self.run_link if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -3601,33 +3601,33 @@ def as_dict(self) -> dict: """Serializes the ModelVersionDatabricks into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.current_stage is not None: - body["{current_stage}"] = self.current_stage.value + body["current_stage"] = self.current_stage.value if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_link is not None: - body["{run_link}"] = self.run_link + body["run_link"] = self.run_link if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -3704,9 +3704,9 @@ def as_dict(self) -> dict: """Serializes the ModelVersionTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -3738,9 +3738,9 @@ def as_dict(self) -> dict: """Serializes the Param into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -3787,13 +3787,13 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3841,15 +3841,15 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3892,11 +3892,11 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -3942,11 +3942,11 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -3981,9 +3981,9 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -4015,9 +4015,9 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.registered_model_id is not None: - body["{registered_model_id}"] = self.registered_model_id + body["registered_model_id"] = self.registered_model_id return body def as_shallow_dict(self) -> dict: @@ -4102,23 +4102,23 @@ def as_dict(self) -> dict: """Serializes the RegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.events: - body["{events}"] = [v.value for v in self.events] + body["events"] = [v.value for v in self.events] if self.http_url_spec: - body["{http_url_spec}"] = self.http_url_spec.as_dict() + body["http_url_spec"] = self.http_url_spec.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.job_spec: - body["{job_spec}"] = self.job_spec.as_dict() + body["job_spec"] = self.job_spec.as_dict() if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -4216,13 +4216,13 @@ def as_dict(self) -> dict: """Serializes the RejectTransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage.value + body["stage"] = self.stage.value if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -4258,7 +4258,7 @@ def as_dict(self) -> dict: """Serializes the RejectTransitionRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.activity: - body["{activity}"] = self.activity.as_dict() + body["activity"] = self.activity.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4286,9 +4286,9 @@ def as_dict(self) -> dict: """Serializes the RenameModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name return body def as_shallow_dict(self) -> dict: @@ -4314,7 +4314,7 @@ def as_dict(self) -> dict: """Serializes the RenameModelResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.registered_model: - body["{registered_model}"] = self.registered_model.as_dict() + body["registered_model"] = self.registered_model.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4339,7 +4339,7 @@ def as_dict(self) -> dict: """Serializes the RestoreExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body def as_shallow_dict(self) -> dict: @@ -4382,7 +4382,7 @@ def as_dict(self) -> dict: """Serializes the RestoreRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body def as_shallow_dict(self) -> dict: @@ -4433,11 +4433,11 @@ def as_dict(self) -> dict: """Serializes the RestoreRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.max_runs is not None: - body["{max_runs}"] = self.max_runs + body["max_runs"] = self.max_runs if self.min_timestamp_millis is not None: - body["{min_timestamp_millis}"] = self.min_timestamp_millis + body["min_timestamp_millis"] = self.min_timestamp_millis return body def as_shallow_dict(self) -> dict: @@ -4470,7 +4470,7 @@ def as_dict(self) -> dict: """Serializes the RestoreRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.runs_restored is not None: - body["{runs_restored}"] = self.runs_restored + body["runs_restored"] = self.runs_restored return body def as_shallow_dict(self) -> dict: @@ -4503,11 +4503,11 @@ def as_dict(self) -> dict: """Serializes the Run into a dictionary suitable for use as a JSON request body.""" body = {} if self.data: - body["{data}"] = self.data.as_dict() + body["data"] = self.data.as_dict() if self.info: - body["{info}"] = self.info.as_dict() + body["info"] = self.info.as_dict() if self.inputs: - body["{inputs}"] = self.inputs.as_dict() + body["inputs"] = self.inputs.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4548,11 +4548,11 @@ def as_dict(self) -> dict: """Serializes the RunData into a dictionary suitable for use as a JSON request body.""" body = {} if self.metrics: - body["{metrics}"] = [v.as_dict() for v in self.metrics] + body["metrics"] = [v.as_dict() for v in self.metrics] if self.params: - body["{params}"] = [v.as_dict() for v in self.params] + body["params"] = [v.as_dict() for v in self.params] if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -4618,25 +4618,25 @@ def as_dict(self) -> dict: """Serializes the RunInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.artifact_uri is not None: - body["{artifact_uri}"] = self.artifact_uri + body["artifact_uri"] = self.artifact_uri if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.lifecycle_stage is not None: - body["{lifecycle_stage}"] = self.lifecycle_stage + body["lifecycle_stage"] = self.lifecycle_stage if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -4708,9 +4708,9 @@ def as_dict(self) -> dict: """Serializes the RunInputs into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataset_inputs: - body["{dataset_inputs}"] = [v.as_dict() for v in self.dataset_inputs] + body["dataset_inputs"] = [v.as_dict() for v in self.dataset_inputs] if self.model_inputs: - body["{model_inputs}"] = [v.as_dict() for v in self.model_inputs] + body["model_inputs"] = [v.as_dict() for v in self.model_inputs] return body def as_shallow_dict(self) -> dict: @@ -4745,9 +4745,9 @@ def as_dict(self) -> dict: """Serializes the RunTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -4789,15 +4789,15 @@ def as_dict(self) -> dict: """Serializes the SearchExperiments into a dictionary suitable for use as a JSON request body.""" body = {} if self.filter is not None: - body["{filter}"] = self.filter + body["filter"] = self.filter if self.max_results is not None: - body["{max_results}"] = self.max_results + body["max_results"] = self.max_results if self.order_by: - body["{order_by}"] = [v for v in self.order_by] + body["order_by"] = [v for v in self.order_by] if self.page_token is not None: - body["{page_token}"] = self.page_token + body["page_token"] = self.page_token if self.view_type is not None: - body["{view_type}"] = self.view_type.value + body["view_type"] = self.view_type.value return body def as_shallow_dict(self) -> dict: @@ -4840,9 +4840,9 @@ def as_dict(self) -> dict: """Serializes the SearchExperimentsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiments: - body["{experiments}"] = [v.as_dict() for v in self.experiments] + body["experiments"] = [v.as_dict() for v in self.experiments] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4874,9 +4874,9 @@ def as_dict(self) -> dict: """Serializes the SearchModelVersionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_versions: - body["{model_versions}"] = [v.as_dict() for v in self.model_versions] + body["model_versions"] = [v.as_dict() for v in self.model_versions] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -4909,9 +4909,9 @@ def as_dict(self) -> dict: """Serializes the SearchModelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.registered_models: - body["{registered_models}"] = [v.as_dict() for v in self.registered_models] + body["registered_models"] = [v.as_dict() for v in self.registered_models] return body def as_shallow_dict(self) -> dict: @@ -4969,17 +4969,17 @@ def as_dict(self) -> dict: """Serializes the SearchRuns into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_ids: - body["{experiment_ids}"] = [v for v in self.experiment_ids] + body["experiment_ids"] = [v for v in self.experiment_ids] if self.filter is not None: - body["{filter}"] = self.filter + body["filter"] = self.filter if self.max_results is not None: - body["{max_results}"] = self.max_results + body["max_results"] = self.max_results if self.order_by: - body["{order_by}"] = [v for v in self.order_by] + body["order_by"] = [v for v in self.order_by] if self.page_token is not None: - body["{page_token}"] = self.page_token + body["page_token"] = self.page_token if self.run_view_type is not None: - body["{run_view_type}"] = self.run_view_type.value + body["run_view_type"] = self.run_view_type.value return body def as_shallow_dict(self) -> dict: @@ -5024,9 +5024,9 @@ def as_dict(self) -> dict: """Serializes the SearchRunsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.runs: - body["{runs}"] = [v.as_dict() for v in self.runs] + body["runs"] = [v.as_dict() for v in self.runs] return body def as_shallow_dict(self) -> dict: @@ -5059,11 +5059,11 @@ def as_dict(self) -> dict: """Serializes the SetExperimentTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -5119,11 +5119,11 @@ def as_dict(self) -> dict: """Serializes the SetModelTagRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -5182,13 +5182,13 @@ def as_dict(self) -> dict: """Serializes the SetModelVersionTagRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -5252,13 +5252,13 @@ def as_dict(self) -> dict: """Serializes the SetTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -5347,9 +5347,9 @@ def as_dict(self) -> dict: """Serializes the TestRegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.body is not None: - body["{body}"] = self.body + body["body"] = self.body if self.status_code is not None: - body["{status_code}"] = self.status_code + body["status_code"] = self.status_code return body def as_shallow_dict(self) -> dict: @@ -5380,9 +5380,9 @@ def as_dict(self) -> dict: """Serializes the TestRegistryWebhookRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.event is not None: - body["{event}"] = self.event.value + body["event"] = self.event.value if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -5409,7 +5409,7 @@ def as_dict(self) -> dict: """Serializes the TestRegistryWebhookResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.webhook: - body["{webhook}"] = self.webhook.as_dict() + body["webhook"] = self.webhook.as_dict() return body def as_shallow_dict(self) -> dict: @@ -5454,15 +5454,15 @@ def as_dict(self) -> dict: """Serializes the TransitionModelVersionStageDatabricks into a dictionary suitable for use as a JSON request body.""" body = {} if self.archive_existing_versions is not None: - body["{archive_existing_versions}"] = self.archive_existing_versions + body["archive_existing_versions"] = self.archive_existing_versions if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage.value + body["stage"] = self.stage.value if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -5523,15 +5523,15 @@ def as_dict(self) -> dict: """Serializes the TransitionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.available_actions: - body["{available_actions}"] = [v.value for v in self.available_actions] + body["available_actions"] = [v.value for v in self.available_actions] if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.to_stage is not None: - body["{to_stage}"] = self.to_stage.value + body["to_stage"] = self.to_stage.value if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -5569,7 +5569,7 @@ def as_dict(self) -> dict: """Serializes the TransitionStageResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_version: - body["{model_version}"] = self.model_version.as_dict() + body["model_version"] = self.model_version.as_dict() return body def as_shallow_dict(self) -> dict: @@ -5597,9 +5597,9 @@ def as_dict(self) -> dict: """Serializes the UpdateComment into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -5626,7 +5626,7 @@ def as_dict(self) -> dict: """Serializes the UpdateCommentResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment: - body["{comment}"] = self.comment.as_dict() + body["comment"] = self.comment.as_dict() return body def as_shallow_dict(self) -> dict: @@ -5654,9 +5654,9 @@ def as_dict(self) -> dict: """Serializes the UpdateExperiment into a dictionary suitable for use as a JSON request body.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name return body def as_shallow_dict(self) -> dict: @@ -5704,9 +5704,9 @@ def as_dict(self) -> dict: """Serializes the UpdateModelRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -5757,11 +5757,11 @@ def as_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body def as_shallow_dict(self) -> dict: @@ -5856,17 +5856,17 @@ def as_dict(self) -> dict: """Serializes the UpdateRegistryWebhook into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.events: - body["{events}"] = [v.value for v in self.events] + body["events"] = [v.value for v in self.events] if self.http_url_spec: - body["{http_url_spec}"] = self.http_url_spec.as_dict() + body["http_url_spec"] = self.http_url_spec.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.job_spec: - body["{job_spec}"] = self.job_spec.as_dict() + body["job_spec"] = self.job_spec.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -5921,15 +5921,15 @@ def as_dict(self) -> dict: """Serializes the UpdateRun into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -5968,7 +5968,7 @@ def as_dict(self) -> dict: """Serializes the UpdateRunResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.run_info: - body["{run_info}"] = self.run_info.as_dict() + body["run_info"] = self.run_info.as_dict() return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/oauth2/v2/impl.py b/databricks/sdk/oauth2/v2/impl.py index 37b93d62e..490887b9a 100755 --- a/databricks/sdk/oauth2/v2/impl.py +++ b/databricks/sdk/oauth2/v2/impl.py @@ -39,17 +39,17 @@ def as_dict(self) -> dict: """Serializes the CreateCustomAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.confidential is not None: - body["{confidential}"] = self.confidential + body["confidential"] = self.confidential if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.redirect_urls: - body["{redirect_urls}"] = [v for v in self.redirect_urls] + body["redirect_urls"] = [v for v in self.redirect_urls] if self.scopes: - body["{scopes}"] = [v for v in self.scopes] + body["scopes"] = [v for v in self.scopes] if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy.as_dict() + body["token_access_policy"] = self.token_access_policy.as_dict() if self.user_authorized_scopes: - body["{user_authorized_scopes}"] = [v for v in self.user_authorized_scopes] + body["user_authorized_scopes"] = [v for v in self.user_authorized_scopes] return body def as_shallow_dict(self) -> dict: @@ -98,11 +98,11 @@ def as_dict(self) -> dict: """Serializes the CreateCustomAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.client_id is not None: - body["{client_id}"] = self.client_id + body["client_id"] = self.client_id if self.client_secret is not None: - body["{client_secret}"] = self.client_secret + body["client_secret"] = self.client_secret if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id return body def as_shallow_dict(self) -> dict: @@ -138,9 +138,9 @@ def as_dict(self) -> dict: """Serializes the CreatePublishedAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_id is not None: - body["{app_id}"] = self.app_id + body["app_id"] = self.app_id if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy.as_dict() + body["token_access_policy"] = self.token_access_policy.as_dict() return body def as_shallow_dict(self) -> dict: @@ -170,7 +170,7 @@ def as_dict(self) -> dict: """Serializes the CreatePublishedAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id return body def as_shallow_dict(self) -> dict: @@ -199,9 +199,9 @@ def as_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.lifetime is not None: - body["{lifetime}"] = self.lifetime + body["lifetime"] = self.lifetime if self.service_principal_id is not None: - body["{service_principal_id}"] = self.service_principal_id + body["service_principal_id"] = self.service_principal_id return body def as_shallow_dict(self) -> dict: @@ -246,19 +246,19 @@ def as_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.expire_time is not None: - body["{expire_time}"] = self.expire_time + body["expire_time"] = self.expire_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.secret is not None: - body["{secret}"] = self.secret + body["secret"] = self.secret if self.secret_hash is not None: - body["{secret_hash}"] = self.secret_hash + body["secret_hash"] = self.secret_hash if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -378,17 +378,17 @@ def as_dict(self) -> dict: """Serializes the FederationPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.oidc_policy: - body["{oidc_policy}"] = self.oidc_policy.as_dict() + body["oidc_policy"] = self.oidc_policy.as_dict() if self.uid is not None: - body["{uid}"] = self.uid + body["uid"] = self.uid if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -457,27 +457,27 @@ def as_dict(self) -> dict: """Serializes the GetCustomAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.client_id is not None: - body["{client_id}"] = self.client_id + body["client_id"] = self.client_id if self.confidential is not None: - body["{confidential}"] = self.confidential + body["confidential"] = self.confidential if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.creator_username is not None: - body["{creator_username}"] = self.creator_username + body["creator_username"] = self.creator_username if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.redirect_urls: - body["{redirect_urls}"] = [v for v in self.redirect_urls] + body["redirect_urls"] = [v for v in self.redirect_urls] if self.scopes: - body["{scopes}"] = [v for v in self.scopes] + body["scopes"] = [v for v in self.scopes] if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy.as_dict() + body["token_access_policy"] = self.token_access_policy.as_dict() if self.user_authorized_scopes: - body["{user_authorized_scopes}"] = [v for v in self.user_authorized_scopes] + body["user_authorized_scopes"] = [v for v in self.user_authorized_scopes] return body def as_shallow_dict(self) -> dict: @@ -536,9 +536,9 @@ def as_dict(self) -> dict: """Serializes the GetCustomAppIntegrationsOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["{apps}"] = [v.as_dict() for v in self.apps] + body["apps"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -581,17 +581,17 @@ def as_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_id is not None: - body["{app_id}"] = self.app_id + body["app_id"] = self.app_id if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy.as_dict() + body["token_access_policy"] = self.token_access_policy.as_dict() return body def as_shallow_dict(self) -> dict: @@ -635,9 +635,9 @@ def as_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationsOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["{apps}"] = [v.as_dict() for v in self.apps] + body["apps"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -671,9 +671,9 @@ def as_dict(self) -> dict: """Serializes the GetPublishedAppsOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.apps: - body["{apps}"] = [v.as_dict() for v in self.apps] + body["apps"] = [v.as_dict() for v in self.apps] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -703,9 +703,9 @@ def as_dict(self) -> dict: """Serializes the ListFederationPoliciesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.policies: - body["{policies}"] = [v.as_dict() for v in self.policies] + body["policies"] = [v.as_dict() for v in self.policies] return body def as_shallow_dict(self) -> dict: @@ -737,9 +737,9 @@ def as_dict(self) -> dict: """Serializes the ListServicePrincipalSecretsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.secrets: - body["{secrets}"] = [v.as_dict() for v in self.secrets] + body["secrets"] = [v.as_dict() for v in self.secrets] return body def as_shallow_dict(self) -> dict: @@ -797,17 +797,17 @@ def as_dict(self) -> dict: """Serializes the OidcFederationPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.audiences: - body["{audiences}"] = [v for v in self.audiences] + body["audiences"] = [v for v in self.audiences] if self.issuer is not None: - body["{issuer}"] = self.issuer + body["issuer"] = self.issuer if self.jwks_json is not None: - body["{jwks_json}"] = self.jwks_json + body["jwks_json"] = self.jwks_json if self.jwks_uri is not None: - body["{jwks_uri}"] = self.jwks_uri + body["jwks_uri"] = self.jwks_uri if self.subject is not None: - body["{subject}"] = self.subject + body["subject"] = self.subject if self.subject_claim is not None: - body["{subject_claim}"] = self.subject_claim + body["subject_claim"] = self.subject_claim return body def as_shallow_dict(self) -> dict: @@ -868,19 +868,19 @@ def as_dict(self) -> dict: """Serializes the PublishedAppOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.app_id is not None: - body["{app_id}"] = self.app_id + body["app_id"] = self.app_id if self.client_id is not None: - body["{client_id}"] = self.client_id + body["client_id"] = self.client_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.is_confidential_client is not None: - body["{is_confidential_client}"] = self.is_confidential_client + body["is_confidential_client"] = self.is_confidential_client if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.redirect_urls: - body["{redirect_urls}"] = [v for v in self.redirect_urls] + body["redirect_urls"] = [v for v in self.redirect_urls] if self.scopes: - body["{scopes}"] = [v for v in self.scopes] + body["scopes"] = [v for v in self.scopes] return body def as_shallow_dict(self) -> dict: @@ -940,17 +940,17 @@ def as_dict(self) -> dict: """Serializes the SecretInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.expire_time is not None: - body["{expire_time}"] = self.expire_time + body["expire_time"] = self.expire_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.secret_hash is not None: - body["{secret_hash}"] = self.secret_hash + body["secret_hash"] = self.secret_hash if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -995,9 +995,9 @@ def as_dict(self) -> dict: """Serializes the TokenAccessPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_token_ttl_in_minutes is not None: - body["{access_token_ttl_in_minutes}"] = self.access_token_ttl_in_minutes + body["access_token_ttl_in_minutes"] = self.access_token_ttl_in_minutes if self.refresh_token_ttl_in_minutes is not None: - body["{refresh_token_ttl_in_minutes}"] = self.refresh_token_ttl_in_minutes + body["refresh_token_ttl_in_minutes"] = self.refresh_token_ttl_in_minutes return body def as_shallow_dict(self) -> dict: @@ -1040,15 +1040,15 @@ def as_dict(self) -> dict: """Serializes the UpdateCustomAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.redirect_urls: - body["{redirect_urls}"] = [v for v in self.redirect_urls] + body["redirect_urls"] = [v for v in self.redirect_urls] if self.scopes: - body["{scopes}"] = [v for v in self.scopes] + body["scopes"] = [v for v in self.scopes] if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy.as_dict() + body["token_access_policy"] = self.token_access_policy.as_dict() if self.user_authorized_scopes: - body["{user_authorized_scopes}"] = [v for v in self.user_authorized_scopes] + body["user_authorized_scopes"] = [v for v in self.user_authorized_scopes] return body def as_shallow_dict(self) -> dict: @@ -1107,9 +1107,9 @@ def as_dict(self) -> dict: """Serializes the UpdatePublishedAppIntegration into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy.as_dict() + body["token_access_policy"] = self.token_access_policy.as_dict() return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/pipelines/v2/impl.py b/databricks/sdk/pipelines/v2/impl.py index 4d35d9a28..5786adc41 100755 --- a/databricks/sdk/pipelines/v2/impl.py +++ b/databricks/sdk/pipelines/v2/impl.py @@ -28,7 +28,7 @@ def as_dict(self) -> dict: """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -128,25 +128,25 @@ def as_dict(self) -> dict: """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.ebs_volume_count is not None: - body["{ebs_volume_count}"] = self.ebs_volume_count + body["ebs_volume_count"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["{ebs_volume_iops}"] = self.ebs_volume_iops + body["ebs_volume_iops"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["{ebs_volume_size}"] = self.ebs_volume_size + body["ebs_volume_size"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["{ebs_volume_throughput}"] = self.ebs_volume_throughput + body["ebs_volume_throughput"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type.value + body["ebs_volume_type"] = self.ebs_volume_type.value if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent + body["spot_bid_price_percent"] = self.spot_bid_price_percent if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body def as_shallow_dict(self) -> dict: @@ -231,13 +231,13 @@ def as_dict(self) -> dict: """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.log_analytics_info: - body["{log_analytics_info}"] = self.log_analytics_info.as_dict() + body["log_analytics_info"] = self.log_analytics_info.as_dict() if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price + body["spot_bid_max_price"] = self.spot_bid_max_price return body def as_shallow_dict(self) -> dict: @@ -295,11 +295,11 @@ def as_dict(self) -> dict: """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbfs: - body["{dbfs}"] = self.dbfs.as_dict() + body["dbfs"] = self.dbfs.as_dict() if self.s3: - body["{s3}"] = self.s3.as_dict() + body["s3"] = self.s3.as_dict() if self.volumes: - body["{volumes}"] = self.volumes.as_dict() + body["volumes"] = self.volumes.as_dict() return body def as_shallow_dict(self) -> dict: @@ -420,59 +420,59 @@ def as_dict(self) -> dict: """Serializes the CreatePipeline into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_duplicate_names is not None: - body["{allow_duplicate_names}"] = self.allow_duplicate_names + body["allow_duplicate_names"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.channel is not None: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.clusters: - body["{clusters}"] = [v.as_dict() for v in self.clusters] + body["clusters"] = [v.as_dict() for v in self.clusters] if self.configuration: - body["{configuration}"] = self.configuration + body["configuration"] = self.configuration if self.continuous is not None: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment.as_dict() + body["deployment"] = self.deployment.as_dict() if self.development is not None: - body["{development}"] = self.development + body["development"] = self.development if self.dry_run is not None: - body["{dry_run}"] = self.dry_run + body["dry_run"] = self.dry_run if self.edition is not None: - body["{edition}"] = self.edition + body["edition"] = self.edition if self.event_log: - body["{event_log}"] = self.event_log.as_dict() + body["event_log"] = self.event_log.as_dict() if self.filters: - body["{filters}"] = self.filters.as_dict() + body["filters"] = self.filters.as_dict() if self.gateway_definition: - body["{gateway_definition}"] = self.gateway_definition.as_dict() + body["gateway_definition"] = self.gateway_definition.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.ingestion_definition: - body["{ingestion_definition}"] = self.ingestion_definition.as_dict() + body["ingestion_definition"] = self.ingestion_definition.as_dict() if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notifications: - body["{notifications}"] = [v.as_dict() for v in self.notifications] + body["notifications"] = [v.as_dict() for v in self.notifications] if self.photon is not None: - body["{photon}"] = self.photon + body["photon"] = self.photon if self.restart_window: - body["{restart_window}"] = self.restart_window.as_dict() + body["restart_window"] = self.restart_window.as_dict() if self.run_as: - body["{run_as}"] = self.run_as.as_dict() + body["run_as"] = self.run_as.as_dict() if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.serverless is not None: - body["{serverless}"] = self.serverless + body["serverless"] = self.serverless if self.storage is not None: - body["{storage}"] = self.storage + body["storage"] = self.storage if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target if self.trigger: - body["{trigger}"] = self.trigger.as_dict() + body["trigger"] = self.trigger.as_dict() return body def as_shallow_dict(self) -> dict: @@ -580,9 +580,9 @@ def as_dict(self) -> dict: """Serializes the CreatePipelineResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.effective_settings: - body["{effective_settings}"] = self.effective_settings.as_dict() + body["effective_settings"] = self.effective_settings.as_dict() if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id return body def as_shallow_dict(self) -> dict: @@ -613,9 +613,9 @@ def as_dict(self) -> dict: """Serializes the CronTrigger into a dictionary suitable for use as a JSON request body.""" body = {} if self.quartz_cron_schedule is not None: - body["{quartz_cron_schedule}"] = self.quartz_cron_schedule + body["quartz_cron_schedule"] = self.quartz_cron_schedule if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body def as_shallow_dict(self) -> dict: @@ -645,9 +645,9 @@ def as_dict(self) -> dict: """Serializes the DataPlaneId into a dictionary suitable for use as a JSON request body.""" body = {} if self.instance is not None: - body["{instance}"] = self.instance + body["instance"] = self.instance if self.seq_no is not None: - body["{seq_no}"] = self.seq_no + body["seq_no"] = self.seq_no return body def as_shallow_dict(self) -> dict: @@ -689,7 +689,7 @@ def as_dict(self) -> dict: """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -840,61 +840,61 @@ def as_dict(self) -> dict: """Serializes the EditPipeline into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_duplicate_names is not None: - body["{allow_duplicate_names}"] = self.allow_duplicate_names + body["allow_duplicate_names"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.channel is not None: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.clusters: - body["{clusters}"] = [v.as_dict() for v in self.clusters] + body["clusters"] = [v.as_dict() for v in self.clusters] if self.configuration: - body["{configuration}"] = self.configuration + body["configuration"] = self.configuration if self.continuous is not None: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment.as_dict() + body["deployment"] = self.deployment.as_dict() if self.development is not None: - body["{development}"] = self.development + body["development"] = self.development if self.edition is not None: - body["{edition}"] = self.edition + body["edition"] = self.edition if self.event_log: - body["{event_log}"] = self.event_log.as_dict() + body["event_log"] = self.event_log.as_dict() if self.expected_last_modified is not None: - body["{expected_last_modified}"] = self.expected_last_modified + body["expected_last_modified"] = self.expected_last_modified if self.filters: - body["{filters}"] = self.filters.as_dict() + body["filters"] = self.filters.as_dict() if self.gateway_definition: - body["{gateway_definition}"] = self.gateway_definition.as_dict() + body["gateway_definition"] = self.gateway_definition.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.ingestion_definition: - body["{ingestion_definition}"] = self.ingestion_definition.as_dict() + body["ingestion_definition"] = self.ingestion_definition.as_dict() if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notifications: - body["{notifications}"] = [v.as_dict() for v in self.notifications] + body["notifications"] = [v.as_dict() for v in self.notifications] if self.photon is not None: - body["{photon}"] = self.photon + body["photon"] = self.photon if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.restart_window: - body["{restart_window}"] = self.restart_window.as_dict() + body["restart_window"] = self.restart_window.as_dict() if self.run_as: - body["{run_as}"] = self.run_as.as_dict() + body["run_as"] = self.run_as.as_dict() if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.serverless is not None: - body["{serverless}"] = self.serverless + body["serverless"] = self.serverless if self.storage is not None: - body["{storage}"] = self.storage + body["storage"] = self.storage if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target if self.trigger: - body["{trigger}"] = self.trigger.as_dict() + body["trigger"] = self.trigger.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1023,9 +1023,9 @@ def as_dict(self) -> dict: """Serializes the ErrorDetail into a dictionary suitable for use as a JSON request body.""" body = {} if self.exceptions: - body["{exceptions}"] = [v.as_dict() for v in self.exceptions] + body["exceptions"] = [v.as_dict() for v in self.exceptions] if self.fatal is not None: - body["{fatal}"] = self.fatal + body["fatal"] = self.fatal return body def as_shallow_dict(self) -> dict: @@ -1069,11 +1069,11 @@ def as_dict(self) -> dict: """Serializes the EventLogSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema return body def as_shallow_dict(self) -> dict: @@ -1102,7 +1102,7 @@ def as_dict(self) -> dict: """Serializes the FileLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -1130,9 +1130,9 @@ def as_dict(self) -> dict: """Serializes the Filters into a dictionary suitable for use as a JSON request body.""" body = {} if self.exclude: - body["{exclude}"] = [v for v in self.exclude] + body["exclude"] = [v for v in self.exclude] if self.include: - body["{include}"] = [v for v in self.include] + body["include"] = [v for v in self.include] return body def as_shallow_dict(self) -> dict: @@ -1189,17 +1189,17 @@ def as_dict(self) -> dict: """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability.value + body["availability"] = self.availability.value if self.boot_disk_size is not None: - body["{boot_disk_size}"] = self.boot_disk_size + body["boot_disk_size"] = self.boot_disk_size if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count + body["local_ssd_count"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["{use_preemptible_executors}"] = self.use_preemptible_executors + body["use_preemptible_executors"] = self.use_preemptible_executors if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body def as_shallow_dict(self) -> dict: @@ -1252,7 +1252,7 @@ def as_dict(self) -> dict: """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -1277,7 +1277,7 @@ def as_dict(self) -> dict: """Serializes the GetPipelinePermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -1335,29 +1335,29 @@ def as_dict(self) -> dict: """Serializes the GetPipelineResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause + body["cause"] = self.cause if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.health is not None: - body["{health}"] = self.health.value + body["health"] = self.health.value if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last_modified"] = self.last_modified if self.latest_updates: - body["{latest_updates}"] = [v.as_dict() for v in self.latest_updates] + body["latest_updates"] = [v.as_dict() for v in self.latest_updates] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.run_as_user_name is not None: - body["{run_as_user_name}"] = self.run_as_user_name + body["run_as_user_name"] = self.run_as_user_name if self.spec: - body["{spec}"] = self.spec.as_dict() + body["spec"] = self.spec.as_dict() if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -1424,7 +1424,7 @@ def as_dict(self) -> dict: """Serializes the GetUpdateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.update: - body["{update}"] = self.update.as_dict() + body["update"] = self.update.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1455,11 +1455,11 @@ def as_dict(self) -> dict: """Serializes the IngestionConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.report: - body["{report}"] = self.report.as_dict() + body["report"] = self.report.as_dict() if self.schema: - body["{schema}"] = self.schema.as_dict() + body["schema"] = self.schema.as_dict() if self.table: - body["{table}"] = self.table.as_dict() + body["table"] = self.table.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1508,15 +1508,15 @@ def as_dict(self) -> dict: """Serializes the IngestionGatewayPipelineDefinition into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_id is not None: - body["{connection_id}"] = self.connection_id + body["connection_id"] = self.connection_id if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.gateway_storage_catalog is not None: - body["{gateway_storage_catalog}"] = self.gateway_storage_catalog + body["gateway_storage_catalog"] = self.gateway_storage_catalog if self.gateway_storage_name is not None: - body["{gateway_storage_name}"] = self.gateway_storage_name + body["gateway_storage_name"] = self.gateway_storage_name if self.gateway_storage_schema is not None: - body["{gateway_storage_schema}"] = self.gateway_storage_schema + body["gateway_storage_schema"] = self.gateway_storage_schema return body def as_shallow_dict(self) -> dict: @@ -1567,13 +1567,13 @@ def as_dict(self) -> dict: """Serializes the IngestionPipelineDefinition into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.ingestion_gateway_id is not None: - body["{ingestion_gateway_id}"] = self.ingestion_gateway_id + body["ingestion_gateway_id"] = self.ingestion_gateway_id if self.objects: - body["{objects}"] = [v.as_dict() for v in self.objects] + body["objects"] = [v.as_dict() for v in self.objects] if self.table_configuration: - body["{table_configuration}"] = self.table_configuration.as_dict() + body["table_configuration"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1636,19 +1636,19 @@ def as_dict(self) -> dict: """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.abfss: - body["{abfss}"] = self.abfss.as_dict() + body["abfss"] = self.abfss.as_dict() if self.dbfs: - body["{dbfs}"] = self.dbfs.as_dict() + body["dbfs"] = self.dbfs.as_dict() if self.file: - body["{file}"] = self.file.as_dict() + body["file"] = self.file.as_dict() if self.gcs: - body["{gcs}"] = self.gcs.as_dict() + body["gcs"] = self.gcs.as_dict() if self.s3: - body["{s3}"] = self.s3.as_dict() + body["s3"] = self.s3.as_dict() if self.volumes: - body["{volumes}"] = self.volumes.as_dict() + body["volumes"] = self.volumes.as_dict() if self.workspace: - body["{workspace}"] = self.workspace.as_dict() + body["workspace"] = self.workspace.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1699,11 +1699,11 @@ def as_dict(self) -> dict: """Serializes the ListPipelineEventsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.events: - body["{events}"] = [v.as_dict() for v in self.events] + body["events"] = [v.as_dict() for v in self.events] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body def as_shallow_dict(self) -> dict: @@ -1739,9 +1739,9 @@ def as_dict(self) -> dict: """Serializes the ListPipelinesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.statuses: - body["{statuses}"] = [v.as_dict() for v in self.statuses] + body["statuses"] = [v.as_dict() for v in self.statuses] return body def as_shallow_dict(self) -> dict: @@ -1777,11 +1777,11 @@ def as_dict(self) -> dict: """Serializes the ListUpdatesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token if self.updates: - body["{updates}"] = [v.as_dict() for v in self.updates] + body["updates"] = [v.as_dict() for v in self.updates] return body def as_shallow_dict(self) -> dict: @@ -1814,7 +1814,7 @@ def as_dict(self) -> dict: """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -1840,9 +1840,9 @@ def as_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.log_analytics_primary_key is not None: - body["{log_analytics_primary_key}"] = self.log_analytics_primary_key + body["log_analytics_primary_key"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id return body def as_shallow_dict(self) -> dict: @@ -1908,11 +1908,11 @@ def as_dict(self) -> dict: """Serializes the MavenLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.coordinates is not None: - body["{coordinates}"] = self.coordinates + body["coordinates"] = self.coordinates if self.exclusions: - body["{exclusions}"] = [v for v in self.exclusions] + body["exclusions"] = [v for v in self.exclusions] if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body def as_shallow_dict(self) -> dict: @@ -1943,7 +1943,7 @@ def as_dict(self) -> dict: """Serializes the NotebookLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -1976,9 +1976,9 @@ def as_dict(self) -> dict: """Serializes the Notifications into a dictionary suitable for use as a JSON request body.""" body = {} if self.alerts: - body["{alerts}"] = [v for v in self.alerts] + body["alerts"] = [v for v in self.alerts] if self.email_recipients: - body["{email_recipients}"] = [v for v in self.email_recipients] + body["email_recipients"] = [v for v in self.email_recipients] return body def as_shallow_dict(self) -> dict: @@ -2054,39 +2054,39 @@ def as_dict(self) -> dict: """Serializes the Origin into a dictionary suitable for use as a JSON request body.""" body = {} if self.batch_id is not None: - body["{batch_id}"] = self.batch_id + body["batch_id"] = self.batch_id if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.dataset_name is not None: - body["{dataset_name}"] = self.dataset_name + body["dataset_name"] = self.dataset_name if self.flow_id is not None: - body["{flow_id}"] = self.flow_id + body["flow_id"] = self.flow_id if self.flow_name is not None: - body["{flow_name}"] = self.flow_name + body["flow_name"] = self.flow_name if self.host is not None: - body["{host}"] = self.host + body["host"] = self.host if self.maintenance_id is not None: - body["{maintenance_id}"] = self.maintenance_id + body["maintenance_id"] = self.maintenance_id if self.materialization_name is not None: - body["{materialization_name}"] = self.materialization_name + body["materialization_name"] = self.materialization_name if self.org_id is not None: - body["{org_id}"] = self.org_id + body["org_id"] = self.org_id if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.pipeline_name is not None: - body["{pipeline_name}"] = self.pipeline_name + body["pipeline_name"] = self.pipeline_name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.request_id is not None: - body["{request_id}"] = self.request_id + body["request_id"] = self.request_id if self.table_id is not None: - body["{table_id}"] = self.table_id + body["table_id"] = self.table_id if self.uc_resource_id is not None: - body["{uc_resource_id}"] = self.uc_resource_id + body["uc_resource_id"] = self.uc_resource_id if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id return body def as_shallow_dict(self) -> dict: @@ -2170,13 +2170,13 @@ def as_dict(self) -> dict: """Serializes the PipelineAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -2224,15 +2224,15 @@ def as_dict(self) -> dict: """Serializes the PipelineAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -2368,43 +2368,43 @@ def as_dict(self) -> dict: """Serializes the PipelineCluster into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale.as_dict() + body["autoscale"] = self.autoscale.as_dict() if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes.as_dict() + body["aws_attributes"] = self.aws_attributes.as_dict() if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes.as_dict() + body["azure_attributes"] = self.azure_attributes.as_dict() if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf.as_dict() + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes.as_dict() + body["gcp_attributes"] = self.gcp_attributes.as_dict() if self.init_scripts: - body["{init_scripts}"] = [v.as_dict() for v in self.init_scripts] + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.ssh_public_keys: - body["{ssh_public_keys}"] = [v for v in self.ssh_public_keys] + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] return body def as_shallow_dict(self) -> dict: @@ -2496,11 +2496,11 @@ def as_dict(self) -> dict: """Serializes the PipelineClusterAutoscale into a dictionary suitable for use as a JSON request body.""" body = {} if self.max_workers is not None: - body["{max_workers}"] = self.max_workers + body["max_workers"] = self.max_workers if self.min_workers is not None: - body["{min_workers}"] = self.min_workers + body["min_workers"] = self.min_workers if self.mode is not None: - body["{mode}"] = self.mode.value + body["mode"] = self.mode.value return body def as_shallow_dict(self) -> dict: @@ -2546,9 +2546,9 @@ def as_dict(self) -> dict: """Serializes the PipelineDeployment into a dictionary suitable for use as a JSON request body.""" body = {} if self.kind is not None: - body["{kind}"] = self.kind.value + body["kind"] = self.kind.value if self.metadata_file_path is not None: - body["{metadata_file_path}"] = self.metadata_file_path + body["metadata_file_path"] = self.metadata_file_path return body def as_shallow_dict(self) -> dict: @@ -2599,23 +2599,23 @@ def as_dict(self) -> dict: """Serializes the PipelineEvent into a dictionary suitable for use as a JSON request body.""" body = {} if self.error: - body["{error}"] = self.error.as_dict() + body["error"] = self.error.as_dict() if self.event_type is not None: - body["{event_type}"] = self.event_type + body["event_type"] = self.event_type if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.level is not None: - body["{level}"] = self.level.value + body["level"] = self.level.value if self.maturity_level is not None: - body["{maturity_level}"] = self.maturity_level.value + body["maturity_level"] = self.maturity_level.value if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.origin: - body["{origin}"] = self.origin.as_dict() + body["origin"] = self.origin.as_dict() if self.sequence: - body["{sequence}"] = self.sequence.as_dict() + body["sequence"] = self.sequence.as_dict() if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body def as_shallow_dict(self) -> dict: @@ -2678,15 +2678,15 @@ def as_dict(self) -> dict: """Serializes the PipelineLibrary into a dictionary suitable for use as a JSON request body.""" body = {} if self.file: - body["{file}"] = self.file.as_dict() + body["file"] = self.file.as_dict() if self.jar is not None: - body["{jar}"] = self.jar + body["jar"] = self.jar if self.maven: - body["{maven}"] = self.maven.as_dict() + body["maven"] = self.maven.as_dict() if self.notebook: - body["{notebook}"] = self.notebook.as_dict() + body["notebook"] = self.notebook.as_dict() if self.whl is not None: - body["{whl}"] = self.whl + body["whl"] = self.whl return body def as_shallow_dict(self) -> dict: @@ -2729,11 +2729,11 @@ def as_dict(self) -> dict: """Serializes the PipelinePermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -2778,11 +2778,11 @@ def as_dict(self) -> dict: """Serializes the PipelinePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -2817,9 +2817,9 @@ def as_dict(self) -> dict: """Serializes the PipelinePermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -2851,9 +2851,9 @@ def as_dict(self) -> dict: """Serializes the PipelinePermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id return body def as_shallow_dict(self) -> dict: @@ -2958,53 +2958,53 @@ def as_dict(self) -> dict: """Serializes the PipelineSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.channel is not None: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.clusters: - body["{clusters}"] = [v.as_dict() for v in self.clusters] + body["clusters"] = [v.as_dict() for v in self.clusters] if self.configuration: - body["{configuration}"] = self.configuration + body["configuration"] = self.configuration if self.continuous is not None: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment.as_dict() + body["deployment"] = self.deployment.as_dict() if self.development is not None: - body["{development}"] = self.development + body["development"] = self.development if self.edition is not None: - body["{edition}"] = self.edition + body["edition"] = self.edition if self.event_log: - body["{event_log}"] = self.event_log.as_dict() + body["event_log"] = self.event_log.as_dict() if self.filters: - body["{filters}"] = self.filters.as_dict() + body["filters"] = self.filters.as_dict() if self.gateway_definition: - body["{gateway_definition}"] = self.gateway_definition.as_dict() + body["gateway_definition"] = self.gateway_definition.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.ingestion_definition: - body["{ingestion_definition}"] = self.ingestion_definition.as_dict() + body["ingestion_definition"] = self.ingestion_definition.as_dict() if self.libraries: - body["{libraries}"] = [v.as_dict() for v in self.libraries] + body["libraries"] = [v.as_dict() for v in self.libraries] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notifications: - body["{notifications}"] = [v.as_dict() for v in self.notifications] + body["notifications"] = [v.as_dict() for v in self.notifications] if self.photon is not None: - body["{photon}"] = self.photon + body["photon"] = self.photon if self.restart_window: - body["{restart_window}"] = self.restart_window.as_dict() + body["restart_window"] = self.restart_window.as_dict() if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.serverless is not None: - body["{serverless}"] = self.serverless + body["serverless"] = self.serverless if self.storage is not None: - body["{storage}"] = self.storage + body["storage"] = self.storage if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target if self.trigger: - body["{trigger}"] = self.trigger.as_dict() + body["trigger"] = self.trigger.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3136,21 +3136,21 @@ def as_dict(self) -> dict: """Serializes the PipelineStateInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.health is not None: - body["{health}"] = self.health.value + body["health"] = self.health.value if self.latest_updates: - body["{latest_updates}"] = [v.as_dict() for v in self.latest_updates] + body["latest_updates"] = [v.as_dict() for v in self.latest_updates] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.run_as_user_name is not None: - body["{run_as_user_name}"] = self.run_as_user_name + body["run_as_user_name"] = self.run_as_user_name if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -3206,9 +3206,9 @@ def as_dict(self) -> dict: """Serializes the PipelineTrigger into a dictionary suitable for use as a JSON request body.""" body = {} if self.cron: - body["{cron}"] = self.cron.as_dict() + body["cron"] = self.cron.as_dict() if self.manual: - body["{manual}"] = self.manual.as_dict() + body["manual"] = self.manual.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3248,15 +3248,15 @@ def as_dict(self) -> dict: """Serializes the ReportSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_catalog is not None: - body["{destination_catalog}"] = self.destination_catalog + body["destination_catalog"] = self.destination_catalog if self.destination_schema is not None: - body["{destination_schema}"] = self.destination_schema + body["destination_schema"] = self.destination_schema if self.destination_table is not None: - body["{destination_table}"] = self.destination_table + body["destination_table"] = self.destination_table if self.source_url is not None: - body["{source_url}"] = self.source_url + body["source_url"] = self.source_url if self.table_configuration: - body["{table_configuration}"] = self.table_configuration.as_dict() + body["table_configuration"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3305,11 +3305,11 @@ def as_dict(self) -> dict: """Serializes the RestartWindow into a dictionary suitable for use as a JSON request body.""" body = {} if self.days_of_week: - body["{days_of_week}"] = [v.value for v in self.days_of_week] + body["days_of_week"] = [v.value for v in self.days_of_week] if self.start_hour is not None: - body["{start_hour}"] = self.start_hour + body["start_hour"] = self.start_hour if self.time_zone_id is not None: - body["{time_zone_id}"] = self.time_zone_id + body["time_zone_id"] = self.time_zone_id return body def as_shallow_dict(self) -> dict: @@ -3353,9 +3353,9 @@ def as_dict(self) -> dict: """Serializes the RunAs into a dictionary suitable for use as a JSON request body.""" body = {} if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3414,19 +3414,19 @@ def as_dict(self) -> dict: """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.canned_acl is not None: - body["{canned_acl}"] = self.canned_acl + body["canned_acl"] = self.canned_acl if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination if self.enable_encryption is not None: - body["{enable_encryption}"] = self.enable_encryption + body["enable_encryption"] = self.enable_encryption if self.encryption_type is not None: - body["{encryption_type}"] = self.encryption_type + body["encryption_type"] = self.encryption_type if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.kms_key is not None: - body["{kms_key}"] = self.kms_key + body["kms_key"] = self.kms_key if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -3487,15 +3487,15 @@ def as_dict(self) -> dict: """Serializes the SchemaSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_catalog is not None: - body["{destination_catalog}"] = self.destination_catalog + body["destination_catalog"] = self.destination_catalog if self.destination_schema is not None: - body["{destination_schema}"] = self.destination_schema + body["destination_schema"] = self.destination_schema if self.source_catalog is not None: - body["{source_catalog}"] = self.source_catalog + body["source_catalog"] = self.source_catalog if self.source_schema is not None: - body["{source_schema}"] = self.source_schema + body["source_schema"] = self.source_schema if self.table_configuration: - body["{table_configuration}"] = self.table_configuration.as_dict() + body["table_configuration"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3537,9 +3537,9 @@ def as_dict(self) -> dict: """Serializes the Sequencing into a dictionary suitable for use as a JSON request body.""" body = {} if self.control_plane_seq_no is not None: - body["{control_plane_seq_no}"] = self.control_plane_seq_no + body["control_plane_seq_no"] = self.control_plane_seq_no if self.data_plane_id: - body["{data_plane_id}"] = self.data_plane_id.as_dict() + body["data_plane_id"] = self.data_plane_id.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3575,11 +3575,11 @@ def as_dict(self) -> dict: """Serializes the SerializedException into a dictionary suitable for use as a JSON request body.""" body = {} if self.class_name is not None: - body["{class_name}"] = self.class_name + body["class_name"] = self.class_name if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.stack: - body["{stack}"] = [v.as_dict() for v in self.stack] + body["stack"] = [v.as_dict() for v in self.stack] return body def as_shallow_dict(self) -> dict: @@ -3621,13 +3621,13 @@ def as_dict(self) -> dict: """Serializes the StackFrame into a dictionary suitable for use as a JSON request body.""" body = {} if self.declaring_class is not None: - body["{declaring_class}"] = self.declaring_class + body["declaring_class"] = self.declaring_class if self.file_name is not None: - body["{file_name}"] = self.file_name + body["file_name"] = self.file_name if self.line_number is not None: - body["{line_number}"] = self.line_number + body["line_number"] = self.line_number if self.method_name is not None: - body["{method_name}"] = self.method_name + body["method_name"] = self.method_name return body def as_shallow_dict(self) -> dict: @@ -3681,17 +3681,17 @@ def as_dict(self) -> dict: """Serializes the StartUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause.value + body["cause"] = self.cause.value if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh if self.full_refresh_selection: - body["{full_refresh_selection}"] = [v for v in self.full_refresh_selection] + body["full_refresh_selection"] = [v for v in self.full_refresh_selection] if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.refresh_selection: - body["{refresh_selection}"] = [v for v in self.refresh_selection] + body["refresh_selection"] = [v for v in self.refresh_selection] if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body def as_shallow_dict(self) -> dict: @@ -3742,7 +3742,7 @@ def as_dict(self) -> dict: """Serializes the StartUpdateResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id return body def as_shallow_dict(self) -> dict: @@ -3805,19 +3805,19 @@ def as_dict(self) -> dict: """Serializes the TableSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_catalog is not None: - body["{destination_catalog}"] = self.destination_catalog + body["destination_catalog"] = self.destination_catalog if self.destination_schema is not None: - body["{destination_schema}"] = self.destination_schema + body["destination_schema"] = self.destination_schema if self.destination_table is not None: - body["{destination_table}"] = self.destination_table + body["destination_table"] = self.destination_table if self.source_catalog is not None: - body["{source_catalog}"] = self.source_catalog + body["source_catalog"] = self.source_catalog if self.source_schema is not None: - body["{source_schema}"] = self.source_schema + body["source_schema"] = self.source_schema if self.source_table is not None: - body["{source_table}"] = self.source_table + body["source_table"] = self.source_table if self.table_configuration: - body["{table_configuration}"] = self.table_configuration.as_dict() + body["table_configuration"] = self.table_configuration.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3873,13 +3873,13 @@ def as_dict(self) -> dict: """Serializes the TableSpecificConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.primary_keys: - body["{primary_keys}"] = [v for v in self.primary_keys] + body["primary_keys"] = [v for v in self.primary_keys] if self.salesforce_include_formula_fields is not None: - body["{salesforce_include_formula_fields}"] = self.salesforce_include_formula_fields + body["salesforce_include_formula_fields"] = self.salesforce_include_formula_fields if self.scd_type is not None: - body["{scd_type}"] = self.scd_type.value + body["scd_type"] = self.scd_type.value if self.sequence_by: - body["{sequence_by}"] = [v for v in self.sequence_by] + body["sequence_by"] = [v for v in self.sequence_by] return body def as_shallow_dict(self) -> dict: @@ -3958,27 +3958,27 @@ def as_dict(self) -> dict: """Serializes the UpdateInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause.value + body["cause"] = self.cause.value if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.config: - body["{config}"] = self.config.as_dict() + body["config"] = self.config.as_dict() if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh if self.full_refresh_selection: - body["{full_refresh_selection}"] = [v for v in self.full_refresh_selection] + body["full_refresh_selection"] = [v for v in self.full_refresh_selection] if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.refresh_selection: - body["{refresh_selection}"] = [v for v in self.refresh_selection] + body["refresh_selection"] = [v for v in self.refresh_selection] if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body def as_shallow_dict(self) -> dict: @@ -4065,11 +4065,11 @@ def as_dict(self) -> dict: """Serializes the UpdateStateInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id return body def as_shallow_dict(self) -> dict: @@ -4120,7 +4120,7 @@ def as_dict(self) -> dict: """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: @@ -4147,7 +4147,7 @@ def as_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/provisioning/v2/impl.py b/databricks/sdk/provisioning/v2/impl.py index 29a45c284..8f8c7dfdd 100755 --- a/databricks/sdk/provisioning/v2/impl.py +++ b/databricks/sdk/provisioning/v2/impl.py @@ -24,7 +24,7 @@ def as_dict(self) -> dict: """Serializes the AwsCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.sts_role: - body["{sts_role}"] = self.sts_role.as_dict() + body["sts_role"] = self.sts_role.as_dict() return body def as_shallow_dict(self) -> dict: @@ -60,13 +60,13 @@ def as_dict(self) -> dict: """Serializes the AwsKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.key_alias is not None: - body["{key_alias}"] = self.key_alias + body["key_alias"] = self.key_alias if self.key_arn is not None: - body["{key_arn}"] = self.key_arn + body["key_arn"] = self.key_arn if self.key_region is not None: - body["{key_region}"] = self.key_region + body["key_region"] = self.key_region if self.reuse_key_for_cluster_volumes is not None: - body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes + body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes return body def as_shallow_dict(self) -> dict: @@ -105,9 +105,9 @@ def as_dict(self) -> dict: """Serializes the AzureWorkspaceInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.resource_group is not None: - body["{resource_group}"] = self.resource_group + body["resource_group"] = self.resource_group if self.subscription_id is not None: - body["{subscription_id}"] = self.subscription_id + body["subscription_id"] = self.subscription_id return body def as_shallow_dict(self) -> dict: @@ -136,7 +136,7 @@ def as_dict(self) -> dict: """Serializes the CloudResourceContainer into a dictionary suitable for use as a JSON request body.""" body = {} if self.gcp: - body["{gcp}"] = self.gcp.as_dict() + body["gcp"] = self.gcp.as_dict() return body def as_shallow_dict(self) -> dict: @@ -170,11 +170,11 @@ def as_dict(self) -> dict: """Serializes the CreateAwsKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.key_alias is not None: - body["{key_alias}"] = self.key_alias + body["key_alias"] = self.key_alias if self.key_arn is not None: - body["{key_arn}"] = self.key_arn + body["key_arn"] = self.key_arn if self.reuse_key_for_cluster_volumes is not None: - body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes + body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes return body def as_shallow_dict(self) -> dict: @@ -206,7 +206,7 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialAwsCredentials into a dictionary suitable for use as a JSON request body.""" body = {} if self.sts_role: - body["{sts_role}"] = self.sts_role.as_dict() + body["sts_role"] = self.sts_role.as_dict() return body def as_shallow_dict(self) -> dict: @@ -233,9 +233,9 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_credentials: - body["{aws_credentials}"] = self.aws_credentials.as_dict() + body["aws_credentials"] = self.aws_credentials.as_dict() if self.credentials_name is not None: - body["{credentials_name}"] = self.credentials_name + body["credentials_name"] = self.credentials_name return body def as_shallow_dict(self) -> dict: @@ -265,7 +265,7 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialStsRole into a dictionary suitable for use as a JSON request body.""" body = {} if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn return body def as_shallow_dict(self) -> dict: @@ -294,11 +294,11 @@ def as_dict(self) -> dict: """Serializes the CreateCustomerManagedKeyRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_key_info: - body["{aws_key_info}"] = self.aws_key_info.as_dict() + body["aws_key_info"] = self.aws_key_info.as_dict() if self.gcp_key_info: - body["{gcp_key_info}"] = self.gcp_key_info.as_dict() + body["gcp_key_info"] = self.gcp_key_info.as_dict() if self.use_cases: - body["{use_cases}"] = [v.value for v in self.use_cases] + body["use_cases"] = [v.value for v in self.use_cases] return body def as_shallow_dict(self) -> dict: @@ -331,7 +331,7 @@ def as_dict(self) -> dict: """Serializes the CreateGcpKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.kms_key_id is not None: - body["{kms_key_id}"] = self.kms_key_id + body["kms_key_id"] = self.kms_key_id return body def as_shallow_dict(self) -> dict: @@ -378,17 +378,17 @@ def as_dict(self) -> dict: """Serializes the CreateNetworkRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.gcp_network_info: - body["{gcp_network_info}"] = self.gcp_network_info.as_dict() + body["gcp_network_info"] = self.gcp_network_info.as_dict() if self.network_name is not None: - body["{network_name}"] = self.network_name + body["network_name"] = self.network_name if self.security_group_ids: - body["{security_group_ids}"] = [v for v in self.security_group_ids] + body["security_group_ids"] = [v for v in self.security_group_ids] if self.subnet_ids: - body["{subnet_ids}"] = [v for v in self.subnet_ids] + body["subnet_ids"] = [v for v in self.subnet_ids] if self.vpc_endpoints: - body["{vpc_endpoints}"] = self.vpc_endpoints.as_dict() + body["vpc_endpoints"] = self.vpc_endpoints.as_dict() if self.vpc_id is not None: - body["{vpc_id}"] = self.vpc_id + body["vpc_id"] = self.vpc_id return body def as_shallow_dict(self) -> dict: @@ -433,9 +433,9 @@ def as_dict(self) -> dict: """Serializes the CreateStorageConfigurationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.root_bucket_info: - body["{root_bucket_info}"] = self.root_bucket_info.as_dict() + body["root_bucket_info"] = self.root_bucket_info.as_dict() if self.storage_configuration_name is not None: - body["{storage_configuration_name}"] = self.storage_configuration_name + body["storage_configuration_name"] = self.storage_configuration_name return body def as_shallow_dict(self) -> dict: @@ -474,13 +474,13 @@ def as_dict(self) -> dict: """Serializes the CreateVpcEndpointRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_vpc_endpoint_id is not None: - body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id + body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info.as_dict() + body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info.as_dict() if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.vpc_endpoint_name is not None: - body["{vpc_endpoint_name}"] = self.vpc_endpoint_name + body["vpc_endpoint_name"] = self.vpc_endpoint_name return body def as_shallow_dict(self) -> dict: @@ -620,39 +620,39 @@ def as_dict(self) -> dict: """Serializes the CreateWorkspaceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.cloud_resource_container: - body["{cloud_resource_container}"] = self.cloud_resource_container.as_dict() + body["cloud_resource_container"] = self.cloud_resource_container.as_dict() if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.deployment_name is not None: - body["{deployment_name}"] = self.deployment_name + body["deployment_name"] = self.deployment_name if self.gcp_managed_network_config: - body["{gcp_managed_network_config}"] = self.gcp_managed_network_config.as_dict() + body["gcp_managed_network_config"] = self.gcp_managed_network_config.as_dict() if self.gke_config: - body["{gke_config}"] = self.gke_config.as_dict() + body["gke_config"] = self.gke_config.as_dict() if self.is_no_public_ip_enabled is not None: - body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled + body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled if self.location is not None: - body["{location}"] = self.location + body["location"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.pricing_tier is not None: - body["{pricing_tier}"] = self.pricing_tier.value + body["pricing_tier"] = self.pricing_tier.value if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id if self.workspace_name is not None: - body["{workspace_name}"] = self.workspace_name + body["workspace_name"] = self.workspace_name return body def as_shallow_dict(self) -> dict: @@ -738,15 +738,15 @@ def as_dict(self) -> dict: """Serializes the Credential into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_credentials: - body["{aws_credentials}"] = self.aws_credentials.as_dict() + body["aws_credentials"] = self.aws_credentials.as_dict() if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.credentials_name is not None: - body["{credentials_name}"] = self.credentials_name + body["credentials_name"] = self.credentials_name return body def as_shallow_dict(self) -> dict: @@ -791,7 +791,7 @@ def as_dict(self) -> dict: """Serializes the CustomerFacingGcpCloudResourceContainer into a dictionary suitable for use as a JSON request body.""" body = {} if self.project_id is not None: - body["{project_id}"] = self.project_id + body["project_id"] = self.project_id return body def as_shallow_dict(self) -> dict: @@ -829,17 +829,17 @@ def as_dict(self) -> dict: """Serializes the CustomerManagedKey into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_key_info: - body["{aws_key_info}"] = self.aws_key_info.as_dict() + body["aws_key_info"] = self.aws_key_info.as_dict() if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.customer_managed_key_id is not None: - body["{customer_managed_key_id}"] = self.customer_managed_key_id + body["customer_managed_key_id"] = self.customer_managed_key_id if self.gcp_key_info: - body["{gcp_key_info}"] = self.gcp_key_info.as_dict() + body["gcp_key_info"] = self.gcp_key_info.as_dict() if self.use_cases: - body["{use_cases}"] = [v.value for v in self.use_cases] + body["use_cases"] = [v.value for v in self.use_cases] return body def as_shallow_dict(self) -> dict: @@ -926,11 +926,11 @@ def as_dict(self) -> dict: """Serializes the ExternalCustomerInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.authoritative_user_email is not None: - body["{authoritative_user_email}"] = self.authoritative_user_email + body["authoritative_user_email"] = self.authoritative_user_email if self.authoritative_user_full_name is not None: - body["{authoritative_user_full_name}"] = self.authoritative_user_full_name + body["authoritative_user_full_name"] = self.authoritative_user_full_name if self.customer_name is not None: - body["{customer_name}"] = self.customer_name + body["customer_name"] = self.customer_name return body def as_shallow_dict(self) -> dict: @@ -963,7 +963,7 @@ def as_dict(self) -> dict: """Serializes the GcpKeyInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.kms_key_id is not None: - body["{kms_key_id}"] = self.kms_key_id + body["kms_key_id"] = self.kms_key_id return body def as_shallow_dict(self) -> dict: @@ -1017,11 +1017,11 @@ def as_dict(self) -> dict: """Serializes the GcpManagedNetworkConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.gke_cluster_pod_ip_range is not None: - body["{gke_cluster_pod_ip_range}"] = self.gke_cluster_pod_ip_range + body["gke_cluster_pod_ip_range"] = self.gke_cluster_pod_ip_range if self.gke_cluster_service_ip_range is not None: - body["{gke_cluster_service_ip_range}"] = self.gke_cluster_service_ip_range + body["gke_cluster_service_ip_range"] = self.gke_cluster_service_ip_range if self.subnet_cidr is not None: - body["{subnet_cidr}"] = self.subnet_cidr + body["subnet_cidr"] = self.subnet_cidr return body def as_shallow_dict(self) -> dict: @@ -1075,17 +1075,17 @@ def as_dict(self) -> dict: """Serializes the GcpNetworkInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.network_project_id is not None: - body["{network_project_id}"] = self.network_project_id + body["network_project_id"] = self.network_project_id if self.pod_ip_range_name is not None: - body["{pod_ip_range_name}"] = self.pod_ip_range_name + body["pod_ip_range_name"] = self.pod_ip_range_name if self.service_ip_range_name is not None: - body["{service_ip_range_name}"] = self.service_ip_range_name + body["service_ip_range_name"] = self.service_ip_range_name if self.subnet_id is not None: - body["{subnet_id}"] = self.subnet_id + body["subnet_id"] = self.subnet_id if self.subnet_region is not None: - body["{subnet_region}"] = self.subnet_region + body["subnet_region"] = self.subnet_region if self.vpc_id is not None: - body["{vpc_id}"] = self.vpc_id + body["vpc_id"] = self.vpc_id return body def as_shallow_dict(self) -> dict: @@ -1141,15 +1141,15 @@ def as_dict(self) -> dict: """Serializes the GcpVpcEndpointInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_region is not None: - body["{endpoint_region}"] = self.endpoint_region + body["endpoint_region"] = self.endpoint_region if self.project_id is not None: - body["{project_id}"] = self.project_id + body["project_id"] = self.project_id if self.psc_connection_id is not None: - body["{psc_connection_id}"] = self.psc_connection_id + body["psc_connection_id"] = self.psc_connection_id if self.psc_endpoint_name is not None: - body["{psc_endpoint_name}"] = self.psc_endpoint_name + body["psc_endpoint_name"] = self.psc_endpoint_name if self.service_attachment_id is not None: - body["{service_attachment_id}"] = self.service_attachment_id + body["service_attachment_id"] = self.service_attachment_id return body def as_shallow_dict(self) -> dict: @@ -1202,9 +1202,9 @@ def as_dict(self) -> dict: """Serializes the GkeConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.connectivity_type is not None: - body["{connectivity_type}"] = self.connectivity_type.value + body["connectivity_type"] = self.connectivity_type.value if self.master_ip_range is not None: - body["{master_ip_range}"] = self.master_ip_range + body["master_ip_range"] = self.master_ip_range return body def as_shallow_dict(self) -> dict: @@ -1296,31 +1296,31 @@ def as_dict(self) -> dict: """Serializes the Network into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.error_messages: - body["{error_messages}"] = [v.as_dict() for v in self.error_messages] + body["error_messages"] = [v.as_dict() for v in self.error_messages] if self.gcp_network_info: - body["{gcp_network_info}"] = self.gcp_network_info.as_dict() + body["gcp_network_info"] = self.gcp_network_info.as_dict() if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.network_name is not None: - body["{network_name}"] = self.network_name + body["network_name"] = self.network_name if self.security_group_ids: - body["{security_group_ids}"] = [v for v in self.security_group_ids] + body["security_group_ids"] = [v for v in self.security_group_ids] if self.subnet_ids: - body["{subnet_ids}"] = [v for v in self.subnet_ids] + body["subnet_ids"] = [v for v in self.subnet_ids] if self.vpc_endpoints: - body["{vpc_endpoints}"] = self.vpc_endpoints.as_dict() + body["vpc_endpoints"] = self.vpc_endpoints.as_dict() if self.vpc_id is not None: - body["{vpc_id}"] = self.vpc_id + body["vpc_id"] = self.vpc_id if self.vpc_status is not None: - body["{vpc_status}"] = self.vpc_status.value + body["vpc_status"] = self.vpc_status.value if self.warning_messages: - body["{warning_messages}"] = [v.as_dict() for v in self.warning_messages] + body["warning_messages"] = [v.as_dict() for v in self.warning_messages] if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -1387,9 +1387,9 @@ def as_dict(self) -> dict: """Serializes the NetworkHealth into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.error_type is not None: - body["{error_type}"] = self.error_type.value + body["error_type"] = self.error_type.value return body def as_shallow_dict(self) -> dict: @@ -1425,9 +1425,9 @@ def as_dict(self) -> dict: """Serializes the NetworkVpcEndpoints into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataplane_relay: - body["{dataplane_relay}"] = [v for v in self.dataplane_relay] + body["dataplane_relay"] = [v for v in self.dataplane_relay] if self.rest_api: - body["{rest_api}"] = [v for v in self.rest_api] + body["rest_api"] = [v for v in self.rest_api] return body def as_shallow_dict(self) -> dict: @@ -1457,9 +1457,9 @@ def as_dict(self) -> dict: """Serializes the NetworkWarning into a dictionary suitable for use as a JSON request body.""" body = {} if self.warning_message is not None: - body["{warning_message}"] = self.warning_message + body["warning_message"] = self.warning_message if self.warning_type is not None: - body["{warning_type}"] = self.warning_type.value + body["warning_type"] = self.warning_type.value return body def as_shallow_dict(self) -> dict: @@ -1537,19 +1537,19 @@ def as_dict(self) -> dict: """Serializes the PrivateAccessSettings into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.allowed_vpc_endpoint_ids: - body["{allowed_vpc_endpoint_ids}"] = [v for v in self.allowed_vpc_endpoint_ids] + body["allowed_vpc_endpoint_ids"] = [v for v in self.allowed_vpc_endpoint_ids] if self.private_access_level is not None: - body["{private_access_level}"] = self.private_access_level.value + body["private_access_level"] = self.private_access_level.value if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["{private_access_settings_name}"] = self.private_access_settings_name + body["private_access_settings_name"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["{public_access_enabled}"] = self.public_access_enabled + body["public_access_enabled"] = self.public_access_enabled if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -1614,7 +1614,7 @@ def as_dict(self) -> dict: """Serializes the RootBucketInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.bucket_name is not None: - body["{bucket_name}"] = self.bucket_name + body["bucket_name"] = self.bucket_name return body def as_shallow_dict(self) -> dict: @@ -1651,15 +1651,15 @@ def as_dict(self) -> dict: """Serializes the StorageConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.root_bucket_info: - body["{root_bucket_info}"] = self.root_bucket_info.as_dict() + body["root_bucket_info"] = self.root_bucket_info.as_dict() if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_configuration_name is not None: - body["{storage_configuration_name}"] = self.storage_configuration_name + body["storage_configuration_name"] = self.storage_configuration_name return body def as_shallow_dict(self) -> dict: @@ -1702,9 +1702,9 @@ def as_dict(self) -> dict: """Serializes the StsRole into a dictionary suitable for use as a JSON request body.""" body = {} if self.external_id is not None: - body["{external_id}"] = self.external_id + body["external_id"] = self.external_id if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn return body def as_shallow_dict(self) -> dict: @@ -1785,25 +1785,25 @@ def as_dict(self) -> dict: """Serializes the UpdateWorkspaceRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -1890,17 +1890,17 @@ def as_dict(self) -> dict: """Serializes the UpsertPrivateAccessSettingsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_vpc_endpoint_ids: - body["{allowed_vpc_endpoint_ids}"] = [v for v in self.allowed_vpc_endpoint_ids] + body["allowed_vpc_endpoint_ids"] = [v for v in self.allowed_vpc_endpoint_ids] if self.private_access_level is not None: - body["{private_access_level}"] = self.private_access_level.value + body["private_access_level"] = self.private_access_level.value if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["{private_access_settings_name}"] = self.private_access_settings_name + body["private_access_settings_name"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["{public_access_enabled}"] = self.public_access_enabled + body["public_access_enabled"] = self.public_access_enabled if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -1981,25 +1981,25 @@ def as_dict(self) -> dict: """Serializes the VpcEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_account_id is not None: - body["{aws_account_id}"] = self.aws_account_id + body["aws_account_id"] = self.aws_account_id if self.aws_endpoint_service_id is not None: - body["{aws_endpoint_service_id}"] = self.aws_endpoint_service_id + body["aws_endpoint_service_id"] = self.aws_endpoint_service_id if self.aws_vpc_endpoint_id is not None: - body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id + body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info.as_dict() + body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info.as_dict() if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.use_case is not None: - body["{use_case}"] = self.use_case.value + body["use_case"] = self.use_case.value if self.vpc_endpoint_id is not None: - body["{vpc_endpoint_id}"] = self.vpc_endpoint_id + body["vpc_endpoint_id"] = self.vpc_endpoint_id if self.vpc_endpoint_name is not None: - body["{vpc_endpoint_name}"] = self.vpc_endpoint_name + body["vpc_endpoint_name"] = self.vpc_endpoint_name return body def as_shallow_dict(self) -> dict: @@ -2173,53 +2173,53 @@ def as_dict(self) -> dict: """Serializes the Workspace into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.azure_workspace_info: - body["{azure_workspace_info}"] = self.azure_workspace_info.as_dict() + body["azure_workspace_info"] = self.azure_workspace_info.as_dict() if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.cloud_resource_container: - body["{cloud_resource_container}"] = self.cloud_resource_container.as_dict() + body["cloud_resource_container"] = self.cloud_resource_container.as_dict() if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.deployment_name is not None: - body["{deployment_name}"] = self.deployment_name + body["deployment_name"] = self.deployment_name if self.external_customer_info: - body["{external_customer_info}"] = self.external_customer_info.as_dict() + body["external_customer_info"] = self.external_customer_info.as_dict() if self.gcp_managed_network_config: - body["{gcp_managed_network_config}"] = self.gcp_managed_network_config.as_dict() + body["gcp_managed_network_config"] = self.gcp_managed_network_config.as_dict() if self.gke_config: - body["{gke_config}"] = self.gke_config.as_dict() + body["gke_config"] = self.gke_config.as_dict() if self.is_no_public_ip_enabled is not None: - body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled + body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled if self.location is not None: - body["{location}"] = self.location + body["location"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.pricing_tier is not None: - body["{pricing_tier}"] = self.pricing_tier.value + body["pricing_tier"] = self.pricing_tier.value if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id if self.workspace_name is not None: - body["{workspace_name}"] = self.workspace_name + body["workspace_name"] = self.workspace_name if self.workspace_status is not None: - body["{workspace_status}"] = self.workspace_status.value + body["workspace_status"] = self.workspace_status.value if self.workspace_status_message is not None: - body["{workspace_status_message}"] = self.workspace_status_message + body["workspace_status_message"] = self.workspace_status_message return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/serving/v2/impl.py b/databricks/sdk/serving/v2/impl.py index 2c17b28ca..c4303f52c 100755 --- a/databricks/sdk/serving/v2/impl.py +++ b/databricks/sdk/serving/v2/impl.py @@ -31,9 +31,9 @@ def as_dict(self) -> dict: """Serializes the Ai21LabsConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai21labs_api_key is not None: - body["{ai21labs_api_key}"] = self.ai21labs_api_key + body["ai21labs_api_key"] = self.ai21labs_api_key if self.ai21labs_api_key_plaintext is not None: - body["{ai21labs_api_key_plaintext}"] = self.ai21labs_api_key_plaintext + body["ai21labs_api_key_plaintext"] = self.ai21labs_api_key_plaintext return body def as_shallow_dict(self) -> dict: @@ -79,15 +79,15 @@ def as_dict(self) -> dict: """Serializes the AiGatewayConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.fallback_config: - body["{fallback_config}"] = self.fallback_config.as_dict() + body["fallback_config"] = self.fallback_config.as_dict() if self.guardrails: - body["{guardrails}"] = self.guardrails.as_dict() + body["guardrails"] = self.guardrails.as_dict() if self.inference_table_config: - body["{inference_table_config}"] = self.inference_table_config.as_dict() + body["inference_table_config"] = self.inference_table_config.as_dict() if self.rate_limits: - body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] + body["rate_limits"] = [v.as_dict() for v in self.rate_limits] if self.usage_tracking_config: - body["{usage_tracking_config}"] = self.usage_tracking_config.as_dict() + body["usage_tracking_config"] = self.usage_tracking_config.as_dict() return body def as_shallow_dict(self) -> dict: @@ -137,13 +137,13 @@ def as_dict(self) -> dict: """Serializes the AiGatewayGuardrailParameters into a dictionary suitable for use as a JSON request body.""" body = {} if self.invalid_keywords: - body["{invalid_keywords}"] = [v for v in self.invalid_keywords] + body["invalid_keywords"] = [v for v in self.invalid_keywords] if self.pii: - body["{pii}"] = self.pii.as_dict() + body["pii"] = self.pii.as_dict() if self.safety is not None: - body["{safety}"] = self.safety + body["safety"] = self.safety if self.valid_topics: - body["{valid_topics}"] = [v for v in self.valid_topics] + body["valid_topics"] = [v for v in self.valid_topics] return body def as_shallow_dict(self) -> dict: @@ -179,7 +179,7 @@ def as_dict(self) -> dict: """Serializes the AiGatewayGuardrailPiiBehavior into a dictionary suitable for use as a JSON request body.""" body = {} if self.behavior is not None: - body["{behavior}"] = self.behavior.value + body["behavior"] = self.behavior.value return body def as_shallow_dict(self) -> dict: @@ -213,9 +213,9 @@ def as_dict(self) -> dict: """Serializes the AiGatewayGuardrails into a dictionary suitable for use as a JSON request body.""" body = {} if self.input: - body["{input}"] = self.input.as_dict() + body["input"] = self.input.as_dict() if self.output: - body["{output}"] = self.output.as_dict() + body["output"] = self.output.as_dict() return body def as_shallow_dict(self) -> dict: @@ -257,13 +257,13 @@ def as_dict(self) -> dict: """Serializes the AiGatewayInferenceTableConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.table_name_prefix is not None: - body["{table_name_prefix}"] = self.table_name_prefix + body["table_name_prefix"] = self.table_name_prefix return body def as_shallow_dict(self) -> dict: @@ -306,11 +306,11 @@ def as_dict(self) -> dict: """Serializes the AiGatewayRateLimit into a dictionary suitable for use as a JSON request body.""" body = {} if self.calls is not None: - body["{calls}"] = self.calls + body["calls"] = self.calls if self.key is not None: - body["{key}"] = self.key.value + body["key"] = self.key.value if self.renewal_period is not None: - body["{renewal_period}"] = self.renewal_period.value + body["renewal_period"] = self.renewal_period.value return body def as_shallow_dict(self) -> dict: @@ -354,7 +354,7 @@ def as_dict(self) -> dict: """Serializes the AiGatewayUsageTrackingConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body def as_shallow_dict(self) -> dict: @@ -413,19 +413,19 @@ def as_dict(self) -> dict: """Serializes the AmazonBedrockConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_access_key_id is not None: - body["{aws_access_key_id}"] = self.aws_access_key_id + body["aws_access_key_id"] = self.aws_access_key_id if self.aws_access_key_id_plaintext is not None: - body["{aws_access_key_id_plaintext}"] = self.aws_access_key_id_plaintext + body["aws_access_key_id_plaintext"] = self.aws_access_key_id_plaintext if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.aws_secret_access_key is not None: - body["{aws_secret_access_key}"] = self.aws_secret_access_key + body["aws_secret_access_key"] = self.aws_secret_access_key if self.aws_secret_access_key_plaintext is not None: - body["{aws_secret_access_key_plaintext}"] = self.aws_secret_access_key_plaintext + body["aws_secret_access_key_plaintext"] = self.aws_secret_access_key_plaintext if self.bedrock_provider is not None: - body["{bedrock_provider}"] = self.bedrock_provider.value + body["bedrock_provider"] = self.bedrock_provider.value if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn return body def as_shallow_dict(self) -> dict: @@ -485,9 +485,9 @@ def as_dict(self) -> dict: """Serializes the AnthropicConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.anthropic_api_key is not None: - body["{anthropic_api_key}"] = self.anthropic_api_key + body["anthropic_api_key"] = self.anthropic_api_key if self.anthropic_api_key_plaintext is not None: - body["{anthropic_api_key_plaintext}"] = self.anthropic_api_key_plaintext + body["anthropic_api_key_plaintext"] = self.anthropic_api_key_plaintext return body def as_shallow_dict(self) -> dict: @@ -525,11 +525,11 @@ def as_dict(self) -> dict: """Serializes the ApiKeyAuth into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value if self.value_plaintext is not None: - body["{value_plaintext}"] = self.value_plaintext + body["value_plaintext"] = self.value_plaintext return body def as_shallow_dict(self) -> dict: @@ -572,13 +572,13 @@ def as_dict(self) -> dict: """Serializes the AutoCaptureConfigInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.table_name_prefix is not None: - body["{table_name_prefix}"] = self.table_name_prefix + body["table_name_prefix"] = self.table_name_prefix return body def as_shallow_dict(self) -> dict: @@ -628,15 +628,15 @@ def as_dict(self) -> dict: """Serializes the AutoCaptureConfigOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.table_name_prefix is not None: - body["{table_name_prefix}"] = self.table_name_prefix + body["table_name_prefix"] = self.table_name_prefix return body def as_shallow_dict(self) -> dict: @@ -674,7 +674,7 @@ def as_dict(self) -> dict: """Serializes the AutoCaptureState into a dictionary suitable for use as a JSON request body.""" body = {} if self.payload_table: - body["{payload_table}"] = self.payload_table.as_dict() + body["payload_table"] = self.payload_table.as_dict() return body def as_shallow_dict(self) -> dict: @@ -704,9 +704,9 @@ def as_dict(self) -> dict: """Serializes the BearerTokenAuth into a dictionary suitable for use as a JSON request body.""" body = {} if self.token is not None: - body["{token}"] = self.token + body["token"] = self.token if self.token_plaintext is not None: - body["{token_plaintext}"] = self.token_plaintext + body["token_plaintext"] = self.token_plaintext return body def as_shallow_dict(self) -> dict: @@ -733,7 +733,7 @@ def as_dict(self) -> dict: """Serializes the BuildLogsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.logs is not None: - body["{logs}"] = self.logs + body["logs"] = self.logs return body def as_shallow_dict(self) -> dict: @@ -761,9 +761,9 @@ def as_dict(self) -> dict: """Serializes the ChatMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.role is not None: - body["{role}"] = self.role.value + body["role"] = self.role.value return body def as_shallow_dict(self) -> dict: @@ -809,11 +809,11 @@ def as_dict(self) -> dict: """Serializes the CohereConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.cohere_api_base is not None: - body["{cohere_api_base}"] = self.cohere_api_base + body["cohere_api_base"] = self.cohere_api_base if self.cohere_api_key is not None: - body["{cohere_api_key}"] = self.cohere_api_key + body["cohere_api_key"] = self.cohere_api_key if self.cohere_api_key_plaintext is not None: - body["{cohere_api_key_plaintext}"] = self.cohere_api_key_plaintext + body["cohere_api_key_plaintext"] = self.cohere_api_key_plaintext return body def as_shallow_dict(self) -> dict: @@ -867,19 +867,19 @@ def as_dict(self) -> dict: """Serializes the CreateServingEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai_gateway: - body["{ai_gateway}"] = self.ai_gateway.as_dict() + body["ai_gateway"] = self.ai_gateway.as_dict() if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.config: - body["{config}"] = self.config.as_dict() + body["config"] = self.config.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rate_limits: - body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] + body["rate_limits"] = [v.as_dict() for v in self.rate_limits] if self.route_optimized is not None: - body["{route_optimized}"] = self.route_optimized + body["route_optimized"] = self.route_optimized if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -934,11 +934,11 @@ def as_dict(self) -> dict: """Serializes the CustomProviderConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.api_key_auth: - body["{api_key_auth}"] = self.api_key_auth.as_dict() + body["api_key_auth"] = self.api_key_auth.as_dict() if self.bearer_token_auth: - body["{bearer_token_auth}"] = self.bearer_token_auth.as_dict() + body["bearer_token_auth"] = self.bearer_token_auth.as_dict() if self.custom_provider_url is not None: - body["{custom_provider_url}"] = self.custom_provider_url + body["custom_provider_url"] = self.custom_provider_url return body def as_shallow_dict(self) -> dict: @@ -976,9 +976,9 @@ def as_dict(self) -> dict: """Serializes the DataPlaneInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.authorization_details is not None: - body["{authorization_details}"] = self.authorization_details + body["authorization_details"] = self.authorization_details if self.endpoint_url is not None: - body["{endpoint_url}"] = self.endpoint_url + body["endpoint_url"] = self.endpoint_url return body def as_shallow_dict(self) -> dict: @@ -1022,11 +1022,11 @@ def as_dict(self) -> dict: """Serializes the DatabricksModelServingConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.databricks_api_token is not None: - body["{databricks_api_token}"] = self.databricks_api_token + body["databricks_api_token"] = self.databricks_api_token if self.databricks_api_token_plaintext is not None: - body["{databricks_api_token_plaintext}"] = self.databricks_api_token_plaintext + body["databricks_api_token_plaintext"] = self.databricks_api_token_plaintext if self.databricks_workspace_url is not None: - body["{databricks_workspace_url}"] = self.databricks_workspace_url + body["databricks_workspace_url"] = self.databricks_workspace_url return body def as_shallow_dict(self) -> dict: @@ -1062,11 +1062,11 @@ def as_dict(self) -> dict: """Serializes the DataframeSplitInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["{columns}"] = [v for v in self.columns] + body["columns"] = [v for v in self.columns] if self.data: - body["{data}"] = [v for v in self.data] + body["data"] = [v for v in self.data] if self.index: - body["{index}"] = [v for v in self.index] + body["index"] = [v for v in self.index] return body def as_shallow_dict(self) -> dict: @@ -1118,11 +1118,11 @@ def as_dict(self) -> dict: """Serializes the EmbeddingsV1ResponseEmbeddingElement into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding: - body["{embedding}"] = [v for v in self.embedding] + body["embedding"] = [v for v in self.embedding] if self.index is not None: - body["{index}"] = self.index + body["index"] = self.index if self.object is not None: - body["{object}"] = self.object.value + body["object"] = self.object.value return body def as_shallow_dict(self) -> dict: @@ -1177,15 +1177,15 @@ def as_dict(self) -> dict: """Serializes the EndpointCoreConfigInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_capture_config: - body["{auto_capture_config}"] = self.auto_capture_config.as_dict() + body["auto_capture_config"] = self.auto_capture_config.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.served_entities: - body["{served_entities}"] = [v.as_dict() for v in self.served_entities] + body["served_entities"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["{served_models}"] = [v.as_dict() for v in self.served_models] + body["served_models"] = [v.as_dict() for v in self.served_models] if self.traffic_config: - body["{traffic_config}"] = self.traffic_config.as_dict() + body["traffic_config"] = self.traffic_config.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1240,15 +1240,15 @@ def as_dict(self) -> dict: """Serializes the EndpointCoreConfigOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_capture_config: - body["{auto_capture_config}"] = self.auto_capture_config.as_dict() + body["auto_capture_config"] = self.auto_capture_config.as_dict() if self.config_version is not None: - body["{config_version}"] = self.config_version + body["config_version"] = self.config_version if self.served_entities: - body["{served_entities}"] = [v.as_dict() for v in self.served_entities] + body["served_entities"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["{served_models}"] = [v.as_dict() for v in self.served_models] + body["served_models"] = [v.as_dict() for v in self.served_models] if self.traffic_config: - body["{traffic_config}"] = self.traffic_config.as_dict() + body["traffic_config"] = self.traffic_config.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1291,9 +1291,9 @@ def as_dict(self) -> dict: """Serializes the EndpointCoreConfigSummary into a dictionary suitable for use as a JSON request body.""" body = {} if self.served_entities: - body["{served_entities}"] = [v.as_dict() for v in self.served_entities] + body["served_entities"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["{served_models}"] = [v.as_dict() for v in self.served_models] + body["served_models"] = [v.as_dict() for v in self.served_models] return body def as_shallow_dict(self) -> dict: @@ -1342,17 +1342,17 @@ def as_dict(self) -> dict: """Serializes the EndpointPendingConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_capture_config: - body["{auto_capture_config}"] = self.auto_capture_config.as_dict() + body["auto_capture_config"] = self.auto_capture_config.as_dict() if self.config_version is not None: - body["{config_version}"] = self.config_version + body["config_version"] = self.config_version if self.served_entities: - body["{served_entities}"] = [v.as_dict() for v in self.served_entities] + body["served_entities"] = [v.as_dict() for v in self.served_entities] if self.served_models: - body["{served_models}"] = [v.as_dict() for v in self.served_models] + body["served_models"] = [v.as_dict() for v in self.served_models] if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.traffic_config: - body["{traffic_config}"] = self.traffic_config.as_dict() + body["traffic_config"] = self.traffic_config.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1402,9 +1402,9 @@ def as_dict(self) -> dict: """Serializes the EndpointState into a dictionary suitable for use as a JSON request body.""" body = {} if self.config_update is not None: - body["{config_update}"] = self.config_update.value + body["config_update"] = self.config_update.value if self.ready is not None: - body["{ready}"] = self.ready.value + body["ready"] = self.ready.value return body def as_shallow_dict(self) -> dict: @@ -1451,9 +1451,9 @@ def as_dict(self) -> dict: """Serializes the EndpointTag into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -1479,7 +1479,7 @@ def as_dict(self) -> dict: """Serializes the EndpointTags into a dictionary suitable for use as a JSON request body.""" body = {} if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -1503,7 +1503,7 @@ def as_dict(self) -> dict: """Serializes the ExportMetricsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body def as_shallow_dict(self) -> dict: @@ -1546,17 +1546,17 @@ def as_dict(self) -> dict: """Serializes the ExternalFunctionRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.headers is not None: - body["{headers}"] = self.headers + body["headers"] = self.headers if self.json is not None: - body["{json}"] = self.json + body["json"] = self.json if self.method is not None: - body["{method}"] = self.method.value + body["method"] = self.method.value if self.params is not None: - body["{params}"] = self.params + body["params"] = self.params if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -1642,29 +1642,29 @@ def as_dict(self) -> dict: """Serializes the ExternalModel into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai21labs_config: - body["{ai21labs_config}"] = self.ai21labs_config.as_dict() + body["ai21labs_config"] = self.ai21labs_config.as_dict() if self.amazon_bedrock_config: - body["{amazon_bedrock_config}"] = self.amazon_bedrock_config.as_dict() + body["amazon_bedrock_config"] = self.amazon_bedrock_config.as_dict() if self.anthropic_config: - body["{anthropic_config}"] = self.anthropic_config.as_dict() + body["anthropic_config"] = self.anthropic_config.as_dict() if self.cohere_config: - body["{cohere_config}"] = self.cohere_config.as_dict() + body["cohere_config"] = self.cohere_config.as_dict() if self.custom_provider_config: - body["{custom_provider_config}"] = self.custom_provider_config.as_dict() + body["custom_provider_config"] = self.custom_provider_config.as_dict() if self.databricks_model_serving_config: - body["{databricks_model_serving_config}"] = self.databricks_model_serving_config.as_dict() + body["databricks_model_serving_config"] = self.databricks_model_serving_config.as_dict() if self.google_cloud_vertex_ai_config: - body["{google_cloud_vertex_ai_config}"] = self.google_cloud_vertex_ai_config.as_dict() + body["google_cloud_vertex_ai_config"] = self.google_cloud_vertex_ai_config.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.openai_config: - body["{openai_config}"] = self.openai_config.as_dict() + body["openai_config"] = self.openai_config.as_dict() if self.palm_config: - body["{palm_config}"] = self.palm_config.as_dict() + body["palm_config"] = self.palm_config.as_dict() if self.provider is not None: - body["{provider}"] = self.provider.value + body["provider"] = self.provider.value if self.task is not None: - body["{task}"] = self.task + body["task"] = self.task return body def as_shallow_dict(self) -> dict: @@ -1745,11 +1745,11 @@ def as_dict(self) -> dict: """Serializes the ExternalModelUsageElement into a dictionary suitable for use as a JSON request body.""" body = {} if self.completion_tokens is not None: - body["{completion_tokens}"] = self.completion_tokens + body["completion_tokens"] = self.completion_tokens if self.prompt_tokens is not None: - body["{prompt_tokens}"] = self.prompt_tokens + body["prompt_tokens"] = self.prompt_tokens if self.total_tokens is not None: - body["{total_tokens}"] = self.total_tokens + body["total_tokens"] = self.total_tokens return body def as_shallow_dict(self) -> dict: @@ -1786,7 +1786,7 @@ def as_dict(self) -> dict: """Serializes the FallbackConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body def as_shallow_dict(self) -> dict: @@ -1819,13 +1819,13 @@ def as_dict(self) -> dict: """Serializes the FoundationModel into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.docs is not None: - body["{docs}"] = self.docs + body["docs"] = self.docs if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -1860,7 +1860,7 @@ def as_dict(self) -> dict: """Serializes the GetOpenApiResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body def as_shallow_dict(self) -> dict: @@ -1885,7 +1885,7 @@ def as_dict(self) -> dict: """Serializes the GetServingEndpointPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -1934,13 +1934,13 @@ def as_dict(self) -> dict: """Serializes the GoogleCloudVertexAiConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.private_key is not None: - body["{private_key}"] = self.private_key + body["private_key"] = self.private_key if self.private_key_plaintext is not None: - body["{private_key_plaintext}"] = self.private_key_plaintext + body["private_key_plaintext"] = self.private_key_plaintext if self.project_id is not None: - body["{project_id}"] = self.project_id + body["project_id"] = self.project_id if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -1975,7 +1975,7 @@ def as_dict(self) -> dict: """Serializes the HttpRequestResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body def as_shallow_dict(self) -> dict: @@ -2000,7 +2000,7 @@ def as_dict(self) -> dict: """Serializes the ListEndpointsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoints: - body["{endpoints}"] = [v.as_dict() for v in self.endpoints] + body["endpoints"] = [v.as_dict() for v in self.endpoints] return body def as_shallow_dict(self) -> dict: @@ -2028,7 +2028,7 @@ def as_dict(self) -> dict: """Serializes the ModelDataPlaneInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.query_info: - body["{query_info}"] = self.query_info.as_dict() + body["query_info"] = self.query_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2103,27 +2103,27 @@ def as_dict(self) -> dict: """Serializes the OpenAiConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.microsoft_entra_client_id is not None: - body["{microsoft_entra_client_id}"] = self.microsoft_entra_client_id + body["microsoft_entra_client_id"] = self.microsoft_entra_client_id if self.microsoft_entra_client_secret is not None: - body["{microsoft_entra_client_secret}"] = self.microsoft_entra_client_secret + body["microsoft_entra_client_secret"] = self.microsoft_entra_client_secret if self.microsoft_entra_client_secret_plaintext is not None: - body["{microsoft_entra_client_secret_plaintext}"] = self.microsoft_entra_client_secret_plaintext + body["microsoft_entra_client_secret_plaintext"] = self.microsoft_entra_client_secret_plaintext if self.microsoft_entra_tenant_id is not None: - body["{microsoft_entra_tenant_id}"] = self.microsoft_entra_tenant_id + body["microsoft_entra_tenant_id"] = self.microsoft_entra_tenant_id if self.openai_api_base is not None: - body["{openai_api_base}"] = self.openai_api_base + body["openai_api_base"] = self.openai_api_base if self.openai_api_key is not None: - body["{openai_api_key}"] = self.openai_api_key + body["openai_api_key"] = self.openai_api_key if self.openai_api_key_plaintext is not None: - body["{openai_api_key_plaintext}"] = self.openai_api_key_plaintext + body["openai_api_key_plaintext"] = self.openai_api_key_plaintext if self.openai_api_type is not None: - body["{openai_api_type}"] = self.openai_api_type + body["openai_api_type"] = self.openai_api_type if self.openai_api_version is not None: - body["{openai_api_version}"] = self.openai_api_version + body["openai_api_version"] = self.openai_api_version if self.openai_deployment_name is not None: - body["{openai_deployment_name}"] = self.openai_deployment_name + body["openai_deployment_name"] = self.openai_deployment_name if self.openai_organization is not None: - body["{openai_organization}"] = self.openai_organization + body["openai_organization"] = self.openai_organization return body def as_shallow_dict(self) -> dict: @@ -2187,9 +2187,9 @@ def as_dict(self) -> dict: """Serializes the PaLmConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.palm_api_key is not None: - body["{palm_api_key}"] = self.palm_api_key + body["palm_api_key"] = self.palm_api_key if self.palm_api_key_plaintext is not None: - body["{palm_api_key_plaintext}"] = self.palm_api_key_plaintext + body["palm_api_key_plaintext"] = self.palm_api_key_plaintext return body def as_shallow_dict(self) -> dict: @@ -2224,11 +2224,11 @@ def as_dict(self) -> dict: """Serializes the PatchServingEndpointTags into a dictionary suitable for use as a JSON request body.""" body = {} if self.add_tags: - body["{add_tags}"] = [v.as_dict() for v in self.add_tags] + body["add_tags"] = [v.as_dict() for v in self.add_tags] if self.delete_tags: - body["{delete_tags}"] = [v for v in self.delete_tags] + body["delete_tags"] = [v for v in self.delete_tags] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -2264,11 +2264,11 @@ def as_dict(self) -> dict: """Serializes the PayloadTable into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message return body def as_shallow_dict(self) -> dict: @@ -2318,17 +2318,17 @@ def as_dict(self) -> dict: """Serializes the PutAiGatewayRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.fallback_config: - body["{fallback_config}"] = self.fallback_config.as_dict() + body["fallback_config"] = self.fallback_config.as_dict() if self.guardrails: - body["{guardrails}"] = self.guardrails.as_dict() + body["guardrails"] = self.guardrails.as_dict() if self.inference_table_config: - body["{inference_table_config}"] = self.inference_table_config.as_dict() + body["inference_table_config"] = self.inference_table_config.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rate_limits: - body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] + body["rate_limits"] = [v.as_dict() for v in self.rate_limits] if self.usage_tracking_config: - body["{usage_tracking_config}"] = self.usage_tracking_config.as_dict() + body["usage_tracking_config"] = self.usage_tracking_config.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2386,15 +2386,15 @@ def as_dict(self) -> dict: """Serializes the PutAiGatewayResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.fallback_config: - body["{fallback_config}"] = self.fallback_config.as_dict() + body["fallback_config"] = self.fallback_config.as_dict() if self.guardrails: - body["{guardrails}"] = self.guardrails.as_dict() + body["guardrails"] = self.guardrails.as_dict() if self.inference_table_config: - body["{inference_table_config}"] = self.inference_table_config.as_dict() + body["inference_table_config"] = self.inference_table_config.as_dict() if self.rate_limits: - body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] + body["rate_limits"] = [v.as_dict() for v in self.rate_limits] if self.usage_tracking_config: - body["{usage_tracking_config}"] = self.usage_tracking_config.as_dict() + body["usage_tracking_config"] = self.usage_tracking_config.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2436,9 +2436,9 @@ def as_dict(self) -> dict: """Serializes the PutRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rate_limits: - body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] + body["rate_limits"] = [v.as_dict() for v in self.rate_limits] return body def as_shallow_dict(self) -> dict: @@ -2465,7 +2465,7 @@ def as_dict(self) -> dict: """Serializes the PutResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.rate_limits: - body["{rate_limits}"] = [v.as_dict() for v in self.rate_limits] + body["rate_limits"] = [v.as_dict() for v in self.rate_limits] return body def as_shallow_dict(self) -> dict: @@ -2545,33 +2545,33 @@ def as_dict(self) -> dict: """Serializes the QueryEndpointInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.dataframe_records: - body["{dataframe_records}"] = [v for v in self.dataframe_records] + body["dataframe_records"] = [v for v in self.dataframe_records] if self.dataframe_split: - body["{dataframe_split}"] = self.dataframe_split.as_dict() + body["dataframe_split"] = self.dataframe_split.as_dict() if self.extra_params: - body["{extra_params}"] = self.extra_params + body["extra_params"] = self.extra_params if self.input: - body["{input}"] = self.input + body["input"] = self.input if self.inputs: - body["{inputs}"] = self.inputs + body["inputs"] = self.inputs if self.instances: - body["{instances}"] = [v for v in self.instances] + body["instances"] = [v for v in self.instances] if self.max_tokens is not None: - body["{max_tokens}"] = self.max_tokens + body["max_tokens"] = self.max_tokens if self.messages: - body["{messages}"] = [v.as_dict() for v in self.messages] + body["messages"] = [v.as_dict() for v in self.messages] if self.n is not None: - body["{n}"] = self.n + body["n"] = self.n if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.prompt: - body["{prompt}"] = self.prompt + body["prompt"] = self.prompt if self.stop: - body["{stop}"] = [v for v in self.stop] + body["stop"] = [v for v in self.stop] if self.stream is not None: - body["{stream}"] = self.stream + body["stream"] = self.stream if self.temperature is not None: - body["{temperature}"] = self.temperature + body["temperature"] = self.temperature return body def as_shallow_dict(self) -> dict: @@ -2669,23 +2669,23 @@ def as_dict(self) -> dict: """Serializes the QueryEndpointResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.choices: - body["{choices}"] = [v.as_dict() for v in self.choices] + body["choices"] = [v.as_dict() for v in self.choices] if self.created is not None: - body["{created}"] = self.created + body["created"] = self.created if self.data: - body["{data}"] = [v.as_dict() for v in self.data] + body["data"] = [v.as_dict() for v in self.data] if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.model is not None: - body["{model}"] = self.model + body["model"] = self.model if self.object is not None: - body["{object}"] = self.object.value + body["object"] = self.object.value if self.predictions: - body["{predictions}"] = [v for v in self.predictions] + body["predictions"] = [v for v in self.predictions] if self.served_model_name is not None: - body["{served_model_name}"] = self.served_model_name + body["served-model-name"] = self.served_model_name if self.usage: - body["{usage}"] = self.usage.as_dict() + body["usage"] = self.usage.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2752,11 +2752,11 @@ def as_dict(self) -> dict: """Serializes the RateLimit into a dictionary suitable for use as a JSON request body.""" body = {} if self.calls is not None: - body["{calls}"] = self.calls + body["calls"] = self.calls if self.key is not None: - body["{key}"] = self.key.value + body["key"] = self.key.value if self.renewal_period is not None: - body["{renewal_period}"] = self.renewal_period.value + body["renewal_period"] = self.renewal_period.value return body def as_shallow_dict(self) -> dict: @@ -2804,9 +2804,9 @@ def as_dict(self) -> dict: """Serializes the Route into a dictionary suitable for use as a JSON request body.""" body = {} if self.served_model_name is not None: - body["{served_model_name}"] = self.served_model_name + body["served_model_name"] = self.served_model_name if self.traffic_percentage is not None: - body["{traffic_percentage}"] = self.traffic_percentage + body["traffic_percentage"] = self.traffic_percentage return body def as_shallow_dict(self) -> dict: @@ -2888,27 +2888,27 @@ def as_dict(self) -> dict: """Serializes the ServedEntityInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.entity_name is not None: - body["{entity_name}"] = self.entity_name + body["entity_name"] = self.entity_name if self.entity_version is not None: - body["{entity_version}"] = self.entity_version + body["entity_version"] = self.entity_version if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.external_model: - body["{external_model}"] = self.external_model.as_dict() + body["external_model"] = self.external_model.as_dict() if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["{max_provisioned_throughput}"] = self.max_provisioned_throughput + body["max_provisioned_throughput"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["{min_provisioned_throughput}"] = self.min_provisioned_throughput + body["min_provisioned_throughput"] = self.min_provisioned_throughput if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["{workload_size}"] = self.workload_size + body["workload_size"] = self.workload_size if self.workload_type is not None: - body["{workload_type}"] = self.workload_type.value + body["workload_type"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: @@ -3028,35 +3028,35 @@ def as_dict(self) -> dict: """Serializes the ServedEntityOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.entity_name is not None: - body["{entity_name}"] = self.entity_name + body["entity_name"] = self.entity_name if self.entity_version is not None: - body["{entity_version}"] = self.entity_version + body["entity_version"] = self.entity_version if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.external_model: - body["{external_model}"] = self.external_model.as_dict() + body["external_model"] = self.external_model.as_dict() if self.foundation_model: - body["{foundation_model}"] = self.foundation_model.as_dict() + body["foundation_model"] = self.foundation_model.as_dict() if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["{max_provisioned_throughput}"] = self.max_provisioned_throughput + body["max_provisioned_throughput"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["{min_provisioned_throughput}"] = self.min_provisioned_throughput + body["min_provisioned_throughput"] = self.min_provisioned_throughput if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.workload_size is not None: - body["{workload_size}"] = self.workload_size + body["workload_size"] = self.workload_size if self.workload_type is not None: - body["{workload_type}"] = self.workload_type.value + body["workload_type"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: @@ -3134,15 +3134,15 @@ def as_dict(self) -> dict: """Serializes the ServedEntitySpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.entity_name is not None: - body["{entity_name}"] = self.entity_name + body["entity_name"] = self.entity_name if self.entity_version is not None: - body["{entity_version}"] = self.entity_version + body["entity_version"] = self.entity_version if self.external_model: - body["{external_model}"] = self.external_model.as_dict() + body["external_model"] = self.external_model.as_dict() if self.foundation_model: - body["{foundation_model}"] = self.foundation_model.as_dict() + body["foundation_model"] = self.foundation_model.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -3222,25 +3222,25 @@ def as_dict(self) -> dict: """Serializes the ServedModelInput into a dictionary suitable for use as a JSON request body.""" body = {} if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["{max_provisioned_throughput}"] = self.max_provisioned_throughput + body["max_provisioned_throughput"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["{min_provisioned_throughput}"] = self.min_provisioned_throughput + body["min_provisioned_throughput"] = self.min_provisioned_throughput if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version is not None: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["{workload_size}"] = self.workload_size.value + body["workload_size"] = self.workload_size.value if self.workload_type is not None: - body["{workload_type}"] = self.workload_type.value + body["workload_type"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: @@ -3352,27 +3352,27 @@ def as_dict(self) -> dict: """Serializes the ServedModelOutput into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version is not None: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.workload_size is not None: - body["{workload_size}"] = self.workload_size + body["workload_size"] = self.workload_size if self.workload_type is not None: - body["{workload_type}"] = self.workload_type.value + body["workload_type"] = self.workload_type.value return body def as_shallow_dict(self) -> dict: @@ -3434,11 +3434,11 @@ def as_dict(self) -> dict: """Serializes the ServedModelSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version is not None: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -3472,9 +3472,9 @@ def as_dict(self) -> dict: """Serializes the ServedModelState into a dictionary suitable for use as a JSON request body.""" body = {} if self.deployment is not None: - body["{deployment}"] = self.deployment.value + body["deployment"] = self.deployment.value if self.deployment_state_message is not None: - body["{deployment_state_message}"] = self.deployment_state_message + body["deployment_state_message"] = self.deployment_state_message return body def as_shallow_dict(self) -> dict: @@ -3513,7 +3513,7 @@ def as_dict(self) -> dict: """Serializes the ServerLogsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.logs is not None: - body["{logs}"] = self.logs + body["logs"] = self.logs return body def as_shallow_dict(self) -> dict: @@ -3569,27 +3569,27 @@ def as_dict(self) -> dict: """Serializes the ServingEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai_gateway: - body["{ai_gateway}"] = self.ai_gateway.as_dict() + body["ai_gateway"] = self.ai_gateway.as_dict() if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.config: - body["{config}"] = self.config.as_dict() + body["config"] = self.config.as_dict() if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.task is not None: - body["{task}"] = self.task + body["task"] = self.task return body def as_shallow_dict(self) -> dict: @@ -3655,13 +3655,13 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3709,15 +3709,15 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3803,37 +3803,37 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointDetailed into a dictionary suitable for use as a JSON request body.""" body = {} if self.ai_gateway: - body["{ai_gateway}"] = self.ai_gateway.as_dict() + body["ai_gateway"] = self.ai_gateway.as_dict() if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.config: - body["{config}"] = self.config.as_dict() + body["config"] = self.config.as_dict() if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.data_plane_info: - body["{data_plane_info}"] = self.data_plane_info.as_dict() + body["data_plane_info"] = self.data_plane_info.as_dict() if self.endpoint_url is not None: - body["{endpoint_url}"] = self.endpoint_url + body["endpoint_url"] = self.endpoint_url if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pending_config: - body["{pending_config}"] = self.pending_config.as_dict() + body["pending_config"] = self.pending_config.as_dict() if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.route_optimized is not None: - body["{route_optimized}"] = self.route_optimized + body["route_optimized"] = self.route_optimized if self.state: - body["{state}"] = self.state.as_dict() + body["state"] = self.state.as_dict() if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] if self.task is not None: - body["{task}"] = self.task + body["task"] = self.task return body def as_shallow_dict(self) -> dict: @@ -3916,11 +3916,11 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -3964,11 +3964,11 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -4003,9 +4003,9 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -4037,9 +4037,9 @@ def as_dict(self) -> dict: """Serializes the ServingEndpointPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.serving_endpoint_id is not None: - body["{serving_endpoint_id}"] = self.serving_endpoint_id + body["serving_endpoint_id"] = self.serving_endpoint_id return body def as_shallow_dict(self) -> dict: @@ -4079,7 +4079,7 @@ def as_dict(self) -> dict: """Serializes the TrafficConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.routes: - body["{routes}"] = [v.as_dict() for v in self.routes] + body["routes"] = [v.as_dict() for v in self.routes] return body def as_shallow_dict(self) -> dict: @@ -4116,15 +4116,15 @@ def as_dict(self) -> dict: """Serializes the V1ResponseChoiceElement into a dictionary suitable for use as a JSON request body.""" body = {} if self.finish_reason is not None: - body["{finish_reason}"] = self.finish_reason + body["finishReason"] = self.finish_reason if self.index is not None: - body["{index}"] = self.index + body["index"] = self.index if self.logprobs is not None: - body["{logprobs}"] = self.logprobs + body["logprobs"] = self.logprobs if self.message: - body["{message}"] = self.message.as_dict() + body["message"] = self.message.as_dict() if self.text is not None: - body["{text}"] = self.text + body["text"] = self.text return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/settings/v2/impl.py b/databricks/sdk/settings/v2/impl.py index a0c5e13a9..fb47a847b 100755 --- a/databricks/sdk/settings/v2/impl.py +++ b/databricks/sdk/settings/v2/impl.py @@ -37,11 +37,11 @@ def as_dict(self) -> dict: """Serializes the AccountIpAccessEnable into a dictionary suitable for use as a JSON request body.""" body = {} if self.acct_ip_acl_enable: - body["{acct_ip_acl_enable}"] = self.acct_ip_acl_enable.as_dict() + body["acct_ip_acl_enable"] = self.acct_ip_acl_enable.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -73,7 +73,7 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicy into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_policy_type is not None: - body["{access_policy_type}"] = self.access_policy_type.value + body["access_policy_type"] = self.access_policy_type.value return body def as_shallow_dict(self) -> dict: @@ -120,11 +120,11 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicySetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.aibi_dashboard_embedding_access_policy: - body["{aibi_dashboard_embedding_access_policy}"] = self.aibi_dashboard_embedding_access_policy.as_dict() + body["aibi_dashboard_embedding_access_policy"] = self.aibi_dashboard_embedding_access_policy.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -158,7 +158,7 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomains into a dictionary suitable for use as a JSON request body.""" body = {} if self.approved_domains: - body["{approved_domains}"] = [v for v in self.approved_domains] + body["approved_domains"] = [v for v in self.approved_domains] return body def as_shallow_dict(self) -> dict: @@ -196,13 +196,11 @@ def as_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomainsSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.aibi_dashboard_embedding_approved_domains: - body["{aibi_dashboard_embedding_approved_domains}"] = ( - self.aibi_dashboard_embedding_approved_domains.as_dict() - ) + body["aibi_dashboard_embedding_approved_domains"] = self.aibi_dashboard_embedding_approved_domains.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -250,11 +248,11 @@ def as_dict(self) -> dict: """Serializes the AutomaticClusterUpdateSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.automatic_cluster_update_workspace: - body["{automatic_cluster_update_workspace}"] = self.automatic_cluster_update_workspace.as_dict() + body["automatic_cluster_update_workspace"] = self.automatic_cluster_update_workspace.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -288,7 +286,7 @@ def as_dict(self) -> dict: """Serializes the BooleanMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -325,15 +323,15 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.can_toggle is not None: - body["{can_toggle}"] = self.can_toggle + body["can_toggle"] = self.can_toggle if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.enablement_details: - body["{enablement_details}"] = self.enablement_details.as_dict() + body["enablement_details"] = self.enablement_details.as_dict() if self.maintenance_window: - body["{maintenance_window}"] = self.maintenance_window.as_dict() + body["maintenance_window"] = self.maintenance_window.as_dict() if self.restart_even_if_no_updates_available is not None: - body["{restart_even_if_no_updates_available}"] = self.restart_even_if_no_updates_available + body["restart_even_if_no_updates_available"] = self.restart_even_if_no_updates_available return body def as_shallow_dict(self) -> dict: @@ -385,11 +383,11 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageEnablementDetails into a dictionary suitable for use as a JSON request body.""" body = {} if self.forced_for_compliance_mode is not None: - body["{forced_for_compliance_mode}"] = self.forced_for_compliance_mode + body["forced_for_compliance_mode"] = self.forced_for_compliance_mode if self.unavailable_for_disabled_entitlement is not None: - body["{unavailable_for_disabled_entitlement}"] = self.unavailable_for_disabled_entitlement + body["unavailable_for_disabled_entitlement"] = self.unavailable_for_disabled_entitlement if self.unavailable_for_non_enterprise_tier is not None: - body["{unavailable_for_non_enterprise_tier}"] = self.unavailable_for_non_enterprise_tier + body["unavailable_for_non_enterprise_tier"] = self.unavailable_for_non_enterprise_tier return body def as_shallow_dict(self) -> dict: @@ -421,7 +419,7 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindow into a dictionary suitable for use as a JSON request body.""" body = {} if self.week_day_based_schedule: - body["{week_day_based_schedule}"] = self.week_day_based_schedule.as_dict() + body["week_day_based_schedule"] = self.week_day_based_schedule.as_dict() return body def as_shallow_dict(self) -> dict: @@ -464,11 +462,11 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule into a dictionary suitable for use as a JSON request body.""" body = {} if self.day_of_week is not None: - body["{day_of_week}"] = self.day_of_week.value + body["day_of_week"] = self.day_of_week.value if self.frequency is not None: - body["{frequency}"] = self.frequency.value + body["frequency"] = self.frequency.value if self.window_start_time: - body["{window_start_time}"] = self.window_start_time.as_dict() + body["window_start_time"] = self.window_start_time.as_dict() return body def as_shallow_dict(self) -> dict: @@ -515,9 +513,9 @@ def as_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime into a dictionary suitable for use as a JSON request body.""" body = {} if self.hours is not None: - body["{hours}"] = self.hours + body["hours"] = self.hours if self.minutes is not None: - body["{minutes}"] = self.minutes + body["minutes"] = self.minutes return body def as_shallow_dict(self) -> dict: @@ -548,9 +546,9 @@ def as_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_standards: - body["{compliance_standards}"] = [v.value for v in self.compliance_standards] + body["compliance_standards"] = [v.value for v in self.compliance_standards] if self.is_enabled is not None: - body["{is_enabled}"] = self.is_enabled + body["is_enabled"] = self.is_enabled return body def as_shallow_dict(self) -> dict: @@ -594,11 +592,11 @@ def as_dict(self) -> dict: """Serializes the ComplianceSecurityProfileSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_security_profile_workspace: - body["{compliance_security_profile_workspace}"] = self.compliance_security_profile_workspace.as_dict() + body["compliance_security_profile_workspace"] = self.compliance_security_profile_workspace.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -657,15 +655,15 @@ def as_dict(self) -> dict: """Serializes the Config into a dictionary suitable for use as a JSON request body.""" body = {} if self.email: - body["{email}"] = self.email.as_dict() + body["email"] = self.email.as_dict() if self.generic_webhook: - body["{generic_webhook}"] = self.generic_webhook.as_dict() + body["generic_webhook"] = self.generic_webhook.as_dict() if self.microsoft_teams: - body["{microsoft_teams}"] = self.microsoft_teams.as_dict() + body["microsoft_teams"] = self.microsoft_teams.as_dict() if self.pagerduty: - body["{pagerduty}"] = self.pagerduty.as_dict() + body["pagerduty"] = self.pagerduty.as_dict() if self.slack: - body["{slack}"] = self.slack.as_dict() + body["slack"] = self.slack.as_dict() return body def as_shallow_dict(self) -> dict: @@ -714,11 +712,11 @@ def as_dict(self) -> dict: """Serializes the CreateIpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_addresses: - body["{ip_addresses}"] = [v for v in self.ip_addresses] + body["ip_addresses"] = [v for v in self.ip_addresses] if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_type is not None: - body["{list_type}"] = self.list_type.value + body["list_type"] = self.list_type.value return body def as_shallow_dict(self) -> dict: @@ -753,7 +751,7 @@ def as_dict(self) -> dict: """Serializes the CreateIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list.as_dict() + body["ip_access_list"] = self.ip_access_list.as_dict() return body def as_shallow_dict(self) -> dict: @@ -784,9 +782,9 @@ def as_dict(self) -> dict: """Serializes the CreateNetworkConnectivityConfigRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body def as_shallow_dict(self) -> dict: @@ -816,9 +814,9 @@ def as_dict(self) -> dict: """Serializes the CreateNotificationDestinationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.config: - body["{config}"] = self.config.as_dict() + body["config"] = self.config.as_dict() if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name return body def as_shallow_dict(self) -> dict: @@ -853,11 +851,11 @@ def as_dict(self) -> dict: """Serializes the CreateOboTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.application_id is not None: - body["{application_id}"] = self.application_id + body["application_id"] = self.application_id if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.lifetime_seconds is not None: - body["{lifetime_seconds}"] = self.lifetime_seconds + body["lifetime_seconds"] = self.lifetime_seconds return body def as_shallow_dict(self) -> dict: @@ -894,9 +892,9 @@ def as_dict(self) -> dict: """Serializes the CreateOboTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_info: - body["{token_info}"] = self.token_info.as_dict() + body["token_info"] = self.token_info.as_dict() if self.token_value is not None: - body["{token_value}"] = self.token_value + body["token_value"] = self.token_value return body def as_shallow_dict(self) -> dict: @@ -930,11 +928,11 @@ def as_dict(self) -> dict: """Serializes the CreatePrivateEndpointRuleRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_id is not None: - body["{group_id}"] = self.group_id.value + body["group_id"] = self.group_id.value if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id return body def as_shallow_dict(self) -> dict: @@ -982,9 +980,9 @@ def as_dict(self) -> dict: """Serializes the CreateTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.lifetime_seconds is not None: - body["{lifetime_seconds}"] = self.lifetime_seconds + body["lifetime_seconds"] = self.lifetime_seconds return body def as_shallow_dict(self) -> dict: @@ -1014,9 +1012,9 @@ def as_dict(self) -> dict: """Serializes the CreateTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_info: - body["{token_info}"] = self.token_info.as_dict() + body["token_info"] = self.token_info.as_dict() if self.token_value is not None: - body["{token_value}"] = self.token_value + body["token_value"] = self.token_value return body def as_shallow_dict(self) -> dict: @@ -1049,9 +1047,9 @@ def as_dict(self) -> dict: """Serializes the CspEnablementAccount into a dictionary suitable for use as a JSON request body.""" body = {} if self.compliance_standards: - body["{compliance_standards}"] = [v.value for v in self.compliance_standards] + body["compliance_standards"] = [v.value for v in self.compliance_standards] if self.is_enforced is not None: - body["{is_enforced}"] = self.is_enforced + body["is_enforced"] = self.is_enforced return body def as_shallow_dict(self) -> dict: @@ -1095,11 +1093,11 @@ def as_dict(self) -> dict: """Serializes the CspEnablementAccountSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.csp_enablement_account: - body["{csp_enablement_account}"] = self.csp_enablement_account.as_dict() + body["csp_enablement_account"] = self.csp_enablement_account.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -1153,11 +1151,11 @@ def as_dict(self) -> dict: """Serializes the DefaultNamespaceSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.namespace: - body["{namespace}"] = self.namespace.as_dict() + body["namespace"] = self.namespace.as_dict() if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -1197,7 +1195,7 @@ def as_dict(self) -> dict: """Serializes the DeleteAccountIpAccessEnableResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1229,7 +1227,7 @@ def as_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingAccessPolicySettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1261,7 +1259,7 @@ def as_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1293,7 +1291,7 @@ def as_dict(self) -> dict: """Serializes the DeleteDefaultNamespaceSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1325,7 +1323,7 @@ def as_dict(self) -> dict: """Serializes the DeleteDisableLegacyAccessResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1357,7 +1355,7 @@ def as_dict(self) -> dict: """Serializes the DeleteDisableLegacyDbfsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1389,7 +1387,7 @@ def as_dict(self) -> dict: """Serializes the DeleteDisableLegacyFeaturesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1439,7 +1437,7 @@ def as_dict(self) -> dict: """Serializes the DeletePersonalComputeSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1489,7 +1487,7 @@ def as_dict(self) -> dict: """Serializes the DeleteRestrictWorkspaceAdminsSettingResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body def as_shallow_dict(self) -> dict: @@ -1536,11 +1534,11 @@ def as_dict(self) -> dict: """Serializes the DisableLegacyAccess into a dictionary suitable for use as a JSON request body.""" body = {} if self.disable_legacy_access: - body["{disable_legacy_access}"] = self.disable_legacy_access.as_dict() + body["disable_legacy_access"] = self.disable_legacy_access.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -1586,11 +1584,11 @@ def as_dict(self) -> dict: """Serializes the DisableLegacyDbfs into a dictionary suitable for use as a JSON request body.""" body = {} if self.disable_legacy_dbfs: - body["{disable_legacy_dbfs}"] = self.disable_legacy_dbfs.as_dict() + body["disable_legacy_dbfs"] = self.disable_legacy_dbfs.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -1636,11 +1634,11 @@ def as_dict(self) -> dict: """Serializes the DisableLegacyFeatures into a dictionary suitable for use as a JSON request body.""" body = {} if self.disable_legacy_features: - body["{disable_legacy_features}"] = self.disable_legacy_features.as_dict() + body["disable_legacy_features"] = self.disable_legacy_features.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -1673,7 +1671,7 @@ def as_dict(self) -> dict: """Serializes the EmailConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.addresses: - body["{addresses}"] = [v for v in self.addresses] + body["addresses"] = [v for v in self.addresses] return body def as_shallow_dict(self) -> dict: @@ -1717,7 +1715,7 @@ def as_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoring into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_enabled is not None: - body["{is_enabled}"] = self.is_enabled + body["is_enabled"] = self.is_enabled return body def as_shallow_dict(self) -> dict: @@ -1756,11 +1754,11 @@ def as_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoringSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.enhanced_security_monitoring_workspace: - body["{enhanced_security_monitoring_workspace}"] = self.enhanced_security_monitoring_workspace.as_dict() + body["enhanced_security_monitoring_workspace"] = self.enhanced_security_monitoring_workspace.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -1796,7 +1794,7 @@ def as_dict(self) -> dict: """Serializes the EsmEnablementAccount into a dictionary suitable for use as a JSON request body.""" body = {} if self.is_enforced is not None: - body["{is_enforced}"] = self.is_enforced + body["is_enforced"] = self.is_enforced return body def as_shallow_dict(self) -> dict: @@ -1835,11 +1833,11 @@ def as_dict(self) -> dict: """Serializes the EsmEnablementAccountSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.esm_enablement_account: - body["{esm_enablement_account}"] = self.esm_enablement_account.as_dict() + body["esm_enablement_account"] = self.esm_enablement_account.as_dict() if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -1886,15 +1884,15 @@ def as_dict(self) -> dict: """Serializes the ExchangeToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential is not None: - body["{credential}"] = self.credential + body["credential"] = self.credential if self.credential_eol_time is not None: - body["{credential_eol_time}"] = self.credential_eol_time + body["credentialEolTime"] = self.credential_eol_time if self.owner_id is not None: - body["{owner_id}"] = self.owner_id + body["ownerId"] = self.owner_id if self.scopes: - body["{scopes}"] = [v for v in self.scopes] + body["scopes"] = [v for v in self.scopes] if self.token_type is not None: - body["{token_type}"] = self.token_type.value + body["tokenType"] = self.token_type.value return body def as_shallow_dict(self) -> dict: @@ -1941,11 +1939,11 @@ def as_dict(self) -> dict: """Serializes the ExchangeTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.partition_id: - body["{partition_id}"] = self.partition_id.as_dict() + body["partitionId"] = self.partition_id.as_dict() if self.scopes: - body["{scopes}"] = [v for v in self.scopes] + body["scopes"] = [v for v in self.scopes] if self.token_type: - body["{token_type}"] = [v.value for v in self.token_type] + body["tokenType"] = [v.value for v in self.token_type] return body def as_shallow_dict(self) -> dict: @@ -1979,7 +1977,7 @@ def as_dict(self) -> dict: """Serializes the ExchangeTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["{values}"] = [v.as_dict() for v in self.values] + body["values"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -2006,7 +2004,7 @@ def as_dict(self) -> dict: """Serializes the FetchIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list.as_dict() + body["ip_access_list"] = self.ip_access_list.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2046,17 +2044,17 @@ def as_dict(self) -> dict: """Serializes the GenericWebhookConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.password is not None: - body["{password}"] = self.password + body["password"] = self.password if self.password_set is not None: - body["{password_set}"] = self.password_set + body["password_set"] = self.password_set if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.url_set is not None: - body["{url_set}"] = self.url_set + body["url_set"] = self.url_set if self.username is not None: - body["{username}"] = self.username + body["username"] = self.username if self.username_set is not None: - body["{username_set}"] = self.username_set + body["username_set"] = self.username_set return body def as_shallow_dict(self) -> dict: @@ -2098,7 +2096,7 @@ def as_dict(self) -> dict: """Serializes the GetIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list.as_dict() + body["ip_access_list"] = self.ip_access_list.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2124,7 +2122,7 @@ def as_dict(self) -> dict: """Serializes the GetIpAccessListsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_lists: - body["{ip_access_lists}"] = [v.as_dict() for v in self.ip_access_lists] + body["ip_access_lists"] = [v.as_dict() for v in self.ip_access_lists] return body def as_shallow_dict(self) -> dict: @@ -2149,7 +2147,7 @@ def as_dict(self) -> dict: """Serializes the GetTokenPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -2175,7 +2173,7 @@ def as_dict(self) -> dict: """Serializes the GetTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_info: - body["{token_info}"] = self.token_info.as_dict() + body["token_info"] = self.token_info.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2231,25 +2229,25 @@ def as_dict(self) -> dict: """Serializes the IpAccessListInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.address_count is not None: - body["{address_count}"] = self.address_count + body["address_count"] = self.address_count if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.ip_addresses: - body["{ip_addresses}"] = [v for v in self.ip_addresses] + body["ip_addresses"] = [v for v in self.ip_addresses] if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_id is not None: - body["{list_id}"] = self.list_id + body["list_id"] = self.list_id if self.list_type is not None: - body["{list_type}"] = self.list_type.value + body["list_type"] = self.list_type.value if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -2304,7 +2302,7 @@ def as_dict(self) -> dict: """Serializes the ListIpAccessListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.ip_access_lists: - body["{ip_access_lists}"] = [v.as_dict() for v in self.ip_access_lists] + body["ip_access_lists"] = [v.as_dict() for v in self.ip_access_lists] return body def as_shallow_dict(self) -> dict: @@ -2332,9 +2330,9 @@ def as_dict(self) -> dict: """Serializes the ListNccAzurePrivateEndpointRulesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items: - body["{items}"] = [v.as_dict() for v in self.items] + body["items"] = [v.as_dict() for v in self.items] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -2367,9 +2365,9 @@ def as_dict(self) -> dict: """Serializes the ListNetworkConnectivityConfigurationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items: - body["{items}"] = [v.as_dict() for v in self.items] + body["items"] = [v.as_dict() for v in self.items] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -2401,9 +2399,9 @@ def as_dict(self) -> dict: """Serializes the ListNotificationDestinationsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -2439,11 +2437,11 @@ def as_dict(self) -> dict: """Serializes the ListNotificationDestinationsResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.destination_type is not None: - body["{destination_type}"] = self.destination_type.value + body["destination_type"] = self.destination_type.value if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -2476,7 +2474,7 @@ def as_dict(self) -> dict: """Serializes the ListPublicTokensResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_infos: - body["{token_infos}"] = [v.as_dict() for v in self.token_infos] + body["token_infos"] = [v.as_dict() for v in self.token_infos] return body def as_shallow_dict(self) -> dict: @@ -2503,7 +2501,7 @@ def as_dict(self) -> dict: """Serializes the ListTokensResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_infos: - body["{token_infos}"] = [v.as_dict() for v in self.token_infos] + body["token_infos"] = [v.as_dict() for v in self.token_infos] return body def as_shallow_dict(self) -> dict: @@ -2541,9 +2539,9 @@ def as_dict(self) -> dict: """Serializes the MicrosoftTeamsConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.url_set is not None: - body["{url_set}"] = self.url_set + body["url_set"] = self.url_set return body def as_shallow_dict(self) -> dict: @@ -2574,7 +2572,7 @@ def as_dict(self) -> dict: """Serializes the NccAwsStableIpRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.cidr_blocks: - body["{cidr_blocks}"] = [v for v in self.cidr_blocks] + body["cidr_blocks"] = [v for v in self.cidr_blocks] return body def as_shallow_dict(self) -> dict: @@ -2637,25 +2635,25 @@ def as_dict(self) -> dict: """Serializes the NccAzurePrivateEndpointRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.connection_state is not None: - body["{connection_state}"] = self.connection_state.value + body["connection_state"] = self.connection_state.value if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.deactivated is not None: - body["{deactivated}"] = self.deactivated + body["deactivated"] = self.deactivated if self.deactivated_at is not None: - body["{deactivated_at}"] = self.deactivated_at + body["deactivated_at"] = self.deactivated_at if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.group_id is not None: - body["{group_id}"] = self.group_id.value + body["group_id"] = self.group_id.value if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id if self.rule_id is not None: - body["{rule_id}"] = self.rule_id + body["rule_id"] = self.rule_id if self.updated_time is not None: - body["{updated_time}"] = self.updated_time + body["updated_time"] = self.updated_time return body def as_shallow_dict(self) -> dict: @@ -2748,11 +2746,11 @@ def as_dict(self) -> dict: """Serializes the NccAzureServiceEndpointRule into a dictionary suitable for use as a JSON request body.""" body = {} if self.subnets: - body["{subnets}"] = [v for v in self.subnets] + body["subnets"] = [v for v in self.subnets] if self.target_region is not None: - body["{target_region}"] = self.target_region + body["target_region"] = self.target_region if self.target_services: - body["{target_services}"] = [v for v in self.target_services] + body["target_services"] = [v for v in self.target_services] return body def as_shallow_dict(self) -> dict: @@ -2794,9 +2792,9 @@ def as_dict(self) -> dict: """Serializes the NccEgressConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.default_rules: - body["{default_rules}"] = self.default_rules.as_dict() + body["default_rules"] = self.default_rules.as_dict() if self.target_rules: - body["{target_rules}"] = self.target_rules.as_dict() + body["target_rules"] = self.target_rules.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2835,9 +2833,9 @@ def as_dict(self) -> dict: """Serializes the NccEgressDefaultRules into a dictionary suitable for use as a JSON request body.""" body = {} if self.aws_stable_ip_rule: - body["{aws_stable_ip_rule}"] = self.aws_stable_ip_rule.as_dict() + body["aws_stable_ip_rule"] = self.aws_stable_ip_rule.as_dict() if self.azure_service_endpoint_rule: - body["{azure_service_endpoint_rule}"] = self.azure_service_endpoint_rule.as_dict() + body["azure_service_endpoint_rule"] = self.azure_service_endpoint_rule.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2869,7 +2867,7 @@ def as_dict(self) -> dict: """Serializes the NccEgressTargetRules into a dictionary suitable for use as a JSON request body.""" body = {} if self.azure_private_endpoint_rules: - body["{azure_private_endpoint_rules}"] = [v.as_dict() for v in self.azure_private_endpoint_rules] + body["azure_private_endpoint_rules"] = [v.as_dict() for v in self.azure_private_endpoint_rules] return body def as_shallow_dict(self) -> dict: @@ -2920,19 +2918,19 @@ def as_dict(self) -> dict: """Serializes the NetworkConnectivityConfiguration into a dictionary suitable for use as a JSON request body.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.egress_config: - body["{egress_config}"] = self.egress_config.as_dict() + body["egress_config"] = self.egress_config.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.updated_time is not None: - body["{updated_time}"] = self.updated_time + body["updated_time"] = self.updated_time return body def as_shallow_dict(self) -> dict: @@ -2987,13 +2985,13 @@ def as_dict(self) -> dict: """Serializes the NotificationDestination into a dictionary suitable for use as a JSON request body.""" body = {} if self.config: - body["{config}"] = self.config.as_dict() + body["config"] = self.config.as_dict() if self.destination_type is not None: - body["{destination_type}"] = self.destination_type.value + body["destination_type"] = self.destination_type.value if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -3032,9 +3030,9 @@ def as_dict(self) -> dict: """Serializes the PagerdutyConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.integration_key is not None: - body["{integration_key}"] = self.integration_key + body["integration_key"] = self.integration_key if self.integration_key_set is not None: - body["{integration_key_set}"] = self.integration_key_set + body["integration_key_set"] = self.integration_key_set return body def as_shallow_dict(self) -> dict: @@ -3065,7 +3063,7 @@ def as_dict(self) -> dict: """Serializes the PartitionId into a dictionary suitable for use as a JSON request body.""" body = {} if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspaceId"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -3094,7 +3092,7 @@ def as_dict(self) -> dict: """Serializes the PersonalComputeMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["{value}"] = self.value.value + body["value"] = self.value.value return body def as_shallow_dict(self) -> dict: @@ -3143,11 +3141,11 @@ def as_dict(self) -> dict: """Serializes the PersonalComputeSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.personal_compute: - body["{personal_compute}"] = self.personal_compute.as_dict() + body["personal_compute"] = self.personal_compute.as_dict() if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -3189,13 +3187,13 @@ def as_dict(self) -> dict: """Serializes the PublicTokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.expiry_time is not None: - body["{expiry_time}"] = self.expiry_time + body["expiry_time"] = self.expiry_time if self.token_id is not None: - body["{token_id}"] = self.token_id + body["token_id"] = self.token_id return body def as_shallow_dict(self) -> dict: @@ -3247,15 +3245,15 @@ def as_dict(self) -> dict: """Serializes the ReplaceIpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.ip_access_list_id is not None: - body["{ip_access_list_id}"] = self.ip_access_list_id + body["ip_access_list_id"] = self.ip_access_list_id if self.ip_addresses: - body["{ip_addresses}"] = [v for v in self.ip_addresses] + body["ip_addresses"] = [v for v in self.ip_addresses] if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_type is not None: - body["{list_type}"] = self.list_type.value + body["list_type"] = self.list_type.value return body def as_shallow_dict(self) -> dict: @@ -3311,7 +3309,7 @@ def as_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -3355,11 +3353,11 @@ def as_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsSetting into a dictionary suitable for use as a JSON request body.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.restrict_workspace_admins: - body["{restrict_workspace_admins}"] = self.restrict_workspace_admins.as_dict() + body["restrict_workspace_admins"] = self.restrict_workspace_admins.as_dict() if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body def as_shallow_dict(self) -> dict: @@ -3392,7 +3390,7 @@ def as_dict(self) -> dict: """Serializes the RevokeTokenRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.token_id is not None: - body["{token_id}"] = self.token_id + body["token_id"] = self.token_id return body def as_shallow_dict(self) -> dict: @@ -3456,9 +3454,9 @@ def as_dict(self) -> dict: """Serializes the SlackConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.url_set is not None: - body["{url_set}"] = self.url_set + body["url_set"] = self.url_set return body def as_shallow_dict(self) -> dict: @@ -3485,7 +3483,7 @@ def as_dict(self) -> dict: """Serializes the StringMessage into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -3519,13 +3517,13 @@ def as_dict(self) -> dict: """Serializes the TokenAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3573,15 +3571,15 @@ def as_dict(self) -> dict: """Serializes the TokenAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -3644,23 +3642,23 @@ def as_dict(self) -> dict: """Serializes the TokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_by_id is not None: - body["{created_by_id}"] = self.created_by_id + body["created_by_id"] = self.created_by_id if self.created_by_username is not None: - body["{created_by_username}"] = self.created_by_username + body["created_by_username"] = self.created_by_username if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.expiry_time is not None: - body["{expiry_time}"] = self.expiry_time + body["expiry_time"] = self.expiry_time if self.last_used_day is not None: - body["{last_used_day}"] = self.last_used_day + body["last_used_day"] = self.last_used_day if self.owner_id is not None: - body["{owner_id}"] = self.owner_id + body["owner_id"] = self.owner_id if self.token_id is not None: - body["{token_id}"] = self.token_id + body["token_id"] = self.token_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body def as_shallow_dict(self) -> dict: @@ -3715,11 +3713,11 @@ def as_dict(self) -> dict: """Serializes the TokenPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -3761,11 +3759,11 @@ def as_dict(self) -> dict: """Serializes the TokenPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -3800,9 +3798,9 @@ def as_dict(self) -> dict: """Serializes the TokenPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -3831,7 +3829,7 @@ def as_dict(self) -> dict: """Serializes the TokenPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] return body def as_shallow_dict(self) -> dict: @@ -3883,11 +3881,11 @@ def as_dict(self) -> dict: """Serializes the UpdateAccountIpAccessEnableRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3935,11 +3933,11 @@ def as_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3987,11 +3985,11 @@ def as_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4039,11 +4037,11 @@ def as_dict(self) -> dict: """Serializes the UpdateAutomaticClusterUpdateSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4091,11 +4089,11 @@ def as_dict(self) -> dict: """Serializes the UpdateComplianceSecurityProfileSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4143,11 +4141,11 @@ def as_dict(self) -> dict: """Serializes the UpdateCspEnablementAccountSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4202,11 +4200,11 @@ def as_dict(self) -> dict: """Serializes the UpdateDefaultNamespaceSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4254,11 +4252,11 @@ def as_dict(self) -> dict: """Serializes the UpdateDisableLegacyAccessRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4306,11 +4304,11 @@ def as_dict(self) -> dict: """Serializes the UpdateDisableLegacyDbfsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4358,11 +4356,11 @@ def as_dict(self) -> dict: """Serializes the UpdateDisableLegacyFeaturesRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4410,11 +4408,11 @@ def as_dict(self) -> dict: """Serializes the UpdateEnhancedSecurityMonitoringSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4462,11 +4460,11 @@ def as_dict(self) -> dict: """Serializes the UpdateEsmEnablementAccountSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4515,15 +4513,15 @@ def as_dict(self) -> dict: """Serializes the UpdateIpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.ip_access_list_id is not None: - body["{ip_access_list_id}"] = self.ip_access_list_id + body["ip_access_list_id"] = self.ip_access_list_id if self.ip_addresses: - body["{ip_addresses}"] = [v for v in self.ip_addresses] + body["ip_addresses"] = [v for v in self.ip_addresses] if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_type is not None: - body["{list_type}"] = self.list_type.value + body["list_type"] = self.list_type.value return body def as_shallow_dict(self) -> dict: @@ -4568,11 +4566,11 @@ def as_dict(self) -> dict: """Serializes the UpdateNotificationDestinationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.config: - body["{config}"] = self.config.as_dict() + body["config"] = self.config.as_dict() if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -4618,11 +4616,11 @@ def as_dict(self) -> dict: """Serializes the UpdatePersonalComputeSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: @@ -4688,11 +4686,11 @@ def as_dict(self) -> dict: """Serializes the UpdateRestrictWorkspaceAdminsSettingRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting.as_dict() + body["setting"] = self.setting.as_dict() return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/sharing/v2/impl.py b/databricks/sdk/sharing/v2/impl.py index 62692e283..badeb0722 100755 --- a/databricks/sdk/sharing/v2/impl.py +++ b/databricks/sdk/sharing/v2/impl.py @@ -71,13 +71,13 @@ def as_dict(self) -> dict: """Serializes the CreateProvider into a dictionary suitable for use as a JSON request body.""" body = {} if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type.value + body["authentication_type"] = self.authentication_type.value if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.recipient_profile_str is not None: - body["{recipient_profile_str}"] = self.recipient_profile_str + body["recipient_profile_str"] = self.recipient_profile_str return body def as_shallow_dict(self) -> dict: @@ -142,23 +142,23 @@ def as_dict(self) -> dict: """Serializes the CreateRecipient into a dictionary suitable for use as a JSON request body.""" body = {} if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type.value + body["authentication_type"] = self.authentication_type.value if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.data_recipient_global_metastore_id is not None: - body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id + body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list.as_dict() + body["ip_access_list"] = self.ip_access_list.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties_kvpairs: - body["{properties_kvpairs}"] = self.properties_kvpairs.as_dict() + body["properties_kvpairs"] = self.properties_kvpairs.as_dict() if self.sharing_code is not None: - body["{sharing_code}"] = self.sharing_code + body["sharing_code"] = self.sharing_code return body def as_shallow_dict(self) -> dict: @@ -215,11 +215,11 @@ def as_dict(self) -> dict: """Serializes the CreateShare into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body def as_shallow_dict(self) -> dict: @@ -273,9 +273,9 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function: - body["{function}"] = self.function.as_dict() + body["function"] = self.function.as_dict() if self.table: - body["{table}"] = self.table.as_dict() + body["table"] = self.table.as_dict() return body def as_shallow_dict(self) -> dict: @@ -307,7 +307,7 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingDependencyList into a dictionary suitable for use as a JSON request body.""" body = {} if self.dependencies: - body["{dependencies}"] = [v.as_dict() for v in self.dependencies] + body["dependencies"] = [v.as_dict() for v in self.dependencies] return body def as_shallow_dict(self) -> dict: @@ -377,37 +377,37 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingFunction into a dictionary suitable for use as a JSON request body.""" body = {} if self.aliases: - body["{aliases}"] = [v.as_dict() for v in self.aliases] + body["aliases"] = [v.as_dict() for v in self.aliases] if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.data_type is not None: - body["{data_type}"] = self.data_type.value + body["data_type"] = self.data_type.value if self.dependency_list: - body["{dependency_list}"] = self.dependency_list.as_dict() + body["dependency_list"] = self.dependency_list.as_dict() if self.full_data_type is not None: - body["{full_data_type}"] = self.full_data_type + body["full_data_type"] = self.full_data_type if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.input_params: - body["{input_params}"] = self.input_params.as_dict() + body["input_params"] = self.input_params.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.properties is not None: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.routine_definition is not None: - body["{routine_definition}"] = self.routine_definition + body["routine_definition"] = self.routine_definition if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.securable_kind is not None: - body["{securable_kind}"] = self.securable_kind.value + body["securable_kind"] = self.securable_kind.value if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -482,9 +482,9 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingFunctionDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name return body def as_shallow_dict(self) -> dict: @@ -514,9 +514,9 @@ def as_dict(self) -> dict: """Serializes the DeltaSharingTableDependency into a dictionary suitable for use as a JSON request body.""" body = {} if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name return body def as_shallow_dict(self) -> dict: @@ -579,29 +579,29 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parameter_default is not None: - body["{parameter_default}"] = self.parameter_default + body["parameter_default"] = self.parameter_default if self.parameter_mode is not None: - body["{parameter_mode}"] = self.parameter_mode.value + body["parameter_mode"] = self.parameter_mode.value if self.parameter_type is not None: - body["{parameter_type}"] = self.parameter_type.value + body["parameter_type"] = self.parameter_type.value if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name.value + body["type_name"] = self.type_name.value if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body def as_shallow_dict(self) -> dict: @@ -661,7 +661,7 @@ def as_dict(self) -> dict: """Serializes the FunctionParameterInfos into a dictionary suitable for use as a JSON request body.""" body = {} if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] return body def as_shallow_dict(self) -> dict: @@ -721,9 +721,9 @@ def as_dict(self) -> dict: """Serializes the GetRecipientSharePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.permissions_out: - body["{permissions_out}"] = [v.as_dict() for v in self.permissions_out] + body["permissions_out"] = [v.as_dict() for v in self.permissions_out] return body def as_shallow_dict(self) -> dict: @@ -757,9 +757,9 @@ def as_dict(self) -> dict: """Serializes the GetSharePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.privilege_assignments: - body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] + body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: @@ -789,7 +789,7 @@ def as_dict(self) -> dict: """Serializes the IpAccessList into a dictionary suitable for use as a JSON request body.""" body = {} if self.allowed_ip_addresses: - body["{allowed_ip_addresses}"] = [v for v in self.allowed_ip_addresses] + body["allowed_ip_addresses"] = [v for v in self.allowed_ip_addresses] return body def as_shallow_dict(self) -> dict: @@ -825,13 +825,13 @@ def as_dict(self) -> dict: """Serializes the ListProviderShareAssetsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.functions: - body["{functions}"] = [v.as_dict() for v in self.functions] + body["functions"] = [v.as_dict() for v in self.functions] if self.notebooks: - body["{notebooks}"] = [v.as_dict() for v in self.notebooks] + body["notebooks"] = [v.as_dict() for v in self.notebooks] if self.tables: - body["{tables}"] = [v.as_dict() for v in self.tables] + body["tables"] = [v.as_dict() for v in self.tables] if self.volumes: - body["{volumes}"] = [v.as_dict() for v in self.volumes] + body["volumes"] = [v.as_dict() for v in self.volumes] return body def as_shallow_dict(self) -> dict: @@ -871,9 +871,9 @@ def as_dict(self) -> dict: """Serializes the ListProviderSharesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.shares: - body["{shares}"] = [v.as_dict() for v in self.shares] + body["shares"] = [v.as_dict() for v in self.shares] return body def as_shallow_dict(self) -> dict: @@ -906,9 +906,9 @@ def as_dict(self) -> dict: """Serializes the ListProvidersResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.providers: - body["{providers}"] = [v.as_dict() for v in self.providers] + body["providers"] = [v.as_dict() for v in self.providers] return body def as_shallow_dict(self) -> dict: @@ -941,9 +941,9 @@ def as_dict(self) -> dict: """Serializes the ListRecipientsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.recipients: - body["{recipients}"] = [v.as_dict() for v in self.recipients] + body["recipients"] = [v.as_dict() for v in self.recipients] return body def as_shallow_dict(self) -> dict: @@ -977,9 +977,9 @@ def as_dict(self) -> dict: """Serializes the ListSharesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.shares: - body["{shares}"] = [v.as_dict() for v in self.shares] + body["shares"] = [v.as_dict() for v in self.shares] return body def as_shallow_dict(self) -> dict: @@ -1021,17 +1021,17 @@ def as_dict(self) -> dict: """Serializes the NotebookFile into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -1073,7 +1073,7 @@ def as_dict(self) -> dict: """Serializes the Partition into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["{values}"] = [v.as_dict() for v in self.values] + body["values"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -1109,13 +1109,13 @@ def as_dict(self) -> dict: """Serializes the PartitionValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.op is not None: - body["{op}"] = self.op.value + body["op"] = self.op.value if self.recipient_property_key is not None: - body["{recipient_property_key}"] = self.recipient_property_key + body["recipient_property_key"] = self.recipient_property_key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -1163,11 +1163,11 @@ def as_dict(self) -> dict: """Serializes the PermissionsChange into a dictionary suitable for use as a JSON request body.""" body = {} if self.add: - body["{add}"] = [v for v in self.add] + body["add"] = [v for v in self.add] if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.remove: - body["{remove}"] = [v for v in self.remove] + body["remove"] = [v for v in self.remove] return body def as_shallow_dict(self) -> dict: @@ -1248,9 +1248,9 @@ def as_dict(self) -> dict: """Serializes the PrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.privileges: - body["{privileges}"] = [v.value for v in self.privileges] + body["privileges"] = [v.value for v in self.privileges] return body def as_shallow_dict(self) -> dict: @@ -1323,33 +1323,33 @@ def as_dict(self) -> dict: """Serializes the ProviderInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type.value + body["authentication_type"] = self.authentication_type.value if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_provider_global_metastore_id is not None: - body["{data_provider_global_metastore_id}"] = self.data_provider_global_metastore_id + body["data_provider_global_metastore_id"] = self.data_provider_global_metastore_id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.recipient_profile: - body["{recipient_profile}"] = self.recipient_profile.as_dict() + body["recipient_profile"] = self.recipient_profile.as_dict() if self.recipient_profile_str is not None: - body["{recipient_profile_str}"] = self.recipient_profile_str + body["recipient_profile_str"] = self.recipient_profile_str if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -1415,7 +1415,7 @@ def as_dict(self) -> dict: """Serializes the ProviderShare into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -1503,43 +1503,43 @@ def as_dict(self) -> dict: """Serializes the RecipientInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.activated is not None: - body["{activated}"] = self.activated + body["activated"] = self.activated if self.activation_url is not None: - body["{activation_url}"] = self.activation_url + body["activation_url"] = self.activation_url if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type.value + body["authentication_type"] = self.authentication_type.value if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_recipient_global_metastore_id is not None: - body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id + body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list.as_dict() + body["ip_access_list"] = self.ip_access_list.as_dict() if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties_kvpairs: - body["{properties_kvpairs}"] = self.properties_kvpairs.as_dict() + body["properties_kvpairs"] = self.properties_kvpairs.as_dict() if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.sharing_code is not None: - body["{sharing_code}"] = self.sharing_code + body["sharing_code"] = self.sharing_code if self.tokens: - body["{tokens}"] = [v.as_dict() for v in self.tokens] + body["tokens"] = [v.as_dict() for v in self.tokens] if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -1626,11 +1626,11 @@ def as_dict(self) -> dict: """Serializes the RecipientProfile into a dictionary suitable for use as a JSON request body.""" body = {} if self.bearer_token is not None: - body["{bearer_token}"] = self.bearer_token + body["bearer_token"] = self.bearer_token if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.share_credentials_version is not None: - body["{share_credentials_version}"] = self.share_credentials_version + body["share_credentials_version"] = self.share_credentials_version return body def as_shallow_dict(self) -> dict: @@ -1682,19 +1682,19 @@ def as_dict(self) -> dict: """Serializes the RecipientTokenInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.activation_url is not None: - body["{activation_url}"] = self.activation_url + body["activation_url"] = self.activation_url if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -1742,9 +1742,9 @@ def as_dict(self) -> dict: """Serializes the RegisteredModelAlias into a dictionary suitable for use as a JSON request body.""" body = {} if self.alias_name is not None: - body["{alias_name}"] = self.alias_name + body["alias_name"] = self.alias_name if self.version_num is not None: - body["{version_num}"] = self.version_num + body["version_num"] = self.version_num return body def as_shallow_dict(self) -> dict: @@ -1780,13 +1780,13 @@ def as_dict(self) -> dict: """Serializes the RetrieveTokenResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.bearer_token is not None: - body["{bearer_token}"] = self.bearer_token + body["bearerToken"] = self.bearer_token if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expirationTime"] = self.expiration_time if self.share_credentials_version is not None: - body["{share_credentials_version}"] = self.share_credentials_version + body["shareCredentialsVersion"] = self.share_credentials_version return body def as_shallow_dict(self) -> dict: @@ -1827,9 +1827,9 @@ def as_dict(self) -> dict: """Serializes the RotateRecipientToken into a dictionary suitable for use as a JSON request body.""" body = {} if self.existing_token_expire_in_seconds is not None: - body["{existing_token_expire_in_seconds}"] = self.existing_token_expire_in_seconds + body["existing_token_expire_in_seconds"] = self.existing_token_expire_in_seconds if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -1861,7 +1861,7 @@ def as_dict(self) -> dict: """Serializes the SecurablePropertiesKvPairs into a dictionary suitable for use as a JSON request body.""" body = {} if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties return body def as_shallow_dict(self) -> dict: @@ -1913,25 +1913,25 @@ def as_dict(self) -> dict: """Serializes the ShareInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.objects: - body["{objects}"] = [v.as_dict() for v in self.objects] + body["objects"] = [v.as_dict() for v in self.objects] if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body def as_shallow_dict(self) -> dict: @@ -1988,9 +1988,9 @@ def as_dict(self) -> dict: """Serializes the ShareToPrivilegeAssignment into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] + body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name return body def as_shallow_dict(self) -> dict: @@ -2070,31 +2070,31 @@ def as_dict(self) -> dict: """Serializes the SharedDataObject into a dictionary suitable for use as a JSON request body.""" body = {} if self.added_at is not None: - body["{added_at}"] = self.added_at + body["added_at"] = self.added_at if self.added_by is not None: - body["{added_by}"] = self.added_by + body["added_by"] = self.added_by if self.cdf_enabled is not None: - body["{cdf_enabled}"] = self.cdf_enabled + body["cdf_enabled"] = self.cdf_enabled if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.data_object_type is not None: - body["{data_object_type}"] = self.data_object_type.value + body["data_object_type"] = self.data_object_type.value if self.history_data_sharing_status is not None: - body["{history_data_sharing_status}"] = self.history_data_sharing_status.value + body["history_data_sharing_status"] = self.history_data_sharing_status.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.partitions: - body["{partitions}"] = [v.as_dict() for v in self.partitions] + body["partitions"] = [v.as_dict() for v in self.partitions] if self.shared_as is not None: - body["{shared_as}"] = self.shared_as + body["shared_as"] = self.shared_as if self.start_version is not None: - body["{start_version}"] = self.start_version + body["start_version"] = self.start_version if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.string_shared_as is not None: - body["{string_shared_as}"] = self.string_shared_as + body["string_shared_as"] = self.string_shared_as return body def as_shallow_dict(self) -> dict: @@ -2187,9 +2187,9 @@ def as_dict(self) -> dict: """Serializes the SharedDataObjectUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.action is not None: - body["{action}"] = self.action.value + body["action"] = self.action.value if self.data_object: - body["{data_object}"] = self.data_object.as_dict() + body["data_object"] = self.data_object.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2258,23 +2258,23 @@ def as_dict(self) -> dict: """Serializes the Table into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.internal_attributes: - body["{internal_attributes}"] = self.internal_attributes.as_dict() + body["internal_attributes"] = self.internal_attributes.as_dict() if self.materialized_table_name is not None: - body["{materialized_table_name}"] = self.materialized_table_name + body["materialized_table_name"] = self.materialized_table_name if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -2341,13 +2341,13 @@ def as_dict(self) -> dict: """Serializes the TableInternalAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.parent_storage_location is not None: - body["{parent_storage_location}"] = self.parent_storage_location + body["parent_storage_location"] = self.parent_storage_location if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value if self.view_definition is not None: - body["{view_definition}"] = self.view_definition + body["view_definition"] = self.view_definition return body def as_shallow_dict(self) -> dict: @@ -2396,9 +2396,9 @@ def as_dict(self) -> dict: """Serializes the TagKeyValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -2438,15 +2438,15 @@ def as_dict(self) -> dict: """Serializes the UpdateProvider into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.recipient_profile_str is not None: - body["{recipient_profile_str}"] = self.recipient_profile_str + body["recipient_profile_str"] = self.recipient_profile_str return body def as_shallow_dict(self) -> dict: @@ -2505,19 +2505,19 @@ def as_dict(self) -> dict: """Serializes the UpdateRecipient into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list.as_dict() + body["ip_access_list"] = self.ip_access_list.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties_kvpairs: - body["{properties_kvpairs}"] = self.properties_kvpairs.as_dict() + body["properties_kvpairs"] = self.properties_kvpairs.as_dict() return body def as_shallow_dict(self) -> dict: @@ -2577,17 +2577,17 @@ def as_dict(self) -> dict: """Serializes the UpdateShare into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updates: - body["{updates}"] = [v.as_dict() for v in self.updates] + body["updates"] = [v.as_dict() for v in self.updates] return body def as_shallow_dict(self) -> dict: @@ -2632,9 +2632,9 @@ def as_dict(self) -> dict: """Serializes the UpdateSharePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.changes: - body["{changes}"] = [v.as_dict() for v in self.changes] + body["changes"] = [v.as_dict() for v in self.changes] if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -2661,7 +2661,7 @@ def as_dict(self) -> dict: """Serializes the UpdateSharePermissionsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = [v.as_dict() for v in self.privilege_assignments] + body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments] return body def as_shallow_dict(self) -> dict: @@ -2708,21 +2708,21 @@ def as_dict(self) -> dict: """Serializes the Volume into a dictionary suitable for use as a JSON request body.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.internal_attributes: - body["{internal_attributes}"] = self.internal_attributes.as_dict() + body["internal_attributes"] = self.internal_attributes.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.tags: - body["{tags}"] = [v.as_dict() for v in self.tags] + body["tags"] = [v.as_dict() for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -2775,9 +2775,9 @@ def as_dict(self) -> dict: """Serializes the VolumeInternalAttributes into a dictionary suitable for use as a JSON request body.""" body = {} if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/sql/v2/impl.py b/databricks/sdk/sql/v2/impl.py index d32603118..099b8e5b3 100755 --- a/databricks/sdk/sql/v2/impl.py +++ b/databricks/sdk/sql/v2/impl.py @@ -30,11 +30,11 @@ def as_dict(self) -> dict: """Serializes the AccessControl into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -116,35 +116,35 @@ def as_dict(self) -> dict: """Serializes the Alert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["{condition}"] = self.condition.as_dict() + body["condition"] = self.condition.as_dict() if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state.value + body["lifecycle_state"] = self.lifecycle_state.value if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.trigger_time is not None: - body["{trigger_time}"] = self.trigger_time + body["trigger_time"] = self.trigger_time if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -222,13 +222,13 @@ def as_dict(self) -> dict: """Serializes the AlertCondition into a dictionary suitable for use as a JSON request body.""" body = {} if self.empty_result_state is not None: - body["{empty_result_state}"] = self.empty_result_state.value + body["empty_result_state"] = self.empty_result_state.value if self.op is not None: - body["{op}"] = self.op.value + body["op"] = self.op.value if self.operand: - body["{operand}"] = self.operand.as_dict() + body["operand"] = self.operand.as_dict() if self.threshold: - body["{threshold}"] = self.threshold.as_dict() + body["threshold"] = self.threshold.as_dict() return body def as_shallow_dict(self) -> dict: @@ -263,7 +263,7 @@ def as_dict(self) -> dict: """Serializes the AlertConditionOperand into a dictionary suitable for use as a JSON request body.""" body = {} if self.column: - body["{column}"] = self.column.as_dict() + body["column"] = self.column.as_dict() return body def as_shallow_dict(self) -> dict: @@ -287,7 +287,7 @@ def as_dict(self) -> dict: """Serializes the AlertConditionThreshold into a dictionary suitable for use as a JSON request body.""" body = {} if self.value: - body["{value}"] = self.value.as_dict() + body["value"] = self.value.as_dict() return body def as_shallow_dict(self) -> dict: @@ -311,7 +311,7 @@ def as_dict(self) -> dict: """Serializes the AlertOperandColumn into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -339,11 +339,11 @@ def as_dict(self) -> dict: """Serializes the AlertOperandValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.bool_value is not None: - body["{bool_value}"] = self.bool_value + body["bool_value"] = self.bool_value if self.double_value is not None: - body["{double_value}"] = self.double_value + body["double_value"] = self.double_value if self.string_value is not None: - body["{string_value}"] = self.string_value + body["string_value"] = self.string_value return body def as_shallow_dict(self) -> dict: @@ -414,19 +414,19 @@ def as_dict(self) -> dict: """Serializes the AlertOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.column is not None: - body["{column}"] = self.column + body["column"] = self.column if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.empty_result_state is not None: - body["{empty_result_state}"] = self.empty_result_state.value + body["empty_result_state"] = self.empty_result_state.value if self.muted is not None: - body["{muted}"] = self.muted + body["muted"] = self.muted if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.value: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -521,31 +521,31 @@ def as_dict(self) -> dict: """Serializes the AlertQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_archived is not None: - body["{is_archived}"] = self.is_archived + body["is_archived"] = self.is_archived if self.is_draft is not None: - body["{is_draft}"] = self.is_draft + body["is_draft"] = self.is_draft if self.is_safe is not None: - body["{is_safe}"] = self.is_safe + body["is_safe"] = self.is_safe if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body def as_shallow_dict(self) -> dict: @@ -628,13 +628,13 @@ def as_dict(self) -> dict: """Serializes the BaseChunkInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body def as_shallow_dict(self) -> dict: @@ -692,9 +692,9 @@ def as_dict(self) -> dict: """Serializes the Channel into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbsql_version is not None: - body["{dbsql_version}"] = self.dbsql_version + body["dbsql_version"] = self.dbsql_version if self.name is not None: - body["{name}"] = self.name.value + body["name"] = self.name.value return body def as_shallow_dict(self) -> dict: @@ -726,9 +726,9 @@ def as_dict(self) -> dict: """Serializes the ChannelInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.dbsql_version is not None: - body["{dbsql_version}"] = self.dbsql_version + body["dbsql_version"] = self.dbsql_version if self.name is not None: - body["{name}"] = self.name.value + body["name"] = self.name.value return body def as_shallow_dict(self) -> dict: @@ -780,25 +780,25 @@ def as_dict(self) -> dict: """Serializes the ClientConfig into a dictionary suitable for use as a JSON request body.""" body = {} if self.allow_custom_js_visualizations is not None: - body["{allow_custom_js_visualizations}"] = self.allow_custom_js_visualizations + body["allow_custom_js_visualizations"] = self.allow_custom_js_visualizations if self.allow_downloads is not None: - body["{allow_downloads}"] = self.allow_downloads + body["allow_downloads"] = self.allow_downloads if self.allow_external_shares is not None: - body["{allow_external_shares}"] = self.allow_external_shares + body["allow_external_shares"] = self.allow_external_shares if self.allow_subscriptions is not None: - body["{allow_subscriptions}"] = self.allow_subscriptions + body["allow_subscriptions"] = self.allow_subscriptions if self.date_format is not None: - body["{date_format}"] = self.date_format + body["date_format"] = self.date_format if self.date_time_format is not None: - body["{date_time_format}"] = self.date_time_format + body["date_time_format"] = self.date_time_format if self.disable_publish is not None: - body["{disable_publish}"] = self.disable_publish + body["disable_publish"] = self.disable_publish if self.enable_legacy_autodetect_types is not None: - body["{enable_legacy_autodetect_types}"] = self.enable_legacy_autodetect_types + body["enable_legacy_autodetect_types"] = self.enable_legacy_autodetect_types if self.feature_show_permissions_control is not None: - body["{feature_show_permissions_control}"] = self.feature_show_permissions_control + body["feature_show_permissions_control"] = self.feature_show_permissions_control if self.hide_plotly_mode_bar is not None: - body["{hide_plotly_mode_bar}"] = self.hide_plotly_mode_bar + body["hide_plotly_mode_bar"] = self.hide_plotly_mode_bar return body def as_shallow_dict(self) -> dict: @@ -872,19 +872,19 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_name is not None: - body["{type_name}"] = self.type_name.value + body["type_name"] = self.type_name.value if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body def as_shallow_dict(self) -> dict: @@ -967,15 +967,15 @@ def as_dict(self) -> dict: """Serializes the CreateAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.rearm is not None: - body["{rearm}"] = self.rearm + body["rearm"] = self.rearm return body def as_shallow_dict(self) -> dict: @@ -1013,7 +1013,7 @@ def as_dict(self) -> dict: """Serializes the CreateAlertRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert: - body["{alert}"] = self.alert.as_dict() + body["alert"] = self.alert.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1065,21 +1065,21 @@ def as_dict(self) -> dict: """Serializes the CreateAlertRequestAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["{condition}"] = self.condition.as_dict() + body["condition"] = self.condition.as_dict() if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger return body def as_shallow_dict(self) -> dict: @@ -1126,7 +1126,7 @@ def as_dict(self) -> dict: """Serializes the CreateQueryRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.query: - body["{query}"] = self.query.as_dict() + body["query"] = self.query.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1180,27 +1180,27 @@ def as_dict(self) -> dict: """Serializes the CreateQueryRequestQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode.value + body["run_as_mode"] = self.run_as_mode.value if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -1256,7 +1256,7 @@ def as_dict(self) -> dict: """Serializes the CreateVisualizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.visualization: - body["{visualization}"] = self.visualization.as_dict() + body["visualization"] = self.visualization.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1295,15 +1295,15 @@ def as_dict(self) -> dict: """Serializes the CreateVisualizationRequestVisualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.serialized_options is not None: - body["{serialized_options}"] = self.serialized_options + body["serialized_options"] = self.serialized_options if self.serialized_query_plan is not None: - body["{serialized_query_plan}"] = self.serialized_query_plan + body["serialized_query_plan"] = self.serialized_query_plan if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body def as_shallow_dict(self) -> dict: @@ -1408,31 +1408,31 @@ def as_dict(self) -> dict: """Serializes the CreateWarehouseRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel.as_dict() + body["channel"] = self.channel.as_dict() if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy.value + body["spot_instance_policy"] = self.spot_instance_policy.value if self.tags: - body["{tags}"] = self.tags.as_dict() + body["tags"] = self.tags.as_dict() if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type.value + body["warehouse_type"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: @@ -1504,7 +1504,7 @@ def as_dict(self) -> dict: """Serializes the CreateWarehouseResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body def as_shallow_dict(self) -> dict: @@ -1544,17 +1544,17 @@ def as_dict(self) -> dict: """Serializes the CreateWidget into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.text is not None: - body["{text}"] = self.text + body["text"] = self.text if self.visualization_id is not None: - body["{visualization_id}"] = self.visualization_id + body["visualization_id"] = self.visualization_id if self.width is not None: - body["{width}"] = self.width + body["width"] = self.width return body def as_shallow_dict(self) -> dict: @@ -1648,39 +1648,39 @@ def as_dict(self) -> dict: """Serializes the Dashboard into a dictionary suitable for use as a JSON request body.""" body = {} if self.can_edit is not None: - body["{can_edit}"] = self.can_edit + body["can_edit"] = self.can_edit if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.dashboard_filters_enabled is not None: - body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled + body["dashboard_filters_enabled"] = self.dashboard_filters_enabled if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_archived is not None: - body["{is_archived}"] = self.is_archived + body["is_archived"] = self.is_archived if self.is_draft is not None: - body["{is_draft}"] = self.is_draft + body["is_draft"] = self.is_draft if self.is_favorite is not None: - body["{is_favorite}"] = self.is_favorite + body["is_favorite"] = self.is_favorite if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.permission_tier is not None: - body["{permission_tier}"] = self.permission_tier.value + body["permission_tier"] = self.permission_tier.value if self.slug is not None: - body["{slug}"] = self.slug + body["slug"] = self.slug if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user: - body["{user}"] = self.user.as_dict() + body["user"] = self.user.as_dict() if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.widgets: - body["{widgets}"] = [v.as_dict() for v in self.widgets] + body["widgets"] = [v.as_dict() for v in self.widgets] return body def as_shallow_dict(self) -> dict: @@ -1763,13 +1763,13 @@ def as_dict(self) -> dict: """Serializes the DashboardEditContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role.value + body["run_as_role"] = self.run_as_role.value if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -1806,7 +1806,7 @@ def as_dict(self) -> dict: """Serializes the DashboardOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.moved_to_trash_at is not None: - body["{moved_to_trash_at}"] = self.moved_to_trash_at + body["moved_to_trash_at"] = self.moved_to_trash_at return body def as_shallow_dict(self) -> dict: @@ -1846,17 +1846,17 @@ def as_dict(self) -> dict: """Serializes the DashboardPostContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.dashboard_filters_enabled is not None: - body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled + body["dashboard_filters_enabled"] = self.dashboard_filters_enabled if self.is_favorite is not None: - body["{is_favorite}"] = self.is_favorite + body["is_favorite"] = self.is_favorite if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role.value + body["run_as_role"] = self.run_as_role.value if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -1928,23 +1928,23 @@ def as_dict(self) -> dict: """Serializes the DataSource into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pause_reason is not None: - body["{pause_reason}"] = self.pause_reason + body["pause_reason"] = self.pause_reason if self.paused is not None: - body["{paused}"] = self.paused + body["paused"] = self.paused if self.supports_auto_limit is not None: - body["{supports_auto_limit}"] = self.supports_auto_limit + body["supports_auto_limit"] = self.supports_auto_limit if self.syntax is not None: - body["{syntax}"] = self.syntax + body["syntax"] = self.syntax if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.view_only is not None: - body["{view_only}"] = self.view_only + body["view_only"] = self.view_only if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -2003,9 +2003,9 @@ def as_dict(self) -> dict: """Serializes the DateRange into a dictionary suitable for use as a JSON request body.""" body = {} if self.end is not None: - body["{end}"] = self.end + body["end"] = self.end if self.start is not None: - body["{start}"] = self.start + body["start"] = self.start return body def as_shallow_dict(self) -> dict: @@ -2041,13 +2041,13 @@ def as_dict(self) -> dict: """Serializes the DateRangeValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.date_range_value: - body["{date_range_value}"] = self.date_range_value.as_dict() + body["date_range_value"] = self.date_range_value.as_dict() if self.dynamic_date_range_value is not None: - body["{dynamic_date_range_value}"] = self.dynamic_date_range_value.value + body["dynamic_date_range_value"] = self.dynamic_date_range_value.value if self.precision is not None: - body["{precision}"] = self.precision.value + body["precision"] = self.precision.value if self.start_day_of_week is not None: - body["{start_day_of_week}"] = self.start_day_of_week + body["start_day_of_week"] = self.start_day_of_week return body def as_shallow_dict(self) -> dict: @@ -2111,11 +2111,11 @@ def as_dict(self) -> dict: """Serializes the DateValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.date_value is not None: - body["{date_value}"] = self.date_value + body["date_value"] = self.date_value if self.dynamic_date_value is not None: - body["{dynamic_date_value}"] = self.dynamic_date_value.value + body["dynamic_date_value"] = self.dynamic_date_value.value if self.precision is not None: - body["{precision}"] = self.precision.value + body["precision"] = self.precision.value return body def as_shallow_dict(self) -> dict: @@ -2208,15 +2208,15 @@ def as_dict(self) -> dict: """Serializes the EditAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_id is not None: - body["{alert_id}"] = self.alert_id + body["alert_id"] = self.alert_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.rearm is not None: - body["{rearm}"] = self.rearm + body["rearm"] = self.rearm return body def as_shallow_dict(self) -> dict: @@ -2323,33 +2323,33 @@ def as_dict(self) -> dict: """Serializes the EditWarehouseRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel.as_dict() + body["channel"] = self.channel.as_dict() if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy.value + body["spot_instance_policy"] = self.spot_instance_policy.value if self.tags: - body["{tags}"] = self.tags.as_dict() + body["tags"] = self.tags.as_dict() if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type.value + body["warehouse_type"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: @@ -2464,9 +2464,9 @@ def as_dict(self) -> dict: """Serializes the EndpointConfPair into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -2506,15 +2506,15 @@ def as_dict(self) -> dict: """Serializes the EndpointHealth into a dictionary suitable for use as a JSON request body.""" body = {} if self.details is not None: - body["{details}"] = self.details + body["details"] = self.details if self.failure_reason: - body["{failure_reason}"] = self.failure_reason.as_dict() + body["failure_reason"] = self.failure_reason.as_dict() if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.summary is not None: - body["{summary}"] = self.summary + body["summary"] = self.summary return body def as_shallow_dict(self) -> dict: @@ -2639,45 +2639,45 @@ def as_dict(self) -> dict: """Serializes the EndpointInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel.as_dict() + body["channel"] = self.channel.as_dict() if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.health: - body["{health}"] = self.health.as_dict() + body["health"] = self.health.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.jdbc_url is not None: - body["{jdbc_url}"] = self.jdbc_url + body["jdbc_url"] = self.jdbc_url if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.num_active_sessions is not None: - body["{num_active_sessions}"] = self.num_active_sessions + body["num_active_sessions"] = self.num_active_sessions if self.num_clusters is not None: - body["{num_clusters}"] = self.num_clusters + body["num_clusters"] = self.num_clusters if self.odbc_params: - body["{odbc_params}"] = self.odbc_params.as_dict() + body["odbc_params"] = self.odbc_params.as_dict() if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy.value + body["spot_instance_policy"] = self.spot_instance_policy.value if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.tags: - body["{tags}"] = self.tags.as_dict() + body["tags"] = self.tags.as_dict() if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type.value + body["warehouse_type"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: @@ -2771,9 +2771,9 @@ def as_dict(self) -> dict: """Serializes the EndpointTagPair into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -2799,7 +2799,7 @@ def as_dict(self) -> dict: """Serializes the EndpointTags into a dictionary suitable for use as a JSON request body.""" body = {} if self.custom_tags: - body["{custom_tags}"] = [v.as_dict() for v in self.custom_tags] + body["custom_tags"] = [v.as_dict() for v in self.custom_tags] return body def as_shallow_dict(self) -> dict: @@ -2830,11 +2830,11 @@ def as_dict(self) -> dict: """Serializes the EnumValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.enum_options is not None: - body["{enum_options}"] = self.enum_options + body["enum_options"] = self.enum_options if self.multi_values_options: - body["{multi_values_options}"] = self.multi_values_options.as_dict() + body["multi_values_options"] = self.multi_values_options.as_dict() if self.values: - body["{values}"] = [v for v in self.values] + body["values"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -2979,27 +2979,27 @@ def as_dict(self) -> dict: """Serializes the ExecuteStatementRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_limit is not None: - body["{byte_limit}"] = self.byte_limit + body["byte_limit"] = self.byte_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.disposition is not None: - body["{disposition}"] = self.disposition.value + body["disposition"] = self.disposition.value if self.format is not None: - body["{format}"] = self.format.value + body["format"] = self.format.value if self.on_wait_timeout is not None: - body["{on_wait_timeout}"] = self.on_wait_timeout.value + body["on_wait_timeout"] = self.on_wait_timeout.value if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.row_limit is not None: - body["{row_limit}"] = self.row_limit + body["row_limit"] = self.row_limit if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.statement is not None: - body["{statement}"] = self.statement + body["statement"] = self.statement if self.wait_timeout is not None: - body["{wait_timeout}"] = self.wait_timeout + body["wait_timeout"] = self.wait_timeout if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -3100,23 +3100,23 @@ def as_dict(self) -> dict: """Serializes the ExternalLink into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.expiration is not None: - body["{expiration}"] = self.expiration + body["expiration"] = self.expiration if self.external_link is not None: - body["{external_link}"] = self.external_link + body["external_link"] = self.external_link if self.http_headers: - body["{http_headers}"] = self.http_headers + body["http_headers"] = self.http_headers if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body def as_shallow_dict(self) -> dict: @@ -3184,19 +3184,19 @@ def as_dict(self) -> dict: """Serializes the ExternalQuerySource into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert_id is not None: - body["{alert_id}"] = self.alert_id + body["alert_id"] = self.alert_id if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.genie_space_id is not None: - body["{genie_space_id}"] = self.genie_space_id + body["genie_space_id"] = self.genie_space_id if self.job_info: - body["{job_info}"] = self.job_info.as_dict() + body["job_info"] = self.job_info.as_dict() if self.legacy_dashboard_id is not None: - body["{legacy_dashboard_id}"] = self.legacy_dashboard_id + body["legacy_dashboard_id"] = self.legacy_dashboard_id if self.notebook_id is not None: - body["{notebook_id}"] = self.notebook_id + body["notebook_id"] = self.notebook_id if self.sql_query_id is not None: - body["{sql_query_id}"] = self.sql_query_id + body["sql_query_id"] = self.sql_query_id return body def as_shallow_dict(self) -> dict: @@ -3247,11 +3247,11 @@ def as_dict(self) -> dict: """Serializes the ExternalQuerySourceJobInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_run_id is not None: - body["{job_run_id}"] = self.job_run_id + body["job_run_id"] = self.job_run_id if self.job_task_run_id is not None: - body["{job_task_run_id}"] = self.job_task_run_id + body["job_task_run_id"] = self.job_task_run_id return body def as_shallow_dict(self) -> dict: @@ -3296,11 +3296,11 @@ def as_dict(self) -> dict: """Serializes the GetResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type.value + body["object_type"] = self.object_type.value return body def as_shallow_dict(self) -> dict: @@ -3333,7 +3333,7 @@ def as_dict(self) -> dict: """Serializes the GetWarehousePermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -3444,45 +3444,45 @@ def as_dict(self) -> dict: """Serializes the GetWarehouseResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel.as_dict() + body["channel"] = self.channel.as_dict() if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.health: - body["{health}"] = self.health.as_dict() + body["health"] = self.health.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.jdbc_url is not None: - body["{jdbc_url}"] = self.jdbc_url + body["jdbc_url"] = self.jdbc_url if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.num_active_sessions is not None: - body["{num_active_sessions}"] = self.num_active_sessions + body["num_active_sessions"] = self.num_active_sessions if self.num_clusters is not None: - body["{num_clusters}"] = self.num_clusters + body["num_clusters"] = self.num_clusters if self.odbc_params: - body["{odbc_params}"] = self.odbc_params.as_dict() + body["odbc_params"] = self.odbc_params.as_dict() if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy.value + body["spot_instance_policy"] = self.spot_instance_policy.value if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.tags: - body["{tags}"] = self.tags.as_dict() + body["tags"] = self.tags.as_dict() if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type.value + body["warehouse_type"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: @@ -3604,23 +3604,23 @@ def as_dict(self) -> dict: """Serializes the GetWorkspaceWarehouseConfigResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.channel: - body["{channel}"] = self.channel.as_dict() + body["channel"] = self.channel.as_dict() if self.config_param: - body["{config_param}"] = self.config_param.as_dict() + body["config_param"] = self.config_param.as_dict() if self.data_access_config: - body["{data_access_config}"] = [v.as_dict() for v in self.data_access_config] + body["data_access_config"] = [v.as_dict() for v in self.data_access_config] if self.enabled_warehouse_types: - body["{enabled_warehouse_types}"] = [v.as_dict() for v in self.enabled_warehouse_types] + body["enabled_warehouse_types"] = [v.as_dict() for v in self.enabled_warehouse_types] if self.global_param: - body["{global_param}"] = self.global_param.as_dict() + body["global_param"] = self.global_param.as_dict() if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.security_policy is not None: - body["{security_policy}"] = self.security_policy.value + body["security_policy"] = self.security_policy.value if self.sql_configuration_parameters: - body["{sql_configuration_parameters}"] = self.sql_configuration_parameters.as_dict() + body["sql_configuration_parameters"] = self.sql_configuration_parameters.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3709,27 +3709,27 @@ def as_dict(self) -> dict: """Serializes the LegacyAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_triggered_at is not None: - body["{last_triggered_at}"] = self.last_triggered_at + body["last_triggered_at"] = self.last_triggered_at if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.query: - body["{query}"] = self.query.as_dict() + body["query"] = self.query.as_dict() if self.rearm is not None: - body["{rearm}"] = self.rearm + body["rearm"] = self.rearm if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user: - body["{user}"] = self.user.as_dict() + body["user"] = self.user.as_dict() return body def as_shallow_dict(self) -> dict: @@ -3871,53 +3871,53 @@ def as_dict(self) -> dict: """Serializes the LegacyQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.can_edit is not None: - body["{can_edit}"] = self.can_edit + body["can_edit"] = self.can_edit if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_archived is not None: - body["{is_archived}"] = self.is_archived + body["is_archived"] = self.is_archived if self.is_draft is not None: - body["{is_draft}"] = self.is_draft + body["is_draft"] = self.is_draft if self.is_favorite is not None: - body["{is_favorite}"] = self.is_favorite + body["is_favorite"] = self.is_favorite if self.is_safe is not None: - body["{is_safe}"] = self.is_safe + body["is_safe"] = self.is_safe if self.last_modified_by: - body["{last_modified_by}"] = self.last_modified_by.as_dict() + body["last_modified_by"] = self.last_modified_by.as_dict() if self.last_modified_by_id is not None: - body["{last_modified_by_id}"] = self.last_modified_by_id + body["last_modified_by_id"] = self.last_modified_by_id if self.latest_query_data_id is not None: - body["{latest_query_data_id}"] = self.latest_query_data_id + body["latest_query_data_id"] = self.latest_query_data_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.permission_tier is not None: - body["{permission_tier}"] = self.permission_tier.value + body["permission_tier"] = self.permission_tier.value if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.query_hash is not None: - body["{query_hash}"] = self.query_hash + body["query_hash"] = self.query_hash if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role.value + body["run_as_role"] = self.run_as_role.value if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user: - body["{user}"] = self.user.as_dict() + body["user"] = self.user.as_dict() if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.visualizations: - body["{visualizations}"] = [v.as_dict() for v in self.visualizations] + body["visualizations"] = [v.as_dict() for v in self.visualizations] return body def as_shallow_dict(self) -> dict: @@ -4037,21 +4037,21 @@ def as_dict(self) -> dict: """Serializes the LegacyVisualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.query: - body["{query}"] = self.query.as_dict() + body["query"] = self.query.as_dict() if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body def as_shallow_dict(self) -> dict: @@ -4106,9 +4106,9 @@ def as_dict(self) -> dict: """Serializes the ListAlertsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -4184,33 +4184,33 @@ def as_dict(self) -> dict: """Serializes the ListAlertsResponseAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["{condition}"] = self.condition.as_dict() + body["condition"] = self.condition.as_dict() if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state.value + body["lifecycle_state"] = self.lifecycle_state.value if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value if self.trigger_time is not None: - body["{trigger_time}"] = self.trigger_time + body["trigger_time"] = self.trigger_time if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -4287,11 +4287,11 @@ def as_dict(self) -> dict: """Serializes the ListQueriesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.has_next_page is not None: - body["{has_next_page}"] = self.has_next_page + body["has_next_page"] = self.has_next_page if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.res: - body["{res}"] = [v.as_dict() for v in self.res] + body["res"] = [v.as_dict() for v in self.res] return body def as_shallow_dict(self) -> dict: @@ -4325,9 +4325,9 @@ def as_dict(self) -> dict: """Serializes the ListQueryObjectsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -4401,37 +4401,37 @@ def as_dict(self) -> dict: """Serializes the ListQueryObjectsResponseQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_modifier_user_name is not None: - body["{last_modifier_user_name}"] = self.last_modifier_user_name + body["last_modifier_user_name"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state.value + body["lifecycle_state"] = self.lifecycle_state.value if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode.value + body["run_as_mode"] = self.run_as_mode.value if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -4512,13 +4512,13 @@ def as_dict(self) -> dict: """Serializes the ListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.count is not None: - body["{count}"] = self.count + body["count"] = self.count if self.page is not None: - body["{page}"] = self.page + body["page"] = self.page if self.page_size is not None: - body["{page_size}"] = self.page_size + body["page_size"] = self.page_size if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -4555,9 +4555,9 @@ def as_dict(self) -> dict: """Serializes the ListVisualizationsForQueryResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -4586,7 +4586,7 @@ def as_dict(self) -> dict: """Serializes the ListWarehousesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.warehouses: - body["{warehouses}"] = [v.as_dict() for v in self.warehouses] + body["warehouses"] = [v.as_dict() for v in self.warehouses] return body def as_shallow_dict(self) -> dict: @@ -4617,11 +4617,11 @@ def as_dict(self) -> dict: """Serializes the MultiValuesOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.prefix is not None: - body["{prefix}"] = self.prefix + body["prefix"] = self.prefix if self.separator is not None: - body["{separator}"] = self.separator + body["separator"] = self.separator if self.suffix is not None: - body["{suffix}"] = self.suffix + body["suffix"] = self.suffix return body def as_shallow_dict(self) -> dict: @@ -4649,7 +4649,7 @@ def as_dict(self) -> dict: """Serializes the NumericValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -4697,13 +4697,13 @@ def as_dict(self) -> dict: """Serializes the OdbcParams into a dictionary suitable for use as a JSON request body.""" body = {} if self.hostname is not None: - body["{hostname}"] = self.hostname + body["hostname"] = self.hostname if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.port is not None: - body["{port}"] = self.port + body["port"] = self.port if self.protocol is not None: - body["{protocol}"] = self.protocol + body["protocol"] = self.protocol return body def as_shallow_dict(self) -> dict: @@ -4767,19 +4767,19 @@ def as_dict(self) -> dict: """Serializes the Parameter into a dictionary suitable for use as a JSON request body.""" body = {} if self.enum_options is not None: - body["{enum_options}"] = self.enum_options + body["enumOptions"] = self.enum_options if self.multi_values_options: - body["{multi_values_options}"] = self.multi_values_options.as_dict() + body["multiValuesOptions"] = self.multi_values_options.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["queryId"] = self.query_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value if self.value: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -4902,39 +4902,39 @@ def as_dict(self) -> dict: """Serializes the Query into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_modifier_user_name is not None: - body["{last_modifier_user_name}"] = self.last_modifier_user_name + body["last_modifier_user_name"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state.value + body["lifecycle_state"] = self.lifecycle_state.value if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode.value + body["run_as_mode"] = self.run_as_mode.value if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -5015,11 +5015,11 @@ def as_dict(self) -> dict: """Serializes the QueryBackedValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.multi_values_options: - body["{multi_values_options}"] = self.multi_values_options.as_dict() + body["multi_values_options"] = self.multi_values_options.as_dict() if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.values: - body["{values}"] = [v for v in self.values] + body["values"] = [v for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -5077,21 +5077,21 @@ def as_dict(self) -> dict: """Serializes the QueryEditContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role.value + body["run_as_role"] = self.run_as_role.value if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -5150,15 +5150,15 @@ def as_dict(self) -> dict: """Serializes the QueryFilter into a dictionary suitable for use as a JSON request body.""" body = {} if self.query_start_time_range: - body["{query_start_time_range}"] = self.query_start_time_range.as_dict() + body["query_start_time_range"] = self.query_start_time_range.as_dict() if self.statement_ids: - body["{statement_ids}"] = [v for v in self.statement_ids] + body["statement_ids"] = [v for v in self.statement_ids] if self.statuses: - body["{statuses}"] = [v.value for v in self.statuses] + body["statuses"] = [v.value for v in self.statuses] if self.user_ids: - body["{user_ids}"] = [v for v in self.user_ids] + body["user_ids"] = [v for v in self.user_ids] if self.warehouse_ids: - body["{warehouse_ids}"] = [v for v in self.warehouse_ids] + body["warehouse_ids"] = [v for v in self.warehouse_ids] return body def as_shallow_dict(self) -> dict: @@ -5269,51 +5269,51 @@ def as_dict(self) -> dict: """Serializes the QueryInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.channel_used: - body["{channel_used}"] = self.channel_used.as_dict() + body["channel_used"] = self.channel_used.as_dict() if self.duration is not None: - body["{duration}"] = self.duration + body["duration"] = self.duration if self.endpoint_id is not None: - body["{endpoint_id}"] = self.endpoint_id + body["endpoint_id"] = self.endpoint_id if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.executed_as_user_id is not None: - body["{executed_as_user_id}"] = self.executed_as_user_id + body["executed_as_user_id"] = self.executed_as_user_id if self.executed_as_user_name is not None: - body["{executed_as_user_name}"] = self.executed_as_user_name + body["executed_as_user_name"] = self.executed_as_user_name if self.execution_end_time_ms is not None: - body["{execution_end_time_ms}"] = self.execution_end_time_ms + body["execution_end_time_ms"] = self.execution_end_time_ms if self.is_final is not None: - body["{is_final}"] = self.is_final + body["is_final"] = self.is_final if self.lookup_key is not None: - body["{lookup_key}"] = self.lookup_key + body["lookup_key"] = self.lookup_key if self.metrics: - body["{metrics}"] = self.metrics.as_dict() + body["metrics"] = self.metrics.as_dict() if self.plans_state is not None: - body["{plans_state}"] = self.plans_state.value + body["plans_state"] = self.plans_state.value if self.query_end_time_ms is not None: - body["{query_end_time_ms}"] = self.query_end_time_ms + body["query_end_time_ms"] = self.query_end_time_ms if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.query_source: - body["{query_source}"] = self.query_source.as_dict() + body["query_source"] = self.query_source.as_dict() if self.query_start_time_ms is not None: - body["{query_start_time_ms}"] = self.query_start_time_ms + body["query_start_time_ms"] = self.query_start_time_ms if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.rows_produced is not None: - body["{rows_produced}"] = self.rows_produced + body["rows_produced"] = self.rows_produced if self.spark_ui_url is not None: - body["{spark_ui_url}"] = self.spark_ui_url + body["spark_ui_url"] = self.spark_ui_url if self.statement_type is not None: - body["{statement_type}"] = self.statement_type.value + body["statement_type"] = self.statement_type.value if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -5415,13 +5415,13 @@ def as_dict(self) -> dict: """Serializes the QueryList into a dictionary suitable for use as a JSON request body.""" body = {} if self.count is not None: - body["{count}"] = self.count + body["count"] = self.count if self.page is not None: - body["{page}"] = self.page + body["page"] = self.page if self.page_size is not None: - body["{page_size}"] = self.page_size + body["page_size"] = self.page_size if self.results: - body["{results}"] = [v.as_dict() for v in self.results] + body["results"] = [v.as_dict() for v in self.results] return body def as_shallow_dict(self) -> dict: @@ -5526,49 +5526,49 @@ def as_dict(self) -> dict: """Serializes the QueryMetrics into a dictionary suitable for use as a JSON request body.""" body = {} if self.compilation_time_ms is not None: - body["{compilation_time_ms}"] = self.compilation_time_ms + body["compilation_time_ms"] = self.compilation_time_ms if self.execution_time_ms is not None: - body["{execution_time_ms}"] = self.execution_time_ms + body["execution_time_ms"] = self.execution_time_ms if self.network_sent_bytes is not None: - body["{network_sent_bytes}"] = self.network_sent_bytes + body["network_sent_bytes"] = self.network_sent_bytes if self.overloading_queue_start_timestamp is not None: - body["{overloading_queue_start_timestamp}"] = self.overloading_queue_start_timestamp + body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp if self.photon_total_time_ms is not None: - body["{photon_total_time_ms}"] = self.photon_total_time_ms + body["photon_total_time_ms"] = self.photon_total_time_ms if self.provisioning_queue_start_timestamp is not None: - body["{provisioning_queue_start_timestamp}"] = self.provisioning_queue_start_timestamp + body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp if self.pruned_bytes is not None: - body["{pruned_bytes}"] = self.pruned_bytes + body["pruned_bytes"] = self.pruned_bytes if self.pruned_files_count is not None: - body["{pruned_files_count}"] = self.pruned_files_count + body["pruned_files_count"] = self.pruned_files_count if self.query_compilation_start_timestamp is not None: - body["{query_compilation_start_timestamp}"] = self.query_compilation_start_timestamp + body["query_compilation_start_timestamp"] = self.query_compilation_start_timestamp if self.read_bytes is not None: - body["{read_bytes}"] = self.read_bytes + body["read_bytes"] = self.read_bytes if self.read_cache_bytes is not None: - body["{read_cache_bytes}"] = self.read_cache_bytes + body["read_cache_bytes"] = self.read_cache_bytes if self.read_files_count is not None: - body["{read_files_count}"] = self.read_files_count + body["read_files_count"] = self.read_files_count if self.read_partitions_count is not None: - body["{read_partitions_count}"] = self.read_partitions_count + body["read_partitions_count"] = self.read_partitions_count if self.read_remote_bytes is not None: - body["{read_remote_bytes}"] = self.read_remote_bytes + body["read_remote_bytes"] = self.read_remote_bytes if self.result_fetch_time_ms is not None: - body["{result_fetch_time_ms}"] = self.result_fetch_time_ms + body["result_fetch_time_ms"] = self.result_fetch_time_ms if self.result_from_cache is not None: - body["{result_from_cache}"] = self.result_from_cache + body["result_from_cache"] = self.result_from_cache if self.rows_produced_count is not None: - body["{rows_produced_count}"] = self.rows_produced_count + body["rows_produced_count"] = self.rows_produced_count if self.rows_read_count is not None: - body["{rows_read_count}"] = self.rows_read_count + body["rows_read_count"] = self.rows_read_count if self.spill_to_disk_bytes is not None: - body["{spill_to_disk_bytes}"] = self.spill_to_disk_bytes + body["spill_to_disk_bytes"] = self.spill_to_disk_bytes if self.task_total_time_ms is not None: - body["{task_total_time_ms}"] = self.task_total_time_ms + body["task_total_time_ms"] = self.task_total_time_ms if self.total_time_ms is not None: - body["{total_time_ms}"] = self.total_time_ms + body["total_time_ms"] = self.total_time_ms if self.write_remote_bytes is not None: - body["{write_remote_bytes}"] = self.write_remote_bytes + body["write_remote_bytes"] = self.write_remote_bytes return body def as_shallow_dict(self) -> dict: @@ -5667,13 +5667,13 @@ def as_dict(self) -> dict: """Serializes the QueryOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.moved_to_trash_at is not None: - body["{moved_to_trash_at}"] = self.moved_to_trash_at + body["moved_to_trash_at"] = self.moved_to_trash_at if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema return body def as_shallow_dict(self) -> dict: @@ -5731,21 +5731,21 @@ def as_dict(self) -> dict: """Serializes the QueryParameter into a dictionary suitable for use as a JSON request body.""" body = {} if self.date_range_value: - body["{date_range_value}"] = self.date_range_value.as_dict() + body["date_range_value"] = self.date_range_value.as_dict() if self.date_value: - body["{date_value}"] = self.date_value.as_dict() + body["date_value"] = self.date_value.as_dict() if self.enum_value: - body["{enum_value}"] = self.enum_value.as_dict() + body["enum_value"] = self.enum_value.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.numeric_value: - body["{numeric_value}"] = self.numeric_value.as_dict() + body["numeric_value"] = self.numeric_value.as_dict() if self.query_backed_value: - body["{query_backed_value}"] = self.query_backed_value.as_dict() + body["query_backed_value"] = self.query_backed_value.as_dict() if self.text_value: - body["{text_value}"] = self.text_value.as_dict() + body["text_value"] = self.text_value.as_dict() if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title return body def as_shallow_dict(self) -> dict: @@ -5819,21 +5819,21 @@ def as_dict(self) -> dict: """Serializes the QueryPostContent into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role.value + body["run_as_role"] = self.run_as_role.value if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] return body def as_shallow_dict(self) -> dict: @@ -5922,9 +5922,9 @@ def as_dict(self) -> dict: """Serializes the RepeatedEndpointConfPairs into a dictionary suitable for use as a JSON request body.""" body = {} if self.config_pair: - body["{config_pair}"] = [v.as_dict() for v in self.config_pair] + body["config_pair"] = [v.as_dict() for v in self.config_pair] if self.configuration_pairs: - body["{configuration_pairs}"] = [v.as_dict() for v in self.configuration_pairs] + body["configuration_pairs"] = [v.as_dict() for v in self.configuration_pairs] return body def as_shallow_dict(self) -> dict: @@ -5998,21 +5998,21 @@ def as_dict(self) -> dict: """Serializes the ResultData into a dictionary suitable for use as a JSON request body.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.data_array: - body["{data_array}"] = [v for v in self.data_array] + body["data_array"] = [v for v in self.data_array] if self.external_links: - body["{external_links}"] = [v.as_dict() for v in self.external_links] + body["external_links"] = [v.as_dict() for v in self.external_links] if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body def as_shallow_dict(self) -> dict: @@ -6080,19 +6080,19 @@ def as_dict(self) -> dict: """Serializes the ResultManifest into a dictionary suitable for use as a JSON request body.""" body = {} if self.chunks: - body["{chunks}"] = [v.as_dict() for v in self.chunks] + body["chunks"] = [v.as_dict() for v in self.chunks] if self.format is not None: - body["{format}"] = self.format.value + body["format"] = self.format.value if self.schema: - body["{schema}"] = self.schema.as_dict() + body["schema"] = self.schema.as_dict() if self.total_byte_count is not None: - body["{total_byte_count}"] = self.total_byte_count + body["total_byte_count"] = self.total_byte_count if self.total_chunk_count is not None: - body["{total_chunk_count}"] = self.total_chunk_count + body["total_chunk_count"] = self.total_chunk_count if self.total_row_count is not None: - body["{total_row_count}"] = self.total_row_count + body["total_row_count"] = self.total_row_count if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body def as_shallow_dict(self) -> dict: @@ -6140,9 +6140,9 @@ def as_dict(self) -> dict: """Serializes the ResultSchema into a dictionary suitable for use as a JSON request body.""" body = {} if self.column_count is not None: - body["{column_count}"] = self.column_count + body["column_count"] = self.column_count if self.columns: - body["{columns}"] = [v.as_dict() for v in self.columns] + body["columns"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: @@ -6185,9 +6185,9 @@ def as_dict(self) -> dict: """Serializes the ServiceError into a dictionary suitable for use as a JSON request body.""" body = {} if self.error_code is not None: - body["{error_code}"] = self.error_code.value + body["error_code"] = self.error_code.value if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body def as_shallow_dict(self) -> dict: @@ -6237,11 +6237,11 @@ def as_dict(self) -> dict: """Serializes the SetResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type.value + body["object_type"] = self.object_type.value return body def as_shallow_dict(self) -> dict: @@ -6303,23 +6303,23 @@ def as_dict(self) -> dict: """Serializes the SetWorkspaceWarehouseConfigRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.channel: - body["{channel}"] = self.channel.as_dict() + body["channel"] = self.channel.as_dict() if self.config_param: - body["{config_param}"] = self.config_param.as_dict() + body["config_param"] = self.config_param.as_dict() if self.data_access_config: - body["{data_access_config}"] = [v.as_dict() for v in self.data_access_config] + body["data_access_config"] = [v.as_dict() for v in self.data_access_config] if self.enabled_warehouse_types: - body["{enabled_warehouse_types}"] = [v.as_dict() for v in self.enabled_warehouse_types] + body["enabled_warehouse_types"] = [v.as_dict() for v in self.enabled_warehouse_types] if self.global_param: - body["{global_param}"] = self.global_param.as_dict() + body["global_param"] = self.global_param.as_dict() if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.security_policy is not None: - body["{security_policy}"] = self.security_policy.value + body["security_policy"] = self.security_policy.value if self.sql_configuration_parameters: - body["{sql_configuration_parameters}"] = self.sql_configuration_parameters.as_dict() + body["sql_configuration_parameters"] = self.sql_configuration_parameters.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6444,11 +6444,11 @@ def as_dict(self) -> dict: """Serializes the StatementParameterListItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -6486,13 +6486,13 @@ def as_dict(self) -> dict: """Serializes the StatementResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.manifest: - body["{manifest}"] = self.manifest.as_dict() + body["manifest"] = self.manifest.as_dict() if self.result: - body["{result}"] = self.result.as_dict() + body["result"] = self.result.as_dict() if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: @@ -6551,9 +6551,9 @@ def as_dict(self) -> dict: """Serializes the StatementStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.error: - body["{error}"] = self.error.as_dict() + body["error"] = self.error.as_dict() if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -6606,7 +6606,7 @@ def as_dict(self) -> dict: """Serializes the Success into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message.value + body["message"] = self.message.value return body def as_shallow_dict(self) -> dict: @@ -6642,11 +6642,11 @@ def as_dict(self) -> dict: """Serializes the TerminationReason into a dictionary suitable for use as a JSON request body.""" body = {} if self.code is not None: - body["{code}"] = self.code.value + body["code"] = self.code.value if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.type is not None: - body["{type}"] = self.type.value + body["type"] = self.type.value return body def as_shallow_dict(self) -> dict: @@ -6771,7 +6771,7 @@ def as_dict(self) -> dict: """Serializes the TextValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -6799,9 +6799,9 @@ def as_dict(self) -> dict: """Serializes the TimeRange into a dictionary suitable for use as a JSON request body.""" body = {} if self.end_time_ms is not None: - body["{end_time_ms}"] = self.end_time_ms + body["end_time_ms"] = self.end_time_ms if self.start_time_ms is not None: - body["{start_time_ms}"] = self.start_time_ms + body["start_time_ms"] = self.start_time_ms return body def as_shallow_dict(self) -> dict: @@ -6828,7 +6828,7 @@ def as_dict(self) -> dict: """Serializes the TransferOwnershipObjectId into a dictionary suitable for use as a JSON request body.""" body = {} if self.new_owner is not None: - body["{new_owner}"] = self.new_owner + body["new_owner"] = self.new_owner return body def as_shallow_dict(self) -> dict: @@ -6865,11 +6865,11 @@ def as_dict(self) -> dict: """Serializes the UpdateAlertRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.alert: - body["{alert}"] = self.alert.as_dict() + body["alert"] = self.alert.as_dict() if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask return body def as_shallow_dict(self) -> dict: @@ -6929,21 +6929,21 @@ def as_dict(self) -> dict: """Serializes the UpdateAlertRequestAlert into a dictionary suitable for use as a JSON request body.""" body = {} if self.condition: - body["{condition}"] = self.condition.as_dict() + body["condition"] = self.condition.as_dict() if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger return body def as_shallow_dict(self) -> dict: @@ -7003,11 +7003,11 @@ def as_dict(self) -> dict: """Serializes the UpdateQueryRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.query: - body["{query}"] = self.query.as_dict() + body["query"] = self.query.as_dict() if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask return body def as_shallow_dict(self) -> dict: @@ -7069,27 +7069,27 @@ def as_dict(self) -> dict: """Serializes the UpdateQueryRequestQuery into a dictionary suitable for use as a JSON request body.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parameters: - body["{parameters}"] = [v.as_dict() for v in self.parameters] + body["parameters"] = [v.as_dict() for v in self.parameters] if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode.value + body["run_as_mode"] = self.run_as_mode.value if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = [v for v in self.tags] + body["tags"] = [v for v in self.tags] if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -7176,11 +7176,11 @@ def as_dict(self) -> dict: """Serializes the UpdateVisualizationRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask if self.visualization: - body["{visualization}"] = self.visualization.as_dict() + body["visualization"] = self.visualization.as_dict() return body def as_shallow_dict(self) -> dict: @@ -7224,13 +7224,13 @@ def as_dict(self) -> dict: """Serializes the UpdateVisualizationRequestVisualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.serialized_options is not None: - body["{serialized_options}"] = self.serialized_options + body["serialized_options"] = self.serialized_options if self.serialized_query_plan is not None: - body["{serialized_query_plan}"] = self.serialized_query_plan + body["serialized_query_plan"] = self.serialized_query_plan if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body def as_shallow_dict(self) -> dict: @@ -7269,11 +7269,11 @@ def as_dict(self) -> dict: """Serializes the User into a dictionary suitable for use as a JSON request body.""" body = {} if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -7325,21 +7325,21 @@ def as_dict(self) -> dict: """Serializes the Visualization into a dictionary suitable for use as a JSON request body.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.serialized_options is not None: - body["{serialized_options}"] = self.serialized_options + body["serialized_options"] = self.serialized_options if self.serialized_query_plan is not None: - body["{serialized_query_plan}"] = self.serialized_query_plan + body["serialized_query_plan"] = self.serialized_query_plan if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body def as_shallow_dict(self) -> dict: @@ -7396,13 +7396,13 @@ def as_dict(self) -> dict: """Serializes the WarehouseAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -7450,15 +7450,15 @@ def as_dict(self) -> dict: """Serializes the WarehouseAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -7501,11 +7501,11 @@ def as_dict(self) -> dict: """Serializes the WarehousePermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -7551,11 +7551,11 @@ def as_dict(self) -> dict: """Serializes the WarehousePermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -7590,9 +7590,9 @@ def as_dict(self) -> dict: """Serializes the WarehousePermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -7624,9 +7624,9 @@ def as_dict(self) -> dict: """Serializes the WarehousePermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body def as_shallow_dict(self) -> dict: @@ -7660,9 +7660,9 @@ def as_dict(self) -> dict: """Serializes the WarehouseTypePair into a dictionary suitable for use as a JSON request body.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type.value + body["warehouse_type"] = self.warehouse_type.value return body def as_shallow_dict(self) -> dict: @@ -7711,13 +7711,13 @@ def as_dict(self) -> dict: """Serializes the Widget into a dictionary suitable for use as a JSON request body.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.options: - body["{options}"] = self.options.as_dict() + body["options"] = self.options.as_dict() if self.visualization: - body["{visualization}"] = self.visualization.as_dict() + body["visualization"] = self.visualization.as_dict() if self.width is not None: - body["{width}"] = self.width + body["width"] = self.width return body def as_shallow_dict(self) -> dict: @@ -7773,19 +7773,19 @@ def as_dict(self) -> dict: """Serializes the WidgetOptions into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.is_hidden is not None: - body["{is_hidden}"] = self.is_hidden + body["isHidden"] = self.is_hidden if self.parameter_mappings: - body["{parameter_mappings}"] = self.parameter_mappings + body["parameterMappings"] = self.parameter_mappings if self.position: - body["{position}"] = self.position.as_dict() + body["position"] = self.position.as_dict() if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body def as_shallow_dict(self) -> dict: @@ -7845,15 +7845,15 @@ def as_dict(self) -> dict: """Serializes the WidgetPosition into a dictionary suitable for use as a JSON request body.""" body = {} if self.auto_height is not None: - body["{auto_height}"] = self.auto_height + body["autoHeight"] = self.auto_height if self.col is not None: - body["{col}"] = self.col + body["col"] = self.col if self.row is not None: - body["{row}"] = self.row + body["row"] = self.row if self.size_x is not None: - body["{size_x}"] = self.size_x + body["sizeX"] = self.size_x if self.size_y is not None: - body["{size_y}"] = self.size_y + body["sizeY"] = self.size_y return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/vectorsearch/v2/impl.py b/databricks/sdk/vectorsearch/v2/impl.py index 6f6e41f5d..0bd91107d 100755 --- a/databricks/sdk/vectorsearch/v2/impl.py +++ b/databricks/sdk/vectorsearch/v2/impl.py @@ -24,7 +24,7 @@ def as_dict(self) -> dict: """Serializes the ColumnInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -52,9 +52,9 @@ def as_dict(self) -> dict: """Serializes the CreateEndpoint into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_type is not None: - body["{endpoint_type}"] = self.endpoint_type.value + body["endpoint_type"] = self.endpoint_type.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -101,17 +101,17 @@ def as_dict(self) -> dict: """Serializes the CreateVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.delta_sync_index_spec: - body["{delta_sync_index_spec}"] = self.delta_sync_index_spec.as_dict() + body["delta_sync_index_spec"] = self.delta_sync_index_spec.as_dict() if self.direct_access_index_spec: - body["{direct_access_index_spec}"] = self.direct_access_index_spec.as_dict() + body["direct_access_index_spec"] = self.direct_access_index_spec.as_dict() if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_type is not None: - body["{index_type}"] = self.index_type.value + body["index_type"] = self.index_type.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.primary_key is not None: - body["{primary_key}"] = self.primary_key + body["primary_key"] = self.primary_key return body def as_shallow_dict(self) -> dict: @@ -152,7 +152,7 @@ def as_dict(self) -> dict: """Serializes the CreateVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.vector_index: - body["{vector_index}"] = self.vector_index.as_dict() + body["vector_index"] = self.vector_index.as_dict() return body def as_shallow_dict(self) -> dict: @@ -182,9 +182,9 @@ def as_dict(self) -> dict: """Serializes the DeleteDataResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.failed_primary_keys: - body["{failed_primary_keys}"] = [v for v in self.failed_primary_keys] + body["failed_primary_keys"] = [v for v in self.failed_primary_keys] if self.success_row_count is not None: - body["{success_row_count}"] = self.success_row_count + body["success_row_count"] = self.success_row_count return body def as_shallow_dict(self) -> dict: @@ -227,9 +227,9 @@ def as_dict(self) -> dict: """Serializes the DeleteDataVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.primary_keys: - body["{primary_keys}"] = [v for v in self.primary_keys] + body["primary_keys"] = [v for v in self.primary_keys] return body def as_shallow_dict(self) -> dict: @@ -261,9 +261,9 @@ def as_dict(self) -> dict: """Serializes the DeleteDataVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.result: - body["{result}"] = self.result.as_dict() + body["result"] = self.result.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -350,17 +350,17 @@ def as_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns_to_sync: - body["{columns_to_sync}"] = [v for v in self.columns_to_sync] + body["columns_to_sync"] = [v for v in self.columns_to_sync] if self.embedding_source_columns: - body["{embedding_source_columns}"] = [v.as_dict() for v in self.embedding_source_columns] + body["embedding_source_columns"] = [v.as_dict() for v in self.embedding_source_columns] if self.embedding_vector_columns: - body["{embedding_vector_columns}"] = [v.as_dict() for v in self.embedding_vector_columns] + body["embedding_vector_columns"] = [v.as_dict() for v in self.embedding_vector_columns] if self.embedding_writeback_table is not None: - body["{embedding_writeback_table}"] = self.embedding_writeback_table + body["embedding_writeback_table"] = self.embedding_writeback_table if self.pipeline_type is not None: - body["{pipeline_type}"] = self.pipeline_type.value + body["pipeline_type"] = self.pipeline_type.value if self.source_table is not None: - body["{source_table}"] = self.source_table + body["source_table"] = self.source_table return body def as_shallow_dict(self) -> dict: @@ -423,17 +423,17 @@ def as_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_source_columns: - body["{embedding_source_columns}"] = [v.as_dict() for v in self.embedding_source_columns] + body["embedding_source_columns"] = [v.as_dict() for v in self.embedding_source_columns] if self.embedding_vector_columns: - body["{embedding_vector_columns}"] = [v.as_dict() for v in self.embedding_vector_columns] + body["embedding_vector_columns"] = [v.as_dict() for v in self.embedding_vector_columns] if self.embedding_writeback_table is not None: - body["{embedding_writeback_table}"] = self.embedding_writeback_table + body["embedding_writeback_table"] = self.embedding_writeback_table if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.pipeline_type is not None: - body["{pipeline_type}"] = self.pipeline_type.value + body["pipeline_type"] = self.pipeline_type.value if self.source_table is not None: - body["{source_table}"] = self.source_table + body["source_table"] = self.source_table return body def as_shallow_dict(self) -> dict: @@ -485,11 +485,11 @@ def as_dict(self) -> dict: """Serializes the DirectAccessVectorIndexSpec into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_source_columns: - body["{embedding_source_columns}"] = [v.as_dict() for v in self.embedding_source_columns] + body["embedding_source_columns"] = [v.as_dict() for v in self.embedding_source_columns] if self.embedding_vector_columns: - body["{embedding_vector_columns}"] = [v.as_dict() for v in self.embedding_vector_columns] + body["embedding_vector_columns"] = [v.as_dict() for v in self.embedding_vector_columns] if self.schema_json is not None: - body["{schema_json}"] = self.schema_json + body["schema_json"] = self.schema_json return body def as_shallow_dict(self) -> dict: @@ -525,9 +525,9 @@ def as_dict(self) -> dict: """Serializes the EmbeddingSourceColumn into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_model_endpoint_name is not None: - body["{embedding_model_endpoint_name}"] = self.embedding_model_endpoint_name + body["embedding_model_endpoint_name"] = self.embedding_model_endpoint_name if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -559,9 +559,9 @@ def as_dict(self) -> dict: """Serializes the EmbeddingVectorColumn into a dictionary suitable for use as a JSON request body.""" body = {} if self.embedding_dimension is not None: - body["{embedding_dimension}"] = self.embedding_dimension + body["embedding_dimension"] = self.embedding_dimension if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -612,23 +612,23 @@ def as_dict(self) -> dict: """Serializes the EndpointInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.endpoint_status: - body["{endpoint_status}"] = self.endpoint_status.as_dict() + body["endpoint_status"] = self.endpoint_status.as_dict() if self.endpoint_type is not None: - body["{endpoint_type}"] = self.endpoint_type.value + body["endpoint_type"] = self.endpoint_type.value if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.last_updated_user is not None: - body["{last_updated_user}"] = self.last_updated_user + body["last_updated_user"] = self.last_updated_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.num_indexes is not None: - body["{num_indexes}"] = self.num_indexes + body["num_indexes"] = self.num_indexes return body def as_shallow_dict(self) -> dict: @@ -684,9 +684,9 @@ def as_dict(self) -> dict: """Serializes the EndpointStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state.value + body["state"] = self.state.value return body def as_shallow_dict(self) -> dict: @@ -731,9 +731,9 @@ def as_dict(self) -> dict: """Serializes the ListEndpointResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoints: - body["{endpoints}"] = [v.as_dict() for v in self.endpoints] + body["endpoints"] = [v.as_dict() for v in self.endpoints] if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body def as_shallow_dict(self) -> dict: @@ -761,7 +761,7 @@ def as_dict(self) -> dict: """Serializes the ListValue into a dictionary suitable for use as a JSON request body.""" body = {} if self.values: - body["{values}"] = [v.as_dict() for v in self.values] + body["values"] = [v.as_dict() for v in self.values] return body def as_shallow_dict(self) -> dict: @@ -789,9 +789,9 @@ def as_dict(self) -> dict: """Serializes the ListVectorIndexesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.vector_indexes: - body["{vector_indexes}"] = [v.as_dict() for v in self.vector_indexes] + body["vector_indexes"] = [v.as_dict() for v in self.vector_indexes] return body def as_shallow_dict(self) -> dict: @@ -826,9 +826,9 @@ def as_dict(self) -> dict: """Serializes the MapStringValueEntry into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value: - body["{value}"] = self.value.as_dict() + body["value"] = self.value.as_dict() return body def as_shallow_dict(self) -> dict: @@ -872,15 +872,15 @@ def as_dict(self) -> dict: """Serializes the MiniVectorIndex into a dictionary suitable for use as a JSON request body.""" body = {} if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_type is not None: - body["{index_type}"] = self.index_type.value + body["index_type"] = self.index_type.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.primary_key is not None: - body["{primary_key}"] = self.primary_key + body["primary_key"] = self.primary_key return body def as_shallow_dict(self) -> dict: @@ -940,11 +940,11 @@ def as_dict(self) -> dict: """Serializes the QueryVectorIndexNextPageRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.page_token is not None: - body["{page_token}"] = self.page_token + body["page_token"] = self.page_token return body def as_shallow_dict(self) -> dict: @@ -1006,23 +1006,23 @@ def as_dict(self) -> dict: """Serializes the QueryVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.columns: - body["{columns}"] = [v for v in self.columns] + body["columns"] = [v for v in self.columns] if self.columns_to_rerank: - body["{columns_to_rerank}"] = [v for v in self.columns_to_rerank] + body["columns_to_rerank"] = [v for v in self.columns_to_rerank] if self.filters_json is not None: - body["{filters_json}"] = self.filters_json + body["filters_json"] = self.filters_json if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.num_results is not None: - body["{num_results}"] = self.num_results + body["num_results"] = self.num_results if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.query_type is not None: - body["{query_type}"] = self.query_type + body["query_type"] = self.query_type if self.query_vector: - body["{query_vector}"] = [v for v in self.query_vector] + body["query_vector"] = [v for v in self.query_vector] if self.score_threshold is not None: - body["{score_threshold}"] = self.score_threshold + body["score_threshold"] = self.score_threshold return body def as_shallow_dict(self) -> dict: @@ -1081,11 +1081,11 @@ def as_dict(self) -> dict: """Serializes the QueryVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.manifest: - body["{manifest}"] = self.manifest.as_dict() + body["manifest"] = self.manifest.as_dict() if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.result: - body["{result}"] = self.result.as_dict() + body["result"] = self.result.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1123,9 +1123,9 @@ def as_dict(self) -> dict: """Serializes the ResultData into a dictionary suitable for use as a JSON request body.""" body = {} if self.data_array: - body["{data_array}"] = [v for v in self.data_array] + body["data_array"] = [v for v in self.data_array] if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count return body def as_shallow_dict(self) -> dict: @@ -1157,9 +1157,9 @@ def as_dict(self) -> dict: """Serializes the ResultManifest into a dictionary suitable for use as a JSON request body.""" body = {} if self.column_count is not None: - body["{column_count}"] = self.column_count + body["column_count"] = self.column_count if self.columns: - body["{columns}"] = [v.as_dict() for v in self.columns] + body["columns"] = [v.as_dict() for v in self.columns] return body def as_shallow_dict(self) -> dict: @@ -1194,11 +1194,11 @@ def as_dict(self) -> dict: """Serializes the ScanVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.last_primary_key is not None: - body["{last_primary_key}"] = self.last_primary_key + body["last_primary_key"] = self.last_primary_key if self.num_results is not None: - body["{num_results}"] = self.num_results + body["num_results"] = self.num_results return body def as_shallow_dict(self) -> dict: @@ -1236,9 +1236,9 @@ def as_dict(self) -> dict: """Serializes the ScanVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.data: - body["{data}"] = [v.as_dict() for v in self.data] + body["data"] = [v.as_dict() for v in self.data] if self.last_primary_key is not None: - body["{last_primary_key}"] = self.last_primary_key + body["last_primary_key"] = self.last_primary_key return body def as_shallow_dict(self) -> dict: @@ -1265,7 +1265,7 @@ def as_dict(self) -> dict: """Serializes the Struct into a dictionary suitable for use as a JSON request body.""" body = {} if self.fields: - body["{fields}"] = [v.as_dict() for v in self.fields] + body["fields"] = [v.as_dict() for v in self.fields] return body def as_shallow_dict(self) -> dict: @@ -1313,9 +1313,9 @@ def as_dict(self) -> dict: """Serializes the UpsertDataResult into a dictionary suitable for use as a JSON request body.""" body = {} if self.failed_primary_keys: - body["{failed_primary_keys}"] = [v for v in self.failed_primary_keys] + body["failed_primary_keys"] = [v for v in self.failed_primary_keys] if self.success_row_count is not None: - body["{success_row_count}"] = self.success_row_count + body["success_row_count"] = self.success_row_count return body def as_shallow_dict(self) -> dict: @@ -1358,9 +1358,9 @@ def as_dict(self) -> dict: """Serializes the UpsertDataVectorIndexRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.inputs_json is not None: - body["{inputs_json}"] = self.inputs_json + body["inputs_json"] = self.inputs_json return body def as_shallow_dict(self) -> dict: @@ -1392,9 +1392,9 @@ def as_dict(self) -> dict: """Serializes the UpsertDataVectorIndexResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.result: - body["{result}"] = self.result.as_dict() + body["result"] = self.result.as_dict() if self.status is not None: - body["{status}"] = self.status.value + body["status"] = self.status.value return body def as_shallow_dict(self) -> dict: @@ -1430,17 +1430,17 @@ def as_dict(self) -> dict: """Serializes the Value into a dictionary suitable for use as a JSON request body.""" body = {} if self.bool_value is not None: - body["{bool_value}"] = self.bool_value + body["bool_value"] = self.bool_value if self.list_value: - body["{list_value}"] = self.list_value.as_dict() + body["list_value"] = self.list_value.as_dict() if self.null_value is not None: - body["{null_value}"] = self.null_value + body["null_value"] = self.null_value if self.number_value is not None: - body["{number_value}"] = self.number_value + body["number_value"] = self.number_value if self.string_value is not None: - body["{string_value}"] = self.string_value + body["string_value"] = self.string_value if self.struct_value: - body["{struct_value}"] = self.struct_value.as_dict() + body["struct_value"] = self.struct_value.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1505,21 +1505,21 @@ def as_dict(self) -> dict: """Serializes the VectorIndex into a dictionary suitable for use as a JSON request body.""" body = {} if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.delta_sync_index_spec: - body["{delta_sync_index_spec}"] = self.delta_sync_index_spec.as_dict() + body["delta_sync_index_spec"] = self.delta_sync_index_spec.as_dict() if self.direct_access_index_spec: - body["{direct_access_index_spec}"] = self.direct_access_index_spec.as_dict() + body["direct_access_index_spec"] = self.direct_access_index_spec.as_dict() if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_type is not None: - body["{index_type}"] = self.index_type.value + body["index_type"] = self.index_type.value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.primary_key is not None: - body["{primary_key}"] = self.primary_key + body["primary_key"] = self.primary_key if self.status: - body["{status}"] = self.status.as_dict() + body["status"] = self.status.as_dict() return body def as_shallow_dict(self) -> dict: @@ -1576,13 +1576,13 @@ def as_dict(self) -> dict: """Serializes the VectorIndexStatus into a dictionary suitable for use as a JSON request body.""" body = {} if self.index_url is not None: - body["{index_url}"] = self.index_url + body["index_url"] = self.index_url if self.indexed_row_count is not None: - body["{indexed_row_count}"] = self.indexed_row_count + body["indexed_row_count"] = self.indexed_row_count if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.ready is not None: - body["{ready}"] = self.ready + body["ready"] = self.ready return body def as_shallow_dict(self) -> dict: diff --git a/databricks/sdk/workspace/v2/impl.py b/databricks/sdk/workspace/v2/impl.py index 6d6ef94de..fc0e8007b 100755 --- a/databricks/sdk/workspace/v2/impl.py +++ b/databricks/sdk/workspace/v2/impl.py @@ -26,9 +26,9 @@ def as_dict(self) -> dict: """Serializes the AclItem into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission is not None: - body["{permission}"] = self.permission.value + body["permission"] = self.permission.value if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal return body def as_shallow_dict(self) -> dict: @@ -65,9 +65,9 @@ def as_dict(self) -> dict: """Serializes the AzureKeyVaultSecretScopeMetadata into a dictionary suitable for use as a JSON request body.""" body = {} if self.dns_name is not None: - body["{dns_name}"] = self.dns_name + body["dns_name"] = self.dns_name if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id return body def as_shallow_dict(self) -> dict: @@ -109,11 +109,11 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username if self.personal_access_token is not None: - body["{personal_access_token}"] = self.personal_access_token + body["personal_access_token"] = self.personal_access_token return body def as_shallow_dict(self) -> dict: @@ -153,11 +153,11 @@ def as_dict(self) -> dict: """Serializes the CreateCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username return body def as_shallow_dict(self) -> dict: @@ -203,13 +203,13 @@ def as_dict(self) -> dict: """Serializes the CreateRepoRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout.as_dict() + body["sparse_checkout"] = self.sparse_checkout.as_dict() if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -263,19 +263,19 @@ def as_dict(self) -> dict: """Serializes the CreateRepoResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.head_commit_id is not None: - body["{head_commit_id}"] = self.head_commit_id + body["head_commit_id"] = self.head_commit_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout.as_dict() + body["sparse_checkout"] = self.sparse_checkout.as_dict() if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -329,13 +329,13 @@ def as_dict(self) -> dict: """Serializes the CreateScope into a dictionary suitable for use as a JSON request body.""" body = {} if self.backend_azure_keyvault: - body["{backend_azure_keyvault}"] = self.backend_azure_keyvault.as_dict() + body["backend_azure_keyvault"] = self.backend_azure_keyvault.as_dict() if self.initial_manage_principal is not None: - body["{initial_manage_principal}"] = self.initial_manage_principal + body["initial_manage_principal"] = self.initial_manage_principal if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope if self.scope_backend_type is not None: - body["{scope_backend_type}"] = self.scope_backend_type.value + body["scope_backend_type"] = self.scope_backend_type.value return body def as_shallow_dict(self) -> dict: @@ -396,11 +396,11 @@ def as_dict(self) -> dict: """Serializes the CredentialInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username return body def as_shallow_dict(self) -> dict: @@ -438,9 +438,9 @@ def as_dict(self) -> dict: """Serializes the Delete into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.recursive is not None: - body["{recursive}"] = self.recursive + body["recursive"] = self.recursive return body def as_shallow_dict(self) -> dict: @@ -470,9 +470,9 @@ def as_dict(self) -> dict: """Serializes the DeleteAcl into a dictionary suitable for use as a JSON request body.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body def as_shallow_dict(self) -> dict: @@ -571,7 +571,7 @@ def as_dict(self) -> dict: """Serializes the DeleteScope into a dictionary suitable for use as a JSON request body.""" body = {} if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body def as_shallow_dict(self) -> dict: @@ -617,9 +617,9 @@ def as_dict(self) -> dict: """Serializes the DeleteSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body def as_shallow_dict(self) -> dict: @@ -683,9 +683,9 @@ def as_dict(self) -> dict: """Serializes the ExportResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.file_type is not None: - body["{file_type}"] = self.file_type + body["file_type"] = self.file_type return body def as_shallow_dict(self) -> dict: @@ -719,11 +719,11 @@ def as_dict(self) -> dict: """Serializes the GetCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username return body def as_shallow_dict(self) -> dict: @@ -756,7 +756,7 @@ def as_dict(self) -> dict: """Serializes the GetRepoPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -799,19 +799,19 @@ def as_dict(self) -> dict: """Serializes the GetRepoResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.head_commit_id is not None: - body["{head_commit_id}"] = self.head_commit_id + body["head_commit_id"] = self.head_commit_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout.as_dict() + body["sparse_checkout"] = self.sparse_checkout.as_dict() if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -859,9 +859,9 @@ def as_dict(self) -> dict: """Serializes the GetSecretResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body def as_shallow_dict(self) -> dict: @@ -888,7 +888,7 @@ def as_dict(self) -> dict: """Serializes the GetWorkspaceObjectPermissionLevelsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission_levels: - body["{permission_levels}"] = [v.as_dict() for v in self.permission_levels] + body["permission_levels"] = [v.as_dict() for v in self.permission_levels] return body def as_shallow_dict(self) -> dict: @@ -940,15 +940,15 @@ def as_dict(self) -> dict: """Serializes the Import into a dictionary suitable for use as a JSON request body.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.format is not None: - body["{format}"] = self.format.value + body["format"] = self.format.value if self.language is not None: - body["{language}"] = self.language.value + body["language"] = self.language.value if self.overwrite is not None: - body["{overwrite}"] = self.overwrite + body["overwrite"] = self.overwrite if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -1026,7 +1026,7 @@ def as_dict(self) -> dict: """Serializes the ListAclsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.items: - body["{items}"] = [v.as_dict() for v in self.items] + body["items"] = [v.as_dict() for v in self.items] return body def as_shallow_dict(self) -> dict: @@ -1051,7 +1051,7 @@ def as_dict(self) -> dict: """Serializes the ListCredentialsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.credentials: - body["{credentials}"] = [v.as_dict() for v in self.credentials] + body["credentials"] = [v.as_dict() for v in self.credentials] return body def as_shallow_dict(self) -> dict: @@ -1080,9 +1080,9 @@ def as_dict(self) -> dict: """Serializes the ListReposResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.repos: - body["{repos}"] = [v.as_dict() for v in self.repos] + body["repos"] = [v.as_dict() for v in self.repos] return body def as_shallow_dict(self) -> dict: @@ -1109,7 +1109,7 @@ def as_dict(self) -> dict: """Serializes the ListResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.objects: - body["{objects}"] = [v.as_dict() for v in self.objects] + body["objects"] = [v.as_dict() for v in self.objects] return body def as_shallow_dict(self) -> dict: @@ -1134,7 +1134,7 @@ def as_dict(self) -> dict: """Serializes the ListScopesResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.scopes: - body["{scopes}"] = [v.as_dict() for v in self.scopes] + body["scopes"] = [v.as_dict() for v in self.scopes] return body def as_shallow_dict(self) -> dict: @@ -1159,7 +1159,7 @@ def as_dict(self) -> dict: """Serializes the ListSecretsResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.secrets: - body["{secrets}"] = [v.as_dict() for v in self.secrets] + body["secrets"] = [v.as_dict() for v in self.secrets] return body def as_shallow_dict(self) -> dict: @@ -1185,7 +1185,7 @@ def as_dict(self) -> dict: """Serializes the Mkdirs into a dictionary suitable for use as a JSON request body.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body def as_shallow_dict(self) -> dict: @@ -1255,21 +1255,21 @@ def as_dict(self) -> dict: """Serializes the ObjectInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.language is not None: - body["{language}"] = self.language.value + body["language"] = self.language.value if self.modified_at is not None: - body["{modified_at}"] = self.modified_at + body["modified_at"] = self.modified_at if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type.value + body["object_type"] = self.object_type.value if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id if self.size is not None: - body["{size}"] = self.size + body["size"] = self.size return body def as_shallow_dict(self) -> dict: @@ -1334,11 +1334,11 @@ def as_dict(self) -> dict: """Serializes the PutAcl into a dictionary suitable for use as a JSON request body.""" body = {} if self.permission is not None: - body["{permission}"] = self.permission.value + body["permission"] = self.permission.value if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body def as_shallow_dict(self) -> dict: @@ -1398,13 +1398,13 @@ def as_dict(self) -> dict: """Serializes the PutSecret into a dictionary suitable for use as a JSON request body.""" body = {} if self.bytes_value is not None: - body["{bytes_value}"] = self.bytes_value + body["bytes_value"] = self.bytes_value if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope if self.string_value is not None: - body["{string_value}"] = self.string_value + body["string_value"] = self.string_value return body def as_shallow_dict(self) -> dict: @@ -1467,13 +1467,13 @@ def as_dict(self) -> dict: """Serializes the RepoAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -1521,15 +1521,15 @@ def as_dict(self) -> dict: """Serializes the RepoAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -1588,19 +1588,19 @@ def as_dict(self) -> dict: """Serializes the RepoInfo into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.head_commit_id is not None: - body["{head_commit_id}"] = self.head_commit_id + body["head_commit_id"] = self.head_commit_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout.as_dict() + body["sparse_checkout"] = self.sparse_checkout.as_dict() if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body def as_shallow_dict(self) -> dict: @@ -1649,11 +1649,11 @@ def as_dict(self) -> dict: """Serializes the RepoPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1698,11 +1698,11 @@ def as_dict(self) -> dict: """Serializes the RepoPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -1737,9 +1737,9 @@ def as_dict(self) -> dict: """Serializes the RepoPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -1771,9 +1771,9 @@ def as_dict(self) -> dict: """Serializes the RepoPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.repo_id is not None: - body["{repo_id}"] = self.repo_id + body["repo_id"] = self.repo_id return body def as_shallow_dict(self) -> dict: @@ -1812,9 +1812,9 @@ def as_dict(self) -> dict: """Serializes the SecretMetadata into a dictionary suitable for use as a JSON request body.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp return body def as_shallow_dict(self) -> dict: @@ -1847,11 +1847,11 @@ def as_dict(self) -> dict: """Serializes the SecretScope into a dictionary suitable for use as a JSON request body.""" body = {} if self.backend_type is not None: - body["{backend_type}"] = self.backend_type.value + body["backend_type"] = self.backend_type.value if self.keyvault_metadata: - body["{keyvault_metadata}"] = self.keyvault_metadata.as_dict() + body["keyvault_metadata"] = self.keyvault_metadata.as_dict() if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body def as_shallow_dict(self) -> dict: @@ -1888,7 +1888,7 @@ def as_dict(self) -> dict: """Serializes the SparseCheckout into a dictionary suitable for use as a JSON request body.""" body = {} if self.patterns: - body["{patterns}"] = [v for v in self.patterns] + body["patterns"] = [v for v in self.patterns] return body def as_shallow_dict(self) -> dict: @@ -1917,7 +1917,7 @@ def as_dict(self) -> dict: """Serializes the SparseCheckoutUpdate into a dictionary suitable for use as a JSON request body.""" body = {} if self.patterns: - body["{patterns}"] = [v for v in self.patterns] + body["patterns"] = [v for v in self.patterns] return body def as_shallow_dict(self) -> dict: @@ -1960,13 +1960,13 @@ def as_dict(self) -> dict: """Serializes the UpdateCredentialsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username if self.personal_access_token is not None: - body["{personal_access_token}"] = self.personal_access_token + body["personal_access_token"] = self.personal_access_token return body def as_shallow_dict(self) -> dict: @@ -2032,13 +2032,13 @@ def as_dict(self) -> dict: """Serializes the UpdateRepoRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.repo_id is not None: - body["{repo_id}"] = self.repo_id + body["repo_id"] = self.repo_id if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout.as_dict() + body["sparse_checkout"] = self.sparse_checkout.as_dict() if self.tag is not None: - body["{tag}"] = self.tag + body["tag"] = self.tag return body def as_shallow_dict(self) -> dict: @@ -2101,13 +2101,13 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -2155,15 +2155,15 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlResponse into a dictionary suitable for use as a JSON request body.""" body = {} if self.all_permissions: - body["{all_permissions}"] = [v.as_dict() for v in self.all_permissions] + body["all_permissions"] = [v.as_dict() for v in self.all_permissions] if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body def as_shallow_dict(self) -> dict: @@ -2206,11 +2206,11 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermission into a dictionary suitable for use as a JSON request body.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = [v for v in self.inherited_from_object] + body["inherited_from_object"] = [v for v in self.inherited_from_object] if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -2255,11 +2255,11 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermissions into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body def as_shallow_dict(self) -> dict: @@ -2294,9 +2294,9 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsDescription into a dictionary suitable for use as a JSON request body.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level.value + body["permission_level"] = self.permission_level.value return body def as_shallow_dict(self) -> dict: @@ -2331,11 +2331,11 @@ def as_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsRequest into a dictionary suitable for use as a JSON request body.""" body = {} if self.access_control_list: - body["{access_control_list}"] = [v.as_dict() for v in self.access_control_list] + body["access_control_list"] = [v.as_dict() for v in self.access_control_list] if self.workspace_object_id is not None: - body["{workspace_object_id}"] = self.workspace_object_id + body["workspace_object_id"] = self.workspace_object_id if self.workspace_object_type is not None: - body["{workspace_object_type}"] = self.workspace_object_type + body["workspace_object_type"] = self.workspace_object_type return body def as_shallow_dict(self) -> dict: From 19a70242c15b50db27490ed4f2bf3a77f72405e2 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 11:34:53 +0000 Subject: [PATCH 05/20] update --- databricks/sdk/apps/v2/impl.py | 333 ++- databricks/sdk/billing/v2/impl.py | 447 ++- databricks/sdk/catalog/v2/impl.py | 3742 ++++++++++++------------ databricks/sdk/cleanrooms/v2/impl.py | 466 ++- databricks/sdk/compute/v2/impl.py | 2970 ++++++++++--------- databricks/sdk/dashboards/v2/impl.py | 738 +++-- databricks/sdk/files/v2/impl.py | 174 +- databricks/sdk/iam/v2/impl.py | 1033 ++++--- databricks/sdk/jobs/v2/impl.py | 3733 ++++++++++++++--------- databricks/sdk/marketplace/v2/impl.py | 1288 ++++---- databricks/sdk/ml/v2/impl.py | 1901 ++++++------ databricks/sdk/oauth2/v2/impl.py | 429 ++- databricks/sdk/pipelines/v2/impl.py | 1406 +++++---- databricks/sdk/provisioning/v2/impl.py | 756 +++-- databricks/sdk/serving/v2/impl.py | 1300 ++++---- databricks/sdk/settings/v2/impl.py | 1305 +++++---- databricks/sdk/sharing/v2/impl.py | 970 +++--- databricks/sdk/sql/v2/impl.py | 2767 +++++++++--------- databricks/sdk/vectorsearch/v2/impl.py | 470 ++- databricks/sdk/workspace/v2/impl.py | 657 +++-- 20 files changed, 13864 insertions(+), 13021 deletions(-) diff --git a/databricks/sdk/apps/v2/impl.py b/databricks/sdk/apps/v2/impl.py index ff0a634f0..b7b4bb868 100755 --- a/databricks/sdk/apps/v2/impl.py +++ b/databricks/sdk/apps/v2/impl.py @@ -135,80 +135,80 @@ def as_shallow_dict(self) -> dict: """Serializes the App into a shallow dictionary of its immediate attributes.""" body = {} if self.active_deployment: - body["{active_deployment}"] = self.active_deployment + body["active_deployment"] = self.active_deployment if self.app_status: - body["{app_status}"] = self.app_status + body["app_status"] = self.app_status if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.compute_status: - body["{compute_status}"] = self.compute_status + body["compute_status"] = self.compute_status if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.default_source_code_path is not None: - body["{default_source_code_path}"] = self.default_source_code_path + body["default_source_code_path"] = self.default_source_code_path if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.effective_user_api_scopes: - body["{effective_user_api_scopes}"] = self.effective_user_api_scopes + body["effective_user_api_scopes"] = self.effective_user_api_scopes if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.oauth2_app_client_id is not None: - body["{oauth2_app_client_id}"] = self.oauth2_app_client_id + body["oauth2_app_client_id"] = self.oauth2_app_client_id if self.oauth2_app_integration_id is not None: - body["{oauth2_app_integration_id}"] = self.oauth2_app_integration_id + body["oauth2_app_integration_id"] = self.oauth2_app_integration_id if self.pending_deployment: - body["{pending_deployment}"] = self.pending_deployment + body["pending_deployment"] = self.pending_deployment if self.resources: - body["{resources}"] = self.resources + body["resources"] = self.resources if self.service_principal_client_id is not None: - body["{service_principal_client_id}"] = self.service_principal_client_id + body["service_principal_client_id"] = self.service_principal_client_id if self.service_principal_id is not None: - body["{service_principal_id}"] = self.service_principal_id + body["service_principal_id"] = self.service_principal_id if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.updater is not None: - body["{updater}"] = self.updater + body["updater"] = self.updater if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.user_api_scopes: - body["{user_api_scopes}"] = self.user_api_scopes + body["user_api_scopes"] = self.user_api_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> App: """Deserializes the App from a dictionary.""" return cls( - active_deployment=_from_dict(d, "{active_deployment}", AppDeployment), - app_status=_from_dict(d, "{app_status}", ApplicationStatus), - budget_policy_id=d.get("{budget_policy_id}", None), - compute_status=_from_dict(d, "{compute_status}", ComputeStatus), - create_time=d.get("{create_time}", None), - creator=d.get("{creator}", None), - default_source_code_path=d.get("{default_source_code_path}", None), - description=d.get("{description}", None), - effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), - effective_user_api_scopes=d.get("{effective_user_api_scopes}", None), - id=d.get("{id}", None), - name=d.get("{name}", None), - oauth2_app_client_id=d.get("{oauth2_app_client_id}", None), - oauth2_app_integration_id=d.get("{oauth2_app_integration_id}", None), - pending_deployment=_from_dict(d, "{pending_deployment}", AppDeployment), - resources=_repeated_dict(d, "{resources}", AppResource), - service_principal_client_id=d.get("{service_principal_client_id}", None), - service_principal_id=d.get("{service_principal_id}", None), - service_principal_name=d.get("{service_principal_name}", None), - update_time=d.get("{update_time}", None), - updater=d.get("{updater}", None), - url=d.get("{url}", None), - user_api_scopes=d.get("{user_api_scopes}", None), + active_deployment=_from_dict(d, "active_deployment", AppDeployment), + app_status=_from_dict(d, "app_status", ApplicationStatus), + budget_policy_id=d.get("budget_policy_id", None), + compute_status=_from_dict(d, "compute_status", ComputeStatus), + create_time=d.get("create_time", None), + creator=d.get("creator", None), + default_source_code_path=d.get("default_source_code_path", None), + description=d.get("description", None), + effective_budget_policy_id=d.get("effective_budget_policy_id", None), + effective_user_api_scopes=d.get("effective_user_api_scopes", None), + id=d.get("id", None), + name=d.get("name", None), + oauth2_app_client_id=d.get("oauth2_app_client_id", None), + oauth2_app_integration_id=d.get("oauth2_app_integration_id", None), + pending_deployment=_from_dict(d, "pending_deployment", AppDeployment), + resources=_repeated_dict(d, "resources", AppResource), + service_principal_client_id=d.get("service_principal_client_id", None), + service_principal_id=d.get("service_principal_id", None), + service_principal_name=d.get("service_principal_name", None), + update_time=d.get("update_time", None), + updater=d.get("updater", None), + url=d.get("url", None), + user_api_scopes=d.get("user_api_scopes", None), ) @@ -243,23 +243,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AppAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppAccessControlRequest: """Deserializes the AppAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", AppPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", AppPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -299,26 +299,26 @@ def as_shallow_dict(self) -> dict: """Serializes the AppAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppAccessControlResponse: """Deserializes the AppAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", AppPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", AppPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -377,35 +377,35 @@ def as_shallow_dict(self) -> dict: """Serializes the AppDeployment into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.deployment_artifacts: - body["{deployment_artifacts}"] = self.deployment_artifacts + body["deployment_artifacts"] = self.deployment_artifacts if self.deployment_id is not None: - body["{deployment_id}"] = self.deployment_id + body["deployment_id"] = self.deployment_id if self.mode is not None: - body["{mode}"] = self.mode + body["mode"] = self.mode if self.source_code_path is not None: - body["{source_code_path}"] = self.source_code_path + body["source_code_path"] = self.source_code_path if self.status: - body["{status}"] = self.status + body["status"] = self.status if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppDeployment: """Deserializes the AppDeployment from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - creator=d.get("{creator}", None), - deployment_artifacts=_from_dict(d, "{deployment_artifacts}", AppDeploymentArtifacts), - deployment_id=d.get("{deployment_id}", None), - mode=_enum(d, "{mode}", AppDeploymentMode), - source_code_path=d.get("{source_code_path}", None), - status=_from_dict(d, "{status}", AppDeploymentStatus), - update_time=d.get("{update_time}", None), + create_time=d.get("create_time", None), + creator=d.get("creator", None), + deployment_artifacts=_from_dict(d, "deployment_artifacts", AppDeploymentArtifacts), + deployment_id=d.get("deployment_id", None), + mode=_enum(d, "mode", AppDeploymentMode), + source_code_path=d.get("source_code_path", None), + status=_from_dict(d, "status", AppDeploymentStatus), + update_time=d.get("update_time", None), ) @@ -425,13 +425,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AppDeploymentArtifacts into a shallow dictionary of its immediate attributes.""" body = {} if self.source_code_path is not None: - body["{source_code_path}"] = self.source_code_path + body["source_code_path"] = self.source_code_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppDeploymentArtifacts: """Deserializes the AppDeploymentArtifacts from a dictionary.""" - return cls(source_code_path=d.get("{source_code_path}", None)) + return cls(source_code_path=d.get("source_code_path", None)) class AppDeploymentMode(Enum): @@ -469,15 +469,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AppDeploymentStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppDeploymentStatus: """Deserializes the AppDeploymentStatus from a dictionary.""" - return cls(message=d.get("{message}", None), state=_enum(d, "{state}", AppDeploymentState)) + return cls(message=d.get("message", None), state=_enum(d, "state", AppDeploymentState)) @dataclass @@ -504,20 +504,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AppPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermission: """Deserializes the AppPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", AppPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", AppPermissionLevel), ) @@ -551,20 +551,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AppPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermissions: """Deserializes the AppPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", AppAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", AppAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -588,17 +588,16 @@ def as_shallow_dict(self) -> dict: """Serializes the AppPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermissionsDescription: """Deserializes the AppPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", AppPermissionLevel), + description=d.get("description", None), permission_level=_enum(d, "permission_level", AppPermissionLevel) ) @@ -622,17 +621,17 @@ def as_shallow_dict(self) -> dict: """Serializes the AppPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.app_name is not None: - body["{app_name}"] = self.app_name + body["app_name"] = self.app_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppPermissionsRequest: """Deserializes the AppPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", AppAccessControlRequest), - app_name=d.get("{app_name}", None), + access_control_list=_repeated_dict(d, "access_control_list", AppAccessControlRequest), + app_name=d.get("app_name", None), ) @@ -673,29 +672,29 @@ def as_shallow_dict(self) -> dict: """Serializes the AppResource into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.job: - body["{job}"] = self.job + body["job"] = self.job if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.secret: - body["{secret}"] = self.secret + body["secret"] = self.secret if self.serving_endpoint: - body["{serving_endpoint}"] = self.serving_endpoint + body["serving_endpoint"] = self.serving_endpoint if self.sql_warehouse: - body["{sql_warehouse}"] = self.sql_warehouse + body["sql_warehouse"] = self.sql_warehouse return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResource: """Deserializes the AppResource from a dictionary.""" return cls( - description=d.get("{description}", None), - job=_from_dict(d, "{job}", AppResourceJob), - name=d.get("{name}", None), - secret=_from_dict(d, "{secret}", AppResourceSecret), - serving_endpoint=_from_dict(d, "{serving_endpoint}", AppResourceServingEndpoint), - sql_warehouse=_from_dict(d, "{sql_warehouse}", AppResourceSqlWarehouse), + description=d.get("description", None), + job=_from_dict(d, "job", AppResourceJob), + name=d.get("name", None), + secret=_from_dict(d, "secret", AppResourceSecret), + serving_endpoint=_from_dict(d, "serving_endpoint", AppResourceServingEndpoint), + sql_warehouse=_from_dict(d, "sql_warehouse", AppResourceSqlWarehouse), ) @@ -721,15 +720,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AppResourceJob into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.permission is not None: - body["{permission}"] = self.permission + body["permission"] = self.permission return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceJob: """Deserializes the AppResourceJob from a dictionary.""" - return cls(id=d.get("{id}", None), permission=_enum(d, "{permission}", AppResourceJobJobPermission)) + return cls(id=d.get("id", None), permission=_enum(d, "permission", AppResourceJobJobPermission)) class AppResourceJobJobPermission(Enum): @@ -767,20 +766,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AppResourceSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.permission is not None: - body["{permission}"] = self.permission + body["permission"] = self.permission if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceSecret: """Deserializes the AppResourceSecret from a dictionary.""" return cls( - key=d.get("{key}", None), - permission=_enum(d, "{permission}", AppResourceSecretSecretPermission), - scope=d.get("{scope}", None), + key=d.get("key", None), + permission=_enum(d, "permission", AppResourceSecretSecretPermission), + scope=d.get("scope", None), ) @@ -814,17 +813,17 @@ def as_shallow_dict(self) -> dict: """Serializes the AppResourceServingEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.permission is not None: - body["{permission}"] = self.permission + body["permission"] = self.permission return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceServingEndpoint: """Deserializes the AppResourceServingEndpoint from a dictionary.""" return cls( - name=d.get("{name}", None), - permission=_enum(d, "{permission}", AppResourceServingEndpointServingEndpointPermission), + name=d.get("name", None), + permission=_enum(d, "permission", AppResourceServingEndpointServingEndpointPermission), ) @@ -857,16 +856,16 @@ def as_shallow_dict(self) -> dict: """Serializes the AppResourceSqlWarehouse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.permission is not None: - body["{permission}"] = self.permission + body["permission"] = self.permission return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AppResourceSqlWarehouse: """Deserializes the AppResourceSqlWarehouse from a dictionary.""" return cls( - id=d.get("{id}", None), permission=_enum(d, "{permission}", AppResourceSqlWarehouseSqlWarehousePermission) + id=d.get("id", None), permission=_enum(d, "permission", AppResourceSqlWarehouseSqlWarehousePermission) ) @@ -906,15 +905,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ApplicationStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApplicationStatus: """Deserializes the ApplicationStatus from a dictionary.""" - return cls(message=d.get("{message}", None), state=_enum(d, "{state}", ApplicationState)) + return cls(message=d.get("message", None), state=_enum(d, "state", ApplicationState)) class ComputeState(Enum): @@ -949,15 +948,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ComputeStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComputeStatus: """Deserializes the ComputeStatus from a dictionary.""" - return cls(message=d.get("{message}", None), state=_enum(d, "{state}", ComputeState)) + return cls(message=d.get("message", None), state=_enum(d, "state", ComputeState)) @dataclass @@ -976,13 +975,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetAppPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetAppPermissionLevelsResponse: """Deserializes the GetAppPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", AppPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", AppPermissionsDescription)) @dataclass @@ -1006,17 +1005,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAppDeploymentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.app_deployments: - body["{app_deployments}"] = self.app_deployments + body["app_deployments"] = self.app_deployments if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAppDeploymentsResponse: """Deserializes the ListAppDeploymentsResponse from a dictionary.""" return cls( - app_deployments=_repeated_dict(d, "{app_deployments}", AppDeployment), - next_page_token=d.get("{next_page_token}", None), + app_deployments=_repeated_dict(d, "app_deployments", AppDeployment), + next_page_token=d.get("next_page_token", None), ) @@ -1040,15 +1039,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAppsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["{apps}"] = self.apps + body["apps"] = self.apps if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAppsResponse: """Deserializes the ListAppsResponse from a dictionary.""" - return cls(apps=_repeated_dict(d, "{apps}", App), next_page_token=d.get("{next_page_token}", None)) + return cls(apps=_repeated_dict(d, "apps", App), next_page_token=d.get("next_page_token", None)) @dataclass @@ -1086,14 +1085,14 @@ def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None body = app.as_dict() query = {} if no_compute is not None: - query["{no_compute}"] = no_compute + query["no_compute"] = no_compute headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", } op_response = self._api.do("POST", "/api/2.0/apps", query=query, body=body, headers=headers) - return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["{name}"]) + return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["name"]) def create_and_wait( self, *, app: Optional[App] = None, no_compute: Optional[bool] = None, timeout=timedelta(minutes=20) @@ -1142,7 +1141,7 @@ def deploy(self, app_name: str, *, app_deployment: Optional[AppDeployment] = Non self.WaitGetDeploymentAppSucceeded, response=AppDeployment.from_dict(op_response), app_name=app_name, - deployment_id=op_response["{deployment_id}"], + deployment_id=op_response["deployment_id"], ) def deploy_and_wait( @@ -1239,21 +1238,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/apps", query=query, headers=headers) - if "{apps}" in json: - for v in json["{apps}"]: + if "apps" in json: + for v in json["apps"]: yield App.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_deployments( self, app_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -1274,21 +1273,21 @@ def list_deployments( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/apps/{app_name}/deployments", query=query, headers=headers) - if "{app_deployments}" in json: - for v in json["{app_deployments}"]: + if "app_deployments" in json: + for v in json["app_deployments"]: yield AppDeployment.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def set_permissions( self, app_name: str, *, access_control_list: Optional[List[AppAccessControlRequest]] = None @@ -1306,7 +1305,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1334,7 +1333,7 @@ def start(self, name: str) -> Wait[App]: } op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) - return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["{name}"]) + return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["name"]) def start_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: return self.start(name=name).result(timeout=timeout) @@ -1358,7 +1357,7 @@ def stop(self, name: str) -> Wait[App]: } op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) - return Wait(self.WaitGetAppStopped, response=App.from_dict(op_response), name=op_response["{name}"]) + return Wait(self.WaitGetAppStopped, response=App.from_dict(op_response), name=op_response["name"]) def stop_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: return self.stop(name=name).result(timeout=timeout) @@ -1399,7 +1398,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/billing/v2/impl.py b/databricks/sdk/billing/v2/impl.py index 4452f4757..8f0eb0bb3 100755 --- a/databricks/sdk/billing/v2/impl.py +++ b/databricks/sdk/billing/v2/impl.py @@ -40,20 +40,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ActionConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.action_configuration_id is not None: - body["{action_configuration_id}"] = self.action_configuration_id + body["action_configuration_id"] = self.action_configuration_id if self.action_type is not None: - body["{action_type}"] = self.action_type + body["action_type"] = self.action_type if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ActionConfiguration: """Deserializes the ActionConfiguration from a dictionary.""" return cls( - action_configuration_id=d.get("{action_configuration_id}", None), - action_type=_enum(d, "{action_type}", ActionConfigurationType), - target=d.get("{target}", None), + action_configuration_id=d.get("action_configuration_id", None), + action_type=_enum(d, "action_type", ActionConfigurationType), + target=d.get("target", None), ) @@ -106,29 +106,29 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.action_configurations: - body["{action_configurations}"] = self.action_configurations + body["action_configurations"] = self.action_configurations if self.alert_configuration_id is not None: - body["{alert_configuration_id}"] = self.alert_configuration_id + body["alert_configuration_id"] = self.alert_configuration_id if self.quantity_threshold is not None: - body["{quantity_threshold}"] = self.quantity_threshold + body["quantity_threshold"] = self.quantity_threshold if self.quantity_type is not None: - body["{quantity_type}"] = self.quantity_type + body["quantity_type"] = self.quantity_type if self.time_period is not None: - body["{time_period}"] = self.time_period + body["time_period"] = self.time_period if self.trigger_type is not None: - body["{trigger_type}"] = self.trigger_type + body["trigger_type"] = self.trigger_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertConfiguration: """Deserializes the AlertConfiguration from a dictionary.""" return cls( - action_configurations=_repeated_dict(d, "{action_configurations}", ActionConfiguration), - alert_configuration_id=d.get("{alert_configuration_id}", None), - quantity_threshold=d.get("{quantity_threshold}", None), - quantity_type=_enum(d, "{quantity_type}", AlertConfigurationQuantityType), - time_period=_enum(d, "{time_period}", AlertConfigurationTimePeriod), - trigger_type=_enum(d, "{trigger_type}", AlertConfigurationTriggerType), + action_configurations=_repeated_dict(d, "action_configurations", ActionConfiguration), + alert_configuration_id=d.get("alert_configuration_id", None), + quantity_threshold=d.get("quantity_threshold", None), + quantity_type=_enum(d, "quantity_type", AlertConfigurationQuantityType), + time_period=_enum(d, "time_period", AlertConfigurationTimePeriod), + trigger_type=_enum(d, "trigger_type", AlertConfigurationTriggerType), ) @@ -196,32 +196,32 @@ def as_shallow_dict(self) -> dict: """Serializes the BudgetConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.alert_configurations: - body["{alert_configurations}"] = self.alert_configurations + body["alert_configurations"] = self.alert_configurations if self.budget_configuration_id is not None: - body["{budget_configuration_id}"] = self.budget_configuration_id + body["budget_configuration_id"] = self.budget_configuration_id if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.filter: - body["{filter}"] = self.filter + body["filter"] = self.filter if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfiguration: """Deserializes the BudgetConfiguration from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - alert_configurations=_repeated_dict(d, "{alert_configurations}", AlertConfiguration), - budget_configuration_id=d.get("{budget_configuration_id}", None), - create_time=d.get("{create_time}", None), - display_name=d.get("{display_name}", None), - filter=_from_dict(d, "{filter}", BudgetConfigurationFilter), - update_time=d.get("{update_time}", None), + account_id=d.get("account_id", None), + alert_configurations=_repeated_dict(d, "alert_configurations", AlertConfiguration), + budget_configuration_id=d.get("budget_configuration_id", None), + create_time=d.get("create_time", None), + display_name=d.get("display_name", None), + filter=_from_dict(d, "filter", BudgetConfigurationFilter), + update_time=d.get("update_time", None), ) @@ -248,17 +248,17 @@ def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.workspace_id: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilter: """Deserializes the BudgetConfigurationFilter from a dictionary.""" return cls( - tags=_repeated_dict(d, "{tags}", BudgetConfigurationFilterTagClause), - workspace_id=_from_dict(d, "{workspace_id}", BudgetConfigurationFilterWorkspaceIdClause), + tags=_repeated_dict(d, "tags", BudgetConfigurationFilterTagClause), + workspace_id=_from_dict(d, "workspace_id", BudgetConfigurationFilterWorkspaceIdClause), ) @@ -281,15 +281,15 @@ def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilterClause into a shallow dictionary of its immediate attributes.""" body = {} if self.operator is not None: - body["{operator}"] = self.operator + body["operator"] = self.operator if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterClause: """Deserializes the BudgetConfigurationFilterClause from a dictionary.""" - return cls(operator=_enum(d, "{operator}", BudgetConfigurationFilterOperator), values=d.get("{values}", None)) + return cls(operator=_enum(d, "operator", BudgetConfigurationFilterOperator), values=d.get("values", None)) class BudgetConfigurationFilterOperator(Enum): @@ -316,15 +316,15 @@ def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilterTagClause into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterTagClause: """Deserializes the BudgetConfigurationFilterTagClause from a dictionary.""" - return cls(key=d.get("{key}", None), value=_from_dict(d, "{value}", BudgetConfigurationFilterClause)) + return cls(key=d.get("key", None), value=_from_dict(d, "value", BudgetConfigurationFilterClause)) @dataclass @@ -346,15 +346,15 @@ def as_shallow_dict(self) -> dict: """Serializes the BudgetConfigurationFilterWorkspaceIdClause into a shallow dictionary of its immediate attributes.""" body = {} if self.operator is not None: - body["{operator}"] = self.operator + body["operator"] = self.operator if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterWorkspaceIdClause: """Deserializes the BudgetConfigurationFilterWorkspaceIdClause from a dictionary.""" - return cls(operator=_enum(d, "{operator}", BudgetConfigurationFilterOperator), values=d.get("{values}", None)) + return cls(operator=_enum(d, "operator", BudgetConfigurationFilterOperator), values=d.get("values", None)) @dataclass @@ -387,20 +387,20 @@ def as_shallow_dict(self) -> dict: """Serializes the BudgetPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.policy_name is not None: - body["{policy_name}"] = self.policy_name + body["policy_name"] = self.policy_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BudgetPolicy: """Deserializes the BudgetPolicy from a dictionary.""" return cls( - custom_tags=_repeated_dict(d, "{custom_tags}", CustomPolicyTag), - policy_id=d.get("{policy_id}", None), - policy_name=d.get("{policy_name}", None), + custom_tags=_repeated_dict(d, "custom_tags", CustomPolicyTag), + policy_id=d.get("policy_id", None), + policy_name=d.get("policy_name", None), ) @@ -426,16 +426,16 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_type is not None: - body["{dashboard_type}"] = self.dashboard_type + body["dashboard_type"] = self.dashboard_type if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBillingUsageDashboardRequest: """Deserializes the CreateBillingUsageDashboardRequest from a dictionary.""" return cls( - dashboard_type=_enum(d, "{dashboard_type}", UsageDashboardType), workspace_id=d.get("{workspace_id}", None) + dashboard_type=_enum(d, "dashboard_type", UsageDashboardType), workspace_id=d.get("workspace_id", None) ) @@ -455,13 +455,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBillingUsageDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBillingUsageDashboardResponse: """Deserializes the CreateBillingUsageDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("{dashboard_id}", None)) + return cls(dashboard_id=d.get("dashboard_id", None)) @dataclass @@ -498,25 +498,25 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudget into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.alert_configurations: - body["{alert_configurations}"] = self.alert_configurations + body["alert_configurations"] = self.alert_configurations if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.filter: - body["{filter}"] = self.filter + body["filter"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationBudget: """Deserializes the CreateBudgetConfigurationBudget from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), + account_id=d.get("account_id", None), alert_configurations=_repeated_dict( - d, "{alert_configurations}", CreateBudgetConfigurationBudgetAlertConfigurations + d, "alert_configurations", CreateBudgetConfigurationBudgetAlertConfigurations ), - display_name=d.get("{display_name}", None), - filter=_from_dict(d, "{filter}", BudgetConfigurationFilter), + display_name=d.get("display_name", None), + filter=_from_dict(d, "filter", BudgetConfigurationFilter), ) @@ -541,15 +541,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetActionConfigurations into a shallow dictionary of its immediate attributes.""" body = {} if self.action_type is not None: - body["{action_type}"] = self.action_type + body["action_type"] = self.action_type if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationBudgetActionConfigurations: """Deserializes the CreateBudgetConfigurationBudgetActionConfigurations from a dictionary.""" - return cls(action_type=_enum(d, "{action_type}", ActionConfigurationType), target=d.get("{target}", None)) + return cls(action_type=_enum(d, "action_type", ActionConfigurationType), target=d.get("target", None)) @dataclass @@ -591,15 +591,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationBudgetAlertConfigurations into a shallow dictionary of its immediate attributes.""" body = {} if self.action_configurations: - body["{action_configurations}"] = self.action_configurations + body["action_configurations"] = self.action_configurations if self.quantity_threshold is not None: - body["{quantity_threshold}"] = self.quantity_threshold + body["quantity_threshold"] = self.quantity_threshold if self.quantity_type is not None: - body["{quantity_type}"] = self.quantity_type + body["quantity_type"] = self.quantity_type if self.time_period is not None: - body["{time_period}"] = self.time_period + body["time_period"] = self.time_period if self.trigger_type is not None: - body["{trigger_type}"] = self.trigger_type + body["trigger_type"] = self.trigger_type return body @classmethod @@ -607,12 +607,12 @@ def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationBudgetAlertCon """Deserializes the CreateBudgetConfigurationBudgetAlertConfigurations from a dictionary.""" return cls( action_configurations=_repeated_dict( - d, "{action_configurations}", CreateBudgetConfigurationBudgetActionConfigurations + d, "action_configurations", CreateBudgetConfigurationBudgetActionConfigurations ), - quantity_threshold=d.get("{quantity_threshold}", None), - quantity_type=_enum(d, "{quantity_type}", AlertConfigurationQuantityType), - time_period=_enum(d, "{time_period}", AlertConfigurationTimePeriod), - trigger_type=_enum(d, "{trigger_type}", AlertConfigurationTriggerType), + quantity_threshold=d.get("quantity_threshold", None), + quantity_type=_enum(d, "quantity_type", AlertConfigurationQuantityType), + time_period=_enum(d, "time_period", AlertConfigurationTimePeriod), + trigger_type=_enum(d, "trigger_type", AlertConfigurationTriggerType), ) @@ -632,13 +632,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["{budget}"] = self.budget + body["budget"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationRequest: """Deserializes the CreateBudgetConfigurationRequest from a dictionary.""" - return cls(budget=_from_dict(d, "{budget}", CreateBudgetConfigurationBudget)) + return cls(budget=_from_dict(d, "budget", CreateBudgetConfigurationBudget)) @dataclass @@ -657,13 +657,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetConfigurationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["{budget}"] = self.budget + body["budget"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetConfigurationResponse: """Deserializes the CreateBudgetConfigurationResponse from a dictionary.""" - return cls(budget=_from_dict(d, "{budget}", BudgetConfiguration)) + return cls(budget=_from_dict(d, "budget", BudgetConfiguration)) @dataclass @@ -692,15 +692,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateBudgetPolicyRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.policy: - body["{policy}"] = self.policy + body["policy"] = self.policy if self.request_id is not None: - body["{request_id}"] = self.request_id + body["request_id"] = self.request_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateBudgetPolicyRequest: """Deserializes the CreateBudgetPolicyRequest from a dictionary.""" - return cls(policy=_from_dict(d, "{policy}", BudgetPolicy), request_id=d.get("{request_id}", None)) + return cls(policy=_from_dict(d, "policy", BudgetPolicy), request_id=d.get("request_id", None)) @dataclass @@ -801,38 +801,38 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateLogDeliveryConfigurationParams into a shallow dictionary of its immediate attributes.""" body = {} if self.config_name is not None: - body["{config_name}"] = self.config_name + body["config_name"] = self.config_name if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.delivery_path_prefix is not None: - body["{delivery_path_prefix}"] = self.delivery_path_prefix + body["delivery_path_prefix"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["{delivery_start_time}"] = self.delivery_start_time + body["delivery_start_time"] = self.delivery_start_time if self.log_type is not None: - body["{log_type}"] = self.log_type + body["log_type"] = self.log_type if self.output_format is not None: - body["{output_format}"] = self.output_format + body["output_format"] = self.output_format if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.workspace_ids_filter: - body["{workspace_ids_filter}"] = self.workspace_ids_filter + body["workspace_ids_filter"] = self.workspace_ids_filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateLogDeliveryConfigurationParams: """Deserializes the CreateLogDeliveryConfigurationParams from a dictionary.""" return cls( - config_name=d.get("{config_name}", None), - credentials_id=d.get("{credentials_id}", None), - delivery_path_prefix=d.get("{delivery_path_prefix}", None), - delivery_start_time=d.get("{delivery_start_time}", None), - log_type=_enum(d, "{log_type}", LogType), - output_format=_enum(d, "{output_format}", OutputFormat), - status=_enum(d, "{status}", LogDeliveryConfigStatus), - storage_configuration_id=d.get("{storage_configuration_id}", None), - workspace_ids_filter=d.get("{workspace_ids_filter}", None), + config_name=d.get("config_name", None), + credentials_id=d.get("credentials_id", None), + delivery_path_prefix=d.get("delivery_path_prefix", None), + delivery_start_time=d.get("delivery_start_time", None), + log_type=_enum(d, "log_type", LogType), + output_format=_enum(d, "output_format", OutputFormat), + status=_enum(d, "status", LogDeliveryConfigStatus), + storage_configuration_id=d.get("storage_configuration_id", None), + workspace_ids_filter=d.get("workspace_ids_filter", None), ) @@ -865,15 +865,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CustomPolicyTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomPolicyTag: """Deserializes the CustomPolicyTag from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -943,13 +943,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DownloadResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DownloadResponse: """Deserializes the DownloadResponse from a dictionary.""" - return cls(contents=d.get("{contents}", None)) + return cls(contents=d.get("contents", None)) @dataclass @@ -981,20 +981,20 @@ def as_shallow_dict(self) -> dict: """Serializes the Filter into a shallow dictionary of its immediate attributes.""" body = {} if self.creator_user_id is not None: - body["{creator_user_id}"] = self.creator_user_id + body["creator_user_id"] = self.creator_user_id if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.policy_name is not None: - body["{policy_name}"] = self.policy_name + body["policy_name"] = self.policy_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Filter: """Deserializes the Filter from a dictionary.""" return cls( - creator_user_id=d.get("{creator_user_id}", None), - creator_user_name=d.get("{creator_user_name}", None), - policy_name=d.get("{policy_name}", None), + creator_user_id=d.get("creator_user_id", None), + creator_user_name=d.get("creator_user_name", None), + policy_name=d.get("policy_name", None), ) @@ -1019,15 +1019,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetBillingUsageDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.dashboard_url is not None: - body["{dashboard_url}"] = self.dashboard_url + body["dashboard_url"] = self.dashboard_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetBillingUsageDashboardResponse: """Deserializes the GetBillingUsageDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("{dashboard_id}", None), dashboard_url=d.get("{dashboard_url}", None)) + return cls(dashboard_id=d.get("dashboard_id", None), dashboard_url=d.get("dashboard_url", None)) @dataclass @@ -1045,13 +1045,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetBudgetConfigurationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["{budget}"] = self.budget + body["budget"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetBudgetConfigurationResponse: """Deserializes the GetBudgetConfigurationResponse from a dictionary.""" - return cls(budget=_from_dict(d, "{budget}", BudgetConfiguration)) + return cls(budget=_from_dict(d, "budget", BudgetConfiguration)) @dataclass @@ -1096,17 +1096,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListBudgetConfigurationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budgets: - body["{budgets}"] = self.budgets + body["budgets"] = self.budgets if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListBudgetConfigurationsResponse: """Deserializes the ListBudgetConfigurationsResponse from a dictionary.""" return cls( - budgets=_repeated_dict(d, "{budgets}", BudgetConfiguration), - next_page_token=d.get("{next_page_token}", None), + budgets=_repeated_dict(d, "budgets", BudgetConfiguration), next_page_token=d.get("next_page_token", None) ) @@ -1139,20 +1138,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListBudgetPoliciesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.policies: - body["{policies}"] = self.policies + body["policies"] = self.policies if self.previous_page_token is not None: - body["{previous_page_token}"] = self.previous_page_token + body["previous_page_token"] = self.previous_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListBudgetPoliciesResponse: """Deserializes the ListBudgetPoliciesResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - policies=_repeated_dict(d, "{policies}", BudgetPolicy), - previous_page_token=d.get("{previous_page_token}", None), + next_page_token=d.get("next_page_token", None), + policies=_repeated_dict(d, "policies", BudgetPolicy), + previous_page_token=d.get("previous_page_token", None), ) @@ -1289,53 +1288,53 @@ def as_shallow_dict(self) -> dict: """Serializes the LogDeliveryConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.config_id is not None: - body["{config_id}"] = self.config_id + body["config_id"] = self.config_id if self.config_name is not None: - body["{config_name}"] = self.config_name + body["config_name"] = self.config_name if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.delivery_path_prefix is not None: - body["{delivery_path_prefix}"] = self.delivery_path_prefix + body["delivery_path_prefix"] = self.delivery_path_prefix if self.delivery_start_time is not None: - body["{delivery_start_time}"] = self.delivery_start_time + body["delivery_start_time"] = self.delivery_start_time if self.log_delivery_status: - body["{log_delivery_status}"] = self.log_delivery_status + body["log_delivery_status"] = self.log_delivery_status if self.log_type is not None: - body["{log_type}"] = self.log_type + body["log_type"] = self.log_type if self.output_format is not None: - body["{output_format}"] = self.output_format + body["output_format"] = self.output_format if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.workspace_ids_filter: - body["{workspace_ids_filter}"] = self.workspace_ids_filter + body["workspace_ids_filter"] = self.workspace_ids_filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogDeliveryConfiguration: """Deserializes the LogDeliveryConfiguration from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - config_id=d.get("{config_id}", None), - config_name=d.get("{config_name}", None), - creation_time=d.get("{creation_time}", None), - credentials_id=d.get("{credentials_id}", None), - delivery_path_prefix=d.get("{delivery_path_prefix}", None), - delivery_start_time=d.get("{delivery_start_time}", None), - log_delivery_status=_from_dict(d, "{log_delivery_status}", LogDeliveryStatus), - log_type=_enum(d, "{log_type}", LogType), - output_format=_enum(d, "{output_format}", OutputFormat), - status=_enum(d, "{status}", LogDeliveryConfigStatus), - storage_configuration_id=d.get("{storage_configuration_id}", None), - update_time=d.get("{update_time}", None), - workspace_ids_filter=d.get("{workspace_ids_filter}", None), + account_id=d.get("account_id", None), + config_id=d.get("config_id", None), + config_name=d.get("config_name", None), + creation_time=d.get("creation_time", None), + credentials_id=d.get("credentials_id", None), + delivery_path_prefix=d.get("delivery_path_prefix", None), + delivery_start_time=d.get("delivery_start_time", None), + log_delivery_status=_from_dict(d, "log_delivery_status", LogDeliveryStatus), + log_type=_enum(d, "log_type", LogType), + output_format=_enum(d, "output_format", OutputFormat), + status=_enum(d, "status", LogDeliveryConfigStatus), + storage_configuration_id=d.get("storage_configuration_id", None), + update_time=d.get("update_time", None), + workspace_ids_filter=d.get("workspace_ids_filter", None), ) @@ -1379,23 +1378,23 @@ def as_shallow_dict(self) -> dict: """Serializes the LogDeliveryStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_attempt_time is not None: - body["{last_attempt_time}"] = self.last_attempt_time + body["last_attempt_time"] = self.last_attempt_time if self.last_successful_attempt_time is not None: - body["{last_successful_attempt_time}"] = self.last_successful_attempt_time + body["last_successful_attempt_time"] = self.last_successful_attempt_time if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogDeliveryStatus: """Deserializes the LogDeliveryStatus from a dictionary.""" return cls( - last_attempt_time=d.get("{last_attempt_time}", None), - last_successful_attempt_time=d.get("{last_successful_attempt_time}", None), - message=d.get("{message}", None), - status=_enum(d, "{status}", DeliveryStatus), + last_attempt_time=d.get("last_attempt_time", None), + last_successful_attempt_time=d.get("last_successful_attempt_time", None), + message=d.get("message", None), + status=_enum(d, "status", DeliveryStatus), ) @@ -1472,15 +1471,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SortSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.descending is not None: - body["{descending}"] = self.descending + body["descending"] = self.descending if self.field is not None: - body["{field}"] = self.field + body["field"] = self.field return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SortSpec: """Deserializes the SortSpec from a dictionary.""" - return cls(descending=d.get("{descending}", None), field=_enum(d, "{field}", SortSpecField)) + return cls(descending=d.get("descending", None), field=_enum(d, "field", SortSpecField)) class SortSpecField(Enum): @@ -1527,26 +1526,26 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationBudget into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.alert_configurations: - body["{alert_configurations}"] = self.alert_configurations + body["alert_configurations"] = self.alert_configurations if self.budget_configuration_id is not None: - body["{budget_configuration_id}"] = self.budget_configuration_id + body["budget_configuration_id"] = self.budget_configuration_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.filter: - body["{filter}"] = self.filter + body["filter"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateBudgetConfigurationBudget: """Deserializes the UpdateBudgetConfigurationBudget from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - alert_configurations=_repeated_dict(d, "{alert_configurations}", AlertConfiguration), - budget_configuration_id=d.get("{budget_configuration_id}", None), - display_name=d.get("{display_name}", None), - filter=_from_dict(d, "{filter}", BudgetConfigurationFilter), + account_id=d.get("account_id", None), + alert_configurations=_repeated_dict(d, "alert_configurations", AlertConfiguration), + budget_configuration_id=d.get("budget_configuration_id", None), + display_name=d.get("display_name", None), + filter=_from_dict(d, "filter", BudgetConfigurationFilter), ) @@ -1571,17 +1570,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["{budget}"] = self.budget + body["budget"] = self.budget if self.budget_id is not None: - body["{budget_id}"] = self.budget_id + body["budget_id"] = self.budget_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateBudgetConfigurationRequest: """Deserializes the UpdateBudgetConfigurationRequest from a dictionary.""" - return cls( - budget=_from_dict(d, "{budget}", UpdateBudgetConfigurationBudget), budget_id=d.get("{budget_id}", None) - ) + return cls(budget=_from_dict(d, "budget", UpdateBudgetConfigurationBudget), budget_id=d.get("budget_id", None)) @dataclass @@ -1600,13 +1597,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateBudgetConfigurationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.budget: - body["{budget}"] = self.budget + body["budget"] = self.budget return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateBudgetConfigurationResponse: """Deserializes the UpdateBudgetConfigurationResponse from a dictionary.""" - return cls(budget=_from_dict(d, "{budget}", BudgetConfiguration)) + return cls(budget=_from_dict(d, "budget", BudgetConfiguration)) @dataclass @@ -1633,17 +1630,17 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateLogDeliveryConfigurationStatusRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configuration_id is not None: - body["{log_delivery_configuration_id}"] = self.log_delivery_configuration_id + body["log_delivery_configuration_id"] = self.log_delivery_configuration_id if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateLogDeliveryConfigurationStatusRequest: """Deserializes the UpdateLogDeliveryConfigurationStatusRequest from a dictionary.""" return cls( - log_delivery_configuration_id=d.get("{log_delivery_configuration_id}", None), - status=_enum(d, "{status}", LogDeliveryConfigStatus), + log_delivery_configuration_id=d.get("log_delivery_configuration_id", None), + status=_enum(d, "status", LogDeliveryConfigStatus), ) @@ -1668,16 +1665,14 @@ def as_shallow_dict(self) -> dict: """Serializes the WrappedCreateLogDeliveryConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configuration: - body["{log_delivery_configuration}"] = self.log_delivery_configuration + body["log_delivery_configuration"] = self.log_delivery_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WrappedCreateLogDeliveryConfiguration: """Deserializes the WrappedCreateLogDeliveryConfiguration from a dictionary.""" return cls( - log_delivery_configuration=_from_dict( - d, "{log_delivery_configuration}", CreateLogDeliveryConfigurationParams - ) + log_delivery_configuration=_from_dict(d, "log_delivery_configuration", CreateLogDeliveryConfigurationParams) ) @@ -1696,13 +1691,13 @@ def as_shallow_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configuration: - body["{log_delivery_configuration}"] = self.log_delivery_configuration + body["log_delivery_configuration"] = self.log_delivery_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WrappedLogDeliveryConfiguration: """Deserializes the WrappedLogDeliveryConfiguration from a dictionary.""" - return cls(log_delivery_configuration=_from_dict(d, "{log_delivery_configuration}", LogDeliveryConfiguration)) + return cls(log_delivery_configuration=_from_dict(d, "log_delivery_configuration", LogDeliveryConfiguration)) @dataclass @@ -1720,14 +1715,14 @@ def as_shallow_dict(self) -> dict: """Serializes the WrappedLogDeliveryConfigurations into a shallow dictionary of its immediate attributes.""" body = {} if self.log_delivery_configurations: - body["{log_delivery_configurations}"] = self.log_delivery_configurations + body["log_delivery_configurations"] = self.log_delivery_configurations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WrappedLogDeliveryConfigurations: """Deserializes the WrappedLogDeliveryConfigurations from a dictionary.""" return cls( - log_delivery_configurations=_repeated_dict(d, "{log_delivery_configurations}", LogDeliveryConfiguration) + log_delivery_configurations=_repeated_dict(d, "log_delivery_configurations", LogDeliveryConfiguration) ) @@ -1764,11 +1759,11 @@ def download(self, start_month: str, end_month: str, *, personal_data: Optional[ query = {} if end_month is not None: - query["{end_month}"] = end_month + query["end_month"] = end_month if personal_data is not None: - query["{personal_data}"] = personal_data + query["personal_data"] = personal_data if start_month is not None: - query["{start_month}"] = start_month + query["start_month"] = start_month headers = { "0": "{Accept text/plain}", } @@ -1802,9 +1797,9 @@ def create(self, *, policy: Optional[BudgetPolicy] = None, request_id: Optional[ """ body = {} if policy is not None: - body["{policy}"] = policy.as_dict() + body["policy"] = policy.as_dict() if request_id is not None: - body["{request_id}"] = request_id + body["request_id"] = request_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1883,13 +1878,13 @@ def list( query = {} if filter_by is not None: - query["{filter_by}"] = filter_by.as_dict() + query["filter_by"] = filter_by.as_dict() if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if sort_spec is not None: - query["{sort_spec}"] = sort_spec.as_dict() + query["sort_spec"] = sort_spec.as_dict() headers = { "0": "{Accept application/json}", } @@ -1898,12 +1893,12 @@ def list( json = self._api.do( "GET", f"/api/2.1/accounts/{self._api.account_id}/budget-policies", query=query, headers=headers ) - if "{policies}" in json: - for v in json["{policies}"]: + if "policies" in json: + for v in json["policies"]: yield BudgetPolicy.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, policy_id: str, *, limit_config: Optional[LimitConfig] = None, policy: Optional[BudgetPolicy] = None @@ -1924,7 +1919,7 @@ def update( body = policy.as_dict() query = {} if limit_config is not None: - query["{limit_config}"] = limit_config.as_dict() + query["limit_config"] = limit_config.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1961,7 +1956,7 @@ def create(self, budget: CreateBudgetConfigurationBudget) -> CreateBudgetConfigu """ body = {} if budget is not None: - body["{budget}"] = budget.as_dict() + body["budget"] = budget.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2020,7 +2015,7 @@ def list(self, *, page_token: Optional[str] = None) -> Iterator[BudgetConfigurat query = {} if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -2029,12 +2024,12 @@ def list(self, *, page_token: Optional[str] = None) -> Iterator[BudgetConfigurat json = self._api.do( "GET", f"/api/2.1/accounts/{self._api.account_id}/budgets", query=query, headers=headers ) - if "{budgets}" in json: - for v in json["{budgets}"]: + if "budgets" in json: + for v in json["budgets"]: yield BudgetConfiguration.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, budget_id: str, budget: UpdateBudgetConfigurationBudget) -> UpdateBudgetConfigurationResponse: """Modify budget. @@ -2051,7 +2046,7 @@ def update(self, budget_id: str, budget: UpdateBudgetConfigurationBudget) -> Upd """ body = {} if budget is not None: - body["{budget}"] = budget.as_dict() + body["budget"] = budget.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2146,7 +2141,7 @@ def create( """ body = {} if log_delivery_configuration is not None: - body["{log_delivery_configuration}"] = log_delivery_configuration.as_dict() + body["log_delivery_configuration"] = log_delivery_configuration.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2200,11 +2195,11 @@ def list( query = {} if credentials_id is not None: - query["{credentials_id}"] = credentials_id + query["credentials_id"] = credentials_id if status is not None: - query["{status}"] = status.value + query["status"] = status.value if storage_configuration_id is not None: - query["{storage_configuration_id}"] = storage_configuration_id + query["storage_configuration_id"] = storage_configuration_id headers = { "0": "{Accept application/json}", } @@ -2235,7 +2230,7 @@ def patch_status(self, log_delivery_configuration_id: str, status: LogDeliveryCo """ body = {} if status is not None: - body["{status}"] = status.value + body["status"] = status.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2274,9 +2269,9 @@ def create( """ body = {} if dashboard_type is not None: - body["{dashboard_type}"] = dashboard_type.value + body["dashboard_type"] = dashboard_type.value if workspace_id is not None: - body["{workspace_id}"] = workspace_id + body["workspace_id"] = workspace_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2303,9 +2298,9 @@ def get( query = {} if dashboard_type is not None: - query["{dashboard_type}"] = dashboard_type.value + query["dashboard_type"] = dashboard_type.value if workspace_id is not None: - query["{workspace_id}"] = workspace_id + query["workspace_id"] = workspace_id headers = { "0": "{Accept application/json}", } diff --git a/databricks/sdk/catalog/v2/impl.py b/databricks/sdk/catalog/v2/impl.py index 055821758..8ce04ea44 100755 --- a/databricks/sdk/catalog/v2/impl.py +++ b/databricks/sdk/catalog/v2/impl.py @@ -31,13 +31,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsCreateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_info: - body["{metastore_info}"] = self.metastore_info + body["metastore_info"] = self.metastore_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsCreateMetastore: """Deserializes the AccountsCreateMetastore from a dictionary.""" - return cls(metastore_info=_from_dict(d, "{metastore_info}", CreateMetastore)) + return cls(metastore_info=_from_dict(d, "metastore_info", CreateMetastore)) @dataclass @@ -65,20 +65,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsCreateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_assignment: - body["{metastore_assignment}"] = self.metastore_assignment + body["metastore_assignment"] = self.metastore_assignment if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsCreateMetastoreAssignment: """Deserializes the AccountsCreateMetastoreAssignment from a dictionary.""" return cls( - metastore_assignment=_from_dict(d, "{metastore_assignment}", CreateMetastoreAssignment), - metastore_id=d.get("{metastore_id}", None), - workspace_id=d.get("{workspace_id}", None), + metastore_assignment=_from_dict(d, "metastore_assignment", CreateMetastoreAssignment), + metastore_id=d.get("metastore_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -102,17 +102,17 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsCreateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_info: - body["{credential_info}"] = self.credential_info + body["credential_info"] = self.credential_info if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsCreateStorageCredential: """Deserializes the AccountsCreateStorageCredential from a dictionary.""" return cls( - credential_info=_from_dict(d, "{credential_info}", CreateStorageCredential), - metastore_id=d.get("{metastore_id}", None), + credential_info=_from_dict(d, "credential_info", CreateStorageCredential), + metastore_id=d.get("metastore_id", None), ) @@ -131,13 +131,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_assignment: - body["{metastore_assignment}"] = self.metastore_assignment + body["metastore_assignment"] = self.metastore_assignment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsMetastoreAssignment: """Deserializes the AccountsMetastoreAssignment from a dictionary.""" - return cls(metastore_assignment=_from_dict(d, "{metastore_assignment}", MetastoreAssignment)) + return cls(metastore_assignment=_from_dict(d, "metastore_assignment", MetastoreAssignment)) @dataclass @@ -155,13 +155,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsMetastoreInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_info: - body["{metastore_info}"] = self.metastore_info + body["metastore_info"] = self.metastore_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsMetastoreInfo: """Deserializes the AccountsMetastoreInfo from a dictionary.""" - return cls(metastore_info=_from_dict(d, "{metastore_info}", MetastoreInfo)) + return cls(metastore_info=_from_dict(d, "metastore_info", MetastoreInfo)) @dataclass @@ -179,13 +179,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsStorageCredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_info: - body["{credential_info}"] = self.credential_info + body["credential_info"] = self.credential_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsStorageCredentialInfo: """Deserializes the AccountsStorageCredentialInfo from a dictionary.""" - return cls(credential_info=_from_dict(d, "{credential_info}", StorageCredentialInfo)) + return cls(credential_info=_from_dict(d, "credential_info", StorageCredentialInfo)) @dataclass @@ -208,17 +208,16 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsUpdateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.metastore_info: - body["{metastore_info}"] = self.metastore_info + body["metastore_info"] = self.metastore_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsUpdateMetastore: """Deserializes the AccountsUpdateMetastore from a dictionary.""" return cls( - metastore_id=d.get("{metastore_id}", None), - metastore_info=_from_dict(d, "{metastore_info}", UpdateMetastore), + metastore_id=d.get("metastore_id", None), metastore_info=_from_dict(d, "metastore_info", UpdateMetastore) ) @@ -247,20 +246,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsUpdateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.metastore_assignment: - body["{metastore_assignment}"] = self.metastore_assignment + body["metastore_assignment"] = self.metastore_assignment if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsUpdateMetastoreAssignment: """Deserializes the AccountsUpdateMetastoreAssignment from a dictionary.""" return cls( - metastore_assignment=_from_dict(d, "{metastore_assignment}", UpdateMetastoreAssignment), - metastore_id=d.get("{metastore_id}", None), - workspace_id=d.get("{workspace_id}", None), + metastore_assignment=_from_dict(d, "metastore_assignment", UpdateMetastoreAssignment), + metastore_id=d.get("metastore_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -289,20 +288,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountsUpdateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_info: - body["{credential_info}"] = self.credential_info + body["credential_info"] = self.credential_info if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.storage_credential_name is not None: - body["{storage_credential_name}"] = self.storage_credential_name + body["storage_credential_name"] = self.storage_credential_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountsUpdateStorageCredential: """Deserializes the AccountsUpdateStorageCredential from a dictionary.""" return cls( - credential_info=_from_dict(d, "{credential_info}", UpdateStorageCredential), - metastore_id=d.get("{metastore_id}", None), - storage_credential_name=d.get("{storage_credential_name}", None), + credential_info=_from_dict(d, "credential_info", UpdateStorageCredential), + metastore_id=d.get("metastore_id", None), + storage_credential_name=d.get("storage_credential_name", None), ) @@ -337,23 +336,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ArtifactAllowlistInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_matchers: - body["{artifact_matchers}"] = self.artifact_matchers + body["artifact_matchers"] = self.artifact_matchers if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ArtifactAllowlistInfo: """Deserializes the ArtifactAllowlistInfo from a dictionary.""" return cls( - artifact_matchers=_repeated_dict(d, "{artifact_matchers}", ArtifactMatcher), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - metastore_id=d.get("{metastore_id}", None), + artifact_matchers=_repeated_dict(d, "artifact_matchers", ArtifactMatcher), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + metastore_id=d.get("metastore_id", None), ) @@ -378,15 +377,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ArtifactMatcher into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact is not None: - body["{artifact}"] = self.artifact + body["artifact"] = self.artifact if self.match_type is not None: - body["{match_type}"] = self.match_type + body["match_type"] = self.match_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ArtifactMatcher: """Deserializes the ArtifactMatcher from a dictionary.""" - return cls(artifact=d.get("{artifact}", None), match_type=_enum(d, "{match_type}", MatchType)) + return cls(artifact=d.get("artifact", None), match_type=_enum(d, "match_type", MatchType)) class ArtifactType(Enum): @@ -450,23 +449,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.access_key_id is not None: - body["{access_key_id}"] = self.access_key_id + body["access_key_id"] = self.access_key_id if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.secret_access_key is not None: - body["{secret_access_key}"] = self.secret_access_key + body["secret_access_key"] = self.secret_access_key if self.session_token is not None: - body["{session_token}"] = self.session_token + body["session_token"] = self.session_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsCredentials: """Deserializes the AwsCredentials from a dictionary.""" return cls( - access_key_id=d.get("{access_key_id}", None), - access_point=d.get("{access_point}", None), - secret_access_key=d.get("{secret_access_key}", None), - session_token=d.get("{session_token}", None), + access_key_id=d.get("access_key_id", None), + access_point=d.get("access_point", None), + secret_access_key=d.get("secret_access_key", None), + session_token=d.get("session_token", None), ) @@ -499,20 +498,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsIamRole into a shallow dictionary of its immediate attributes.""" body = {} if self.external_id is not None: - body["{external_id}"] = self.external_id + body["external_id"] = self.external_id if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn + body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsIamRole: """Deserializes the AwsIamRole from a dictionary.""" return cls( - external_id=d.get("{external_id}", None), - role_arn=d.get("{role_arn}", None), - unity_catalog_iam_arn=d.get("{unity_catalog_iam_arn}", None), + external_id=d.get("external_id", None), + role_arn=d.get("role_arn", None), + unity_catalog_iam_arn=d.get("unity_catalog_iam_arn", None), ) @@ -532,13 +531,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsIamRoleRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsIamRoleRequest: """Deserializes the AwsIamRoleRequest from a dictionary.""" - return cls(role_arn=d.get("{role_arn}", None)) + return cls(role_arn=d.get("role_arn", None)) @dataclass @@ -568,20 +567,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsIamRoleResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.external_id is not None: - body["{external_id}"] = self.external_id + body["external_id"] = self.external_id if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn if self.unity_catalog_iam_arn is not None: - body["{unity_catalog_iam_arn}"] = self.unity_catalog_iam_arn + body["unity_catalog_iam_arn"] = self.unity_catalog_iam_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsIamRoleResponse: """Deserializes the AwsIamRoleResponse from a dictionary.""" return cls( - external_id=d.get("{external_id}", None), - role_arn=d.get("{role_arn}", None), - unity_catalog_iam_arn=d.get("{unity_catalog_iam_arn}", None), + external_id=d.get("external_id", None), + role_arn=d.get("role_arn", None), + unity_catalog_iam_arn=d.get("unity_catalog_iam_arn", None), ) @@ -606,13 +605,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureActiveDirectoryToken into a shallow dictionary of its immediate attributes.""" body = {} if self.aad_token is not None: - body["{aad_token}"] = self.aad_token + body["aad_token"] = self.aad_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureActiveDirectoryToken: """Deserializes the AzureActiveDirectoryToken from a dictionary.""" - return cls(aad_token=d.get("{aad_token}", None)) + return cls(aad_token=d.get("aad_token", None)) @dataclass @@ -650,20 +649,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureManagedIdentity into a shallow dictionary of its immediate attributes.""" body = {} if self.access_connector_id is not None: - body["{access_connector_id}"] = self.access_connector_id + body["access_connector_id"] = self.access_connector_id if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.managed_identity_id is not None: - body["{managed_identity_id}"] = self.managed_identity_id + body["managed_identity_id"] = self.managed_identity_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureManagedIdentity: """Deserializes the AzureManagedIdentity from a dictionary.""" return cls( - access_connector_id=d.get("{access_connector_id}", None), - credential_id=d.get("{credential_id}", None), - managed_identity_id=d.get("{managed_identity_id}", None), + access_connector_id=d.get("access_connector_id", None), + credential_id=d.get("credential_id", None), + managed_identity_id=d.get("managed_identity_id", None), ) @@ -693,17 +692,17 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureManagedIdentityRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_connector_id is not None: - body["{access_connector_id}"] = self.access_connector_id + body["access_connector_id"] = self.access_connector_id if self.managed_identity_id is not None: - body["{managed_identity_id}"] = self.managed_identity_id + body["managed_identity_id"] = self.managed_identity_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureManagedIdentityRequest: """Deserializes the AzureManagedIdentityRequest from a dictionary.""" return cls( - access_connector_id=d.get("{access_connector_id}", None), - managed_identity_id=d.get("{managed_identity_id}", None), + access_connector_id=d.get("access_connector_id", None), + managed_identity_id=d.get("managed_identity_id", None), ) @@ -738,20 +737,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureManagedIdentityResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.access_connector_id is not None: - body["{access_connector_id}"] = self.access_connector_id + body["access_connector_id"] = self.access_connector_id if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.managed_identity_id is not None: - body["{managed_identity_id}"] = self.managed_identity_id + body["managed_identity_id"] = self.managed_identity_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureManagedIdentityResponse: """Deserializes the AzureManagedIdentityResponse from a dictionary.""" return cls( - access_connector_id=d.get("{access_connector_id}", None), - credential_id=d.get("{credential_id}", None), - managed_identity_id=d.get("{managed_identity_id}", None), + access_connector_id=d.get("access_connector_id", None), + credential_id=d.get("credential_id", None), + managed_identity_id=d.get("managed_identity_id", None), ) @@ -783,20 +782,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureServicePrincipal into a shallow dictionary of its immediate attributes.""" body = {} if self.application_id is not None: - body["{application_id}"] = self.application_id + body["application_id"] = self.application_id if self.client_secret is not None: - body["{client_secret}"] = self.client_secret + body["client_secret"] = self.client_secret if self.directory_id is not None: - body["{directory_id}"] = self.directory_id + body["directory_id"] = self.directory_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureServicePrincipal: """Deserializes the AzureServicePrincipal from a dictionary.""" return cls( - application_id=d.get("{application_id}", None), - client_secret=d.get("{client_secret}", None), - directory_id=d.get("{directory_id}", None), + application_id=d.get("application_id", None), + client_secret=d.get("client_secret", None), + directory_id=d.get("directory_id", None), ) @@ -819,13 +818,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureUserDelegationSas into a shallow dictionary of its immediate attributes.""" body = {} if self.sas_token is not None: - body["{sas_token}"] = self.sas_token + body["sas_token"] = self.sas_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureUserDelegationSas: """Deserializes the AzureUserDelegationSas from a dictionary.""" - return cls(sas_token=d.get("{sas_token}", None)) + return cls(sas_token=d.get("sas_token", None)) @dataclass @@ -973,82 +972,82 @@ def as_shallow_dict(self) -> dict: """Serializes the CatalogInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_type is not None: - body["{catalog_type}"] = self.catalog_type + body["catalog_type"] = self.catalog_type if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.effective_predictive_optimization_flag: - body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag + body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization + body["enable_predictive_optimization"] = self.enable_predictive_optimization if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.provider_name is not None: - body["{provider_name}"] = self.provider_name + body["provider_name"] = self.provider_name if self.provisioning_info: - body["{provisioning_info}"] = self.provisioning_info + body["provisioning_info"] = self.provisioning_info if self.securable_type is not None: - body["{securable_type}"] = self.securable_type + body["securable_type"] = self.securable_type if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CatalogInfo: """Deserializes the CatalogInfo from a dictionary.""" return cls( - browse_only=d.get("{browse_only}", None), - catalog_type=_enum(d, "{catalog_type}", CatalogType), - comment=d.get("{comment}", None), - connection_name=d.get("{connection_name}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), + browse_only=d.get("browse_only", None), + catalog_type=_enum(d, "catalog_type", CatalogType), + comment=d.get("comment", None), + connection_name=d.get("connection_name", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), effective_predictive_optimization_flag=_from_dict( - d, "{effective_predictive_optimization_flag}", EffectivePredictiveOptimizationFlag + d, "effective_predictive_optimization_flag", EffectivePredictiveOptimizationFlag ), - enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), - full_name=d.get("{full_name}", None), - isolation_mode=_enum(d, "{isolation_mode}", CatalogIsolationMode), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - options=d.get("{options}", None), - owner=d.get("{owner}", None), - properties=d.get("{properties}", None), - provider_name=d.get("{provider_name}", None), - provisioning_info=_from_dict(d, "{provisioning_info}", ProvisioningInfo), - securable_type=d.get("{securable_type}", None), - share_name=d.get("{share_name}", None), - storage_location=d.get("{storage_location}", None), - storage_root=d.get("{storage_root}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), + full_name=d.get("full_name", None), + isolation_mode=_enum(d, "isolation_mode", CatalogIsolationMode), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + options=d.get("options", None), + owner=d.get("owner", None), + properties=d.get("properties", None), + provider_name=d.get("provider_name", None), + provisioning_info=_from_dict(d, "provisioning_info", ProvisioningInfo), + securable_type=d.get("securable_type", None), + share_name=d.get("share_name", None), + storage_location=d.get("storage_location", None), + storage_root=d.get("storage_root", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -1094,20 +1093,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CloudflareApiToken into a shallow dictionary of its immediate attributes.""" body = {} if self.access_key_id is not None: - body["{access_key_id}"] = self.access_key_id + body["access_key_id"] = self.access_key_id if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.secret_access_key is not None: - body["{secret_access_key}"] = self.secret_access_key + body["secret_access_key"] = self.secret_access_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloudflareApiToken: """Deserializes the CloudflareApiToken from a dictionary.""" return cls( - access_key_id=d.get("{access_key_id}", None), - account_id=d.get("{account_id}", None), - secret_access_key=d.get("{secret_access_key}", None), + access_key_id=d.get("access_key_id", None), + account_id=d.get("account_id", None), + secret_access_key=d.get("secret_access_key", None), ) @@ -1180,47 +1179,47 @@ def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.mask: - body["{mask}"] = self.mask + body["mask"] = self.mask if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.nullable is not None: - body["{nullable}"] = self.nullable + body["nullable"] = self.nullable if self.partition_index is not None: - body["{partition_index}"] = self.partition_index + body["partition_index"] = self.partition_index if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name + body["type_name"] = self.type_name if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - mask=_from_dict(d, "{mask}", ColumnMask), - name=d.get("{name}", None), - nullable=d.get("{nullable}", None), - partition_index=d.get("{partition_index}", None), - position=d.get("{position}", None), - type_interval_type=d.get("{type_interval_type}", None), - type_json=d.get("{type_json}", None), - type_name=_enum(d, "{type_name}", ColumnTypeName), - type_precision=d.get("{type_precision}", None), - type_scale=d.get("{type_scale}", None), - type_text=d.get("{type_text}", None), + comment=d.get("comment", None), + mask=_from_dict(d, "mask", ColumnMask), + name=d.get("name", None), + nullable=d.get("nullable", None), + partition_index=d.get("partition_index", None), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_json=d.get("type_json", None), + type_name=_enum(d, "type_name", ColumnTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), ) @@ -1247,15 +1246,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ColumnMask into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.using_column_names: - body["{using_column_names}"] = self.using_column_names + body["using_column_names"] = self.using_column_names return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnMask: """Deserializes the ColumnMask from a dictionary.""" - return cls(function_name=d.get("{function_name}", None), using_column_names=d.get("{using_column_names}", None)) + return cls(function_name=d.get("function_name", None), using_column_names=d.get("using_column_names", None)) class ColumnTypeName(Enum): @@ -1384,65 +1383,65 @@ def as_shallow_dict(self) -> dict: """Serializes the ConnectionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_id is not None: - body["{connection_id}"] = self.connection_id + body["connection_id"] = self.connection_id if self.connection_type is not None: - body["{connection_type}"] = self.connection_type + body["connection_type"] = self.connection_type if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.credential_type is not None: - body["{credential_type}"] = self.credential_type + body["credential_type"] = self.credential_type if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.provisioning_info: - body["{provisioning_info}"] = self.provisioning_info + body["provisioning_info"] = self.provisioning_info if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.securable_type is not None: - body["{securable_type}"] = self.securable_type + body["securable_type"] = self.securable_type if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConnectionInfo: """Deserializes the ConnectionInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - connection_id=d.get("{connection_id}", None), - connection_type=_enum(d, "{connection_type}", ConnectionType), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - credential_type=_enum(d, "{credential_type}", CredentialType), - full_name=d.get("{full_name}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - options=d.get("{options}", None), - owner=d.get("{owner}", None), - properties=d.get("{properties}", None), - provisioning_info=_from_dict(d, "{provisioning_info}", ProvisioningInfo), - read_only=d.get("{read_only}", None), - securable_type=d.get("{securable_type}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - url=d.get("{url}", None), + comment=d.get("comment", None), + connection_id=d.get("connection_id", None), + connection_type=_enum(d, "connection_type", ConnectionType), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + credential_type=_enum(d, "credential_type", CredentialType), + full_name=d.get("full_name", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + options=d.get("options", None), + owner=d.get("owner", None), + properties=d.get("properties", None), + provisioning_info=_from_dict(d, "provisioning_info", ProvisioningInfo), + read_only=d.get("read_only", None), + securable_type=d.get("securable_type", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + url=d.get("url", None), ) @@ -1495,20 +1494,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ContinuousUpdateStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.initial_pipeline_sync_progress: - body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress + body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress if self.last_processed_commit_version is not None: - body["{last_processed_commit_version}"] = self.last_processed_commit_version + body["last_processed_commit_version"] = self.last_processed_commit_version if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ContinuousUpdateStatus: """Deserializes the ContinuousUpdateStatus from a dictionary.""" return cls( - initial_pipeline_sync_progress=_from_dict(d, "{initial_pipeline_sync_progress}", PipelineProgress), - last_processed_commit_version=d.get("{last_processed_commit_version}", None), - timestamp=d.get("{timestamp}", None), + initial_pipeline_sync_progress=_from_dict(d, "initial_pipeline_sync_progress", PipelineProgress), + last_processed_commit_version=d.get("last_processed_commit_version", None), + timestamp=d.get("timestamp", None), ) @@ -1565,35 +1564,35 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCatalog into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.provider_name is not None: - body["{provider_name}"] = self.provider_name + body["provider_name"] = self.provider_name if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCatalog: """Deserializes the CreateCatalog from a dictionary.""" return cls( - comment=d.get("{comment}", None), - connection_name=d.get("{connection_name}", None), - name=d.get("{name}", None), - options=d.get("{options}", None), - properties=d.get("{properties}", None), - provider_name=d.get("{provider_name}", None), - share_name=d.get("{share_name}", None), - storage_root=d.get("{storage_root}", None), + comment=d.get("comment", None), + connection_name=d.get("connection_name", None), + name=d.get("name", None), + options=d.get("options", None), + properties=d.get("properties", None), + provider_name=d.get("provider_name", None), + share_name=d.get("share_name", None), + storage_root=d.get("storage_root", None), ) @@ -1638,29 +1637,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateConnection into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.connection_type is not None: - body["{connection_type}"] = self.connection_type + body["connection_type"] = self.connection_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateConnection: """Deserializes the CreateConnection from a dictionary.""" return cls( - comment=d.get("{comment}", None), - connection_type=_enum(d, "{connection_type}", ConnectionType), - name=d.get("{name}", None), - options=d.get("{options}", None), - properties=d.get("{properties}", None), - read_only=d.get("{read_only}", None), + comment=d.get("comment", None), + connection_type=_enum(d, "connection_type", ConnectionType), + name=d.get("name", None), + options=d.get("options", None), + properties=d.get("properties", None), + read_only=d.get("read_only", None), ) @@ -1722,40 +1721,38 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal + body["azure_service_principal"] = self.azure_service_principal if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.purpose is not None: - body["{purpose}"] = self.purpose + body["purpose"] = self.purpose if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialRequest: """Deserializes the CreateCredentialRequest from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), - azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), - comment=d.get("{comment}", None), - databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount - ), - name=d.get("{name}", None), - purpose=_enum(d, "{purpose}", CredentialPurpose), - read_only=d.get("{read_only}", None), - skip_validation=d.get("{skip_validation}", None), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), + azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), + comment=d.get("comment", None), + databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), + name=d.get("name", None), + purpose=_enum(d, "purpose", CredentialPurpose), + read_only=d.get("read_only", None), + skip_validation=d.get("skip_validation", None), ) @@ -1817,38 +1814,38 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateExternalLocation into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.encryption_details: - body["{encryption_details}"] = self.encryption_details + body["encryption_details"] = self.encryption_details if self.fallback is not None: - body["{fallback}"] = self.fallback + body["fallback"] = self.fallback if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExternalLocation: """Deserializes the CreateExternalLocation from a dictionary.""" return cls( - access_point=d.get("{access_point}", None), - comment=d.get("{comment}", None), - credential_name=d.get("{credential_name}", None), - encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), - fallback=d.get("{fallback}", None), - name=d.get("{name}", None), - read_only=d.get("{read_only}", None), - skip_validation=d.get("{skip_validation}", None), - url=d.get("{url}", None), + access_point=d.get("access_point", None), + comment=d.get("comment", None), + credential_name=d.get("credential_name", None), + encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), + fallback=d.get("fallback", None), + name=d.get("name", None), + read_only=d.get("read_only", None), + skip_validation=d.get("skip_validation", None), + url=d.get("url", None), ) @@ -1970,74 +1967,74 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateFunction into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.data_type is not None: - body["{data_type}"] = self.data_type + body["data_type"] = self.data_type if self.external_language is not None: - body["{external_language}"] = self.external_language + body["external_language"] = self.external_language if self.external_name is not None: - body["{external_name}"] = self.external_name + body["external_name"] = self.external_name if self.full_data_type is not None: - body["{full_data_type}"] = self.full_data_type + body["full_data_type"] = self.full_data_type if self.input_params: - body["{input_params}"] = self.input_params + body["input_params"] = self.input_params if self.is_deterministic is not None: - body["{is_deterministic}"] = self.is_deterministic + body["is_deterministic"] = self.is_deterministic if self.is_null_call is not None: - body["{is_null_call}"] = self.is_null_call + body["is_null_call"] = self.is_null_call if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parameter_style is not None: - body["{parameter_style}"] = self.parameter_style + body["parameter_style"] = self.parameter_style if self.properties is not None: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.return_params: - body["{return_params}"] = self.return_params + body["return_params"] = self.return_params if self.routine_body is not None: - body["{routine_body}"] = self.routine_body + body["routine_body"] = self.routine_body if self.routine_definition is not None: - body["{routine_definition}"] = self.routine_definition + body["routine_definition"] = self.routine_definition if self.routine_dependencies: - body["{routine_dependencies}"] = self.routine_dependencies + body["routine_dependencies"] = self.routine_dependencies if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.security_type is not None: - body["{security_type}"] = self.security_type + body["security_type"] = self.security_type if self.specific_name is not None: - body["{specific_name}"] = self.specific_name + body["specific_name"] = self.specific_name if self.sql_data_access is not None: - body["{sql_data_access}"] = self.sql_data_access + body["sql_data_access"] = self.sql_data_access if self.sql_path is not None: - body["{sql_path}"] = self.sql_path + body["sql_path"] = self.sql_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFunction: """Deserializes the CreateFunction from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - data_type=_enum(d, "{data_type}", ColumnTypeName), - external_language=d.get("{external_language}", None), - external_name=d.get("{external_name}", None), - full_data_type=d.get("{full_data_type}", None), - input_params=_from_dict(d, "{input_params}", FunctionParameterInfos), - is_deterministic=d.get("{is_deterministic}", None), - is_null_call=d.get("{is_null_call}", None), - name=d.get("{name}", None), - parameter_style=_enum(d, "{parameter_style}", CreateFunctionParameterStyle), - properties=d.get("{properties}", None), - return_params=_from_dict(d, "{return_params}", FunctionParameterInfos), - routine_body=_enum(d, "{routine_body}", CreateFunctionRoutineBody), - routine_definition=d.get("{routine_definition}", None), - routine_dependencies=_from_dict(d, "{routine_dependencies}", DependencyList), - schema_name=d.get("{schema_name}", None), - security_type=_enum(d, "{security_type}", CreateFunctionSecurityType), - specific_name=d.get("{specific_name}", None), - sql_data_access=_enum(d, "{sql_data_access}", CreateFunctionSqlDataAccess), - sql_path=d.get("{sql_path}", None), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + data_type=_enum(d, "data_type", ColumnTypeName), + external_language=d.get("external_language", None), + external_name=d.get("external_name", None), + full_data_type=d.get("full_data_type", None), + input_params=_from_dict(d, "input_params", FunctionParameterInfos), + is_deterministic=d.get("is_deterministic", None), + is_null_call=d.get("is_null_call", None), + name=d.get("name", None), + parameter_style=_enum(d, "parameter_style", CreateFunctionParameterStyle), + properties=d.get("properties", None), + return_params=_from_dict(d, "return_params", FunctionParameterInfos), + routine_body=_enum(d, "routine_body", CreateFunctionRoutineBody), + routine_definition=d.get("routine_definition", None), + routine_dependencies=_from_dict(d, "routine_dependencies", DependencyList), + schema_name=d.get("schema_name", None), + security_type=_enum(d, "security_type", CreateFunctionSecurityType), + specific_name=d.get("specific_name", None), + sql_data_access=_enum(d, "sql_data_access", CreateFunctionSqlDataAccess), + sql_path=d.get("sql_path", None), ) @@ -2063,13 +2060,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateFunctionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.function_info: - body["{function_info}"] = self.function_info + body["function_info"] = self.function_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFunctionRequest: """Deserializes the CreateFunctionRequest from a dictionary.""" - return cls(function_info=_from_dict(d, "{function_info}", CreateFunction)) + return cls(function_info=_from_dict(d, "function_info", CreateFunction)) class CreateFunctionRoutineBody(Enum): @@ -2124,19 +2121,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateMetastore: """Deserializes the CreateMetastore from a dictionary.""" - return cls( - name=d.get("{name}", None), region=d.get("{region}", None), storage_root=d.get("{storage_root}", None) - ) + return cls(name=d.get("name", None), region=d.get("region", None), storage_root=d.get("storage_root", None)) @dataclass @@ -2166,20 +2161,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.default_catalog_name is not None: - body["{default_catalog_name}"] = self.default_catalog_name + body["default_catalog_name"] = self.default_catalog_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateMetastoreAssignment: """Deserializes the CreateMetastoreAssignment from a dictionary.""" return cls( - default_catalog_name=d.get("{default_catalog_name}", None), - metastore_id=d.get("{metastore_id}", None), - workspace_id=d.get("{workspace_id}", None), + default_catalog_name=d.get("default_catalog_name", None), + metastore_id=d.get("metastore_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -2270,53 +2265,53 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateMonitor into a shallow dictionary of its immediate attributes.""" body = {} if self.assets_dir is not None: - body["{assets_dir}"] = self.assets_dir + body["assets_dir"] = self.assets_dir if self.baseline_table_name is not None: - body["{baseline_table_name}"] = self.baseline_table_name + body["baseline_table_name"] = self.baseline_table_name if self.custom_metrics: - body["{custom_metrics}"] = self.custom_metrics + body["custom_metrics"] = self.custom_metrics if self.data_classification_config: - body["{data_classification_config}"] = self.data_classification_config + body["data_classification_config"] = self.data_classification_config if self.inference_log: - body["{inference_log}"] = self.inference_log + body["inference_log"] = self.inference_log if self.notifications: - body["{notifications}"] = self.notifications + body["notifications"] = self.notifications if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.schedule: - body["{schedule}"] = self.schedule + body["schedule"] = self.schedule if self.skip_builtin_dashboard is not None: - body["{skip_builtin_dashboard}"] = self.skip_builtin_dashboard + body["skip_builtin_dashboard"] = self.skip_builtin_dashboard if self.slicing_exprs: - body["{slicing_exprs}"] = self.slicing_exprs + body["slicing_exprs"] = self.slicing_exprs if self.snapshot: - body["{snapshot}"] = self.snapshot + body["snapshot"] = self.snapshot if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.time_series: - body["{time_series}"] = self.time_series + body["time_series"] = self.time_series if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateMonitor: """Deserializes the CreateMonitor from a dictionary.""" return cls( - assets_dir=d.get("{assets_dir}", None), - baseline_table_name=d.get("{baseline_table_name}", None), - custom_metrics=_repeated_dict(d, "{custom_metrics}", MonitorMetric), - data_classification_config=_from_dict(d, "{data_classification_config}", MonitorDataClassificationConfig), - inference_log=_from_dict(d, "{inference_log}", MonitorInferenceLog), - notifications=_from_dict(d, "{notifications}", MonitorNotifications), - output_schema_name=d.get("{output_schema_name}", None), - schedule=_from_dict(d, "{schedule}", MonitorCronSchedule), - skip_builtin_dashboard=d.get("{skip_builtin_dashboard}", None), - slicing_exprs=d.get("{slicing_exprs}", None), - snapshot=_from_dict(d, "{snapshot}", MonitorSnapshot), - table_name=d.get("{table_name}", None), - time_series=_from_dict(d, "{time_series}", MonitorTimeSeries), - warehouse_id=d.get("{warehouse_id}", None), + assets_dir=d.get("assets_dir", None), + baseline_table_name=d.get("baseline_table_name", None), + custom_metrics=_repeated_dict(d, "custom_metrics", MonitorMetric), + data_classification_config=_from_dict(d, "data_classification_config", MonitorDataClassificationConfig), + inference_log=_from_dict(d, "inference_log", MonitorInferenceLog), + notifications=_from_dict(d, "notifications", MonitorNotifications), + output_schema_name=d.get("output_schema_name", None), + schedule=_from_dict(d, "schedule", MonitorCronSchedule), + skip_builtin_dashboard=d.get("skip_builtin_dashboard", None), + slicing_exprs=d.get("slicing_exprs", None), + snapshot=_from_dict(d, "snapshot", MonitorSnapshot), + table_name=d.get("table_name", None), + time_series=_from_dict(d, "time_series", MonitorTimeSeries), + warehouse_id=d.get("warehouse_id", None), ) @@ -2356,26 +2351,26 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateRegisteredModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRegisteredModelRequest: """Deserializes the CreateRegisteredModelRequest from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - name=d.get("{name}", None), - schema_name=d.get("{schema_name}", None), - storage_location=d.get("{storage_location}", None), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + name=d.get("name", None), + schema_name=d.get("schema_name", None), + storage_location=d.get("storage_location", None), ) @@ -2433,26 +2428,26 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateSchema: """Deserializes the CreateSchema from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - name=d.get("{name}", None), - properties=d.get("{properties}", None), - storage_root=d.get("{storage_root}", None), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + name=d.get("name", None), + properties=d.get("properties", None), + storage_root=d.get("storage_root", None), ) @@ -2512,40 +2507,40 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal + body["azure_service_principal"] = self.azure_service_principal if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token + body["cloudflare_api_token"] = self.cloudflare_api_token if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateStorageCredential: """Deserializes the CreateStorageCredential from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleRequest), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityRequest), - azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), - comment=d.get("{comment}", None), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleRequest), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityRequest), + azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), + comment=d.get("comment", None), databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountRequest + d, "databricks_gcp_service_account", DatabricksGcpServiceAccountRequest ), - name=d.get("{name}", None), - read_only=d.get("{read_only}", None), - skip_validation=d.get("{skip_validation}", None), + name=d.get("name", None), + read_only=d.get("read_only", None), + skip_validation=d.get("skip_validation", None), ) @@ -2571,17 +2566,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateTableConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.constraint: - body["{constraint}"] = self.constraint + body["constraint"] = self.constraint if self.full_name_arg is not None: - body["{full_name_arg}"] = self.full_name_arg + body["full_name_arg"] = self.full_name_arg return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTableConstraint: """Deserializes the CreateTableConstraint from a dictionary.""" - return cls( - constraint=_from_dict(d, "{constraint}", TableConstraint), full_name_arg=d.get("{full_name_arg}", None) - ) + return cls(constraint=_from_dict(d, "constraint", TableConstraint), full_name_arg=d.get("full_name_arg", None)) @dataclass @@ -2629,29 +2622,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateVolumeRequestContent into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.volume_type is not None: - body["{volume_type}"] = self.volume_type + body["volume_type"] = self.volume_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVolumeRequestContent: """Deserializes the CreateVolumeRequestContent from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - name=d.get("{name}", None), - schema_name=d.get("{schema_name}", None), - storage_location=d.get("{storage_location}", None), - volume_type=_enum(d, "{volume_type}", VolumeType), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + name=d.get("name", None), + schema_name=d.get("schema_name", None), + storage_location=d.get("storage_location", None), + volume_type=_enum(d, "volume_type", VolumeType), ) @@ -2759,67 +2752,65 @@ def as_shallow_dict(self) -> dict: """Serializes the CredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal + body["azure_service_principal"] = self.azure_service_principal if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.purpose is not None: - body["{purpose}"] = self.purpose + body["purpose"] = self.purpose if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.used_for_managed_storage is not None: - body["{used_for_managed_storage}"] = self.used_for_managed_storage + body["used_for_managed_storage"] = self.used_for_managed_storage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CredentialInfo: """Deserializes the CredentialInfo from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), - azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount - ), - full_name=d.get("{full_name}", None), - id=d.get("{id}", None), - isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - purpose=_enum(d, "{purpose}", CredentialPurpose), - read_only=d.get("{read_only}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - used_for_managed_storage=d.get("{used_for_managed_storage}", None), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), + azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), + full_name=d.get("full_name", None), + id=d.get("id", None), + isolation_mode=_enum(d, "isolation_mode", IsolationMode), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + purpose=_enum(d, "purpose", CredentialPurpose), + read_only=d.get("read_only", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + used_for_managed_storage=d.get("used_for_managed_storage", None), ) @@ -2857,15 +2848,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CredentialValidationResult into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.result is not None: - body["{result}"] = self.result + body["result"] = self.result return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CredentialValidationResult: """Deserializes the CredentialValidationResult from a dictionary.""" - return cls(message=d.get("{message}", None), result=_enum(d, "{result}", ValidateCredentialResult)) + return cls(message=d.get("message", None), result=_enum(d, "result", ValidateCredentialResult)) @dataclass @@ -2886,13 +2877,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CurrentWorkspaceBindings into a shallow dictionary of its immediate attributes.""" body = {} if self.workspaces: - body["{workspaces}"] = self.workspaces + body["workspaces"] = self.workspaces return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CurrentWorkspaceBindings: """Deserializes the CurrentWorkspaceBindings from a dictionary.""" - return cls(workspaces=d.get("{workspaces}", None)) + return cls(workspaces=d.get("workspaces", None)) class DataSourceFormat(Enum): @@ -2953,20 +2944,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccount into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email if self.private_key_id is not None: - body["{private_key_id}"] = self.private_key_id + body["private_key_id"] = self.private_key_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatabricksGcpServiceAccount: """Deserializes the DatabricksGcpServiceAccount from a dictionary.""" return cls( - credential_id=d.get("{credential_id}", None), - email=d.get("{email}", None), - private_key_id=d.get("{private_key_id}", None), + credential_id=d.get("credential_id", None), + email=d.get("email", None), + private_key_id=d.get("private_key_id", None), ) @@ -3009,15 +3000,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DatabricksGcpServiceAccountResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatabricksGcpServiceAccountResponse: """Deserializes the DatabricksGcpServiceAccountResponse from a dictionary.""" - return cls(credential_id=d.get("{credential_id}", None), email=d.get("{email}", None)) + return cls(credential_id=d.get("credential_id", None), email=d.get("email", None)) @dataclass @@ -3093,13 +3084,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaRuntimePropertiesKvPairs into a shallow dictionary of its immediate attributes.""" body = {} if self.delta_runtime_properties: - body["{delta_runtime_properties}"] = self.delta_runtime_properties + body["delta_runtime_properties"] = self.delta_runtime_properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaRuntimePropertiesKvPairs: """Deserializes the DeltaRuntimePropertiesKvPairs from a dictionary.""" - return cls(delta_runtime_properties=d.get("{delta_runtime_properties}", None)) + return cls(delta_runtime_properties=d.get("delta_runtime_properties", None)) @dataclass @@ -3126,16 +3117,16 @@ def as_shallow_dict(self) -> dict: """Serializes the Dependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function: - body["{function}"] = self.function + body["function"] = self.function if self.table: - body["{table}"] = self.table + body["table"] = self.table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dependency: """Deserializes the Dependency from a dictionary.""" return cls( - function=_from_dict(d, "{function}", FunctionDependency), table=_from_dict(d, "{table}", TableDependency) + function=_from_dict(d, "function", FunctionDependency), table=_from_dict(d, "table", TableDependency) ) @@ -3157,13 +3148,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DependencyList into a shallow dictionary of its immediate attributes.""" body = {} if self.dependencies: - body["{dependencies}"] = self.dependencies + body["dependencies"] = self.dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DependencyList: """Deserializes the DependencyList from a dictionary.""" - return cls(dependencies=_repeated_dict(d, "{dependencies}", Dependency)) + return cls(dependencies=_repeated_dict(d, "dependencies", Dependency)) @dataclass @@ -3200,13 +3191,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EffectivePermissionsList into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = self.privilege_assignments + body["privilege_assignments"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePermissionsList: """Deserializes the EffectivePermissionsList from a dictionary.""" - return cls(privilege_assignments=_repeated_dict(d, "{privilege_assignments}", EffectivePrivilegeAssignment)) + return cls(privilege_assignments=_repeated_dict(d, "privilege_assignments", EffectivePrivilegeAssignment)) @dataclass @@ -3237,20 +3228,20 @@ def as_shallow_dict(self) -> dict: """Serializes the EffectivePredictiveOptimizationFlag into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited_from_name is not None: - body["{inherited_from_name}"] = self.inherited_from_name + body["inherited_from_name"] = self.inherited_from_name if self.inherited_from_type is not None: - body["{inherited_from_type}"] = self.inherited_from_type + body["inherited_from_type"] = self.inherited_from_type if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePredictiveOptimizationFlag: """Deserializes the EffectivePredictiveOptimizationFlag from a dictionary.""" return cls( - inherited_from_name=d.get("{inherited_from_name}", None), - inherited_from_type=_enum(d, "{inherited_from_type}", EffectivePredictiveOptimizationFlagInheritedFromType), - value=_enum(d, "{value}", EnablePredictiveOptimization), + inherited_from_name=d.get("inherited_from_name", None), + inherited_from_type=_enum(d, "inherited_from_type", EffectivePredictiveOptimizationFlagInheritedFromType), + value=_enum(d, "value", EnablePredictiveOptimization), ) @@ -3290,20 +3281,20 @@ def as_shallow_dict(self) -> dict: """Serializes the EffectivePrivilege into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited_from_name is not None: - body["{inherited_from_name}"] = self.inherited_from_name + body["inherited_from_name"] = self.inherited_from_name if self.inherited_from_type is not None: - body["{inherited_from_type}"] = self.inherited_from_type + body["inherited_from_type"] = self.inherited_from_type if self.privilege is not None: - body["{privilege}"] = self.privilege + body["privilege"] = self.privilege return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePrivilege: """Deserializes the EffectivePrivilege from a dictionary.""" return cls( - inherited_from_name=d.get("{inherited_from_name}", None), - inherited_from_type=_enum(d, "{inherited_from_type}", SecurableType), - privilege=_enum(d, "{privilege}", Privilege), + inherited_from_name=d.get("inherited_from_name", None), + inherited_from_type=_enum(d, "inherited_from_type", SecurableType), + privilege=_enum(d, "privilege", Privilege), ) @@ -3328,17 +3319,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EffectivePrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.privileges: - body["{privileges}"] = self.privileges + body["privileges"] = self.privileges return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EffectivePrivilegeAssignment: """Deserializes the EffectivePrivilegeAssignment from a dictionary.""" - return cls( - principal=d.get("{principal}", None), privileges=_repeated_dict(d, "{privileges}", EffectivePrivilege) - ) + return cls(principal=d.get("principal", None), privileges=_repeated_dict(d, "privileges", EffectivePrivilege)) class EnablePredictiveOptimization(Enum): @@ -3385,13 +3374,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EncryptionDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.sse_encryption_details: - body["{sse_encryption_details}"] = self.sse_encryption_details + body["sse_encryption_details"] = self.sse_encryption_details return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EncryptionDetails: """Deserializes the EncryptionDetails from a dictionary.""" - return cls(sse_encryption_details=_from_dict(d, "{sse_encryption_details}", SseEncryptionDetails)) + return cls(sse_encryption_details=_from_dict(d, "sse_encryption_details", SseEncryptionDetails)) @dataclass @@ -3492,62 +3481,62 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalLocationInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.encryption_details: - body["{encryption_details}"] = self.encryption_details + body["encryption_details"] = self.encryption_details if self.fallback is not None: - body["{fallback}"] = self.fallback + body["fallback"] = self.fallback if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalLocationInfo: """Deserializes the ExternalLocationInfo from a dictionary.""" return cls( - access_point=d.get("{access_point}", None), - browse_only=d.get("{browse_only}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - credential_id=d.get("{credential_id}", None), - credential_name=d.get("{credential_name}", None), - encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), - fallback=d.get("{fallback}", None), - isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - read_only=d.get("{read_only}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - url=d.get("{url}", None), + access_point=d.get("access_point", None), + browse_only=d.get("browse_only", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + credential_id=d.get("credential_id", None), + credential_name=d.get("credential_name", None), + encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), + fallback=d.get("fallback", None), + isolation_mode=_enum(d, "isolation_mode", IsolationMode), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + read_only=d.get("read_only", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + url=d.get("url", None), ) @@ -3578,17 +3567,17 @@ def as_shallow_dict(self) -> dict: """Serializes the FailedStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_processed_commit_version is not None: - body["{last_processed_commit_version}"] = self.last_processed_commit_version + body["last_processed_commit_version"] = self.last_processed_commit_version if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FailedStatus: """Deserializes the FailedStatus from a dictionary.""" return cls( - last_processed_commit_version=d.get("{last_processed_commit_version}", None), - timestamp=d.get("{timestamp}", None), + last_processed_commit_version=d.get("last_processed_commit_version", None), + timestamp=d.get("timestamp", None), ) @@ -3623,23 +3612,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ForeignKeyConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.child_columns: - body["{child_columns}"] = self.child_columns + body["child_columns"] = self.child_columns if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parent_columns: - body["{parent_columns}"] = self.parent_columns + body["parent_columns"] = self.parent_columns if self.parent_table is not None: - body["{parent_table}"] = self.parent_table + body["parent_table"] = self.parent_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForeignKeyConstraint: """Deserializes the ForeignKeyConstraint from a dictionary.""" return cls( - child_columns=d.get("{child_columns}", None), - name=d.get("{name}", None), - parent_columns=d.get("{parent_columns}", None), - parent_table=d.get("{parent_table}", None), + child_columns=d.get("child_columns", None), + name=d.get("name", None), + parent_columns=d.get("parent_columns", None), + parent_table=d.get("parent_table", None), ) @@ -3662,13 +3651,13 @@ def as_shallow_dict(self) -> dict: """Serializes the FunctionDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function_full_name is not None: - body["{function_full_name}"] = self.function_full_name + body["function_full_name"] = self.function_full_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionDependency: """Deserializes the FunctionDependency from a dictionary.""" - return cls(function_full_name=d.get("{function_full_name}", None)) + return cls(function_full_name=d.get("function_full_name", None)) @dataclass @@ -3835,101 +3824,101 @@ def as_shallow_dict(self) -> dict: """Serializes the FunctionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_type is not None: - body["{data_type}"] = self.data_type + body["data_type"] = self.data_type if self.external_language is not None: - body["{external_language}"] = self.external_language + body["external_language"] = self.external_language if self.external_name is not None: - body["{external_name}"] = self.external_name + body["external_name"] = self.external_name if self.full_data_type is not None: - body["{full_data_type}"] = self.full_data_type + body["full_data_type"] = self.full_data_type if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.function_id is not None: - body["{function_id}"] = self.function_id + body["function_id"] = self.function_id if self.input_params: - body["{input_params}"] = self.input_params + body["input_params"] = self.input_params if self.is_deterministic is not None: - body["{is_deterministic}"] = self.is_deterministic + body["is_deterministic"] = self.is_deterministic if self.is_null_call is not None: - body["{is_null_call}"] = self.is_null_call + body["is_null_call"] = self.is_null_call if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.parameter_style is not None: - body["{parameter_style}"] = self.parameter_style + body["parameter_style"] = self.parameter_style if self.properties is not None: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.return_params: - body["{return_params}"] = self.return_params + body["return_params"] = self.return_params if self.routine_body is not None: - body["{routine_body}"] = self.routine_body + body["routine_body"] = self.routine_body if self.routine_definition is not None: - body["{routine_definition}"] = self.routine_definition + body["routine_definition"] = self.routine_definition if self.routine_dependencies: - body["{routine_dependencies}"] = self.routine_dependencies + body["routine_dependencies"] = self.routine_dependencies if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.security_type is not None: - body["{security_type}"] = self.security_type + body["security_type"] = self.security_type if self.specific_name is not None: - body["{specific_name}"] = self.specific_name + body["specific_name"] = self.specific_name if self.sql_data_access is not None: - body["{sql_data_access}"] = self.sql_data_access + body["sql_data_access"] = self.sql_data_access if self.sql_path is not None: - body["{sql_path}"] = self.sql_path + body["sql_path"] = self.sql_path if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionInfo: """Deserializes the FunctionInfo from a dictionary.""" return cls( - browse_only=d.get("{browse_only}", None), - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - data_type=_enum(d, "{data_type}", ColumnTypeName), - external_language=d.get("{external_language}", None), - external_name=d.get("{external_name}", None), - full_data_type=d.get("{full_data_type}", None), - full_name=d.get("{full_name}", None), - function_id=d.get("{function_id}", None), - input_params=_from_dict(d, "{input_params}", FunctionParameterInfos), - is_deterministic=d.get("{is_deterministic}", None), - is_null_call=d.get("{is_null_call}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - parameter_style=_enum(d, "{parameter_style}", FunctionInfoParameterStyle), - properties=d.get("{properties}", None), - return_params=_from_dict(d, "{return_params}", FunctionParameterInfos), - routine_body=_enum(d, "{routine_body}", FunctionInfoRoutineBody), - routine_definition=d.get("{routine_definition}", None), - routine_dependencies=_from_dict(d, "{routine_dependencies}", DependencyList), - schema_name=d.get("{schema_name}", None), - security_type=_enum(d, "{security_type}", FunctionInfoSecurityType), - specific_name=d.get("{specific_name}", None), - sql_data_access=_enum(d, "{sql_data_access}", FunctionInfoSqlDataAccess), - sql_path=d.get("{sql_path}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + browse_only=d.get("browse_only", None), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + data_type=_enum(d, "data_type", ColumnTypeName), + external_language=d.get("external_language", None), + external_name=d.get("external_name", None), + full_data_type=d.get("full_data_type", None), + full_name=d.get("full_name", None), + function_id=d.get("function_id", None), + input_params=_from_dict(d, "input_params", FunctionParameterInfos), + is_deterministic=d.get("is_deterministic", None), + is_null_call=d.get("is_null_call", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + parameter_style=_enum(d, "parameter_style", FunctionInfoParameterStyle), + properties=d.get("properties", None), + return_params=_from_dict(d, "return_params", FunctionParameterInfos), + routine_body=_enum(d, "routine_body", FunctionInfoRoutineBody), + routine_definition=d.get("routine_definition", None), + routine_dependencies=_from_dict(d, "routine_dependencies", DependencyList), + schema_name=d.get("schema_name", None), + security_type=_enum(d, "security_type", FunctionInfoSecurityType), + specific_name=d.get("specific_name", None), + sql_data_access=_enum(d, "sql_data_access", FunctionInfoSqlDataAccess), + sql_path=d.get("sql_path", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -4033,47 +4022,47 @@ def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parameter_default is not None: - body["{parameter_default}"] = self.parameter_default + body["parameter_default"] = self.parameter_default if self.parameter_mode is not None: - body["{parameter_mode}"] = self.parameter_mode + body["parameter_mode"] = self.parameter_mode if self.parameter_type is not None: - body["{parameter_type}"] = self.parameter_type + body["parameter_type"] = self.parameter_type if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name + body["type_name"] = self.type_name if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfo: """Deserializes the FunctionParameterInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - name=d.get("{name}", None), - parameter_default=d.get("{parameter_default}", None), - parameter_mode=_enum(d, "{parameter_mode}", FunctionParameterMode), - parameter_type=_enum(d, "{parameter_type}", FunctionParameterType), - position=d.get("{position}", None), - type_interval_type=d.get("{type_interval_type}", None), - type_json=d.get("{type_json}", None), - type_name=_enum(d, "{type_name}", ColumnTypeName), - type_precision=d.get("{type_precision}", None), - type_scale=d.get("{type_scale}", None), - type_text=d.get("{type_text}", None), + comment=d.get("comment", None), + name=d.get("name", None), + parameter_default=d.get("parameter_default", None), + parameter_mode=_enum(d, "parameter_mode", FunctionParameterMode), + parameter_type=_enum(d, "parameter_type", FunctionParameterType), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_json=d.get("type_json", None), + type_name=_enum(d, "type_name", ColumnTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), ) @@ -4093,13 +4082,13 @@ def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfos into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfos: """Deserializes the FunctionParameterInfos from a dictionary.""" - return cls(parameters=_repeated_dict(d, "{parameters}", FunctionParameterInfo)) + return cls(parameters=_repeated_dict(d, "parameters", FunctionParameterInfo)) class FunctionParameterMode(Enum): @@ -4133,13 +4122,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GcpOauthToken into a shallow dictionary of its immediate attributes.""" body = {} if self.oauth_token is not None: - body["{oauth_token}"] = self.oauth_token + body["oauth_token"] = self.oauth_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpOauthToken: """Deserializes the GcpOauthToken from a dictionary.""" - return cls(oauth_token=d.get("{oauth_token}", None)) + return cls(oauth_token=d.get("oauth_token", None)) @dataclass @@ -4162,13 +4151,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialAzureOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.resources: - body["{resources}"] = self.resources + body["resources"] = self.resources return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryServiceCredentialAzureOptions: """Deserializes the GenerateTemporaryServiceCredentialAzureOptions from a dictionary.""" - return cls(resources=d.get("{resources}", None)) + return cls(resources=d.get("resources", None)) @dataclass @@ -4191,13 +4180,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialGcpOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryServiceCredentialGcpOptions: """Deserializes the GenerateTemporaryServiceCredentialGcpOptions from a dictionary.""" - return cls(scopes=d.get("{scopes}", None)) + return cls(scopes=d.get("scopes", None)) @dataclass @@ -4226,20 +4215,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryServiceCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.azure_options: - body["{azure_options}"] = self.azure_options + body["azure_options"] = self.azure_options if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.gcp_options: - body["{gcp_options}"] = self.gcp_options + body["gcp_options"] = self.gcp_options return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryServiceCredentialRequest: """Deserializes the GenerateTemporaryServiceCredentialRequest from a dictionary.""" return cls( - azure_options=_from_dict(d, "{azure_options}", GenerateTemporaryServiceCredentialAzureOptions), - credential_name=d.get("{credential_name}", None), - gcp_options=_from_dict(d, "{gcp_options}", GenerateTemporaryServiceCredentialGcpOptions), + azure_options=_from_dict(d, "azure_options", GenerateTemporaryServiceCredentialAzureOptions), + credential_name=d.get("credential_name", None), + gcp_options=_from_dict(d, "gcp_options", GenerateTemporaryServiceCredentialGcpOptions), ) @@ -4266,15 +4255,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.operation is not None: - body["{operation}"] = self.operation + body["operation"] = self.operation if self.table_id is not None: - body["{table_id}"] = self.table_id + body["table_id"] = self.table_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryTableCredentialRequest: """Deserializes the GenerateTemporaryTableCredentialRequest from a dictionary.""" - return cls(operation=_enum(d, "{operation}", TableOperation), table_id=d.get("{table_id}", None)) + return cls(operation=_enum(d, "operation", TableOperation), table_id=d.get("table_id", None)) @dataclass @@ -4330,32 +4319,32 @@ def as_shallow_dict(self) -> dict: """Serializes the GenerateTemporaryTableCredentialResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_temp_credentials: - body["{aws_temp_credentials}"] = self.aws_temp_credentials + body["aws_temp_credentials"] = self.aws_temp_credentials if self.azure_aad: - body["{azure_aad}"] = self.azure_aad + body["azure_aad"] = self.azure_aad if self.azure_user_delegation_sas: - body["{azure_user_delegation_sas}"] = self.azure_user_delegation_sas + body["azure_user_delegation_sas"] = self.azure_user_delegation_sas if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.gcp_oauth_token: - body["{gcp_oauth_token}"] = self.gcp_oauth_token + body["gcp_oauth_token"] = self.gcp_oauth_token if self.r2_temp_credentials: - body["{r2_temp_credentials}"] = self.r2_temp_credentials + body["r2_temp_credentials"] = self.r2_temp_credentials if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenerateTemporaryTableCredentialResponse: """Deserializes the GenerateTemporaryTableCredentialResponse from a dictionary.""" return cls( - aws_temp_credentials=_from_dict(d, "{aws_temp_credentials}", AwsCredentials), - azure_aad=_from_dict(d, "{azure_aad}", AzureActiveDirectoryToken), - azure_user_delegation_sas=_from_dict(d, "{azure_user_delegation_sas}", AzureUserDelegationSas), - expiration_time=d.get("{expiration_time}", None), - gcp_oauth_token=_from_dict(d, "{gcp_oauth_token}", GcpOauthToken), - r2_temp_credentials=_from_dict(d, "{r2_temp_credentials}", R2Credentials), - url=d.get("{url}", None), + aws_temp_credentials=_from_dict(d, "aws_temp_credentials", AwsCredentials), + azure_aad=_from_dict(d, "azure_aad", AzureActiveDirectoryToken), + azure_user_delegation_sas=_from_dict(d, "azure_user_delegation_sas", AzureUserDelegationSas), + expiration_time=d.get("expiration_time", None), + gcp_oauth_token=_from_dict(d, "gcp_oauth_token", GcpOauthToken), + r2_temp_credentials=_from_dict(d, "r2_temp_credentials", R2Credentials), + url=d.get("url", None), ) @@ -4476,72 +4465,72 @@ def as_shallow_dict(self) -> dict: """Serializes the GetMetastoreSummaryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.default_data_access_config_id is not None: - body["{default_data_access_config_id}"] = self.default_data_access_config_id + body["default_data_access_config_id"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name + body["delta_sharing_organization_name"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( + body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["{delta_sharing_scope}"] = self.delta_sharing_scope + body["delta_sharing_scope"] = self.delta_sharing_scope if self.external_access_enabled is not None: - body["{external_access_enabled}"] = self.external_access_enabled + body["external_access_enabled"] = self.external_access_enabled if self.global_metastore_id is not None: - body["{global_metastore_id}"] = self.global_metastore_id + body["global_metastore_id"] = self.global_metastore_id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.privilege_model_version is not None: - body["{privilege_model_version}"] = self.privilege_model_version + body["privilege_model_version"] = self.privilege_model_version if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.storage_root_credential_id is not None: - body["{storage_root_credential_id}"] = self.storage_root_credential_id + body["storage_root_credential_id"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["{storage_root_credential_name}"] = self.storage_root_credential_name + body["storage_root_credential_name"] = self.storage_root_credential_name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetMetastoreSummaryResponse: """Deserializes the GetMetastoreSummaryResponse from a dictionary.""" return cls( - cloud=d.get("{cloud}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - default_data_access_config_id=d.get("{default_data_access_config_id}", None), - delta_sharing_organization_name=d.get("{delta_sharing_organization_name}", None), + cloud=d.get("cloud", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + default_data_access_config_id=d.get("default_data_access_config_id", None), + delta_sharing_organization_name=d.get("delta_sharing_organization_name", None), delta_sharing_recipient_token_lifetime_in_seconds=d.get( - "{delta_sharing_recipient_token_lifetime_in_seconds}", None + "delta_sharing_recipient_token_lifetime_in_seconds", None ), - delta_sharing_scope=_enum(d, "{delta_sharing_scope}", GetMetastoreSummaryResponseDeltaSharingScope), - external_access_enabled=d.get("{external_access_enabled}", None), - global_metastore_id=d.get("{global_metastore_id}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - privilege_model_version=d.get("{privilege_model_version}", None), - region=d.get("{region}", None), - storage_root=d.get("{storage_root}", None), - storage_root_credential_id=d.get("{storage_root_credential_id}", None), - storage_root_credential_name=d.get("{storage_root_credential_name}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + delta_sharing_scope=_enum(d, "delta_sharing_scope", GetMetastoreSummaryResponseDeltaSharingScope), + external_access_enabled=d.get("external_access_enabled", None), + global_metastore_id=d.get("global_metastore_id", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + privilege_model_version=d.get("privilege_model_version", None), + region=d.get("region", None), + storage_root=d.get("storage_root", None), + storage_root_credential_id=d.get("storage_root_credential_id", None), + storage_root_credential_name=d.get("storage_root_credential_name", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -4568,13 +4557,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetQuotaResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.quota_info: - body["{quota_info}"] = self.quota_info + body["quota_info"] = self.quota_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetQuotaResponse: """Deserializes the GetQuotaResponse from a dictionary.""" - return cls(quota_info=_from_dict(d, "{quota_info}", QuotaInfo)) + return cls(quota_info=_from_dict(d, "quota_info", QuotaInfo)) class IsolationMode(Enum): @@ -4600,13 +4589,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAccountMetastoreAssignmentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.workspace_ids: - body["{workspace_ids}"] = self.workspace_ids + body["workspace_ids"] = self.workspace_ids return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAccountMetastoreAssignmentsResponse: """Deserializes the ListAccountMetastoreAssignmentsResponse from a dictionary.""" - return cls(workspace_ids=d.get("{workspace_ids}", None)) + return cls(workspace_ids=d.get("workspace_ids", None)) @dataclass @@ -4625,13 +4614,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAccountStorageCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.storage_credentials: - body["{storage_credentials}"] = self.storage_credentials + body["storage_credentials"] = self.storage_credentials return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAccountStorageCredentialsResponse: """Deserializes the ListAccountStorageCredentialsResponse from a dictionary.""" - return cls(storage_credentials=_repeated_dict(d, "{storage_credentials}", StorageCredentialInfo)) + return cls(storage_credentials=_repeated_dict(d, "storage_credentials", StorageCredentialInfo)) @dataclass @@ -4656,17 +4645,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListCatalogsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.catalogs: - body["{catalogs}"] = self.catalogs + body["catalogs"] = self.catalogs if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCatalogsResponse: """Deserializes the ListCatalogsResponse from a dictionary.""" - return cls( - catalogs=_repeated_dict(d, "{catalogs}", CatalogInfo), next_page_token=d.get("{next_page_token}", None) - ) + return cls(catalogs=_repeated_dict(d, "catalogs", CatalogInfo), next_page_token=d.get("next_page_token", None)) @dataclass @@ -4691,17 +4678,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListConnectionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.connections: - body["{connections}"] = self.connections + body["connections"] = self.connections if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListConnectionsResponse: """Deserializes the ListConnectionsResponse from a dictionary.""" return cls( - connections=_repeated_dict(d, "{connections}", ConnectionInfo), - next_page_token=d.get("{next_page_token}", None), + connections=_repeated_dict(d, "connections", ConnectionInfo), next_page_token=d.get("next_page_token", None) ) @@ -4726,17 +4712,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credentials: - body["{credentials}"] = self.credentials + body["credentials"] = self.credentials if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCredentialsResponse: """Deserializes the ListCredentialsResponse from a dictionary.""" return cls( - credentials=_repeated_dict(d, "{credentials}", CredentialInfo), - next_page_token=d.get("{next_page_token}", None), + credentials=_repeated_dict(d, "credentials", CredentialInfo), next_page_token=d.get("next_page_token", None) ) @@ -4762,17 +4747,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListExternalLocationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.external_locations: - body["{external_locations}"] = self.external_locations + body["external_locations"] = self.external_locations if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExternalLocationsResponse: """Deserializes the ListExternalLocationsResponse from a dictionary.""" return cls( - external_locations=_repeated_dict(d, "{external_locations}", ExternalLocationInfo), - next_page_token=d.get("{next_page_token}", None), + external_locations=_repeated_dict(d, "external_locations", ExternalLocationInfo), + next_page_token=d.get("next_page_token", None), ) @@ -4798,16 +4783,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListFunctionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.functions: - body["{functions}"] = self.functions + body["functions"] = self.functions if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFunctionsResponse: """Deserializes the ListFunctionsResponse from a dictionary.""" return cls( - functions=_repeated_dict(d, "{functions}", FunctionInfo), next_page_token=d.get("{next_page_token}", None) + functions=_repeated_dict(d, "functions", FunctionInfo), next_page_token=d.get("next_page_token", None) ) @@ -4827,13 +4812,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListMetastoresResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.metastores: - body["{metastores}"] = self.metastores + body["metastores"] = self.metastores return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListMetastoresResponse: """Deserializes the ListMetastoresResponse from a dictionary.""" - return cls(metastores=_repeated_dict(d, "{metastores}", MetastoreInfo)) + return cls(metastores=_repeated_dict(d, "metastores", MetastoreInfo)) @dataclass @@ -4857,17 +4842,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListModelVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_versions: - body["{model_versions}"] = self.model_versions + body["model_versions"] = self.model_versions if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListModelVersionsResponse: """Deserializes the ListModelVersionsResponse from a dictionary.""" return cls( - model_versions=_repeated_dict(d, "{model_versions}", ModelVersionInfo), - next_page_token=d.get("{next_page_token}", None), + model_versions=_repeated_dict(d, "model_versions", ModelVersionInfo), + next_page_token=d.get("next_page_token", None), ) @@ -4893,15 +4878,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListQuotasResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.quotas: - body["{quotas}"] = self.quotas + body["quotas"] = self.quotas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQuotasResponse: """Deserializes the ListQuotasResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), quotas=_repeated_dict(d, "{quotas}", QuotaInfo)) + return cls(next_page_token=d.get("next_page_token", None), quotas=_repeated_dict(d, "quotas", QuotaInfo)) @dataclass @@ -4925,17 +4910,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListRegisteredModelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.registered_models: - body["{registered_models}"] = self.registered_models + body["registered_models"] = self.registered_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListRegisteredModelsResponse: """Deserializes the ListRegisteredModelsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - registered_models=_repeated_dict(d, "{registered_models}", RegisteredModelInfo), + next_page_token=d.get("next_page_token", None), + registered_models=_repeated_dict(d, "registered_models", RegisteredModelInfo), ) @@ -4961,15 +4946,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListSchemasResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSchemasResponse: """Deserializes the ListSchemasResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), schemas=_repeated_dict(d, "{schemas}", SchemaInfo)) + return cls(next_page_token=d.get("next_page_token", None), schemas=_repeated_dict(d, "schemas", SchemaInfo)) @dataclass @@ -4993,17 +4978,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListStorageCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.storage_credentials: - body["{storage_credentials}"] = self.storage_credentials + body["storage_credentials"] = self.storage_credentials return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListStorageCredentialsResponse: """Deserializes the ListStorageCredentialsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - storage_credentials=_repeated_dict(d, "{storage_credentials}", StorageCredentialInfo), + next_page_token=d.get("next_page_token", None), + storage_credentials=_repeated_dict(d, "storage_credentials", StorageCredentialInfo), ) @@ -5029,16 +5014,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListSystemSchemasResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSystemSchemasResponse: """Deserializes the ListSystemSchemasResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), schemas=_repeated_dict(d, "{schemas}", SystemSchemaInfo) + next_page_token=d.get("next_page_token", None), schemas=_repeated_dict(d, "schemas", SystemSchemaInfo) ) @@ -5064,15 +5049,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListTableSummariesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.tables: - body["{tables}"] = self.tables + body["tables"] = self.tables return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTableSummariesResponse: """Deserializes the ListTableSummariesResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), tables=_repeated_dict(d, "{tables}", TableSummary)) + return cls(next_page_token=d.get("next_page_token", None), tables=_repeated_dict(d, "tables", TableSummary)) @dataclass @@ -5097,15 +5082,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListTablesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.tables: - body["{tables}"] = self.tables + body["tables"] = self.tables return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTablesResponse: """Deserializes the ListTablesResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), tables=_repeated_dict(d, "{tables}", TableInfo)) + return cls(next_page_token=d.get("next_page_token", None), tables=_repeated_dict(d, "tables", TableInfo)) @dataclass @@ -5130,15 +5115,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListVolumesResponseContent into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.volumes: - body["{volumes}"] = self.volumes + body["volumes"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListVolumesResponseContent: """Deserializes the ListVolumesResponseContent from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), volumes=_repeated_dict(d, "{volumes}", VolumeInfo)) + return cls(next_page_token=d.get("next_page_token", None), volumes=_repeated_dict(d, "volumes", VolumeInfo)) class MatchType(Enum): @@ -5173,20 +5158,20 @@ def as_shallow_dict(self) -> dict: """Serializes the MetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.default_catalog_name is not None: - body["{default_catalog_name}"] = self.default_catalog_name + body["default_catalog_name"] = self.default_catalog_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MetastoreAssignment: """Deserializes the MetastoreAssignment from a dictionary.""" return cls( - default_catalog_name=d.get("{default_catalog_name}", None), - metastore_id=d.get("{metastore_id}", None), - workspace_id=d.get("{workspace_id}", None), + default_catalog_name=d.get("default_catalog_name", None), + metastore_id=d.get("metastore_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -5299,72 +5284,72 @@ def as_shallow_dict(self) -> dict: """Serializes the MetastoreInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.default_data_access_config_id is not None: - body["{default_data_access_config_id}"] = self.default_data_access_config_id + body["default_data_access_config_id"] = self.default_data_access_config_id if self.delta_sharing_organization_name is not None: - body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name + body["delta_sharing_organization_name"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( + body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["{delta_sharing_scope}"] = self.delta_sharing_scope + body["delta_sharing_scope"] = self.delta_sharing_scope if self.external_access_enabled is not None: - body["{external_access_enabled}"] = self.external_access_enabled + body["external_access_enabled"] = self.external_access_enabled if self.global_metastore_id is not None: - body["{global_metastore_id}"] = self.global_metastore_id + body["global_metastore_id"] = self.global_metastore_id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.privilege_model_version is not None: - body["{privilege_model_version}"] = self.privilege_model_version + body["privilege_model_version"] = self.privilege_model_version if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.storage_root_credential_id is not None: - body["{storage_root_credential_id}"] = self.storage_root_credential_id + body["storage_root_credential_id"] = self.storage_root_credential_id if self.storage_root_credential_name is not None: - body["{storage_root_credential_name}"] = self.storage_root_credential_name + body["storage_root_credential_name"] = self.storage_root_credential_name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MetastoreInfo: """Deserializes the MetastoreInfo from a dictionary.""" return cls( - cloud=d.get("{cloud}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - default_data_access_config_id=d.get("{default_data_access_config_id}", None), - delta_sharing_organization_name=d.get("{delta_sharing_organization_name}", None), + cloud=d.get("cloud", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + default_data_access_config_id=d.get("default_data_access_config_id", None), + delta_sharing_organization_name=d.get("delta_sharing_organization_name", None), delta_sharing_recipient_token_lifetime_in_seconds=d.get( - "{delta_sharing_recipient_token_lifetime_in_seconds}", None + "delta_sharing_recipient_token_lifetime_in_seconds", None ), - delta_sharing_scope=_enum(d, "{delta_sharing_scope}", MetastoreInfoDeltaSharingScope), - external_access_enabled=d.get("{external_access_enabled}", None), - global_metastore_id=d.get("{global_metastore_id}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - privilege_model_version=d.get("{privilege_model_version}", None), - region=d.get("{region}", None), - storage_root=d.get("{storage_root}", None), - storage_root_credential_id=d.get("{storage_root_credential_id}", None), - storage_root_credential_name=d.get("{storage_root_credential_name}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + delta_sharing_scope=_enum(d, "delta_sharing_scope", MetastoreInfoDeltaSharingScope), + external_access_enabled=d.get("external_access_enabled", None), + global_metastore_id=d.get("global_metastore_id", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + privilege_model_version=d.get("privilege_model_version", None), + region=d.get("region", None), + storage_root=d.get("storage_root", None), + storage_root_credential_id=d.get("storage_root_credential_id", None), + storage_root_credential_name=d.get("storage_root_credential_name", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -5484,68 +5469,68 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelVersionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aliases: - body["{aliases}"] = self.aliases + body["aliases"] = self.aliases if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version_dependencies: - body["{model_version_dependencies}"] = self.model_version_dependencies + body["model_version_dependencies"] = self.model_version_dependencies if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_workspace_id is not None: - body["{run_workspace_id}"] = self.run_workspace_id + body["run_workspace_id"] = self.run_workspace_id if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersionInfo: """Deserializes the ModelVersionInfo from a dictionary.""" return cls( - aliases=_repeated_dict(d, "{aliases}", RegisteredModelAlias), - browse_only=d.get("{browse_only}", None), - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - id=d.get("{id}", None), - metastore_id=d.get("{metastore_id}", None), - model_name=d.get("{model_name}", None), - model_version_dependencies=_from_dict(d, "{model_version_dependencies}", DependencyList), - run_id=d.get("{run_id}", None), - run_workspace_id=d.get("{run_workspace_id}", None), - schema_name=d.get("{schema_name}", None), - source=d.get("{source}", None), - status=_enum(d, "{status}", ModelVersionInfoStatus), - storage_location=d.get("{storage_location}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - version=d.get("{version}", None), + aliases=_repeated_dict(d, "aliases", RegisteredModelAlias), + browse_only=d.get("browse_only", None), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + id=d.get("id", None), + metastore_id=d.get("metastore_id", None), + model_name=d.get("model_name", None), + model_version_dependencies=_from_dict(d, "model_version_dependencies", DependencyList), + run_id=d.get("run_id", None), + run_workspace_id=d.get("run_workspace_id", None), + schema_name=d.get("schema_name", None), + source=d.get("source", None), + status=_enum(d, "status", ModelVersionInfoStatus), + storage_location=d.get("storage_location", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + version=d.get("version", None), ) @@ -5587,20 +5572,20 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorCronSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.pause_status is not None: - body["{pause_status}"] = self.pause_status + body["pause_status"] = self.pause_status if self.quartz_cron_expression is not None: - body["{quartz_cron_expression}"] = self.quartz_cron_expression + body["quartz_cron_expression"] = self.quartz_cron_expression if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorCronSchedule: """Deserializes the MonitorCronSchedule from a dictionary.""" return cls( - pause_status=_enum(d, "{pause_status}", MonitorCronSchedulePauseStatus), - quartz_cron_expression=d.get("{quartz_cron_expression}", None), - timezone_id=d.get("{timezone_id}", None), + pause_status=_enum(d, "pause_status", MonitorCronSchedulePauseStatus), + quartz_cron_expression=d.get("quartz_cron_expression", None), + timezone_id=d.get("timezone_id", None), ) @@ -5627,13 +5612,13 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorDataClassificationConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorDataClassificationConfig: """Deserializes the MonitorDataClassificationConfig from a dictionary.""" - return cls(enabled=d.get("{enabled}", None)) + return cls(enabled=d.get("enabled", None)) @dataclass @@ -5653,13 +5638,13 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.email_addresses: - body["{email_addresses}"] = self.email_addresses + body["email_addresses"] = self.email_addresses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorDestination: """Deserializes the MonitorDestination from a dictionary.""" - return cls(email_addresses=d.get("{email_addresses}", None)) + return cls(email_addresses=d.get("email_addresses", None)) @dataclass @@ -5718,32 +5703,32 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorInferenceLog into a shallow dictionary of its immediate attributes.""" body = {} if self.granularities: - body["{granularities}"] = self.granularities + body["granularities"] = self.granularities if self.label_col is not None: - body["{label_col}"] = self.label_col + body["label_col"] = self.label_col if self.model_id_col is not None: - body["{model_id_col}"] = self.model_id_col + body["model_id_col"] = self.model_id_col if self.prediction_col is not None: - body["{prediction_col}"] = self.prediction_col + body["prediction_col"] = self.prediction_col if self.prediction_proba_col is not None: - body["{prediction_proba_col}"] = self.prediction_proba_col + body["prediction_proba_col"] = self.prediction_proba_col if self.problem_type is not None: - body["{problem_type}"] = self.problem_type + body["problem_type"] = self.problem_type if self.timestamp_col is not None: - body["{timestamp_col}"] = self.timestamp_col + body["timestamp_col"] = self.timestamp_col return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorInferenceLog: """Deserializes the MonitorInferenceLog from a dictionary.""" return cls( - granularities=d.get("{granularities}", None), - label_col=d.get("{label_col}", None), - model_id_col=d.get("{model_id_col}", None), - prediction_col=d.get("{prediction_col}", None), - prediction_proba_col=d.get("{prediction_proba_col}", None), - problem_type=_enum(d, "{problem_type}", MonitorInferenceLogProblemType), - timestamp_col=d.get("{timestamp_col}", None), + granularities=d.get("granularities", None), + label_col=d.get("label_col", None), + model_id_col=d.get("model_id_col", None), + prediction_col=d.get("prediction_col", None), + prediction_proba_col=d.get("prediction_proba_col", None), + problem_type=_enum(d, "problem_type", MonitorInferenceLogProblemType), + timestamp_col=d.get("timestamp_col", None), ) @@ -5864,65 +5849,65 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.assets_dir is not None: - body["{assets_dir}"] = self.assets_dir + body["assets_dir"] = self.assets_dir if self.baseline_table_name is not None: - body["{baseline_table_name}"] = self.baseline_table_name + body["baseline_table_name"] = self.baseline_table_name if self.custom_metrics: - body["{custom_metrics}"] = self.custom_metrics + body["custom_metrics"] = self.custom_metrics if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.data_classification_config: - body["{data_classification_config}"] = self.data_classification_config + body["data_classification_config"] = self.data_classification_config if self.drift_metrics_table_name is not None: - body["{drift_metrics_table_name}"] = self.drift_metrics_table_name + body["drift_metrics_table_name"] = self.drift_metrics_table_name if self.inference_log: - body["{inference_log}"] = self.inference_log + body["inference_log"] = self.inference_log if self.latest_monitor_failure_msg is not None: - body["{latest_monitor_failure_msg}"] = self.latest_monitor_failure_msg + body["latest_monitor_failure_msg"] = self.latest_monitor_failure_msg if self.monitor_version is not None: - body["{monitor_version}"] = self.monitor_version + body["monitor_version"] = self.monitor_version if self.notifications: - body["{notifications}"] = self.notifications + body["notifications"] = self.notifications if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.profile_metrics_table_name is not None: - body["{profile_metrics_table_name}"] = self.profile_metrics_table_name + body["profile_metrics_table_name"] = self.profile_metrics_table_name if self.schedule: - body["{schedule}"] = self.schedule + body["schedule"] = self.schedule if self.slicing_exprs: - body["{slicing_exprs}"] = self.slicing_exprs + body["slicing_exprs"] = self.slicing_exprs if self.snapshot: - body["{snapshot}"] = self.snapshot + body["snapshot"] = self.snapshot if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.time_series: - body["{time_series}"] = self.time_series + body["time_series"] = self.time_series return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorInfo: """Deserializes the MonitorInfo from a dictionary.""" return cls( - assets_dir=d.get("{assets_dir}", None), - baseline_table_name=d.get("{baseline_table_name}", None), - custom_metrics=_repeated_dict(d, "{custom_metrics}", MonitorMetric), - dashboard_id=d.get("{dashboard_id}", None), - data_classification_config=_from_dict(d, "{data_classification_config}", MonitorDataClassificationConfig), - drift_metrics_table_name=d.get("{drift_metrics_table_name}", None), - inference_log=_from_dict(d, "{inference_log}", MonitorInferenceLog), - latest_monitor_failure_msg=d.get("{latest_monitor_failure_msg}", None), - monitor_version=d.get("{monitor_version}", None), - notifications=_from_dict(d, "{notifications}", MonitorNotifications), - output_schema_name=d.get("{output_schema_name}", None), - profile_metrics_table_name=d.get("{profile_metrics_table_name}", None), - schedule=_from_dict(d, "{schedule}", MonitorCronSchedule), - slicing_exprs=d.get("{slicing_exprs}", None), - snapshot=_from_dict(d, "{snapshot}", MonitorSnapshot), - status=_enum(d, "{status}", MonitorInfoStatus), - table_name=d.get("{table_name}", None), - time_series=_from_dict(d, "{time_series}", MonitorTimeSeries), + assets_dir=d.get("assets_dir", None), + baseline_table_name=d.get("baseline_table_name", None), + custom_metrics=_repeated_dict(d, "custom_metrics", MonitorMetric), + dashboard_id=d.get("dashboard_id", None), + data_classification_config=_from_dict(d, "data_classification_config", MonitorDataClassificationConfig), + drift_metrics_table_name=d.get("drift_metrics_table_name", None), + inference_log=_from_dict(d, "inference_log", MonitorInferenceLog), + latest_monitor_failure_msg=d.get("latest_monitor_failure_msg", None), + monitor_version=d.get("monitor_version", None), + notifications=_from_dict(d, "notifications", MonitorNotifications), + output_schema_name=d.get("output_schema_name", None), + profile_metrics_table_name=d.get("profile_metrics_table_name", None), + schedule=_from_dict(d, "schedule", MonitorCronSchedule), + slicing_exprs=d.get("slicing_exprs", None), + snapshot=_from_dict(d, "snapshot", MonitorSnapshot), + status=_enum(d, "status", MonitorInfoStatus), + table_name=d.get("table_name", None), + time_series=_from_dict(d, "time_series", MonitorTimeSeries), ) @@ -5982,26 +5967,26 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorMetric into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.input_columns: - body["{input_columns}"] = self.input_columns + body["input_columns"] = self.input_columns if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.output_data_type is not None: - body["{output_data_type}"] = self.output_data_type + body["output_data_type"] = self.output_data_type if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorMetric: """Deserializes the MonitorMetric from a dictionary.""" return cls( - definition=d.get("{definition}", None), - input_columns=d.get("{input_columns}", None), - name=d.get("{name}", None), - output_data_type=d.get("{output_data_type}", None), - type=_enum(d, "{type}", MonitorMetricType), + definition=d.get("definition", None), + input_columns=d.get("input_columns", None), + name=d.get("name", None), + output_data_type=d.get("output_data_type", None), + type=_enum(d, "type", MonitorMetricType), ) @@ -6040,19 +6025,17 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.on_failure: - body["{on_failure}"] = self.on_failure + body["on_failure"] = self.on_failure if self.on_new_classification_tag_detected: - body["{on_new_classification_tag_detected}"] = self.on_new_classification_tag_detected + body["on_new_classification_tag_detected"] = self.on_new_classification_tag_detected return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorNotifications: """Deserializes the MonitorNotifications from a dictionary.""" return cls( - on_failure=_from_dict(d, "{on_failure}", MonitorDestination), - on_new_classification_tag_detected=_from_dict( - d, "{on_new_classification_tag_detected}", MonitorDestination - ), + on_failure=_from_dict(d, "on_failure", MonitorDestination), + on_new_classification_tag_detected=_from_dict(d, "on_new_classification_tag_detected", MonitorDestination), ) @@ -6097,29 +6080,29 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorRefreshInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time_ms is not None: - body["{end_time_ms}"] = self.end_time_ms + body["end_time_ms"] = self.end_time_ms if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.refresh_id is not None: - body["{refresh_id}"] = self.refresh_id + body["refresh_id"] = self.refresh_id if self.start_time_ms is not None: - body["{start_time_ms}"] = self.start_time_ms + body["start_time_ms"] = self.start_time_ms if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.trigger is not None: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorRefreshInfo: """Deserializes the MonitorRefreshInfo from a dictionary.""" return cls( - end_time_ms=d.get("{end_time_ms}", None), - message=d.get("{message}", None), - refresh_id=d.get("{refresh_id}", None), - start_time_ms=d.get("{start_time_ms}", None), - state=_enum(d, "{state}", MonitorRefreshInfoState), - trigger=_enum(d, "{trigger}", MonitorRefreshInfoTrigger), + end_time_ms=d.get("end_time_ms", None), + message=d.get("message", None), + refresh_id=d.get("refresh_id", None), + start_time_ms=d.get("start_time_ms", None), + state=_enum(d, "state", MonitorRefreshInfoState), + trigger=_enum(d, "trigger", MonitorRefreshInfoTrigger), ) @@ -6156,13 +6139,13 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorRefreshListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.refreshes: - body["{refreshes}"] = self.refreshes + body["refreshes"] = self.refreshes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorRefreshListResponse: """Deserializes the MonitorRefreshListResponse from a dictionary.""" - return cls(refreshes=_repeated_dict(d, "{refreshes}", MonitorRefreshInfo)) + return cls(refreshes=_repeated_dict(d, "refreshes", MonitorRefreshInfo)) @dataclass @@ -6210,15 +6193,15 @@ def as_shallow_dict(self) -> dict: """Serializes the MonitorTimeSeries into a shallow dictionary of its immediate attributes.""" body = {} if self.granularities: - body["{granularities}"] = self.granularities + body["granularities"] = self.granularities if self.timestamp_col is not None: - body["{timestamp_col}"] = self.timestamp_col + body["timestamp_col"] = self.timestamp_col return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MonitorTimeSeries: """Deserializes the MonitorTimeSeries from a dictionary.""" - return cls(granularities=d.get("{granularities}", None), timestamp_col=d.get("{timestamp_col}", None)) + return cls(granularities=d.get("granularities", None), timestamp_col=d.get("timestamp_col", None)) @dataclass @@ -6237,13 +6220,13 @@ def as_shallow_dict(self) -> dict: """Serializes the NamedTableConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NamedTableConstraint: """Deserializes the NamedTableConstraint from a dictionary.""" - return cls(name=d.get("{name}", None)) + return cls(name=d.get("name", None)) @dataclass @@ -6286,26 +6269,26 @@ def as_shallow_dict(self) -> dict: """Serializes the OnlineTable into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.spec: - body["{spec}"] = self.spec + body["spec"] = self.spec if self.status: - body["{status}"] = self.status + body["status"] = self.status if self.table_serving_url is not None: - body["{table_serving_url}"] = self.table_serving_url + body["table_serving_url"] = self.table_serving_url if self.unity_catalog_provisioning_state is not None: - body["{unity_catalog_provisioning_state}"] = self.unity_catalog_provisioning_state + body["unity_catalog_provisioning_state"] = self.unity_catalog_provisioning_state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OnlineTable: """Deserializes the OnlineTable from a dictionary.""" return cls( - name=d.get("{name}", None), - spec=_from_dict(d, "{spec}", OnlineTableSpec), - status=_from_dict(d, "{status}", OnlineTableStatus), - table_serving_url=d.get("{table_serving_url}", None), - unity_catalog_provisioning_state=_enum(d, "{unity_catalog_provisioning_state}", ProvisioningInfoState), + name=d.get("name", None), + spec=_from_dict(d, "spec", OnlineTableSpec), + status=_from_dict(d, "status", OnlineTableStatus), + table_serving_url=d.get("table_serving_url", None), + unity_catalog_provisioning_state=_enum(d, "unity_catalog_provisioning_state", ProvisioningInfoState), ) @@ -6363,32 +6346,32 @@ def as_shallow_dict(self) -> dict: """Serializes the OnlineTableSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.perform_full_copy is not None: - body["{perform_full_copy}"] = self.perform_full_copy + body["perform_full_copy"] = self.perform_full_copy if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.primary_key_columns: - body["{primary_key_columns}"] = self.primary_key_columns + body["primary_key_columns"] = self.primary_key_columns if self.run_continuously: - body["{run_continuously}"] = self.run_continuously + body["run_continuously"] = self.run_continuously if self.run_triggered: - body["{run_triggered}"] = self.run_triggered + body["run_triggered"] = self.run_triggered if self.source_table_full_name is not None: - body["{source_table_full_name}"] = self.source_table_full_name + body["source_table_full_name"] = self.source_table_full_name if self.timeseries_key is not None: - body["{timeseries_key}"] = self.timeseries_key + body["timeseries_key"] = self.timeseries_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OnlineTableSpec: """Deserializes the OnlineTableSpec from a dictionary.""" return cls( - perform_full_copy=d.get("{perform_full_copy}", None), - pipeline_id=d.get("{pipeline_id}", None), - primary_key_columns=d.get("{primary_key_columns}", None), - run_continuously=_from_dict(d, "{run_continuously}", OnlineTableSpecContinuousSchedulingPolicy), - run_triggered=_from_dict(d, "{run_triggered}", OnlineTableSpecTriggeredSchedulingPolicy), - source_table_full_name=d.get("{source_table_full_name}", None), - timeseries_key=d.get("{timeseries_key}", None), + perform_full_copy=d.get("perform_full_copy", None), + pipeline_id=d.get("pipeline_id", None), + primary_key_columns=d.get("primary_key_columns", None), + run_continuously=_from_dict(d, "run_continuously", OnlineTableSpecContinuousSchedulingPolicy), + run_triggered=_from_dict(d, "run_triggered", OnlineTableSpecTriggeredSchedulingPolicy), + source_table_full_name=d.get("source_table_full_name", None), + timeseries_key=d.get("timeseries_key", None), ) @@ -6491,29 +6474,29 @@ def as_shallow_dict(self) -> dict: """Serializes the OnlineTableStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.continuous_update_status: - body["{continuous_update_status}"] = self.continuous_update_status + body["continuous_update_status"] = self.continuous_update_status if self.detailed_state is not None: - body["{detailed_state}"] = self.detailed_state + body["detailed_state"] = self.detailed_state if self.failed_status: - body["{failed_status}"] = self.failed_status + body["failed_status"] = self.failed_status if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.provisioning_status: - body["{provisioning_status}"] = self.provisioning_status + body["provisioning_status"] = self.provisioning_status if self.triggered_update_status: - body["{triggered_update_status}"] = self.triggered_update_status + body["triggered_update_status"] = self.triggered_update_status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OnlineTableStatus: """Deserializes the OnlineTableStatus from a dictionary.""" return cls( - continuous_update_status=_from_dict(d, "{continuous_update_status}", ContinuousUpdateStatus), - detailed_state=_enum(d, "{detailed_state}", OnlineTableState), - failed_status=_from_dict(d, "{failed_status}", FailedStatus), - message=d.get("{message}", None), - provisioning_status=_from_dict(d, "{provisioning_status}", ProvisioningStatus), - triggered_update_status=_from_dict(d, "{triggered_update_status}", TriggeredUpdateStatus), + continuous_update_status=_from_dict(d, "continuous_update_status", ContinuousUpdateStatus), + detailed_state=_enum(d, "detailed_state", OnlineTableState), + failed_status=_from_dict(d, "failed_status", FailedStatus), + message=d.get("message", None), + provisioning_status=_from_dict(d, "provisioning_status", ProvisioningStatus), + triggered_update_status=_from_dict(d, "triggered_update_status", TriggeredUpdateStatus), ) @@ -6543,20 +6526,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.add: - body["{add}"] = self.add + body["add"] = self.add if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.remove: - body["{remove}"] = self.remove + body["remove"] = self.remove return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsChange: """Deserializes the PermissionsChange from a dictionary.""" return cls( - add=_repeated_enum(d, "{add}", Privilege), - principal=d.get("{principal}", None), - remove=_repeated_enum(d, "{remove}", Privilege), + add=_repeated_enum(d, "add", Privilege), + principal=d.get("principal", None), + remove=_repeated_enum(d, "remove", Privilege), ) @@ -6576,13 +6559,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionsList into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = self.privilege_assignments + body["privilege_assignments"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsList: """Deserializes the PermissionsList from a dictionary.""" - return cls(privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment)) + return cls(privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment)) @dataclass @@ -6624,26 +6607,26 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineProgress into a shallow dictionary of its immediate attributes.""" body = {} if self.estimated_completion_time_seconds is not None: - body["{estimated_completion_time_seconds}"] = self.estimated_completion_time_seconds + body["estimated_completion_time_seconds"] = self.estimated_completion_time_seconds if self.latest_version_currently_processing is not None: - body["{latest_version_currently_processing}"] = self.latest_version_currently_processing + body["latest_version_currently_processing"] = self.latest_version_currently_processing if self.sync_progress_completion is not None: - body["{sync_progress_completion}"] = self.sync_progress_completion + body["sync_progress_completion"] = self.sync_progress_completion if self.synced_row_count is not None: - body["{synced_row_count}"] = self.synced_row_count + body["synced_row_count"] = self.synced_row_count if self.total_row_count is not None: - body["{total_row_count}"] = self.total_row_count + body["total_row_count"] = self.total_row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineProgress: """Deserializes the PipelineProgress from a dictionary.""" return cls( - estimated_completion_time_seconds=d.get("{estimated_completion_time_seconds}", None), - latest_version_currently_processing=d.get("{latest_version_currently_processing}", None), - sync_progress_completion=d.get("{sync_progress_completion}", None), - synced_row_count=d.get("{synced_row_count}", None), - total_row_count=d.get("{total_row_count}", None), + estimated_completion_time_seconds=d.get("estimated_completion_time_seconds", None), + latest_version_currently_processing=d.get("latest_version_currently_processing", None), + sync_progress_completion=d.get("sync_progress_completion", None), + synced_row_count=d.get("synced_row_count", None), + total_row_count=d.get("total_row_count", None), ) @@ -6668,15 +6651,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PrimaryKeyConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.child_columns: - body["{child_columns}"] = self.child_columns + body["child_columns"] = self.child_columns if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrimaryKeyConstraint: """Deserializes the PrimaryKeyConstraint from a dictionary.""" - return cls(child_columns=d.get("{child_columns}", None), name=d.get("{name}", None)) + return cls(child_columns=d.get("child_columns", None), name=d.get("name", None)) class Privilege(Enum): @@ -6750,15 +6733,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.privileges: - body["{privileges}"] = self.privileges + body["privileges"] = self.privileges return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrivilegeAssignment: """Deserializes the PrivilegeAssignment from a dictionary.""" - return cls(principal=d.get("{principal}", None), privileges=_repeated_enum(d, "{privileges}", Privilege)) + return cls(principal=d.get("principal", None), privileges=_repeated_enum(d, "privileges", Privilege)) PropertiesKvPairs = Dict[str, str] @@ -6781,13 +6764,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ProvisioningInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProvisioningInfo: """Deserializes the ProvisioningInfo from a dictionary.""" - return cls(state=_enum(d, "{state}", ProvisioningInfoState)) + return cls(state=_enum(d, "state", ProvisioningInfoState)) class ProvisioningInfoState(Enum): @@ -6820,13 +6803,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ProvisioningStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.initial_pipeline_sync_progress: - body["{initial_pipeline_sync_progress}"] = self.initial_pipeline_sync_progress + body["initial_pipeline_sync_progress"] = self.initial_pipeline_sync_progress return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProvisioningStatus: """Deserializes the ProvisioningStatus from a dictionary.""" - return cls(initial_pipeline_sync_progress=_from_dict(d, "{initial_pipeline_sync_progress}", PipelineProgress)) + return cls(initial_pipeline_sync_progress=_from_dict(d, "initial_pipeline_sync_progress", PipelineProgress)) @dataclass @@ -6870,29 +6853,29 @@ def as_shallow_dict(self) -> dict: """Serializes the QuotaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.last_refreshed_at is not None: - body["{last_refreshed_at}"] = self.last_refreshed_at + body["last_refreshed_at"] = self.last_refreshed_at if self.parent_full_name is not None: - body["{parent_full_name}"] = self.parent_full_name + body["parent_full_name"] = self.parent_full_name if self.parent_securable_type is not None: - body["{parent_securable_type}"] = self.parent_securable_type + body["parent_securable_type"] = self.parent_securable_type if self.quota_count is not None: - body["{quota_count}"] = self.quota_count + body["quota_count"] = self.quota_count if self.quota_limit is not None: - body["{quota_limit}"] = self.quota_limit + body["quota_limit"] = self.quota_limit if self.quota_name is not None: - body["{quota_name}"] = self.quota_name + body["quota_name"] = self.quota_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QuotaInfo: """Deserializes the QuotaInfo from a dictionary.""" return cls( - last_refreshed_at=d.get("{last_refreshed_at}", None), - parent_full_name=d.get("{parent_full_name}", None), - parent_securable_type=_enum(d, "{parent_securable_type}", SecurableType), - quota_count=d.get("{quota_count}", None), - quota_limit=d.get("{quota_limit}", None), - quota_name=d.get("{quota_name}", None), + last_refreshed_at=d.get("last_refreshed_at", None), + parent_full_name=d.get("parent_full_name", None), + parent_securable_type=_enum(d, "parent_securable_type", SecurableType), + quota_count=d.get("quota_count", None), + quota_limit=d.get("quota_limit", None), + quota_name=d.get("quota_name", None), ) @@ -6925,20 +6908,20 @@ def as_shallow_dict(self) -> dict: """Serializes the R2Credentials into a shallow dictionary of its immediate attributes.""" body = {} if self.access_key_id is not None: - body["{access_key_id}"] = self.access_key_id + body["access_key_id"] = self.access_key_id if self.secret_access_key is not None: - body["{secret_access_key}"] = self.secret_access_key + body["secret_access_key"] = self.secret_access_key if self.session_token is not None: - body["{session_token}"] = self.session_token + body["session_token"] = self.session_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> R2Credentials: """Deserializes the R2Credentials from a dictionary.""" return cls( - access_key_id=d.get("{access_key_id}", None), - secret_access_key=d.get("{secret_access_key}", None), - session_token=d.get("{session_token}", None), + access_key_id=d.get("access_key_id", None), + secret_access_key=d.get("secret_access_key", None), + session_token=d.get("session_token", None), ) @@ -6964,15 +6947,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RegenerateDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegenerateDashboardRequest: """Deserializes the RegenerateDashboardRequest from a dictionary.""" - return cls(table_name=d.get("{table_name}", None), warehouse_id=d.get("{warehouse_id}", None)) + return cls(table_name=d.get("table_name", None), warehouse_id=d.get("warehouse_id", None)) @dataclass @@ -6996,15 +6979,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RegenerateDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.parent_folder is not None: - body["{parent_folder}"] = self.parent_folder + body["parent_folder"] = self.parent_folder return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegenerateDashboardResponse: """Deserializes the RegenerateDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("{dashboard_id}", None), parent_folder=d.get("{parent_folder}", None)) + return cls(dashboard_id=d.get("dashboard_id", None), parent_folder=d.get("parent_folder", None)) @dataclass @@ -7030,15 +7013,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAlias into a shallow dictionary of its immediate attributes.""" body = {} if self.alias_name is not None: - body["{alias_name}"] = self.alias_name + body["alias_name"] = self.alias_name if self.version_num is not None: - body["{version_num}"] = self.version_num + body["version_num"] = self.version_num return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAlias: """Deserializes the RegisteredModelAlias from a dictionary.""" - return cls(alias_name=d.get("{alias_name}", None), version_num=d.get("{version_num}", None)) + return cls(alias_name=d.get("alias_name", None), version_num=d.get("version_num", None)) @dataclass @@ -7123,53 +7106,53 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aliases: - body["{aliases}"] = self.aliases + body["aliases"] = self.aliases if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelInfo: """Deserializes the RegisteredModelInfo from a dictionary.""" return cls( - aliases=_repeated_dict(d, "{aliases}", RegisteredModelAlias), - browse_only=d.get("{browse_only}", None), - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - full_name=d.get("{full_name}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - schema_name=d.get("{schema_name}", None), - storage_location=d.get("{storage_location}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + aliases=_repeated_dict(d, "aliases", RegisteredModelAlias), + browse_only=d.get("browse_only", None), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + full_name=d.get("full_name", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + schema_name=d.get("schema_name", None), + storage_location=d.get("storage_location", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -7274,67 +7257,67 @@ def as_shallow_dict(self) -> dict: """Serializes the SchemaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.catalog_type is not None: - body["{catalog_type}"] = self.catalog_type + body["catalog_type"] = self.catalog_type if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.effective_predictive_optimization_flag: - body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag + body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization + body["enable_predictive_optimization"] = self.enable_predictive_optimization if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.schema_id is not None: - body["{schema_id}"] = self.schema_id + body["schema_id"] = self.schema_id if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SchemaInfo: """Deserializes the SchemaInfo from a dictionary.""" return cls( - browse_only=d.get("{browse_only}", None), - catalog_name=d.get("{catalog_name}", None), - catalog_type=d.get("{catalog_type}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), + browse_only=d.get("browse_only", None), + catalog_name=d.get("catalog_name", None), + catalog_type=d.get("catalog_type", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), effective_predictive_optimization_flag=_from_dict( - d, "{effective_predictive_optimization_flag}", EffectivePredictiveOptimizationFlag + d, "effective_predictive_optimization_flag", EffectivePredictiveOptimizationFlag ), - enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), - full_name=d.get("{full_name}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - properties=d.get("{properties}", None), - schema_id=d.get("{schema_id}", None), - storage_location=d.get("{storage_location}", None), - storage_root=d.get("{storage_root}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), + full_name=d.get("full_name", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + properties=d.get("properties", None), + schema_id=d.get("schema_id", None), + storage_location=d.get("storage_location", None), + storage_root=d.get("storage_root", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -7385,17 +7368,17 @@ def as_shallow_dict(self) -> dict: """Serializes the SetArtifactAllowlist into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_matchers: - body["{artifact_matchers}"] = self.artifact_matchers + body["artifact_matchers"] = self.artifact_matchers if self.artifact_type is not None: - body["{artifact_type}"] = self.artifact_type + body["artifact_type"] = self.artifact_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetArtifactAllowlist: """Deserializes the SetArtifactAllowlist from a dictionary.""" return cls( - artifact_matchers=_repeated_dict(d, "{artifact_matchers}", ArtifactMatcher), - artifact_type=_enum(d, "{artifact_type}", ArtifactType), + artifact_matchers=_repeated_dict(d, "artifact_matchers", ArtifactMatcher), + artifact_type=_enum(d, "artifact_type", ArtifactType), ) @@ -7425,18 +7408,18 @@ def as_shallow_dict(self) -> dict: """Serializes the SetRegisteredModelAliasRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.alias is not None: - body["{alias}"] = self.alias + body["alias"] = self.alias if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.version_num is not None: - body["{version_num}"] = self.version_num + body["version_num"] = self.version_num return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetRegisteredModelAliasRequest: """Deserializes the SetRegisteredModelAliasRequest from a dictionary.""" return cls( - alias=d.get("{alias}", None), full_name=d.get("{full_name}", None), version_num=d.get("{version_num}", None) + alias=d.get("alias", None), full_name=d.get("full_name", None), version_num=d.get("version_num", None) ) @@ -7463,17 +7446,17 @@ def as_shallow_dict(self) -> dict: """Serializes the SseEncryptionDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.algorithm is not None: - body["{algorithm}"] = self.algorithm + body["algorithm"] = self.algorithm if self.aws_kms_key_arn is not None: - body["{aws_kms_key_arn}"] = self.aws_kms_key_arn + body["aws_kms_key_arn"] = self.aws_kms_key_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SseEncryptionDetails: """Deserializes the SseEncryptionDetails from a dictionary.""" return cls( - algorithm=_enum(d, "{algorithm}", SseEncryptionDetailsAlgorithm), - aws_kms_key_arn=d.get("{aws_kms_key_arn}", None), + algorithm=_enum(d, "algorithm", SseEncryptionDetailsAlgorithm), + aws_kms_key_arn=d.get("aws_kms_key_arn", None), ) @@ -7584,67 +7567,67 @@ def as_shallow_dict(self) -> dict: """Serializes the StorageCredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal + body["azure_service_principal"] = self.azure_service_principal if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token + body["cloudflare_api_token"] = self.cloudflare_api_token if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.used_for_managed_storage is not None: - body["{used_for_managed_storage}"] = self.used_for_managed_storage + body["used_for_managed_storage"] = self.used_for_managed_storage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StorageCredentialInfo: """Deserializes the StorageCredentialInfo from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleResponse), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityResponse), - azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleResponse), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityResponse), + azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountResponse + d, "databricks_gcp_service_account", DatabricksGcpServiceAccountResponse ), - full_name=d.get("{full_name}", None), - id=d.get("{id}", None), - isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - read_only=d.get("{read_only}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - used_for_managed_storage=d.get("{used_for_managed_storage}", None), + full_name=d.get("full_name", None), + id=d.get("id", None), + isolation_mode=_enum(d, "isolation_mode", IsolationMode), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + read_only=d.get("read_only", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + used_for_managed_storage=d.get("used_for_managed_storage", None), ) @@ -7670,15 +7653,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SystemSchemaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SystemSchemaInfo: """Deserializes the SystemSchemaInfo from a dictionary.""" - return cls(schema=d.get("{schema}", None), state=_enum(d, "{state}", SystemSchemaInfoState)) + return cls(schema=d.get("schema", None), state=_enum(d, "state", SystemSchemaInfoState)) class SystemSchemaInfoState(Enum): @@ -7718,20 +7701,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TableConstraint into a shallow dictionary of its immediate attributes.""" body = {} if self.foreign_key_constraint: - body["{foreign_key_constraint}"] = self.foreign_key_constraint + body["foreign_key_constraint"] = self.foreign_key_constraint if self.named_table_constraint: - body["{named_table_constraint}"] = self.named_table_constraint + body["named_table_constraint"] = self.named_table_constraint if self.primary_key_constraint: - body["{primary_key_constraint}"] = self.primary_key_constraint + body["primary_key_constraint"] = self.primary_key_constraint return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableConstraint: """Deserializes the TableConstraint from a dictionary.""" return cls( - foreign_key_constraint=_from_dict(d, "{foreign_key_constraint}", ForeignKeyConstraint), - named_table_constraint=_from_dict(d, "{named_table_constraint}", NamedTableConstraint), - primary_key_constraint=_from_dict(d, "{primary_key_constraint}", PrimaryKeyConstraint), + foreign_key_constraint=_from_dict(d, "foreign_key_constraint", ForeignKeyConstraint), + named_table_constraint=_from_dict(d, "named_table_constraint", NamedTableConstraint), + primary_key_constraint=_from_dict(d, "primary_key_constraint", PrimaryKeyConstraint), ) @@ -7754,13 +7737,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TableDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.table_full_name is not None: - body["{table_full_name}"] = self.table_full_name + body["table_full_name"] = self.table_full_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableDependency: """Deserializes the TableDependency from a dictionary.""" - return cls(table_full_name=d.get("{table_full_name}", None)) + return cls(table_full_name=d.get("table_full_name", None)) @dataclass @@ -7779,13 +7762,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TableExistsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.table_exists is not None: - body["{table_exists}"] = self.table_exists + body["table_exists"] = self.table_exists return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableExistsResponse: """Deserializes the TableExistsResponse from a dictionary.""" - return cls(table_exists=d.get("{table_exists}", None)) + return cls(table_exists=d.get("table_exists", None)) @dataclass @@ -7963,111 +7946,111 @@ def as_shallow_dict(self) -> dict: """Serializes the TableInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_access_configuration_id is not None: - body["{data_access_configuration_id}"] = self.data_access_configuration_id + body["data_access_configuration_id"] = self.data_access_configuration_id if self.data_source_format is not None: - body["{data_source_format}"] = self.data_source_format + body["data_source_format"] = self.data_source_format if self.deleted_at is not None: - body["{deleted_at}"] = self.deleted_at + body["deleted_at"] = self.deleted_at if self.delta_runtime_properties_kvpairs: - body["{delta_runtime_properties_kvpairs}"] = self.delta_runtime_properties_kvpairs + body["delta_runtime_properties_kvpairs"] = self.delta_runtime_properties_kvpairs if self.effective_predictive_optimization_flag: - body["{effective_predictive_optimization_flag}"] = self.effective_predictive_optimization_flag + body["effective_predictive_optimization_flag"] = self.effective_predictive_optimization_flag if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization + body["enable_predictive_optimization"] = self.enable_predictive_optimization if self.encryption_details: - body["{encryption_details}"] = self.encryption_details + body["encryption_details"] = self.encryption_details if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.row_filter: - body["{row_filter}"] = self.row_filter + body["row_filter"] = self.row_filter if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.sql_path is not None: - body["{sql_path}"] = self.sql_path + body["sql_path"] = self.sql_path if self.storage_credential_name is not None: - body["{storage_credential_name}"] = self.storage_credential_name + body["storage_credential_name"] = self.storage_credential_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.table_constraints: - body["{table_constraints}"] = self.table_constraints + body["table_constraints"] = self.table_constraints if self.table_id is not None: - body["{table_id}"] = self.table_id + body["table_id"] = self.table_id if self.table_type is not None: - body["{table_type}"] = self.table_type + body["table_type"] = self.table_type if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.view_definition is not None: - body["{view_definition}"] = self.view_definition + body["view_definition"] = self.view_definition if self.view_dependencies: - body["{view_dependencies}"] = self.view_dependencies + body["view_dependencies"] = self.view_dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableInfo: """Deserializes the TableInfo from a dictionary.""" return cls( - access_point=d.get("{access_point}", None), - browse_only=d.get("{browse_only}", None), - catalog_name=d.get("{catalog_name}", None), - columns=_repeated_dict(d, "{columns}", ColumnInfo), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - data_access_configuration_id=d.get("{data_access_configuration_id}", None), - data_source_format=_enum(d, "{data_source_format}", DataSourceFormat), - deleted_at=d.get("{deleted_at}", None), + access_point=d.get("access_point", None), + browse_only=d.get("browse_only", None), + catalog_name=d.get("catalog_name", None), + columns=_repeated_dict(d, "columns", ColumnInfo), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + data_access_configuration_id=d.get("data_access_configuration_id", None), + data_source_format=_enum(d, "data_source_format", DataSourceFormat), + deleted_at=d.get("deleted_at", None), delta_runtime_properties_kvpairs=_from_dict( - d, "{delta_runtime_properties_kvpairs}", DeltaRuntimePropertiesKvPairs + d, "delta_runtime_properties_kvpairs", DeltaRuntimePropertiesKvPairs ), effective_predictive_optimization_flag=_from_dict( - d, "{effective_predictive_optimization_flag}", EffectivePredictiveOptimizationFlag + d, "effective_predictive_optimization_flag", EffectivePredictiveOptimizationFlag ), - enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), - encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), - full_name=d.get("{full_name}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - pipeline_id=d.get("{pipeline_id}", None), - properties=d.get("{properties}", None), - row_filter=_from_dict(d, "{row_filter}", TableRowFilter), - schema_name=d.get("{schema_name}", None), - sql_path=d.get("{sql_path}", None), - storage_credential_name=d.get("{storage_credential_name}", None), - storage_location=d.get("{storage_location}", None), - table_constraints=_repeated_dict(d, "{table_constraints}", TableConstraint), - table_id=d.get("{table_id}", None), - table_type=_enum(d, "{table_type}", TableType), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - view_definition=d.get("{view_definition}", None), - view_dependencies=_from_dict(d, "{view_dependencies}", DependencyList), + enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), + encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), + full_name=d.get("full_name", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + pipeline_id=d.get("pipeline_id", None), + properties=d.get("properties", None), + row_filter=_from_dict(d, "row_filter", TableRowFilter), + schema_name=d.get("schema_name", None), + sql_path=d.get("sql_path", None), + storage_credential_name=d.get("storage_credential_name", None), + storage_location=d.get("storage_location", None), + table_constraints=_repeated_dict(d, "table_constraints", TableConstraint), + table_id=d.get("table_id", None), + table_type=_enum(d, "table_type", TableType), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + view_definition=d.get("view_definition", None), + view_dependencies=_from_dict(d, "view_dependencies", DependencyList), ) @@ -8099,15 +8082,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TableRowFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.input_column_names: - body["{input_column_names}"] = self.input_column_names + body["input_column_names"] = self.input_column_names return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableRowFilter: """Deserializes the TableRowFilter from a dictionary.""" - return cls(function_name=d.get("{function_name}", None), input_column_names=d.get("{input_column_names}", None)) + return cls(function_name=d.get("function_name", None), input_column_names=d.get("input_column_names", None)) @dataclass @@ -8130,15 +8113,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TableSummary into a shallow dictionary of its immediate attributes.""" body = {} if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.table_type is not None: - body["{table_type}"] = self.table_type + body["table_type"] = self.table_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableSummary: """Deserializes the TableSummary from a dictionary.""" - return cls(full_name=d.get("{full_name}", None), table_type=_enum(d, "{table_type}", TableType)) + return cls(full_name=d.get("full_name", None), table_type=_enum(d, "table_type", TableType)) class TableType(Enum): @@ -8189,23 +8172,23 @@ def as_shallow_dict(self) -> dict: """Serializes the TemporaryCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_temp_credentials: - body["{aws_temp_credentials}"] = self.aws_temp_credentials + body["aws_temp_credentials"] = self.aws_temp_credentials if self.azure_aad: - body["{azure_aad}"] = self.azure_aad + body["azure_aad"] = self.azure_aad if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.gcp_oauth_token: - body["{gcp_oauth_token}"] = self.gcp_oauth_token + body["gcp_oauth_token"] = self.gcp_oauth_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TemporaryCredentials: """Deserializes the TemporaryCredentials from a dictionary.""" return cls( - aws_temp_credentials=_from_dict(d, "{aws_temp_credentials}", AwsCredentials), - azure_aad=_from_dict(d, "{azure_aad}", AzureActiveDirectoryToken), - expiration_time=d.get("{expiration_time}", None), - gcp_oauth_token=_from_dict(d, "{gcp_oauth_token}", GcpOauthToken), + aws_temp_credentials=_from_dict(d, "aws_temp_credentials", AwsCredentials), + azure_aad=_from_dict(d, "azure_aad", AzureActiveDirectoryToken), + expiration_time=d.get("expiration_time", None), + gcp_oauth_token=_from_dict(d, "gcp_oauth_token", GcpOauthToken), ) @@ -8240,20 +8223,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TriggeredUpdateStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_processed_commit_version is not None: - body["{last_processed_commit_version}"] = self.last_processed_commit_version + body["last_processed_commit_version"] = self.last_processed_commit_version if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.triggered_update_progress: - body["{triggered_update_progress}"] = self.triggered_update_progress + body["triggered_update_progress"] = self.triggered_update_progress return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TriggeredUpdateStatus: """Deserializes the TriggeredUpdateStatus from a dictionary.""" return cls( - last_processed_commit_version=d.get("{last_processed_commit_version}", None), - timestamp=d.get("{timestamp}", None), - triggered_update_progress=_from_dict(d, "{triggered_update_progress}", PipelineProgress), + last_processed_commit_version=d.get("last_processed_commit_version", None), + timestamp=d.get("timestamp", None), + triggered_update_progress=_from_dict(d, "triggered_update_progress", PipelineProgress), ) @@ -8352,35 +8335,35 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCatalog into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization + body["enable_predictive_optimization"] = self.enable_predictive_optimization if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCatalog: """Deserializes the UpdateCatalog from a dictionary.""" return cls( - comment=d.get("{comment}", None), - enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), - isolation_mode=_enum(d, "{isolation_mode}", CatalogIsolationMode), - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - options=d.get("{options}", None), - owner=d.get("{owner}", None), - properties=d.get("{properties}", None), + comment=d.get("comment", None), + enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), + isolation_mode=_enum(d, "isolation_mode", CatalogIsolationMode), + name=d.get("name", None), + new_name=d.get("new_name", None), + options=d.get("options", None), + owner=d.get("owner", None), + properties=d.get("properties", None), ) @@ -8415,23 +8398,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateConnection into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateConnection: """Deserializes the UpdateConnection from a dictionary.""" return cls( - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - options=d.get("{options}", None), - owner=d.get("{owner}", None), + name=d.get("name", None), + new_name=d.get("new_name", None), + options=d.get("options", None), + owner=d.get("owner", None), ) @@ -8508,49 +8491,47 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal + body["azure_service_principal"] = self.azure_service_principal if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.force is not None: - body["{force}"] = self.force + body["force"] = self.force if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.name_arg is not None: - body["{name_arg}"] = self.name_arg + body["name_arg"] = self.name_arg if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCredentialRequest: """Deserializes the UpdateCredentialRequest from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), - azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), - comment=d.get("{comment}", None), - databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount - ), - force=d.get("{force}", None), - isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), - name_arg=d.get("{name_arg}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - read_only=d.get("{read_only}", None), - skip_validation=d.get("{skip_validation}", None), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), + azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), + comment=d.get("comment", None), + databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), + force=d.get("force", None), + isolation_mode=_enum(d, "isolation_mode", IsolationMode), + name_arg=d.get("name_arg", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + read_only=d.get("read_only", None), + skip_validation=d.get("skip_validation", None), ) @@ -8631,50 +8612,50 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateExternalLocation into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.encryption_details: - body["{encryption_details}"] = self.encryption_details + body["encryption_details"] = self.encryption_details if self.fallback is not None: - body["{fallback}"] = self.fallback + body["fallback"] = self.fallback if self.force is not None: - body["{force}"] = self.force + body["force"] = self.force if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExternalLocation: """Deserializes the UpdateExternalLocation from a dictionary.""" return cls( - access_point=d.get("{access_point}", None), - comment=d.get("{comment}", None), - credential_name=d.get("{credential_name}", None), - encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), - fallback=d.get("{fallback}", None), - force=d.get("{force}", None), - isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - read_only=d.get("{read_only}", None), - skip_validation=d.get("{skip_validation}", None), - url=d.get("{url}", None), + access_point=d.get("access_point", None), + comment=d.get("comment", None), + credential_name=d.get("credential_name", None), + encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), + fallback=d.get("fallback", None), + force=d.get("force", None), + isolation_mode=_enum(d, "isolation_mode", IsolationMode), + name=d.get("name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + read_only=d.get("read_only", None), + skip_validation=d.get("skip_validation", None), + url=d.get("url", None), ) @@ -8700,15 +8681,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateFunction into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateFunction: """Deserializes the UpdateFunction from a dictionary.""" - return cls(name=d.get("{name}", None), owner=d.get("{owner}", None)) + return cls(name=d.get("name", None), owner=d.get("owner", None)) @dataclass @@ -8765,39 +8746,39 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateMetastore into a shallow dictionary of its immediate attributes.""" body = {} if self.delta_sharing_organization_name is not None: - body["{delta_sharing_organization_name}"] = self.delta_sharing_organization_name + body["delta_sharing_organization_name"] = self.delta_sharing_organization_name if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( + body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( self.delta_sharing_recipient_token_lifetime_in_seconds ) if self.delta_sharing_scope is not None: - body["{delta_sharing_scope}"] = self.delta_sharing_scope + body["delta_sharing_scope"] = self.delta_sharing_scope if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.privilege_model_version is not None: - body["{privilege_model_version}"] = self.privilege_model_version + body["privilege_model_version"] = self.privilege_model_version if self.storage_root_credential_id is not None: - body["{storage_root_credential_id}"] = self.storage_root_credential_id + body["storage_root_credential_id"] = self.storage_root_credential_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateMetastore: """Deserializes the UpdateMetastore from a dictionary.""" return cls( - delta_sharing_organization_name=d.get("{delta_sharing_organization_name}", None), + delta_sharing_organization_name=d.get("delta_sharing_organization_name", None), delta_sharing_recipient_token_lifetime_in_seconds=d.get( - "{delta_sharing_recipient_token_lifetime_in_seconds}", None + "delta_sharing_recipient_token_lifetime_in_seconds", None ), - delta_sharing_scope=_enum(d, "{delta_sharing_scope}", UpdateMetastoreDeltaSharingScope), - id=d.get("{id}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - privilege_model_version=d.get("{privilege_model_version}", None), - storage_root_credential_id=d.get("{storage_root_credential_id}", None), + delta_sharing_scope=_enum(d, "delta_sharing_scope", UpdateMetastoreDeltaSharingScope), + id=d.get("id", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + privilege_model_version=d.get("privilege_model_version", None), + storage_root_credential_id=d.get("storage_root_credential_id", None), ) @@ -8828,20 +8809,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateMetastoreAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.default_catalog_name is not None: - body["{default_catalog_name}"] = self.default_catalog_name + body["default_catalog_name"] = self.default_catalog_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateMetastoreAssignment: """Deserializes the UpdateMetastoreAssignment from a dictionary.""" return cls( - default_catalog_name=d.get("{default_catalog_name}", None), - metastore_id=d.get("{metastore_id}", None), - workspace_id=d.get("{workspace_id}", None), + default_catalog_name=d.get("default_catalog_name", None), + metastore_id=d.get("metastore_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -8878,19 +8859,17 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionRequest: """Deserializes the UpdateModelVersionRequest from a dictionary.""" - return cls( - comment=d.get("{comment}", None), full_name=d.get("{full_name}", None), version=d.get("{version}", None) - ) + return cls(comment=d.get("comment", None), full_name=d.get("full_name", None), version=d.get("version", None)) @dataclass @@ -8970,47 +8949,47 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateMonitor into a shallow dictionary of its immediate attributes.""" body = {} if self.baseline_table_name is not None: - body["{baseline_table_name}"] = self.baseline_table_name + body["baseline_table_name"] = self.baseline_table_name if self.custom_metrics: - body["{custom_metrics}"] = self.custom_metrics + body["custom_metrics"] = self.custom_metrics if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.data_classification_config: - body["{data_classification_config}"] = self.data_classification_config + body["data_classification_config"] = self.data_classification_config if self.inference_log: - body["{inference_log}"] = self.inference_log + body["inference_log"] = self.inference_log if self.notifications: - body["{notifications}"] = self.notifications + body["notifications"] = self.notifications if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.schedule: - body["{schedule}"] = self.schedule + body["schedule"] = self.schedule if self.slicing_exprs: - body["{slicing_exprs}"] = self.slicing_exprs + body["slicing_exprs"] = self.slicing_exprs if self.snapshot: - body["{snapshot}"] = self.snapshot + body["snapshot"] = self.snapshot if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name if self.time_series: - body["{time_series}"] = self.time_series + body["time_series"] = self.time_series return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateMonitor: """Deserializes the UpdateMonitor from a dictionary.""" return cls( - baseline_table_name=d.get("{baseline_table_name}", None), - custom_metrics=_repeated_dict(d, "{custom_metrics}", MonitorMetric), - dashboard_id=d.get("{dashboard_id}", None), - data_classification_config=_from_dict(d, "{data_classification_config}", MonitorDataClassificationConfig), - inference_log=_from_dict(d, "{inference_log}", MonitorInferenceLog), - notifications=_from_dict(d, "{notifications}", MonitorNotifications), - output_schema_name=d.get("{output_schema_name}", None), - schedule=_from_dict(d, "{schedule}", MonitorCronSchedule), - slicing_exprs=d.get("{slicing_exprs}", None), - snapshot=_from_dict(d, "{snapshot}", MonitorSnapshot), - table_name=d.get("{table_name}", None), - time_series=_from_dict(d, "{time_series}", MonitorTimeSeries), + baseline_table_name=d.get("baseline_table_name", None), + custom_metrics=_repeated_dict(d, "custom_metrics", MonitorMetric), + dashboard_id=d.get("dashboard_id", None), + data_classification_config=_from_dict(d, "data_classification_config", MonitorDataClassificationConfig), + inference_log=_from_dict(d, "inference_log", MonitorInferenceLog), + notifications=_from_dict(d, "notifications", MonitorNotifications), + output_schema_name=d.get("output_schema_name", None), + schedule=_from_dict(d, "schedule", MonitorCronSchedule), + slicing_exprs=d.get("slicing_exprs", None), + snapshot=_from_dict(d, "snapshot", MonitorSnapshot), + table_name=d.get("table_name", None), + time_series=_from_dict(d, "time_series", MonitorTimeSeries), ) @@ -9040,20 +9019,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdatePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.changes: - body["{changes}"] = self.changes + body["changes"] = self.changes if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.securable_type is not None: - body["{securable_type}"] = self.securable_type + body["securable_type"] = self.securable_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePermissions: """Deserializes the UpdatePermissions from a dictionary.""" return cls( - changes=_repeated_dict(d, "{changes}", PermissionsChange), - full_name=d.get("{full_name}", None), - securable_type=_enum(d, "{securable_type}", SecurableType), + changes=_repeated_dict(d, "changes", PermissionsChange), + full_name=d.get("full_name", None), + securable_type=_enum(d, "securable_type", SecurableType), ) @@ -9088,23 +9067,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRegisteredModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRegisteredModelRequest: """Deserializes the UpdateRegisteredModelRequest from a dictionary.""" return cls( - comment=d.get("{comment}", None), - full_name=d.get("{full_name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), + comment=d.get("comment", None), + full_name=d.get("full_name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), ) @@ -9167,29 +9146,29 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = self.enable_predictive_optimization + body["enable_predictive_optimization"] = self.enable_predictive_optimization if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateSchema: """Deserializes the UpdateSchema from a dictionary.""" return cls( - comment=d.get("{comment}", None), - enable_predictive_optimization=_enum(d, "{enable_predictive_optimization}", EnablePredictiveOptimization), - full_name=d.get("{full_name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - properties=d.get("{properties}", None), + comment=d.get("comment", None), + enable_predictive_optimization=_enum(d, "enable_predictive_optimization", EnablePredictiveOptimization), + full_name=d.get("full_name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + properties=d.get("properties", None), ) @@ -9268,52 +9247,52 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal + body["azure_service_principal"] = self.azure_service_principal if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token + body["cloudflare_api_token"] = self.cloudflare_api_token if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.force is not None: - body["{force}"] = self.force + body["force"] = self.force if self.isolation_mode is not None: - body["{isolation_mode}"] = self.isolation_mode + body["isolation_mode"] = self.isolation_mode if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateStorageCredential: """Deserializes the UpdateStorageCredential from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleRequest), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityResponse), - azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), - comment=d.get("{comment}", None), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleRequest), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityResponse), + azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), + comment=d.get("comment", None), databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountRequest + d, "databricks_gcp_service_account", DatabricksGcpServiceAccountRequest ), - force=d.get("{force}", None), - isolation_mode=_enum(d, "{isolation_mode}", IsolationMode), - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - read_only=d.get("{read_only}", None), - skip_validation=d.get("{skip_validation}", None), + force=d.get("force", None), + isolation_mode=_enum(d, "isolation_mode", IsolationMode), + name=d.get("name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + read_only=d.get("read_only", None), + skip_validation=d.get("skip_validation", None), ) @@ -9348,23 +9327,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateVolumeRequestContent into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateVolumeRequestContent: """Deserializes the UpdateVolumeRequestContent from a dictionary.""" return cls( - comment=d.get("{comment}", None), - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), + comment=d.get("comment", None), + name=d.get("name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), ) @@ -9394,20 +9373,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceBindings into a shallow dictionary of its immediate attributes.""" body = {} if self.assign_workspaces: - body["{assign_workspaces}"] = self.assign_workspaces + body["assign_workspaces"] = self.assign_workspaces if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.unassign_workspaces: - body["{unassign_workspaces}"] = self.unassign_workspaces + body["unassign_workspaces"] = self.unassign_workspaces return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceBindings: """Deserializes the UpdateWorkspaceBindings from a dictionary.""" return cls( - assign_workspaces=d.get("{assign_workspaces}", None), - name=d.get("{name}", None), - unassign_workspaces=d.get("{unassign_workspaces}", None), + assign_workspaces=d.get("assign_workspaces", None), + name=d.get("name", None), + unassign_workspaces=d.get("unassign_workspaces", None), ) @@ -9442,23 +9421,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceBindingsParameters into a shallow dictionary of its immediate attributes.""" body = {} if self.add: - body["{add}"] = self.add + body["add"] = self.add if self.remove: - body["{remove}"] = self.remove + body["remove"] = self.remove if self.securable_name is not None: - body["{securable_name}"] = self.securable_name + body["securable_name"] = self.securable_name if self.securable_type is not None: - body["{securable_type}"] = self.securable_type + body["securable_type"] = self.securable_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceBindingsParameters: """Deserializes the UpdateWorkspaceBindingsParameters from a dictionary.""" return cls( - add=_repeated_dict(d, "{add}", WorkspaceBinding), - remove=_repeated_dict(d, "{remove}", WorkspaceBinding), - securable_name=d.get("{securable_name}", None), - securable_type=_enum(d, "{securable_type}", UpdateBindingsSecurableType), + add=_repeated_dict(d, "add", WorkspaceBinding), + remove=_repeated_dict(d, "remove", WorkspaceBinding), + securable_name=d.get("securable_name", None), + securable_type=_enum(d, "securable_type", UpdateBindingsSecurableType), ) @@ -9517,37 +9496,35 @@ def as_shallow_dict(self) -> dict: """Serializes the ValidateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.credential_name is not None: - body["{credential_name}"] = self.credential_name + body["credential_name"] = self.credential_name if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.external_location_name is not None: - body["{external_location_name}"] = self.external_location_name + body["external_location_name"] = self.external_location_name if self.purpose is not None: - body["{purpose}"] = self.purpose + body["purpose"] = self.purpose if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateCredentialRequest: """Deserializes the ValidateCredentialRequest from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRole), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentity), - credential_name=d.get("{credential_name}", None), - databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccount - ), - external_location_name=d.get("{external_location_name}", None), - purpose=_enum(d, "{purpose}", CredentialPurpose), - read_only=d.get("{read_only}", None), - url=d.get("{url}", None), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRole), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentity), + credential_name=d.get("credential_name", None), + databricks_gcp_service_account=_from_dict(d, "databricks_gcp_service_account", DatabricksGcpServiceAccount), + external_location_name=d.get("external_location_name", None), + purpose=_enum(d, "purpose", CredentialPurpose), + read_only=d.get("read_only", None), + url=d.get("url", None), ) @@ -9573,15 +9550,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ValidateCredentialResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["isDir"] = self.is_dir if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateCredentialResponse: """Deserializes the ValidateCredentialResponse from a dictionary.""" - return cls(is_dir=d.get("{is_dir}", None), results=_repeated_dict(d, "{results}", CredentialValidationResult)) + return cls(is_dir=d.get("isDir", None), results=_repeated_dict(d, "results", CredentialValidationResult)) class ValidateCredentialResult(Enum): @@ -9648,40 +9625,40 @@ def as_shallow_dict(self) -> dict: """Serializes the ValidateStorageCredential into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_iam_role: - body["{aws_iam_role}"] = self.aws_iam_role + body["aws_iam_role"] = self.aws_iam_role if self.azure_managed_identity: - body["{azure_managed_identity}"] = self.azure_managed_identity + body["azure_managed_identity"] = self.azure_managed_identity if self.azure_service_principal: - body["{azure_service_principal}"] = self.azure_service_principal + body["azure_service_principal"] = self.azure_service_principal if self.cloudflare_api_token: - body["{cloudflare_api_token}"] = self.cloudflare_api_token + body["cloudflare_api_token"] = self.cloudflare_api_token if self.databricks_gcp_service_account: - body["{databricks_gcp_service_account}"] = self.databricks_gcp_service_account + body["databricks_gcp_service_account"] = self.databricks_gcp_service_account if self.external_location_name is not None: - body["{external_location_name}"] = self.external_location_name + body["external_location_name"] = self.external_location_name if self.read_only is not None: - body["{read_only}"] = self.read_only + body["read_only"] = self.read_only if self.storage_credential_name is not None: - body["{storage_credential_name}"] = self.storage_credential_name + body["storage_credential_name"] = self.storage_credential_name if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateStorageCredential: """Deserializes the ValidateStorageCredential from a dictionary.""" return cls( - aws_iam_role=_from_dict(d, "{aws_iam_role}", AwsIamRoleRequest), - azure_managed_identity=_from_dict(d, "{azure_managed_identity}", AzureManagedIdentityRequest), - azure_service_principal=_from_dict(d, "{azure_service_principal}", AzureServicePrincipal), - cloudflare_api_token=_from_dict(d, "{cloudflare_api_token}", CloudflareApiToken), + aws_iam_role=_from_dict(d, "aws_iam_role", AwsIamRoleRequest), + azure_managed_identity=_from_dict(d, "azure_managed_identity", AzureManagedIdentityRequest), + azure_service_principal=_from_dict(d, "azure_service_principal", AzureServicePrincipal), + cloudflare_api_token=_from_dict(d, "cloudflare_api_token", CloudflareApiToken), databricks_gcp_service_account=_from_dict( - d, "{databricks_gcp_service_account}", DatabricksGcpServiceAccountRequest + d, "databricks_gcp_service_account", DatabricksGcpServiceAccountRequest ), - external_location_name=d.get("{external_location_name}", None), - read_only=d.get("{read_only}", None), - storage_credential_name=d.get("{storage_credential_name}", None), - url=d.get("{url}", None), + external_location_name=d.get("external_location_name", None), + read_only=d.get("read_only", None), + storage_credential_name=d.get("storage_credential_name", None), + url=d.get("url", None), ) @@ -9706,15 +9683,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ValidateStorageCredentialResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["isDir"] = self.is_dir if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidateStorageCredentialResponse: """Deserializes the ValidateStorageCredentialResponse from a dictionary.""" - return cls(is_dir=d.get("{is_dir}", None), results=_repeated_dict(d, "{results}", ValidationResult)) + return cls(is_dir=d.get("isDir", None), results=_repeated_dict(d, "results", ValidationResult)) @dataclass @@ -9743,20 +9720,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ValidationResult into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.operation is not None: - body["{operation}"] = self.operation + body["operation"] = self.operation if self.result is not None: - body["{result}"] = self.result + body["result"] = self.result return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ValidationResult: """Deserializes the ValidationResult from a dictionary.""" return cls( - message=d.get("{message}", None), - operation=_enum(d, "{operation}", ValidationResultOperation), - result=_enum(d, "{result}", ValidationResultResult), + message=d.get("message", None), + operation=_enum(d, "operation", ValidationResultOperation), + result=_enum(d, "result", ValidationResultResult), ) @@ -9877,62 +9854,62 @@ def as_shallow_dict(self) -> dict: """Serializes the VolumeInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.access_point is not None: - body["{access_point}"] = self.access_point + body["access_point"] = self.access_point if self.browse_only is not None: - body["{browse_only}"] = self.browse_only + body["browse_only"] = self.browse_only if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.encryption_details: - body["{encryption_details}"] = self.encryption_details + body["encryption_details"] = self.encryption_details if self.full_name is not None: - body["{full_name}"] = self.full_name + body["full_name"] = self.full_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.volume_id is not None: - body["{volume_id}"] = self.volume_id + body["volume_id"] = self.volume_id if self.volume_type is not None: - body["{volume_type}"] = self.volume_type + body["volume_type"] = self.volume_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumeInfo: """Deserializes the VolumeInfo from a dictionary.""" return cls( - access_point=d.get("{access_point}", None), - browse_only=d.get("{browse_only}", None), - catalog_name=d.get("{catalog_name}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - encryption_details=_from_dict(d, "{encryption_details}", EncryptionDetails), - full_name=d.get("{full_name}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - schema_name=d.get("{schema_name}", None), - storage_location=d.get("{storage_location}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - volume_id=d.get("{volume_id}", None), - volume_type=_enum(d, "{volume_type}", VolumeType), + access_point=d.get("access_point", None), + browse_only=d.get("browse_only", None), + catalog_name=d.get("catalog_name", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + encryption_details=_from_dict(d, "encryption_details", EncryptionDetails), + full_name=d.get("full_name", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + schema_name=d.get("schema_name", None), + storage_location=d.get("storage_location", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + volume_id=d.get("volume_id", None), + volume_type=_enum(d, "volume_type", VolumeType), ) @@ -9966,17 +9943,16 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceBinding into a shallow dictionary of its immediate attributes.""" body = {} if self.binding_type is not None: - body["{binding_type}"] = self.binding_type + body["binding_type"] = self.binding_type if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceBinding: """Deserializes the WorkspaceBinding from a dictionary.""" return cls( - binding_type=_enum(d, "{binding_type}", WorkspaceBindingBindingType), - workspace_id=d.get("{workspace_id}", None), + binding_type=_enum(d, "binding_type", WorkspaceBindingBindingType), workspace_id=d.get("workspace_id", None) ) @@ -10010,16 +9986,16 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceBindingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.bindings: - body["{bindings}"] = self.bindings + body["bindings"] = self.bindings if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceBindingsResponse: """Deserializes the WorkspaceBindingsResponse from a dictionary.""" return cls( - bindings=_repeated_dict(d, "{bindings}", WorkspaceBinding), next_page_token=d.get("{next_page_token}", None) + bindings=_repeated_dict(d, "bindings", WorkspaceBinding), next_page_token=d.get("next_page_token", None) ) @@ -10046,7 +10022,7 @@ def create( """ body = {} if metastore_assignment is not None: - body["{metastore_assignment}"] = metastore_assignment.as_dict() + body["metastore_assignment"] = metastore_assignment.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10143,7 +10119,7 @@ def update( """ body = {} if metastore_assignment is not None: - body["{metastore_assignment}"] = metastore_assignment.as_dict() + body["metastore_assignment"] = metastore_assignment.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10175,7 +10151,7 @@ def create(self, *, metastore_info: Optional[CreateMetastore] = None) -> Account """ body = {} if metastore_info is not None: - body["{metastore_info}"] = metastore_info.as_dict() + body["metastore_info"] = metastore_info.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10199,7 +10175,7 @@ def delete(self, metastore_id: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -10260,7 +10236,7 @@ def update(self, metastore_id: str, *, metastore_info: Optional[UpdateMetastore] """ body = {} if metastore_info is not None: - body["{metastore_info}"] = metastore_info.as_dict() + body["metastore_info"] = metastore_info.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10299,7 +10275,7 @@ def create( """ body = {} if credential_info is not None: - body["{credential_info}"] = credential_info.as_dict() + body["credential_info"] = credential_info.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10331,7 +10307,7 @@ def delete(self, metastore_id: str, storage_credential_name: str, *, force: Opti query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -10413,7 +10389,7 @@ def update( """ body = {} if credential_info is not None: - body["{credential_info}"] = credential_info.as_dict() + body["credential_info"] = credential_info.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10470,7 +10446,7 @@ def update(self, artifact_type: ArtifactType, artifact_matchers: List[ArtifactMa """ body = {} if artifact_matchers is not None: - body["{artifact_matchers}"] = [v.as_dict() for v in artifact_matchers] + body["artifact_matchers"] = [v.as_dict() for v in artifact_matchers] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10533,21 +10509,21 @@ def create( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if connection_name is not None: - body["{connection_name}"] = connection_name + body["connection_name"] = connection_name if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options + body["options"] = options if properties is not None: - body["{properties}"] = properties + body["properties"] = properties if provider_name is not None: - body["{provider_name}"] = provider_name + body["provider_name"] = provider_name if share_name is not None: - body["{share_name}"] = share_name + body["share_name"] = share_name if storage_root is not None: - body["{storage_root}"] = storage_root + body["storage_root"] = storage_root headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10572,7 +10548,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -10596,7 +10572,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> CatalogInf query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse headers = { "0": "{Accept application/json}", } @@ -10637,25 +10613,25 @@ def list( query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/catalogs", query=query, headers=headers) - if "{catalogs}" in json: - for v in json["{catalogs}"]: + if "catalogs" in json: + for v in json["catalogs"]: yield CatalogInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -10695,19 +10671,19 @@ def update( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = enable_predictive_optimization.value + body["enable_predictive_optimization"] = enable_predictive_optimization.value if isolation_mode is not None: - body["{isolation_mode}"] = isolation_mode.value + body["isolation_mode"] = isolation_mode.value if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if options is not None: - body["{options}"] = options + body["options"] = options if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if properties is not None: - body["{properties}"] = properties + body["properties"] = properties headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10764,17 +10740,17 @@ def create( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if connection_type is not None: - body["{connection_type}"] = connection_type.value + body["connection_type"] = connection_type.value if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options + body["options"] = options if properties is not None: - body["{properties}"] = properties + body["properties"] = properties if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10836,23 +10812,23 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/connections", query=query, headers=headers) - if "{connections}" in json: - for v in json["{connections}"]: + if "connections" in json: + for v in json["connections"]: yield ConnectionInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, name: str, options: Dict[str, str], *, new_name: Optional[str] = None, owner: Optional[str] = None @@ -10874,11 +10850,11 @@ def update( """ body = {} if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if options is not None: - body["{options}"] = options + body["options"] = options if owner is not None: - body["{owner}"] = owner + body["owner"] = owner headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10946,23 +10922,23 @@ def create_credential( """ body = {} if aws_iam_role is not None: - body["{aws_iam_role}"] = aws_iam_role.as_dict() + body["aws_iam_role"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["{azure_managed_identity}"] = azure_managed_identity.as_dict() + body["azure_managed_identity"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["{azure_service_principal}"] = azure_service_principal.as_dict() + body["azure_service_principal"] = azure_service_principal.as_dict() if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if databricks_gcp_service_account is not None: - body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() if name is not None: - body["{name}"] = name + body["name"] = name if purpose is not None: - body["{purpose}"] = purpose.value + body["purpose"] = purpose.value if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if skip_validation is not None: - body["{skip_validation}"] = skip_validation + body["skip_validation"] = skip_validation headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10988,7 +10964,7 @@ def delete_credential(self, name_arg: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -11018,11 +10994,11 @@ def generate_temporary_service_credential( """ body = {} if azure_options is not None: - body["{azure_options}"] = azure_options.as_dict() + body["azure_options"] = azure_options.as_dict() if credential_name is not None: - body["{credential_name}"] = credential_name + body["credential_name"] = credential_name if gcp_options is not None: - body["{gcp_options}"] = gcp_options.as_dict() + body["gcp_options"] = gcp_options.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11080,23 +11056,23 @@ def list_credentials( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if purpose is not None: - query["{purpose}"] = purpose.value + query["purpose"] = purpose.value headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/credentials", query=query, headers=headers) - if "{credentials}" in json: - for v in json["{credentials}"]: + if "credentials" in json: + for v in json["credentials"]: yield CredentialInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update_credential( self, @@ -11152,27 +11128,27 @@ def update_credential( """ body = {} if aws_iam_role is not None: - body["{aws_iam_role}"] = aws_iam_role.as_dict() + body["aws_iam_role"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["{azure_managed_identity}"] = azure_managed_identity.as_dict() + body["azure_managed_identity"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["{azure_service_principal}"] = azure_service_principal.as_dict() + body["azure_service_principal"] = azure_service_principal.as_dict() if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if databricks_gcp_service_account is not None: - body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() if force is not None: - body["{force}"] = force + body["force"] = force if isolation_mode is not None: - body["{isolation_mode}"] = isolation_mode.value + body["isolation_mode"] = isolation_mode.value if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if skip_validation is not None: - body["{skip_validation}"] = skip_validation + body["skip_validation"] = skip_validation headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11232,21 +11208,21 @@ def validate_credential( """ body = {} if aws_iam_role is not None: - body["{aws_iam_role}"] = aws_iam_role.as_dict() + body["aws_iam_role"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["{azure_managed_identity}"] = azure_managed_identity.as_dict() + body["azure_managed_identity"] = azure_managed_identity.as_dict() if credential_name is not None: - body["{credential_name}"] = credential_name + body["credential_name"] = credential_name if databricks_gcp_service_account is not None: - body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() if external_location_name is not None: - body["{external_location_name}"] = external_location_name + body["external_location_name"] = external_location_name if purpose is not None: - body["{purpose}"] = purpose.value + body["purpose"] = purpose.value if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if url is not None: - body["{url}"] = url + body["url"] = url headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11315,23 +11291,23 @@ def create( """ body = {} if access_point is not None: - body["{access_point}"] = access_point + body["access_point"] = access_point if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if credential_name is not None: - body["{credential_name}"] = credential_name + body["credential_name"] = credential_name if encryption_details is not None: - body["{encryption_details}"] = encryption_details.as_dict() + body["encryption_details"] = encryption_details.as_dict() if fallback is not None: - body["{fallback}"] = fallback + body["fallback"] = fallback if name is not None: - body["{name}"] = name + body["name"] = name if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if skip_validation is not None: - body["{skip_validation}"] = skip_validation + body["skip_validation"] = skip_validation if url is not None: - body["{url}"] = url + body["url"] = url headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11356,7 +11332,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -11380,7 +11356,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> ExternalLo query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse headers = { "0": "{Accept application/json}", } @@ -11417,25 +11393,25 @@ def list( query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/external-locations", query=query, headers=headers) - if "{external_locations}" in json: - for v in json["{external_locations}"]: + if "external_locations" in json: + for v in json["external_locations"]: yield ExternalLocationInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -11492,29 +11468,29 @@ def update( """ body = {} if access_point is not None: - body["{access_point}"] = access_point + body["access_point"] = access_point if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if credential_name is not None: - body["{credential_name}"] = credential_name + body["credential_name"] = credential_name if encryption_details is not None: - body["{encryption_details}"] = encryption_details.as_dict() + body["encryption_details"] = encryption_details.as_dict() if fallback is not None: - body["{fallback}"] = fallback + body["fallback"] = fallback if force is not None: - body["{force}"] = force + body["force"] = force if isolation_mode is not None: - body["{isolation_mode}"] = isolation_mode.value + body["isolation_mode"] = isolation_mode.value if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if skip_validation is not None: - body["{skip_validation}"] = skip_validation + body["skip_validation"] = skip_validation if url is not None: - body["{url}"] = url + body["url"] = url headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11552,7 +11528,7 @@ def create(self, function_info: CreateFunction) -> FunctionInfo: """ body = {} if function_info is not None: - body["{function_info}"] = function_info.as_dict() + body["function_info"] = function_info.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11581,7 +11557,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -11610,7 +11586,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> FunctionIn query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse headers = { "0": "{Accept application/json}", } @@ -11655,27 +11631,27 @@ def list( query = {} if catalog_name is not None: - query["{catalog_name}"] = catalog_name + query["catalog_name"] = catalog_name if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if schema_name is not None: - query["{schema_name}"] = schema_name + query["schema_name"] = schema_name headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/functions", query=query, headers=headers) - if "{functions}" in json: - for v in json["{functions}"]: + if "functions" in json: + for v in json["functions"]: yield FunctionInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: """Update a function. @@ -11697,7 +11673,7 @@ def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: """ body = {} if owner is not None: - body["{owner}"] = owner + body["owner"] = owner headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11738,7 +11714,7 @@ def get(self, securable_type: SecurableType, full_name: str, *, principal: Optio query = {} if principal is not None: - query["{principal}"] = principal + query["principal"] = principal headers = { "0": "{Accept application/json}", } @@ -11771,7 +11747,7 @@ def get_effective( query = {} if principal is not None: - query["{principal}"] = principal + query["principal"] = principal headers = { "0": "{Accept application/json}", } @@ -11802,7 +11778,7 @@ def update( """ body = {} if changes is not None: - body["{changes}"] = [v.as_dict() for v in changes] + body["changes"] = [v.as_dict() for v in changes] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11852,9 +11828,9 @@ def assign(self, workspace_id: int, metastore_id: str, default_catalog_name: str """ body = {} if default_catalog_name is not None: - body["{default_catalog_name}"] = default_catalog_name + body["default_catalog_name"] = default_catalog_name if metastore_id is not None: - body["{metastore_id}"] = metastore_id + body["metastore_id"] = metastore_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11883,11 +11859,11 @@ def create(self, name: str, *, region: Optional[str] = None, storage_root: Optio """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if region is not None: - body["{region}"] = region + body["region"] = region if storage_root is not None: - body["{storage_root}"] = storage_root + body["storage_root"] = storage_root headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11926,7 +11902,7 @@ def delete(self, id: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -12000,7 +11976,7 @@ def unassign(self, workspace_id: int, metastore_id: str): query = {} if metastore_id is not None: - query["{metastore_id}"] = metastore_id + query["metastore_id"] = metastore_id headers = { "0": "{Accept application/json}", } @@ -12048,21 +12024,21 @@ def update( """ body = {} if delta_sharing_organization_name is not None: - body["{delta_sharing_organization_name}"] = delta_sharing_organization_name + body["delta_sharing_organization_name"] = delta_sharing_organization_name if delta_sharing_recipient_token_lifetime_in_seconds is not None: - body["{delta_sharing_recipient_token_lifetime_in_seconds}"] = ( + body["delta_sharing_recipient_token_lifetime_in_seconds"] = ( delta_sharing_recipient_token_lifetime_in_seconds ) if delta_sharing_scope is not None: - body["{delta_sharing_scope}"] = delta_sharing_scope.value + body["delta_sharing_scope"] = delta_sharing_scope.value if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if privilege_model_version is not None: - body["{privilege_model_version}"] = privilege_model_version + body["privilege_model_version"] = privilege_model_version if storage_root_credential_id is not None: - body["{storage_root_credential_id}"] = storage_root_credential_id + body["storage_root_credential_id"] = storage_root_credential_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12093,9 +12069,9 @@ def update_assignment( """ body = {} if default_catalog_name is not None: - body["{default_catalog_name}"] = default_catalog_name + body["default_catalog_name"] = default_catalog_name if metastore_id is not None: - body["{metastore_id}"] = metastore_id + body["metastore_id"] = metastore_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12168,9 +12144,9 @@ def get( query = {} if include_aliases is not None: - query["{include_aliases}"] = include_aliases + query["include_aliases"] = include_aliases if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse headers = { "0": "{Accept application/json}", } @@ -12201,7 +12177,7 @@ def get_by_alias(self, full_name: str, alias: str, *, include_aliases: Optional[ query = {} if include_aliases is not None: - query["{include_aliases}"] = include_aliases + query["include_aliases"] = include_aliases headers = { "0": "{Accept application/json}", } @@ -12252,11 +12228,11 @@ def list( query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -12265,12 +12241,12 @@ def list( json = self._api.do( "GET", f"/api/2.1/unity-catalog/models/{full_name}/versions", query=query, headers=headers ) - if "{model_versions}" in json: - for v in json["{model_versions}"]: + if "model_versions" in json: + for v in json["model_versions"]: yield ModelVersionInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, full_name: str, version: int, *, comment: Optional[str] = None) -> ModelVersionInfo: """Update a Model Version. @@ -12294,7 +12270,7 @@ def update(self, full_name: str, version: int, *, comment: Optional[str] = None) """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12332,7 +12308,7 @@ def create(self, *, table: Optional[OnlineTable] = None) -> Wait[OnlineTable]: op_response = self._api.do("POST", "/api/2.0/online-tables", body=body, headers=headers) return Wait( - self.WaitGetOnlineTableActive, response=OnlineTable.from_dict(op_response), name=op_response["{name}"] + self.WaitGetOnlineTableActive, response=OnlineTable.from_dict(op_response), name=op_response["name"] ) def create_and_wait(self, *, table: Optional[OnlineTable] = None, timeout=timedelta(minutes=20)) -> OnlineTable: @@ -12481,31 +12457,31 @@ def create( """ body = {} if assets_dir is not None: - body["{assets_dir}"] = assets_dir + body["assets_dir"] = assets_dir if baseline_table_name is not None: - body["{baseline_table_name}"] = baseline_table_name + body["baseline_table_name"] = baseline_table_name if custom_metrics is not None: - body["{custom_metrics}"] = [v.as_dict() for v in custom_metrics] + body["custom_metrics"] = [v.as_dict() for v in custom_metrics] if data_classification_config is not None: - body["{data_classification_config}"] = data_classification_config.as_dict() + body["data_classification_config"] = data_classification_config.as_dict() if inference_log is not None: - body["{inference_log}"] = inference_log.as_dict() + body["inference_log"] = inference_log.as_dict() if notifications is not None: - body["{notifications}"] = notifications.as_dict() + body["notifications"] = notifications.as_dict() if output_schema_name is not None: - body["{output_schema_name}"] = output_schema_name + body["output_schema_name"] = output_schema_name if schedule is not None: - body["{schedule}"] = schedule.as_dict() + body["schedule"] = schedule.as_dict() if skip_builtin_dashboard is not None: - body["{skip_builtin_dashboard}"] = skip_builtin_dashboard + body["skip_builtin_dashboard"] = skip_builtin_dashboard if slicing_exprs is not None: - body["{slicing_exprs}"] = [v for v in slicing_exprs] + body["slicing_exprs"] = [v for v in slicing_exprs] if snapshot is not None: - body["{snapshot}"] = snapshot.as_dict() + body["snapshot"] = snapshot.as_dict() if time_series is not None: - body["{time_series}"] = time_series.as_dict() + body["time_series"] = time_series.as_dict() if warehouse_id is not None: - body["{warehouse_id}"] = warehouse_id + body["warehouse_id"] = warehouse_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12645,7 +12621,7 @@ def regenerate_dashboard( """ body = {} if warehouse_id is not None: - body["{warehouse_id}"] = warehouse_id + body["warehouse_id"] = warehouse_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12746,27 +12722,27 @@ def update( """ body = {} if baseline_table_name is not None: - body["{baseline_table_name}"] = baseline_table_name + body["baseline_table_name"] = baseline_table_name if custom_metrics is not None: - body["{custom_metrics}"] = [v.as_dict() for v in custom_metrics] + body["custom_metrics"] = [v.as_dict() for v in custom_metrics] if dashboard_id is not None: - body["{dashboard_id}"] = dashboard_id + body["dashboard_id"] = dashboard_id if data_classification_config is not None: - body["{data_classification_config}"] = data_classification_config.as_dict() + body["data_classification_config"] = data_classification_config.as_dict() if inference_log is not None: - body["{inference_log}"] = inference_log.as_dict() + body["inference_log"] = inference_log.as_dict() if notifications is not None: - body["{notifications}"] = notifications.as_dict() + body["notifications"] = notifications.as_dict() if output_schema_name is not None: - body["{output_schema_name}"] = output_schema_name + body["output_schema_name"] = output_schema_name if schedule is not None: - body["{schedule}"] = schedule.as_dict() + body["schedule"] = schedule.as_dict() if slicing_exprs is not None: - body["{slicing_exprs}"] = [v for v in slicing_exprs] + body["slicing_exprs"] = [v for v in slicing_exprs] if snapshot is not None: - body["{snapshot}"] = snapshot.as_dict() + body["snapshot"] = snapshot.as_dict() if time_series is not None: - body["{time_series}"] = time_series.as_dict() + body["time_series"] = time_series.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12841,15 +12817,15 @@ def create( """ body = {} if catalog_name is not None: - body["{catalog_name}"] = catalog_name + body["catalog_name"] = catalog_name if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if schema_name is not None: - body["{schema_name}"] = schema_name + body["schema_name"] = schema_name if storage_location is not None: - body["{storage_location}"] = storage_location + body["storage_location"] = storage_location headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12922,9 +12898,9 @@ def get( query = {} if include_aliases is not None: - query["{include_aliases}"] = include_aliases + query["include_aliases"] = include_aliases if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse headers = { "0": "{Accept application/json}", } @@ -12985,27 +12961,27 @@ def list( query = {} if catalog_name is not None: - query["{catalog_name}"] = catalog_name + query["catalog_name"] = catalog_name if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if schema_name is not None: - query["{schema_name}"] = schema_name + query["schema_name"] = schema_name headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/models", query=query, headers=headers) - if "{registered_models}" in json: - for v in json["{registered_models}"]: + if "registered_models" in json: + for v in json["registered_models"]: yield RegisteredModelInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredModelAlias: """Set a Registered Model Alias. @@ -13027,7 +13003,7 @@ def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredM """ body = {} if version_num is not None: - body["{version_num}"] = version_num + body["version_num"] = version_num headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13069,11 +13045,11 @@ def update( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13141,9 +13117,9 @@ def list_quotas( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -13152,12 +13128,12 @@ def list_quotas( json = self._api.do( "GET", "/api/2.1/unity-catalog/resource-quotas/all-resource-quotas", query=query, headers=headers ) - if "{quotas}" in json: - for v in json["{quotas}"]: + if "quotas" in json: + for v in json["quotas"]: yield QuotaInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class SchemasAPI: @@ -13198,15 +13174,15 @@ def create( """ body = {} if catalog_name is not None: - body["{catalog_name}"] = catalog_name + body["catalog_name"] = catalog_name if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if properties is not None: - body["{properties}"] = properties + body["properties"] = properties if storage_root is not None: - body["{storage_root}"] = storage_root + body["storage_root"] = storage_root headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13231,7 +13207,7 @@ def delete(self, full_name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -13255,7 +13231,7 @@ def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> Schem query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse headers = { "0": "{Accept application/json}", } @@ -13296,27 +13272,27 @@ def list( query = {} if catalog_name is not None: - query["{catalog_name}"] = catalog_name + query["catalog_name"] = catalog_name if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/schemas", query=query, headers=headers) - if "{schemas}" in json: - for v in json["{schemas}"]: + if "schemas" in json: + for v in json["schemas"]: yield SchemaInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -13352,15 +13328,15 @@ def update( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if enable_predictive_optimization is not None: - body["{enable_predictive_optimization}"] = enable_predictive_optimization.value + body["enable_predictive_optimization"] = enable_predictive_optimization.value if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if properties is not None: - body["{properties}"] = properties + body["properties"] = properties headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13425,23 +13401,23 @@ def create( """ body = {} if aws_iam_role is not None: - body["{aws_iam_role}"] = aws_iam_role.as_dict() + body["aws_iam_role"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["{azure_managed_identity}"] = azure_managed_identity.as_dict() + body["azure_managed_identity"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["{azure_service_principal}"] = azure_service_principal.as_dict() + body["azure_service_principal"] = azure_service_principal.as_dict() if cloudflare_api_token is not None: - body["{cloudflare_api_token}"] = cloudflare_api_token.as_dict() + body["cloudflare_api_token"] = cloudflare_api_token.as_dict() if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if databricks_gcp_service_account is not None: - body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() if name is not None: - body["{name}"] = name + body["name"] = name if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if skip_validation is not None: - body["{skip_validation}"] = skip_validation + body["skip_validation"] = skip_validation headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13466,7 +13442,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: - query["{force}"] = force + query["force"] = force headers = { "0": "{Accept application/json}", } @@ -13516,23 +13492,23 @@ def list( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/storage-credentials", query=query, headers=headers) - if "{storage_credentials}" in json: - for v in json["{storage_credentials}"]: + if "storage_credentials" in json: + for v in json["storage_credentials"]: yield StorageCredentialInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -13585,29 +13561,29 @@ def update( """ body = {} if aws_iam_role is not None: - body["{aws_iam_role}"] = aws_iam_role.as_dict() + body["aws_iam_role"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["{azure_managed_identity}"] = azure_managed_identity.as_dict() + body["azure_managed_identity"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["{azure_service_principal}"] = azure_service_principal.as_dict() + body["azure_service_principal"] = azure_service_principal.as_dict() if cloudflare_api_token is not None: - body["{cloudflare_api_token}"] = cloudflare_api_token.as_dict() + body["cloudflare_api_token"] = cloudflare_api_token.as_dict() if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if databricks_gcp_service_account is not None: - body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() if force is not None: - body["{force}"] = force + body["force"] = force if isolation_mode is not None: - body["{isolation_mode}"] = isolation_mode.value + body["isolation_mode"] = isolation_mode.value if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if skip_validation is not None: - body["{skip_validation}"] = skip_validation + body["skip_validation"] = skip_validation headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13664,23 +13640,23 @@ def validate( """ body = {} if aws_iam_role is not None: - body["{aws_iam_role}"] = aws_iam_role.as_dict() + body["aws_iam_role"] = aws_iam_role.as_dict() if azure_managed_identity is not None: - body["{azure_managed_identity}"] = azure_managed_identity.as_dict() + body["azure_managed_identity"] = azure_managed_identity.as_dict() if azure_service_principal is not None: - body["{azure_service_principal}"] = azure_service_principal.as_dict() + body["azure_service_principal"] = azure_service_principal.as_dict() if cloudflare_api_token is not None: - body["{cloudflare_api_token}"] = cloudflare_api_token.as_dict() + body["cloudflare_api_token"] = cloudflare_api_token.as_dict() if databricks_gcp_service_account is not None: - body["{databricks_gcp_service_account}"] = databricks_gcp_service_account.as_dict() + body["databricks_gcp_service_account"] = databricks_gcp_service_account.as_dict() if external_location_name is not None: - body["{external_location_name}"] = external_location_name + body["external_location_name"] = external_location_name if read_only is not None: - body["{read_only}"] = read_only + body["read_only"] = read_only if storage_credential_name is not None: - body["{storage_credential_name}"] = storage_credential_name + body["storage_credential_name"] = storage_credential_name if url is not None: - body["{url}"] = url + body["url"] = url headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13764,25 +13740,25 @@ def list( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do( "GET", f"/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas", query=query, headers=headers ) - if "{schemas}" in json: - for v in json["{schemas}"]: + if "schemas" in json: + for v in json["schemas"]: yield SystemSchemaInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class TableConstraintsAPI: @@ -13822,9 +13798,9 @@ def create(self, full_name_arg: str, constraint: TableConstraint) -> TableConstr """ body = {} if constraint is not None: - body["{constraint}"] = constraint.as_dict() + body["constraint"] = constraint.as_dict() if full_name_arg is not None: - body["{full_name_arg}"] = full_name_arg + body["full_name_arg"] = full_name_arg headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -13858,9 +13834,9 @@ def delete(self, full_name: str, constraint_name: str, cascade: bool): query = {} if cascade is not None: - query["{cascade}"] = cascade + query["cascade"] = cascade if constraint_name is not None: - query["{constraint_name}"] = constraint_name + query["constraint_name"] = constraint_name headers = { "0": "{Accept application/json}", } @@ -13955,11 +13931,11 @@ def get( query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if include_delta_metadata is not None: - query["{include_delta_metadata}"] = include_delta_metadata + query["include_delta_metadata"] = include_delta_metadata if include_manifest_capabilities is not None: - query["{include_manifest_capabilities}"] = include_manifest_capabilities + query["include_manifest_capabilities"] = include_manifest_capabilities headers = { "0": "{Accept application/json}", } @@ -14020,39 +13996,39 @@ def list( query = {} if catalog_name is not None: - query["{catalog_name}"] = catalog_name + query["catalog_name"] = catalog_name if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if include_delta_metadata is not None: - query["{include_delta_metadata}"] = include_delta_metadata + query["include_delta_metadata"] = include_delta_metadata if include_manifest_capabilities is not None: - query["{include_manifest_capabilities}"] = include_manifest_capabilities + query["include_manifest_capabilities"] = include_manifest_capabilities if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if omit_columns is not None: - query["{omit_columns}"] = omit_columns + query["omit_columns"] = omit_columns if omit_properties is not None: - query["{omit_properties}"] = omit_properties + query["omit_properties"] = omit_properties if omit_username is not None: - query["{omit_username}"] = omit_username + query["omit_username"] = omit_username if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if schema_name is not None: - query["{schema_name}"] = schema_name + query["schema_name"] = schema_name headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/tables", query=query, headers=headers) - if "{tables}" in json: - for v in json["{tables}"]: + if "tables" in json: + for v in json["tables"]: yield TableInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_summaries( self, @@ -14099,31 +14075,31 @@ def list_summaries( query = {} if catalog_name is not None: - query["{catalog_name}"] = catalog_name + query["catalog_name"] = catalog_name if include_manifest_capabilities is not None: - query["{include_manifest_capabilities}"] = include_manifest_capabilities + query["include_manifest_capabilities"] = include_manifest_capabilities if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if schema_name_pattern is not None: - query["{schema_name_pattern}"] = schema_name_pattern + query["schema_name_pattern"] = schema_name_pattern if table_name_pattern is not None: - query["{table_name_pattern}"] = table_name_pattern + query["table_name_pattern"] = table_name_pattern headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/table-summaries", query=query, headers=headers) - if "{tables}" in json: - for v in json["{tables}"]: + if "tables" in json: + for v in json["tables"]: yield TableSummary.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, full_name: str, *, owner: Optional[str] = None): """Update a table owner. @@ -14141,7 +14117,7 @@ def update(self, full_name: str, *, owner: Optional[str] = None): """ body = {} if owner is not None: - body["{owner}"] = owner + body["owner"] = owner headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -14187,9 +14163,9 @@ def generate_temporary_table_credentials( """ body = {} if operation is not None: - body["{operation}"] = operation.value + body["operation"] = operation.value if table_id is not None: - body["{table_id}"] = table_id + body["table_id"] = table_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -14259,17 +14235,17 @@ def create( """ body = {} if catalog_name is not None: - body["{catalog_name}"] = catalog_name + body["catalog_name"] = catalog_name if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if schema_name is not None: - body["{schema_name}"] = schema_name + body["schema_name"] = schema_name if storage_location is not None: - body["{storage_location}"] = storage_location + body["storage_location"] = storage_location if volume_type is not None: - body["{volume_type}"] = volume_type.value + body["volume_type"] = volume_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -14346,27 +14322,27 @@ def list( query = {} if catalog_name is not None: - query["{catalog_name}"] = catalog_name + query["catalog_name"] = catalog_name if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if schema_name is not None: - query["{schema_name}"] = schema_name + query["schema_name"] = schema_name headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/unity-catalog/volumes", query=query, headers=headers) - if "{volumes}" in json: - for v in json["{volumes}"]: + if "volumes" in json: + for v in json["volumes"]: yield VolumeInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInfo: """Get a Volume. @@ -14388,7 +14364,7 @@ def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInf query = {} if include_browse is not None: - query["{include_browse}"] = include_browse + query["include_browse"] = include_browse headers = { "0": "{Accept application/json}", } @@ -14422,11 +14398,11 @@ def update( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -14504,9 +14480,9 @@ def get_bindings( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -14518,12 +14494,12 @@ def get_bindings( query=query, headers=headers, ) - if "{bindings}" in json: - for v in json["{bindings}"]: + if "bindings" in json: + for v in json["bindings"]: yield WorkspaceBinding.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -14548,9 +14524,9 @@ def update( """ body = {} if assign_workspaces is not None: - body["{assign_workspaces}"] = [v for v in assign_workspaces] + body["assign_workspaces"] = [v for v in assign_workspaces] if unassign_workspaces is not None: - body["{unassign_workspaces}"] = [v for v in unassign_workspaces] + body["unassign_workspaces"] = [v for v in unassign_workspaces] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -14587,9 +14563,9 @@ def update_bindings( """ body = {} if add is not None: - body["{add}"] = [v.as_dict() for v in add] + body["add"] = [v.as_dict() for v in add] if remove is not None: - body["{remove}"] = [v.as_dict() for v in remove] + body["remove"] = [v.as_dict() for v in remove] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/cleanrooms/v2/impl.py b/databricks/sdk/cleanrooms/v2/impl.py index 23c592c20..94c4910d7 100755 --- a/databricks/sdk/cleanrooms/v2/impl.py +++ b/databricks/sdk/cleanrooms/v2/impl.py @@ -82,41 +82,41 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoom into a shallow dictionary of its immediate attributes.""" body = {} if self.access_restricted is not None: - body["{access_restricted}"] = self.access_restricted + body["access_restricted"] = self.access_restricted if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.local_collaborator_alias is not None: - body["{local_collaborator_alias}"] = self.local_collaborator_alias + body["local_collaborator_alias"] = self.local_collaborator_alias if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.output_catalog: - body["{output_catalog}"] = self.output_catalog + body["output_catalog"] = self.output_catalog if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.remote_detailed_info: - body["{remote_detailed_info}"] = self.remote_detailed_info + body["remote_detailed_info"] = self.remote_detailed_info if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoom: """Deserializes the CleanRoom from a dictionary.""" return cls( - access_restricted=_enum(d, "{access_restricted}", CleanRoomAccessRestricted), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - local_collaborator_alias=d.get("{local_collaborator_alias}", None), - name=d.get("{name}", None), - output_catalog=_from_dict(d, "{output_catalog}", CleanRoomOutputCatalog), - owner=d.get("{owner}", None), - remote_detailed_info=_from_dict(d, "{remote_detailed_info}", CleanRoomRemoteDetail), - status=_enum(d, "{status}", CleanRoomStatusEnum), - updated_at=d.get("{updated_at}", None), + access_restricted=_enum(d, "access_restricted", CleanRoomAccessRestricted), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + local_collaborator_alias=d.get("local_collaborator_alias", None), + name=d.get("name", None), + output_catalog=_from_dict(d, "output_catalog", CleanRoomOutputCatalog), + owner=d.get("owner", None), + remote_detailed_info=_from_dict(d, "remote_detailed_info", CleanRoomRemoteDetail), + status=_enum(d, "status", CleanRoomStatusEnum), + updated_at=d.get("updated_at", None), ) @@ -218,52 +218,52 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAsset into a shallow dictionary of its immediate attributes.""" body = {} if self.added_at is not None: - body["{added_at}"] = self.added_at + body["added_at"] = self.added_at if self.asset_type is not None: - body["{asset_type}"] = self.asset_type + body["asset_type"] = self.asset_type if self.foreign_table: - body["{foreign_table}"] = self.foreign_table + body["foreign_table"] = self.foreign_table if self.foreign_table_local_details: - body["{foreign_table_local_details}"] = self.foreign_table_local_details + body["foreign_table_local_details"] = self.foreign_table_local_details if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notebook: - body["{notebook}"] = self.notebook + body["notebook"] = self.notebook if self.owner_collaborator_alias is not None: - body["{owner_collaborator_alias}"] = self.owner_collaborator_alias + body["owner_collaborator_alias"] = self.owner_collaborator_alias if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.table: - body["{table}"] = self.table + body["table"] = self.table if self.table_local_details: - body["{table_local_details}"] = self.table_local_details + body["table_local_details"] = self.table_local_details if self.view: - body["{view}"] = self.view + body["view"] = self.view if self.view_local_details: - body["{view_local_details}"] = self.view_local_details + body["view_local_details"] = self.view_local_details if self.volume_local_details: - body["{volume_local_details}"] = self.volume_local_details + body["volume_local_details"] = self.volume_local_details return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAsset: """Deserializes the CleanRoomAsset from a dictionary.""" return cls( - added_at=d.get("{added_at}", None), - asset_type=_enum(d, "{asset_type}", CleanRoomAssetAssetType), - foreign_table=_from_dict(d, "{foreign_table}", CleanRoomAssetForeignTable), + added_at=d.get("added_at", None), + asset_type=_enum(d, "asset_type", CleanRoomAssetAssetType), + foreign_table=_from_dict(d, "foreign_table", CleanRoomAssetForeignTable), foreign_table_local_details=_from_dict( - d, "{foreign_table_local_details}", CleanRoomAssetForeignTableLocalDetails + d, "foreign_table_local_details", CleanRoomAssetForeignTableLocalDetails ), - name=d.get("{name}", None), - notebook=_from_dict(d, "{notebook}", CleanRoomAssetNotebook), - owner_collaborator_alias=d.get("{owner_collaborator_alias}", None), - status=_enum(d, "{status}", CleanRoomAssetStatusEnum), - table=_from_dict(d, "{table}", CleanRoomAssetTable), - table_local_details=_from_dict(d, "{table_local_details}", CleanRoomAssetTableLocalDetails), - view=_from_dict(d, "{view}", CleanRoomAssetView), - view_local_details=_from_dict(d, "{view_local_details}", CleanRoomAssetViewLocalDetails), - volume_local_details=_from_dict(d, "{volume_local_details}", CleanRoomAssetVolumeLocalDetails), + name=d.get("name", None), + notebook=_from_dict(d, "notebook", CleanRoomAssetNotebook), + owner_collaborator_alias=d.get("owner_collaborator_alias", None), + status=_enum(d, "status", CleanRoomAssetStatusEnum), + table=_from_dict(d, "table", CleanRoomAssetTable), + table_local_details=_from_dict(d, "table_local_details", CleanRoomAssetTableLocalDetails), + view=_from_dict(d, "view", CleanRoomAssetView), + view_local_details=_from_dict(d, "view_local_details", CleanRoomAssetViewLocalDetails), + volume_local_details=_from_dict(d, "volume_local_details", CleanRoomAssetVolumeLocalDetails), ) @@ -292,13 +292,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTable into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetForeignTable: """Deserializes the CleanRoomAssetForeignTable from a dictionary.""" - return cls(columns=_repeated_dict(d, "{columns}", ColumnInfo)) + return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -318,13 +318,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetForeignTableLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetForeignTableLocalDetails: """Deserializes the CleanRoomAssetForeignTableLocalDetails from a dictionary.""" - return cls(local_name=d.get("{local_name}", None)) + return cls(local_name=d.get("local_name", None)) @dataclass @@ -349,15 +349,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetNotebook into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.notebook_content is not None: - body["{notebook_content}"] = self.notebook_content + body["notebook_content"] = self.notebook_content return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetNotebook: """Deserializes the CleanRoomAssetNotebook from a dictionary.""" - return cls(etag=d.get("{etag}", None), notebook_content=d.get("{notebook_content}", None)) + return cls(etag=d.get("etag", None), notebook_content=d.get("notebook_content", None)) class CleanRoomAssetStatusEnum(Enum): @@ -383,13 +383,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetTable into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetTable: """Deserializes the CleanRoomAssetTable from a dictionary.""" - return cls(columns=_repeated_dict(d, "{columns}", ColumnInfo)) + return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -414,15 +414,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetTableLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name if self.partitions: - body["{partitions}"] = self.partitions + body["partitions"] = self.partitions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetTableLocalDetails: """Deserializes the CleanRoomAssetTableLocalDetails from a dictionary.""" - return cls(local_name=d.get("{local_name}", None), partitions=_repeated_dict(d, "{partitions}", Partition)) + return cls(local_name=d.get("local_name", None), partitions=_repeated_dict(d, "partitions", Partition)) @dataclass @@ -441,13 +441,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetView into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetView: """Deserializes the CleanRoomAssetView from a dictionary.""" - return cls(columns=_repeated_dict(d, "{columns}", ColumnInfo)) + return cls(columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -467,13 +467,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetViewLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetViewLocalDetails: """Deserializes the CleanRoomAssetViewLocalDetails from a dictionary.""" - return cls(local_name=d.get("{local_name}", None)) + return cls(local_name=d.get("local_name", None)) @dataclass @@ -493,13 +493,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomAssetVolumeLocalDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.local_name is not None: - body["{local_name}"] = self.local_name + body["local_name"] = self.local_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomAssetVolumeLocalDetails: """Deserializes the CleanRoomAssetVolumeLocalDetails from a dictionary.""" - return cls(local_name=d.get("{local_name}", None)) + return cls(local_name=d.get("local_name", None)) @dataclass @@ -557,29 +557,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomCollaborator into a shallow dictionary of its immediate attributes.""" body = {} if self.collaborator_alias is not None: - body["{collaborator_alias}"] = self.collaborator_alias + body["collaborator_alias"] = self.collaborator_alias if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.global_metastore_id is not None: - body["{global_metastore_id}"] = self.global_metastore_id + body["global_metastore_id"] = self.global_metastore_id if self.invite_recipient_email is not None: - body["{invite_recipient_email}"] = self.invite_recipient_email + body["invite_recipient_email"] = self.invite_recipient_email if self.invite_recipient_workspace_id is not None: - body["{invite_recipient_workspace_id}"] = self.invite_recipient_workspace_id + body["invite_recipient_workspace_id"] = self.invite_recipient_workspace_id if self.organization_name is not None: - body["{organization_name}"] = self.organization_name + body["organization_name"] = self.organization_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomCollaborator: """Deserializes the CleanRoomCollaborator from a dictionary.""" return cls( - collaborator_alias=d.get("{collaborator_alias}", None), - display_name=d.get("{display_name}", None), - global_metastore_id=d.get("{global_metastore_id}", None), - invite_recipient_email=d.get("{invite_recipient_email}", None), - invite_recipient_workspace_id=d.get("{invite_recipient_workspace_id}", None), - organization_name=d.get("{organization_name}", None), + collaborator_alias=d.get("collaborator_alias", None), + display_name=d.get("display_name", None), + global_metastore_id=d.get("global_metastore_id", None), + invite_recipient_email=d.get("invite_recipient_email", None), + invite_recipient_workspace_id=d.get("invite_recipient_workspace_id", None), + organization_name=d.get("organization_name", None), ) @@ -633,32 +633,32 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomNotebookTaskRun into a shallow dictionary of its immediate attributes.""" body = {} if self.collaborator_job_run_info: - body["{collaborator_job_run_info}"] = self.collaborator_job_run_info + body["collaborator_job_run_info"] = self.collaborator_job_run_info if self.notebook_job_run_state: - body["{notebook_job_run_state}"] = self.notebook_job_run_state + body["notebook_job_run_state"] = self.notebook_job_run_state if self.notebook_name is not None: - body["{notebook_name}"] = self.notebook_name + body["notebook_name"] = self.notebook_name if self.output_schema_expiration_time is not None: - body["{output_schema_expiration_time}"] = self.output_schema_expiration_time + body["output_schema_expiration_time"] = self.output_schema_expiration_time if self.output_schema_name is not None: - body["{output_schema_name}"] = self.output_schema_name + body["output_schema_name"] = self.output_schema_name if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomNotebookTaskRun: """Deserializes the CleanRoomNotebookTaskRun from a dictionary.""" return cls( - collaborator_job_run_info=_from_dict(d, "{collaborator_job_run_info}", CollaboratorJobRunInfo), - notebook_job_run_state=_from_dict(d, "{notebook_job_run_state}", CleanRoomTaskRunState), - notebook_name=d.get("{notebook_name}", None), - output_schema_expiration_time=d.get("{output_schema_expiration_time}", None), - output_schema_name=d.get("{output_schema_name}", None), - run_duration=d.get("{run_duration}", None), - start_time=d.get("{start_time}", None), + collaborator_job_run_info=_from_dict(d, "collaborator_job_run_info", CollaboratorJobRunInfo), + notebook_job_run_state=_from_dict(d, "notebook_job_run_state", CleanRoomTaskRunState), + notebook_name=d.get("notebook_name", None), + output_schema_expiration_time=d.get("output_schema_expiration_time", None), + output_schema_name=d.get("output_schema_name", None), + run_duration=d.get("run_duration", None), + start_time=d.get("start_time", None), ) @@ -685,17 +685,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomOutputCatalog into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomOutputCatalog: """Deserializes the CleanRoomOutputCatalog from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - status=_enum(d, "{status}", CleanRoomOutputCatalogOutputCatalogStatus), + catalog_name=d.get("catalog_name", None), + status=_enum(d, "status", CleanRoomOutputCatalogOutputCatalogStatus), ) @@ -759,32 +759,32 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomRemoteDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.central_clean_room_id is not None: - body["{central_clean_room_id}"] = self.central_clean_room_id + body["central_clean_room_id"] = self.central_clean_room_id if self.cloud_vendor is not None: - body["{cloud_vendor}"] = self.cloud_vendor + body["cloud_vendor"] = self.cloud_vendor if self.collaborators: - body["{collaborators}"] = self.collaborators + body["collaborators"] = self.collaborators if self.compliance_security_profile: - body["{compliance_security_profile}"] = self.compliance_security_profile + body["compliance_security_profile"] = self.compliance_security_profile if self.creator: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.egress_network_policy: - body["{egress_network_policy}"] = self.egress_network_policy + body["egress_network_policy"] = self.egress_network_policy if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomRemoteDetail: """Deserializes the CleanRoomRemoteDetail from a dictionary.""" return cls( - central_clean_room_id=d.get("{central_clean_room_id}", None), - cloud_vendor=d.get("{cloud_vendor}", None), - collaborators=_repeated_dict(d, "{collaborators}", CleanRoomCollaborator), - compliance_security_profile=_from_dict(d, "{compliance_security_profile}", ComplianceSecurityProfile), - creator=_from_dict(d, "{creator}", CleanRoomCollaborator), - egress_network_policy=_from_dict(d, "{egress_network_policy}", EgressNetworkPolicy), - region=d.get("{region}", None), + central_clean_room_id=d.get("central_clean_room_id", None), + cloud_vendor=d.get("cloud_vendor", None), + collaborators=_repeated_dict(d, "collaborators", CleanRoomCollaborator), + compliance_security_profile=_from_dict(d, "compliance_security_profile", ComplianceSecurityProfile), + creator=_from_dict(d, "creator", CleanRoomCollaborator), + egress_network_policy=_from_dict(d, "egress_network_policy", EgressNetworkPolicy), + region=d.get("region", None), ) @@ -855,17 +855,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a shallow dictionary of its immediate attributes.""" body = {} if self.life_cycle_state is not None: - body["{life_cycle_state}"] = self.life_cycle_state + body["life_cycle_state"] = self.life_cycle_state if self.result_state is not None: - body["{result_state}"] = self.result_state + body["result_state"] = self.result_state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomTaskRunState: """Deserializes the CleanRoomTaskRunState from a dictionary.""" return cls( - life_cycle_state=_enum(d, "{life_cycle_state}", CleanRoomTaskRunLifeCycleState), - result_state=_enum(d, "{result_state}", CleanRoomTaskRunResultState), + life_cycle_state=_enum(d, "life_cycle_state", CleanRoomTaskRunLifeCycleState), + result_state=_enum(d, "result_state", CleanRoomTaskRunResultState), ) @@ -905,26 +905,26 @@ def as_shallow_dict(self) -> dict: """Serializes the CollaboratorJobRunInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.collaborator_alias is not None: - body["{collaborator_alias}"] = self.collaborator_alias + body["collaborator_alias"] = self.collaborator_alias if self.collaborator_job_id is not None: - body["{collaborator_job_id}"] = self.collaborator_job_id + body["collaborator_job_id"] = self.collaborator_job_id if self.collaborator_job_run_id is not None: - body["{collaborator_job_run_id}"] = self.collaborator_job_run_id + body["collaborator_job_run_id"] = self.collaborator_job_run_id if self.collaborator_task_run_id is not None: - body["{collaborator_task_run_id}"] = self.collaborator_task_run_id + body["collaborator_task_run_id"] = self.collaborator_task_run_id if self.collaborator_workspace_id is not None: - body["{collaborator_workspace_id}"] = self.collaborator_workspace_id + body["collaborator_workspace_id"] = self.collaborator_workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CollaboratorJobRunInfo: """Deserializes the CollaboratorJobRunInfo from a dictionary.""" return cls( - collaborator_alias=d.get("{collaborator_alias}", None), - collaborator_job_id=d.get("{collaborator_job_id}", None), - collaborator_job_run_id=d.get("{collaborator_job_run_id}", None), - collaborator_task_run_id=d.get("{collaborator_task_run_id}", None), - collaborator_workspace_id=d.get("{collaborator_workspace_id}", None), + collaborator_alias=d.get("collaborator_alias", None), + collaborator_job_id=d.get("collaborator_job_id", None), + collaborator_job_run_id=d.get("collaborator_job_run_id", None), + collaborator_task_run_id=d.get("collaborator_task_run_id", None), + collaborator_workspace_id=d.get("collaborator_workspace_id", None), ) @@ -997,47 +997,47 @@ def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.mask: - body["{mask}"] = self.mask + body["mask"] = self.mask if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.nullable is not None: - body["{nullable}"] = self.nullable + body["nullable"] = self.nullable if self.partition_index is not None: - body["{partition_index}"] = self.partition_index + body["partition_index"] = self.partition_index if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name + body["type_name"] = self.type_name if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - mask=_from_dict(d, "{mask}", ColumnMask), - name=d.get("{name}", None), - nullable=d.get("{nullable}", None), - partition_index=d.get("{partition_index}", None), - position=d.get("{position}", None), - type_interval_type=d.get("{type_interval_type}", None), - type_json=d.get("{type_json}", None), - type_name=_enum(d, "{type_name}", ColumnTypeName), - type_precision=d.get("{type_precision}", None), - type_scale=d.get("{type_scale}", None), - type_text=d.get("{type_text}", None), + comment=d.get("comment", None), + mask=_from_dict(d, "mask", ColumnMask), + name=d.get("name", None), + nullable=d.get("nullable", None), + partition_index=d.get("partition_index", None), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_json=d.get("type_json", None), + type_name=_enum(d, "type_name", ColumnTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), ) @@ -1064,15 +1064,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ColumnMask into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.using_column_names: - body["{using_column_names}"] = self.using_column_names + body["using_column_names"] = self.using_column_names return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnMask: """Deserializes the ColumnMask from a dictionary.""" - return cls(function_name=d.get("{function_name}", None), using_column_names=d.get("{using_column_names}", None)) + return cls(function_name=d.get("function_name", None), using_column_names=d.get("using_column_names", None)) class ColumnTypeName(Enum): @@ -1124,17 +1124,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_standards: - body["{compliance_standards}"] = self.compliance_standards + body["compliance_standards"] = self.compliance_standards if self.is_enabled is not None: - body["{is_enabled}"] = self.is_enabled + body["is_enabled"] = self.is_enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComplianceSecurityProfile: """Deserializes the ComplianceSecurityProfile from a dictionary.""" return cls( - compliance_standards=_repeated_enum(d, "{compliance_standards}", ComplianceStandard), - is_enabled=d.get("{is_enabled}", None), + compliance_standards=_repeated_enum(d, "compliance_standards", ComplianceStandard), + is_enabled=d.get("is_enabled", None), ) @@ -1170,13 +1170,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCleanRoomOutputCatalogResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.output_catalog: - body["{output_catalog}"] = self.output_catalog + body["output_catalog"] = self.output_catalog return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCleanRoomOutputCatalogResponse: """Deserializes the CreateCleanRoomOutputCatalogResponse from a dictionary.""" - return cls(output_catalog=_from_dict(d, "{output_catalog}", CleanRoomOutputCatalog)) + return cls(output_catalog=_from_dict(d, "output_catalog", CleanRoomOutputCatalog)) @dataclass @@ -1238,13 +1238,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.internet_access: - body["{internet_access}"] = self.internet_access + body["internet_access"] = self.internet_access return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicy: """Deserializes the EgressNetworkPolicy from a dictionary.""" - return cls(internet_access=_from_dict(d, "{internet_access}", EgressNetworkPolicyInternetAccessPolicy)) + return cls(internet_access=_from_dict(d, "internet_access", EgressNetworkPolicyInternetAccessPolicy)) @dataclass @@ -1280,13 +1280,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_internet_destinations: - body["{allowed_internet_destinations}"] = self.allowed_internet_destinations + body["allowed_internet_destinations"] = self.allowed_internet_destinations if self.allowed_storage_destinations: - body["{allowed_storage_destinations}"] = self.allowed_storage_destinations + body["allowed_storage_destinations"] = self.allowed_storage_destinations if self.log_only_mode: - body["{log_only_mode}"] = self.log_only_mode + body["log_only_mode"] = self.log_only_mode if self.restriction_mode is not None: - body["{restriction_mode}"] = self.restriction_mode + body["restriction_mode"] = self.restriction_mode return body @classmethod @@ -1294,13 +1294,13 @@ def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicy """Deserializes the EgressNetworkPolicyInternetAccessPolicy from a dictionary.""" return cls( allowed_internet_destinations=_repeated_dict( - d, "{allowed_internet_destinations}", EgressNetworkPolicyInternetAccessPolicyInternetDestination + d, "allowed_internet_destinations", EgressNetworkPolicyInternetAccessPolicyInternetDestination ), allowed_storage_destinations=_repeated_dict( - d, "{allowed_storage_destinations}", EgressNetworkPolicyInternetAccessPolicyStorageDestination + d, "allowed_storage_destinations", EgressNetworkPolicyInternetAccessPolicyStorageDestination ), - log_only_mode=_from_dict(d, "{log_only_mode}", EgressNetworkPolicyInternetAccessPolicyLogOnlyMode), - restriction_mode=_enum(d, "{restriction_mode}", EgressNetworkPolicyInternetAccessPolicyRestrictionMode), + log_only_mode=_from_dict(d, "log_only_mode", EgressNetworkPolicyInternetAccessPolicyLogOnlyMode), + restriction_mode=_enum(d, "restriction_mode", EgressNetworkPolicyInternetAccessPolicyRestrictionMode), ) @@ -1337,24 +1337,24 @@ def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination if self.protocol is not None: - body["{protocol}"] = self.protocol + body["protocol"] = self.protocol if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyInternetDestination: """Deserializes the EgressNetworkPolicyInternetAccessPolicyInternetDestination from a dictionary.""" return cls( - destination=d.get("{destination}", None), + destination=d.get("destination", None), protocol=_enum( d, - "{protocol}", + "protocol", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol, ), - type=_enum(d, "{type}", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType), + type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType), ) @@ -1391,9 +1391,9 @@ def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode into a shallow dictionary of its immediate attributes.""" body = {} if self.log_only_mode_type is not None: - body["{log_only_mode_type}"] = self.log_only_mode_type + body["log_only_mode_type"] = self.log_only_mode_type if self.workloads: - body["{workloads}"] = self.workloads + body["workloads"] = self.workloads return body @classmethod @@ -1401,9 +1401,9 @@ def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicy """Deserializes the EgressNetworkPolicyInternetAccessPolicyLogOnlyMode from a dictionary.""" return cls( log_only_mode_type=_enum( - d, "{log_only_mode_type}", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType + d, "log_only_mode_type", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType ), - workloads=_repeated_enum(d, "{workloads}", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType), + workloads=_repeated_enum(d, "workloads", EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType), ) @@ -1477,35 +1477,35 @@ def as_shallow_dict(self) -> dict: """Serializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_paths: - body["{allowed_paths}"] = self.allowed_paths + body["allowed_paths"] = self.allowed_paths if self.azure_container is not None: - body["{azure_container}"] = self.azure_container + body["azure_container"] = self.azure_container if self.azure_dns_zone is not None: - body["{azure_dns_zone}"] = self.azure_dns_zone + body["azure_dns_zone"] = self.azure_dns_zone if self.azure_storage_account is not None: - body["{azure_storage_account}"] = self.azure_storage_account + body["azure_storage_account"] = self.azure_storage_account if self.azure_storage_service is not None: - body["{azure_storage_service}"] = self.azure_storage_service + body["azure_storage_service"] = self.azure_storage_service if self.bucket_name is not None: - body["{bucket_name}"] = self.bucket_name + body["bucket_name"] = self.bucket_name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EgressNetworkPolicyInternetAccessPolicyStorageDestination: """Deserializes the EgressNetworkPolicyInternetAccessPolicyStorageDestination from a dictionary.""" return cls( - allowed_paths=d.get("{allowed_paths}", None), - azure_container=d.get("{azure_container}", None), - azure_dns_zone=d.get("{azure_dns_zone}", None), - azure_storage_account=d.get("{azure_storage_account}", None), - azure_storage_service=d.get("{azure_storage_service}", None), - bucket_name=d.get("{bucket_name}", None), - region=d.get("{region}", None), - type=_enum(d, "{type}", EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType), + allowed_paths=d.get("allowed_paths", None), + azure_container=d.get("azure_container", None), + azure_dns_zone=d.get("azure_dns_zone", None), + azure_storage_account=d.get("azure_storage_account", None), + azure_storage_service=d.get("azure_storage_service", None), + bucket_name=d.get("bucket_name", None), + region=d.get("region", None), + type=_enum(d, "type", EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType), ) @@ -1539,17 +1539,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListCleanRoomAssetsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.assets: - body["{assets}"] = self.assets + body["assets"] = self.assets if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCleanRoomAssetsResponse: """Deserializes the ListCleanRoomAssetsResponse from a dictionary.""" - return cls( - assets=_repeated_dict(d, "{assets}", CleanRoomAsset), next_page_token=d.get("{next_page_token}", None) - ) + return cls(assets=_repeated_dict(d, "assets", CleanRoomAsset), next_page_token=d.get("next_page_token", None)) @dataclass @@ -1574,16 +1572,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListCleanRoomNotebookTaskRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.runs: - body["{runs}"] = self.runs + body["runs"] = self.runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCleanRoomNotebookTaskRunsResponse: """Deserializes the ListCleanRoomNotebookTaskRunsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), runs=_repeated_dict(d, "{runs}", CleanRoomNotebookTaskRun) + next_page_token=d.get("next_page_token", None), runs=_repeated_dict(d, "runs", CleanRoomNotebookTaskRun) ) @@ -1608,16 +1606,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListCleanRoomsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms: - body["{clean_rooms}"] = self.clean_rooms + body["clean_rooms"] = self.clean_rooms if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCleanRoomsResponse: """Deserializes the ListCleanRoomsResponse from a dictionary.""" return cls( - clean_rooms=_repeated_dict(d, "{clean_rooms}", CleanRoom), next_page_token=d.get("{next_page_token}", None) + clean_rooms=_repeated_dict(d, "clean_rooms", CleanRoom), next_page_token=d.get("next_page_token", None) ) @@ -1637,13 +1635,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Partition into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Partition: """Deserializes the Partition from a dictionary.""" - return cls(values=_repeated_dict(d, "{values}", PartitionValue)) + return cls(values=_repeated_dict(d, "values", PartitionValue)) @dataclass @@ -1679,23 +1677,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PartitionValue into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.recipient_property_key is not None: - body["{recipient_property_key}"] = self.recipient_property_key + body["recipient_property_key"] = self.recipient_property_key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartitionValue: """Deserializes the PartitionValue from a dictionary.""" return cls( - name=d.get("{name}", None), - op=_enum(d, "{op}", PartitionValueOp), - recipient_property_key=d.get("{recipient_property_key}", None), - value=d.get("{value}", None), + name=d.get("name", None), + op=_enum(d, "op", PartitionValueOp), + recipient_property_key=d.get("recipient_property_key", None), + value=d.get("value", None), ) @@ -1725,15 +1723,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCleanRoomRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_room: - body["{clean_room}"] = self.clean_room + body["clean_room"] = self.clean_room if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCleanRoomRequest: """Deserializes the UpdateCleanRoomRequest from a dictionary.""" - return cls(clean_room=_from_dict(d, "{clean_room}", CleanRoom), name=d.get("{name}", None)) + return cls(clean_room=_from_dict(d, "clean_room", CleanRoom), name=d.get("name", None)) class CleanRoomAssetsAPI: @@ -1831,19 +1829,19 @@ def list(self, clean_room_name: str, *, page_token: Optional[str] = None) -> Ite query = {} if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/clean-rooms/{clean_room_name}/assets", query=query, headers=headers) - if "{assets}" in json: - for v in json["{assets}"]: + if "assets" in json: + for v in json["assets"]: yield CleanRoomAsset.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -1922,23 +1920,23 @@ def list( query = {} if notebook_name is not None: - query["{notebook_name}"] = notebook_name + query["notebook_name"] = notebook_name if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/clean-rooms/{clean_room_name}/runs", query=query, headers=headers) - if "{runs}" in json: - for v in json["{runs}"]: + if "runs" in json: + for v in json["runs"]: yield CleanRoomNotebookTaskRun.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class CleanRoomsAPI: @@ -2049,21 +2047,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/clean-rooms", query=query, headers=headers) - if "{clean_rooms}" in json: - for v in json["{clean_rooms}"]: + if "clean_rooms" in json: + for v in json["clean_rooms"]: yield CleanRoom.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanRoom: """Update a clean room. @@ -2081,7 +2079,7 @@ def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanR """ body = {} if clean_room is not None: - body["{clean_room}"] = clean_room.as_dict() + body["clean_room"] = clean_room.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/compute/v2/impl.py b/databricks/sdk/compute/v2/impl.py index a5dfdafa0..3c4c4c771 100755 --- a/databricks/sdk/compute/v2/impl.py +++ b/databricks/sdk/compute/v2/impl.py @@ -60,23 +60,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AddInstanceProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.iam_role_arn is not None: - body["{iam_role_arn}"] = self.iam_role_arn + body["iam_role_arn"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["{is_meta_instance_profile}"] = self.is_meta_instance_profile + body["is_meta_instance_profile"] = self.is_meta_instance_profile if self.skip_validation is not None: - body["{skip_validation}"] = self.skip_validation + body["skip_validation"] = self.skip_validation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddInstanceProfile: """Deserializes the AddInstanceProfile from a dictionary.""" return cls( - iam_role_arn=d.get("{iam_role_arn}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - is_meta_instance_profile=d.get("{is_meta_instance_profile}", None), - skip_validation=d.get("{skip_validation}", None), + iam_role_arn=d.get("iam_role_arn", None), + instance_profile_arn=d.get("instance_profile_arn", None), + is_meta_instance_profile=d.get("is_meta_instance_profile", None), + skip_validation=d.get("skip_validation", None), ) @@ -117,13 +117,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: """Deserializes the Adlsgen2Info from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -149,15 +149,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" body = {} if self.max_workers is not None: - body["{max_workers}"] = self.max_workers + body["max_workers"] = self.max_workers if self.min_workers is not None: - body["{min_workers}"] = self.min_workers + body["min_workers"] = self.min_workers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoScale: """Deserializes the AutoScale from a dictionary.""" - return cls(max_workers=d.get("{max_workers}", None), min_workers=d.get("{min_workers}", None)) + return cls(max_workers=d.get("max_workers", None), min_workers=d.get("min_workers", None)) @dataclass @@ -269,41 +269,41 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.ebs_volume_count is not None: - body["{ebs_volume_count}"] = self.ebs_volume_count + body["ebs_volume_count"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["{ebs_volume_iops}"] = self.ebs_volume_iops + body["ebs_volume_iops"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["{ebs_volume_size}"] = self.ebs_volume_size + body["ebs_volume_size"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["{ebs_volume_throughput}"] = self.ebs_volume_throughput + body["ebs_volume_throughput"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type + body["ebs_volume_type"] = self.ebs_volume_type if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent + body["spot_bid_price_percent"] = self.spot_bid_price_percent if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: """Deserializes the AwsAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", AwsAvailability), - ebs_volume_count=d.get("{ebs_volume_count}", None), - ebs_volume_iops=d.get("{ebs_volume_iops}", None), - ebs_volume_size=d.get("{ebs_volume_size}", None), - ebs_volume_throughput=d.get("{ebs_volume_throughput}", None), - ebs_volume_type=_enum(d, "{ebs_volume_type}", EbsVolumeType), - first_on_demand=d.get("{first_on_demand}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), - zone_id=d.get("{zone_id}", None), + availability=_enum(d, "availability", AwsAvailability), + ebs_volume_count=d.get("ebs_volume_count", None), + ebs_volume_iops=d.get("ebs_volume_iops", None), + ebs_volume_size=d.get("ebs_volume_size", None), + ebs_volume_throughput=d.get("ebs_volume_throughput", None), + ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), + first_on_demand=d.get("first_on_demand", None), + instance_profile_arn=d.get("instance_profile_arn", None), + spot_bid_price_percent=d.get("spot_bid_price_percent", None), + zone_id=d.get("zone_id", None), ) @@ -360,23 +360,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.log_analytics_info: - body["{log_analytics_info}"] = self.log_analytics_info + body["log_analytics_info"] = self.log_analytics_info if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price + body["spot_bid_max_price"] = self.spot_bid_max_price return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: """Deserializes the AzureAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", AzureAvailability), - first_on_demand=d.get("{first_on_demand}", None), - log_analytics_info=_from_dict(d, "{log_analytics_info}", LogAnalyticsInfo), - spot_bid_max_price=d.get("{spot_bid_max_price}", None), + availability=_enum(d, "availability", AzureAvailability), + first_on_demand=d.get("first_on_demand", None), + log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), + spot_bid_max_price=d.get("spot_bid_max_price", None), ) @@ -412,20 +412,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CancelCommand into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.command_id is not None: - body["{command_id}"] = self.command_id + body["commandId"] = self.command_id if self.context_id is not None: - body["{context_id}"] = self.context_id + body["contextId"] = self.context_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelCommand: """Deserializes the CancelCommand from a dictionary.""" return cls( - cluster_id=d.get("{cluster_id}", None), - command_id=d.get("{command_id}", None), - context_id=d.get("{context_id}", None), + cluster_id=d.get("clusterId", None), + command_id=d.get("commandId", None), + context_id=d.get("contextId", None), ) @@ -467,15 +467,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ChangeClusterOwner into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.owner_username is not None: - body["{owner_username}"] = self.owner_username + body["owner_username"] = self.owner_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ChangeClusterOwner: """Deserializes the ChangeClusterOwner from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), owner_username=d.get("{owner_username}", None)) + return cls(cluster_id=d.get("cluster_id", None), owner_username=d.get("owner_username", None)) @dataclass @@ -517,15 +517,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" body = {} if self.jobs is not None: - body["{jobs}"] = self.jobs + body["jobs"] = self.jobs if self.notebooks is not None: - body["{notebooks}"] = self.notebooks + body["notebooks"] = self.notebooks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: """Deserializes the ClientsTypes from a dictionary.""" - return cls(jobs=d.get("{jobs}", None), notebooks=d.get("{notebooks}", None)) + return cls(jobs=d.get("jobs", None), notebooks=d.get("notebooks", None)) @dataclass @@ -544,13 +544,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CloneCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.source_cluster_id is not None: - body["{source_cluster_id}"] = self.source_cluster_id + body["source_cluster_id"] = self.source_cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloneCluster: """Deserializes the CloneCluster from a dictionary.""" - return cls(source_cluster_id=d.get("{source_cluster_id}", None)) + return cls(source_cluster_id=d.get("source_cluster_id", None)) @dataclass @@ -569,13 +569,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CloudProviderNodeInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloudProviderNodeInfo: """Deserializes the CloudProviderNodeInfo from a dictionary.""" - return cls(status=_repeated_enum(d, "{status}", CloudProviderNodeStatus)) + return cls(status=_repeated_enum(d, "status", CloudProviderNodeStatus)) class CloudProviderNodeStatus(Enum): @@ -615,23 +615,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAccessControlRequest: """Deserializes the ClusterAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", ClusterPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", ClusterPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -671,26 +671,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAccessControlResponse: """Deserializes the ClusterAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", ClusterPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", ClusterPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -935,92 +935,92 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode + body["data_security_mode"] = self.data_security_mode if self.docker_image: - body["{docker_image}"] = self.docker_image + body["docker_image"] = self.docker_image if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine + body["runtime_engine"] = self.runtime_engine if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAttributes: """Deserializes the ClusterAttributes from a dictionary.""" return cls( - autotermination_minutes=d.get("{autotermination_minutes}", None), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - cluster_name=d.get("{cluster_name}", None), - custom_tags=d.get("{custom_tags}", None), - data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), - docker_image=_from_dict(d, "{docker_image}", DockerImage), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - is_single_node=d.get("{is_single_node}", None), - kind=_enum(d, "{kind}", Kind), - node_type_id=d.get("{node_type_id}", None), - policy_id=d.get("{policy_id}", None), - runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), - single_user_name=d.get("{single_user_name}", None), - spark_conf=d.get("{spark_conf}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - spark_version=d.get("{spark_version}", None), - ssh_public_keys=d.get("{ssh_public_keys}", None), - use_ml_runtime=d.get("{use_ml_runtime}", None), - workload_type=_from_dict(d, "{workload_type}", WorkloadType), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), ) @@ -1052,20 +1052,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterCompliance into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterCompliance: """Deserializes the ClusterCompliance from a dictionary.""" return cls( - cluster_id=d.get("{cluster_id}", None), - is_compliant=d.get("{is_compliant}", None), - violations=d.get("{violations}", None), + cluster_id=d.get("cluster_id", None), + is_compliant=d.get("is_compliant", None), + violations=d.get("violations", None), ) @@ -1445,155 +1445,155 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.cluster_cores is not None: - body["{cluster_cores}"] = self.cluster_cores + body["cluster_cores"] = self.cluster_cores if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.cluster_log_status: - body["{cluster_log_status}"] = self.cluster_log_status + body["cluster_log_status"] = self.cluster_log_status if self.cluster_memory_mb is not None: - body["{cluster_memory_mb}"] = self.cluster_memory_mb + body["cluster_memory_mb"] = self.cluster_memory_mb if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.cluster_source is not None: - body["{cluster_source}"] = self.cluster_source + body["cluster_source"] = self.cluster_source if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode + body["data_security_mode"] = self.data_security_mode if self.default_tags: - body["{default_tags}"] = self.default_tags + body["default_tags"] = self.default_tags if self.docker_image: - body["{docker_image}"] = self.docker_image + body["docker_image"] = self.docker_image if self.driver: - body["{driver}"] = self.driver + body["driver"] = self.driver if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.executors: - body["{executors}"] = self.executors + body["executors"] = self.executors if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.jdbc_port is not None: - body["{jdbc_port}"] = self.jdbc_port + body["jdbc_port"] = self.jdbc_port if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.last_restarted_time is not None: - body["{last_restarted_time}"] = self.last_restarted_time + body["last_restarted_time"] = self.last_restarted_time if self.last_state_loss_time is not None: - body["{last_state_loss_time}"] = self.last_state_loss_time + body["last_state_loss_time"] = self.last_state_loss_time if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine + body["runtime_engine"] = self.runtime_engine if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_context_id is not None: - body["{spark_context_id}"] = self.spark_context_id + body["spark_context_id"] = self.spark_context_id if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.spec: - body["{spec}"] = self.spec + body["spec"] = self.spec if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.state_message is not None: - body["{state_message}"] = self.state_message + body["state_message"] = self.state_message if self.terminated_time is not None: - body["{terminated_time}"] = self.terminated_time + body["terminated_time"] = self.terminated_time if self.termination_reason: - body["{termination_reason}"] = self.termination_reason + body["termination_reason"] = self.termination_reason if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterDetails: """Deserializes the ClusterDetails from a dictionary.""" return cls( - autoscale=_from_dict(d, "{autoscale}", AutoScale), - autotermination_minutes=d.get("{autotermination_minutes}", None), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - cluster_cores=d.get("{cluster_cores}", None), - cluster_id=d.get("{cluster_id}", None), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - cluster_log_status=_from_dict(d, "{cluster_log_status}", LogSyncStatus), - cluster_memory_mb=d.get("{cluster_memory_mb}", None), - cluster_name=d.get("{cluster_name}", None), - cluster_source=_enum(d, "{cluster_source}", ClusterSource), - creator_user_name=d.get("{creator_user_name}", None), - custom_tags=d.get("{custom_tags}", None), - data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), - default_tags=d.get("{default_tags}", None), - docker_image=_from_dict(d, "{docker_image}", DockerImage), - driver=_from_dict(d, "{driver}", SparkNode), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - executors=_repeated_dict(d, "{executors}", SparkNode), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - is_single_node=d.get("{is_single_node}", None), - jdbc_port=d.get("{jdbc_port}", None), - kind=_enum(d, "{kind}", Kind), - last_restarted_time=d.get("{last_restarted_time}", None), - last_state_loss_time=d.get("{last_state_loss_time}", None), - node_type_id=d.get("{node_type_id}", None), - num_workers=d.get("{num_workers}", None), - policy_id=d.get("{policy_id}", None), - runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), - single_user_name=d.get("{single_user_name}", None), - spark_conf=d.get("{spark_conf}", None), - spark_context_id=d.get("{spark_context_id}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - spark_version=d.get("{spark_version}", None), - spec=_from_dict(d, "{spec}", ClusterSpec), - ssh_public_keys=d.get("{ssh_public_keys}", None), - start_time=d.get("{start_time}", None), - state=_enum(d, "{state}", State), - state_message=d.get("{state_message}", None), - terminated_time=d.get("{terminated_time}", None), - termination_reason=_from_dict(d, "{termination_reason}", TerminationReason), - use_ml_runtime=d.get("{use_ml_runtime}", None), - workload_type=_from_dict(d, "{workload_type}", WorkloadType), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_cores=d.get("cluster_cores", None), + cluster_id=d.get("cluster_id", None), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_log_status=_from_dict(d, "cluster_log_status", LogSyncStatus), + cluster_memory_mb=d.get("cluster_memory_mb", None), + cluster_name=d.get("cluster_name", None), + cluster_source=_enum(d, "cluster_source", ClusterSource), + creator_user_name=d.get("creator_user_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + default_tags=d.get("default_tags", None), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver=_from_dict(d, "driver", SparkNode), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + executors=_repeated_dict(d, "executors", SparkNode), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + jdbc_port=d.get("jdbc_port", None), + kind=_enum(d, "kind", Kind), + last_restarted_time=d.get("last_restarted_time", None), + last_state_loss_time=d.get("last_state_loss_time", None), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_context_id=d.get("spark_context_id", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + spec=_from_dict(d, "spec", ClusterSpec), + ssh_public_keys=d.get("ssh_public_keys", None), + start_time=d.get("start_time", None), + state=_enum(d, "state", State), + state_message=d.get("state_message", None), + terminated_time=d.get("terminated_time", None), + termination_reason=_from_dict(d, "termination_reason", TerminationReason), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), ) @@ -1630,26 +1630,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterEvent into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.data_plane_event_details: - body["{data_plane_event_details}"] = self.data_plane_event_details + body["data_plane_event_details"] = self.data_plane_event_details if self.details: - body["{details}"] = self.details + body["details"] = self.details if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterEvent: """Deserializes the ClusterEvent from a dictionary.""" return cls( - cluster_id=d.get("{cluster_id}", None), - data_plane_event_details=_from_dict(d, "{data_plane_event_details}", DataPlaneEventDetails), - details=_from_dict(d, "{details}", EventDetails), - timestamp=d.get("{timestamp}", None), - type=_enum(d, "{type}", EventType), + cluster_id=d.get("cluster_id", None), + data_plane_event_details=_from_dict(d, "data_plane_event_details", DataPlaneEventDetails), + details=_from_dict(d, "details", EventDetails), + timestamp=d.get("timestamp", None), + type=_enum(d, "type", EventType), ) @@ -1674,17 +1674,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterLibraryStatuses into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.library_statuses: - body["{library_statuses}"] = self.library_statuses + body["library_statuses"] = self.library_statuses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterLibraryStatuses: """Deserializes the ClusterLibraryStatuses from a dictionary.""" return cls( - cluster_id=d.get("{cluster_id}", None), - library_statuses=_repeated_dict(d, "{library_statuses}", LibraryFullStatus), + cluster_id=d.get("cluster_id", None), + library_statuses=_repeated_dict(d, "library_statuses", LibraryFullStatus), ) @@ -1721,20 +1721,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" body = {} if self.dbfs: - body["{dbfs}"] = self.dbfs + body["dbfs"] = self.dbfs if self.s3: - body["{s3}"] = self.s3 + body["s3"] = self.s3 if self.volumes: - body["{volumes}"] = self.volumes + body["volumes"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: """Deserializes the ClusterLogConf from a dictionary.""" return cls( - dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), - s3=_from_dict(d, "{s3}", S3StorageInfo), - volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), ) @@ -1762,20 +1762,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermission: """Deserializes the ClusterPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", ClusterPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", ClusterPermissionLevel), ) @@ -1810,20 +1810,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissions: """Deserializes the ClusterPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ClusterAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", ClusterAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -1847,17 +1847,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissionsDescription: """Deserializes the ClusterPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", ClusterPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", ClusterPermissionLevel), ) @@ -1881,17 +1881,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPermissionsRequest: """Deserializes the ClusterPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ClusterAccessControlRequest), - cluster_id=d.get("{cluster_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", ClusterAccessControlRequest), + cluster_id=d.get("cluster_id", None), ) @@ -1926,23 +1926,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyAccessControlRequest: """Deserializes the ClusterPolicyAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", ClusterPolicyPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -1982,26 +1982,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyAccessControlResponse: """Deserializes the ClusterPolicyAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", ClusterPolicyPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", ClusterPolicyPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -2029,20 +2029,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermission: """Deserializes the ClusterPolicyPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", ClusterPolicyPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), ) @@ -2075,20 +2075,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissions: """Deserializes the ClusterPolicyPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ClusterPolicyAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", ClusterPolicyAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -2112,17 +2112,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissionsDescription: """Deserializes the ClusterPolicyPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", ClusterPolicyPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", ClusterPolicyPermissionLevel), ) @@ -2146,17 +2146,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterPolicyPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.cluster_policy_id is not None: - body["{cluster_policy_id}"] = self.cluster_policy_id + body["cluster_policy_id"] = self.cluster_policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterPolicyPermissionsRequest: """Deserializes the ClusterPolicyPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ClusterPolicyAccessControlRequest), - cluster_policy_id=d.get("{cluster_policy_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", ClusterPolicyAccessControlRequest), + cluster_policy_id=d.get("cluster_policy_id", None), ) @@ -2193,20 +2193,18 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterSettingsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.field is not None: - body["{field}"] = self.field + body["field"] = self.field if self.new_value is not None: - body["{new_value}"] = self.new_value + body["new_value"] = self.new_value if self.previous_value is not None: - body["{previous_value}"] = self.previous_value + body["previous_value"] = self.previous_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSettingsChange: """Deserializes the ClusterSettingsChange from a dictionary.""" return cls( - field=d.get("{field}", None), - new_value=d.get("{new_value}", None), - previous_value=d.get("{previous_value}", None), + field=d.get("field", None), new_value=d.get("new_value", None), previous_value=d.get("previous_value", None) ) @@ -2239,15 +2237,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterSize into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSize: """Deserializes the ClusterSize from a dictionary.""" - return cls(autoscale=_from_dict(d, "{autoscale}", AutoScale), num_workers=d.get("{num_workers}", None)) + return cls(autoscale=_from_dict(d, "autoscale", AutoScale), num_workers=d.get("num_workers", None)) class ClusterSource(Enum): @@ -2528,101 +2526,101 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode + body["data_security_mode"] = self.data_security_mode if self.docker_image: - body["{docker_image}"] = self.docker_image + body["docker_image"] = self.docker_image if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine + body["runtime_engine"] = self.runtime_engine if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSpec: """Deserializes the ClusterSpec from a dictionary.""" return cls( - apply_policy_default_values=d.get("{apply_policy_default_values}", None), - autoscale=_from_dict(d, "{autoscale}", AutoScale), - autotermination_minutes=d.get("{autotermination_minutes}", None), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - cluster_name=d.get("{cluster_name}", None), - custom_tags=d.get("{custom_tags}", None), - data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), - docker_image=_from_dict(d, "{docker_image}", DockerImage), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - is_single_node=d.get("{is_single_node}", None), - kind=_enum(d, "{kind}", Kind), - node_type_id=d.get("{node_type_id}", None), - num_workers=d.get("{num_workers}", None), - policy_id=d.get("{policy_id}", None), - runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), - single_user_name=d.get("{single_user_name}", None), - spark_conf=d.get("{spark_conf}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - spark_version=d.get("{spark_version}", None), - ssh_public_keys=d.get("{ssh_public_keys}", None), - use_ml_runtime=d.get("{use_ml_runtime}", None), - workload_type=_from_dict(d, "{workload_type}", WorkloadType), + apply_policy_default_values=d.get("apply_policy_default_values", None), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), ) @@ -2656,23 +2654,23 @@ def as_shallow_dict(self) -> dict: """Serializes the Command into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.command is not None: - body["{command}"] = self.command + body["command"] = self.command if self.context_id is not None: - body["{context_id}"] = self.context_id + body["contextId"] = self.context_id if self.language is not None: - body["{language}"] = self.language + body["language"] = self.language return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Command: """Deserializes the Command from a dictionary.""" return cls( - cluster_id=d.get("{cluster_id}", None), - command=d.get("{command}", None), - context_id=d.get("{context_id}", None), - language=_enum(d, "{language}", Language), + cluster_id=d.get("clusterId", None), + command=d.get("command", None), + context_id=d.get("contextId", None), + language=_enum(d, "language", Language), ) @@ -2709,20 +2707,18 @@ def as_shallow_dict(self) -> dict: """Serializes the CommandStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.results: - body["{results}"] = self.results + body["results"] = self.results if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CommandStatusResponse: """Deserializes the CommandStatusResponse from a dictionary.""" return cls( - id=d.get("{id}", None), - results=_from_dict(d, "{results}", Results), - status=_enum(d, "{status}", CommandStatus), + id=d.get("id", None), results=_from_dict(d, "results", Results), status=_enum(d, "status", CommandStatus) ) @@ -2752,15 +2748,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ContextStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ContextStatusResponse: """Deserializes the ContextStatusResponse from a dictionary.""" - return cls(id=d.get("{id}", None), status=_enum(d, "{status}", ContextStatus)) + return cls(id=d.get("id", None), status=_enum(d, "status", ContextStatus)) @dataclass @@ -3031,104 +3027,104 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.clone_from: - body["{clone_from}"] = self.clone_from + body["clone_from"] = self.clone_from if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode + body["data_security_mode"] = self.data_security_mode if self.docker_image: - body["{docker_image}"] = self.docker_image + body["docker_image"] = self.docker_image if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine + body["runtime_engine"] = self.runtime_engine if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCluster: """Deserializes the CreateCluster from a dictionary.""" return cls( - apply_policy_default_values=d.get("{apply_policy_default_values}", None), - autoscale=_from_dict(d, "{autoscale}", AutoScale), - autotermination_minutes=d.get("{autotermination_minutes}", None), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - clone_from=_from_dict(d, "{clone_from}", CloneCluster), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - cluster_name=d.get("{cluster_name}", None), - custom_tags=d.get("{custom_tags}", None), - data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), - docker_image=_from_dict(d, "{docker_image}", DockerImage), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - is_single_node=d.get("{is_single_node}", None), - kind=_enum(d, "{kind}", Kind), - node_type_id=d.get("{node_type_id}", None), - num_workers=d.get("{num_workers}", None), - policy_id=d.get("{policy_id}", None), - runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), - single_user_name=d.get("{single_user_name}", None), - spark_conf=d.get("{spark_conf}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - spark_version=d.get("{spark_version}", None), - ssh_public_keys=d.get("{ssh_public_keys}", None), - use_ml_runtime=d.get("{use_ml_runtime}", None), - workload_type=_from_dict(d, "{workload_type}", WorkloadType), + apply_policy_default_values=d.get("apply_policy_default_values", None), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + clone_from=_from_dict(d, "clone_from", CloneCluster), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), ) @@ -3147,13 +3143,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateClusterResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateClusterResponse: """Deserializes the CreateClusterResponse from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None)) + return cls(cluster_id=d.get("cluster_id", None)) @dataclass @@ -3176,15 +3172,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateContext into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.language is not None: - body["{language}"] = self.language + body["language"] = self.language return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateContext: """Deserializes the CreateContext from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), language=_enum(d, "{language}", Language)) + return cls(cluster_id=d.get("clusterId", None), language=_enum(d, "language", Language)) @dataclass @@ -3284,50 +3280,50 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.disk_spec: - body["{disk_spec}"] = self.disk_spec + body["disk_spec"] = self.disk_spec if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.preloaded_docker_images: - body["{preloaded_docker_images}"] = self.preloaded_docker_images + body["preloaded_docker_images"] = self.preloaded_docker_images if self.preloaded_spark_versions: - body["{preloaded_spark_versions}"] = self.preloaded_spark_versions + body["preloaded_spark_versions"] = self.preloaded_spark_versions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateInstancePool: """Deserializes the CreateInstancePool from a dictionary.""" return cls( - aws_attributes=_from_dict(d, "{aws_attributes}", InstancePoolAwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", InstancePoolAzureAttributes), - custom_tags=d.get("{custom_tags}", None), - disk_spec=_from_dict(d, "{disk_spec}", DiskSpec), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", InstancePoolGcpAttributes), - idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), - instance_pool_name=d.get("{instance_pool_name}", None), - max_capacity=d.get("{max_capacity}", None), - min_idle_instances=d.get("{min_idle_instances}", None), - node_type_id=d.get("{node_type_id}", None), - preloaded_docker_images=_repeated_dict(d, "{preloaded_docker_images}", DockerImage), - preloaded_spark_versions=d.get("{preloaded_spark_versions}", None), + aws_attributes=_from_dict(d, "aws_attributes", InstancePoolAwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", InstancePoolAzureAttributes), + custom_tags=d.get("custom_tags", None), + disk_spec=_from_dict(d, "disk_spec", DiskSpec), + enable_elastic_disk=d.get("enable_elastic_disk", None), + gcp_attributes=_from_dict(d, "gcp_attributes", InstancePoolGcpAttributes), + idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), + instance_pool_name=d.get("instance_pool_name", None), + max_capacity=d.get("max_capacity", None), + min_idle_instances=d.get("min_idle_instances", None), + node_type_id=d.get("node_type_id", None), + preloaded_docker_images=_repeated_dict(d, "preloaded_docker_images", DockerImage), + preloaded_spark_versions=d.get("preloaded_spark_versions", None), ) @@ -3347,13 +3343,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateInstancePoolResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateInstancePoolResponse: """Deserializes the CreateInstancePoolResponse from a dictionary.""" - return cls(instance_pool_id=d.get("{instance_pool_id}", None)) + return cls(instance_pool_id=d.get("instance_pool_id", None)) @dataclass @@ -3417,32 +3413,32 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = self.max_clusters_per_user + body["max_clusters_per_user"] = self.max_clusters_per_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides + body["policy_family_definition_overrides"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePolicy: """Deserializes the CreatePolicy from a dictionary.""" return cls( - definition=d.get("{definition}", None), - description=d.get("{description}", None), - libraries=_repeated_dict(d, "{libraries}", Library), - max_clusters_per_user=d.get("{max_clusters_per_user}", None), - name=d.get("{name}", None), - policy_family_definition_overrides=d.get("{policy_family_definition_overrides}", None), - policy_family_id=d.get("{policy_family_id}", None), + definition=d.get("definition", None), + description=d.get("description", None), + libraries=_repeated_dict(d, "libraries", Library), + max_clusters_per_user=d.get("max_clusters_per_user", None), + name=d.get("name", None), + policy_family_definition_overrides=d.get("policy_family_definition_overrides", None), + policy_family_id=d.get("policy_family_id", None), ) @@ -3462,13 +3458,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePolicyResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePolicyResponse: """Deserializes the CreatePolicyResponse from a dictionary.""" - return cls(policy_id=d.get("{policy_id}", None)) + return cls(policy_id=d.get("policy_id", None)) @dataclass @@ -3487,13 +3483,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" - return cls(script_id=d.get("{script_id}", None)) + return cls(script_id=d.get("script_id", None)) @dataclass @@ -3511,13 +3507,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Created into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Created: """Deserializes the Created from a dictionary.""" - return cls(id=d.get("{id}", None)) + return cls(id=d.get("id", None)) @dataclass @@ -3547,23 +3543,23 @@ def as_shallow_dict(self) -> dict: """Serializes the DataPlaneEventDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.event_type is not None: - body["{event_type}"] = self.event_type + body["event_type"] = self.event_type if self.executor_failures is not None: - body["{executor_failures}"] = self.executor_failures + body["executor_failures"] = self.executor_failures if self.host_id is not None: - body["{host_id}"] = self.host_id + body["host_id"] = self.host_id if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataPlaneEventDetails: """Deserializes the DataPlaneEventDetails from a dictionary.""" return cls( - event_type=_enum(d, "{event_type}", DataPlaneEventDetailsEventType), - executor_failures=d.get("{executor_failures}", None), - host_id=d.get("{host_id}", None), - timestamp=d.get("{timestamp}", None), + event_type=_enum(d, "event_type", DataPlaneEventDetailsEventType), + executor_failures=d.get("executor_failures", None), + host_id=d.get("host_id", None), + timestamp=d.get("timestamp", None), ) @@ -3629,13 +3625,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: """Deserializes the DbfsStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -3654,13 +3650,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteCluster: """Deserializes the DeleteCluster from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None)) + return cls(cluster_id=d.get("cluster_id", None)) @dataclass @@ -3697,13 +3693,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteInstancePool: """Deserializes the DeleteInstancePool from a dictionary.""" - return cls(instance_pool_id=d.get("{instance_pool_id}", None)) + return cls(instance_pool_id=d.get("instance_pool_id", None)) @dataclass @@ -3740,13 +3736,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeletePolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeletePolicy: """Deserializes the DeletePolicy from a dictionary.""" - return cls(policy_id=d.get("{policy_id}", None)) + return cls(policy_id=d.get("policy_id", None)) @dataclass @@ -3804,15 +3800,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DestroyContext into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["clusterId"] = self.cluster_id if self.context_id is not None: - body["{context_id}"] = self.context_id + body["contextId"] = self.context_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DestroyContext: """Deserializes the DestroyContext from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), context_id=d.get("{context_id}", None)) + return cls(cluster_id=d.get("clusterId", None), context_id=d.get("contextId", None)) @dataclass @@ -3888,26 +3884,26 @@ def as_shallow_dict(self) -> dict: """Serializes the DiskSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.disk_count is not None: - body["{disk_count}"] = self.disk_count + body["disk_count"] = self.disk_count if self.disk_iops is not None: - body["{disk_iops}"] = self.disk_iops + body["disk_iops"] = self.disk_iops if self.disk_size is not None: - body["{disk_size}"] = self.disk_size + body["disk_size"] = self.disk_size if self.disk_throughput is not None: - body["{disk_throughput}"] = self.disk_throughput + body["disk_throughput"] = self.disk_throughput if self.disk_type: - body["{disk_type}"] = self.disk_type + body["disk_type"] = self.disk_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DiskSpec: """Deserializes the DiskSpec from a dictionary.""" return cls( - disk_count=d.get("{disk_count}", None), - disk_iops=d.get("{disk_iops}", None), - disk_size=d.get("{disk_size}", None), - disk_throughput=d.get("{disk_throughput}", None), - disk_type=_from_dict(d, "{disk_type}", DiskType), + disk_count=d.get("disk_count", None), + disk_iops=d.get("disk_iops", None), + disk_size=d.get("disk_size", None), + disk_throughput=d.get("disk_throughput", None), + disk_type=_from_dict(d, "disk_type", DiskType), ) @@ -3936,17 +3932,17 @@ def as_shallow_dict(self) -> dict: """Serializes the DiskType into a shallow dictionary of its immediate attributes.""" body = {} if self.azure_disk_volume_type is not None: - body["{azure_disk_volume_type}"] = self.azure_disk_volume_type + body["azure_disk_volume_type"] = self.azure_disk_volume_type if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type + body["ebs_volume_type"] = self.ebs_volume_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DiskType: """Deserializes the DiskType from a dictionary.""" return cls( - azure_disk_volume_type=_enum(d, "{azure_disk_volume_type}", DiskTypeAzureDiskVolumeType), - ebs_volume_type=_enum(d, "{ebs_volume_type}", DiskTypeEbsVolumeType), + azure_disk_volume_type=_enum(d, "azure_disk_volume_type", DiskTypeAzureDiskVolumeType), + ebs_volume_type=_enum(d, "ebs_volume_type", DiskTypeEbsVolumeType), ) @@ -3987,15 +3983,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" body = {} if self.password is not None: - body["{password}"] = self.password + body["password"] = self.password if self.username is not None: - body["{username}"] = self.username + body["username"] = self.username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: """Deserializes the DockerBasicAuth from a dictionary.""" - return cls(password=d.get("{password}", None), username=d.get("{username}", None)) + return cls(password=d.get("password", None), username=d.get("username", None)) @dataclass @@ -4019,15 +4015,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" body = {} if self.basic_auth: - body["{basic_auth}"] = self.basic_auth + body["basic_auth"] = self.basic_auth if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DockerImage: """Deserializes the DockerImage from a dictionary.""" - return cls(basic_auth=_from_dict(d, "{basic_auth}", DockerBasicAuth), url=d.get("{url}", None)) + return cls(basic_auth=_from_dict(d, "basic_auth", DockerBasicAuth), url=d.get("url", None)) class EbsVolumeType(Enum): @@ -4305,104 +4301,104 @@ def as_shallow_dict(self) -> dict: """Serializes the EditCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode + body["data_security_mode"] = self.data_security_mode if self.docker_image: - body["{docker_image}"] = self.docker_image + body["docker_image"] = self.docker_image if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine + body["runtime_engine"] = self.runtime_engine if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditCluster: """Deserializes the EditCluster from a dictionary.""" return cls( - apply_policy_default_values=d.get("{apply_policy_default_values}", None), - autoscale=_from_dict(d, "{autoscale}", AutoScale), - autotermination_minutes=d.get("{autotermination_minutes}", None), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - cluster_id=d.get("{cluster_id}", None), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - cluster_name=d.get("{cluster_name}", None), - custom_tags=d.get("{custom_tags}", None), - data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), - docker_image=_from_dict(d, "{docker_image}", DockerImage), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - is_single_node=d.get("{is_single_node}", None), - kind=_enum(d, "{kind}", Kind), - node_type_id=d.get("{node_type_id}", None), - num_workers=d.get("{num_workers}", None), - policy_id=d.get("{policy_id}", None), - runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), - single_user_name=d.get("{single_user_name}", None), - spark_conf=d.get("{spark_conf}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - spark_version=d.get("{spark_version}", None), - ssh_public_keys=d.get("{ssh_public_keys}", None), - use_ml_runtime=d.get("{use_ml_runtime}", None), - workload_type=_from_dict(d, "{workload_type}", WorkloadType), + apply_policy_default_values=d.get("apply_policy_default_values", None), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_id=d.get("cluster_id", None), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), ) @@ -4483,32 +4479,32 @@ def as_shallow_dict(self) -> dict: """Serializes the EditInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditInstancePool: """Deserializes the EditInstancePool from a dictionary.""" return cls( - custom_tags=d.get("{custom_tags}", None), - idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), - instance_pool_id=d.get("{instance_pool_id}", None), - instance_pool_name=d.get("{instance_pool_name}", None), - max_capacity=d.get("{max_capacity}", None), - min_idle_instances=d.get("{min_idle_instances}", None), - node_type_id=d.get("{node_type_id}", None), + custom_tags=d.get("custom_tags", None), + idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), + instance_pool_id=d.get("instance_pool_id", None), + instance_pool_name=d.get("instance_pool_name", None), + max_capacity=d.get("max_capacity", None), + min_idle_instances=d.get("min_idle_instances", None), + node_type_id=d.get("node_type_id", None), ) @@ -4596,35 +4592,35 @@ def as_shallow_dict(self) -> dict: """Serializes the EditPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = self.max_clusters_per_user + body["max_clusters_per_user"] = self.max_clusters_per_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides + body["policy_family_definition_overrides"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditPolicy: """Deserializes the EditPolicy from a dictionary.""" return cls( - definition=d.get("{definition}", None), - description=d.get("{description}", None), - libraries=_repeated_dict(d, "{libraries}", Library), - max_clusters_per_user=d.get("{max_clusters_per_user}", None), - name=d.get("{name}", None), - policy_family_definition_overrides=d.get("{policy_family_definition_overrides}", None), - policy_family_id=d.get("{policy_family_id}", None), - policy_id=d.get("{policy_id}", None), + definition=d.get("definition", None), + description=d.get("description", None), + libraries=_repeated_dict(d, "libraries", Library), + max_clusters_per_user=d.get("max_clusters_per_user", None), + name=d.get("name", None), + policy_family_definition_overrides=d.get("policy_family_definition_overrides", None), + policy_family_id=d.get("policy_family_id", None), + policy_id=d.get("policy_id", None), ) @@ -4686,15 +4682,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EnforceClusterComplianceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforceClusterComplianceRequest: """Deserializes the EnforceClusterComplianceRequest from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), validate_only=d.get("{validate_only}", None)) + return cls(cluster_id=d.get("cluster_id", None), validate_only=d.get("validate_only", None)) @dataclass @@ -4720,17 +4716,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EnforceClusterComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.changes: - body["{changes}"] = self.changes + body["changes"] = self.changes if self.has_changes is not None: - body["{has_changes}"] = self.has_changes + body["has_changes"] = self.has_changes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforceClusterComplianceResponse: """Deserializes the EnforceClusterComplianceResponse from a dictionary.""" - return cls( - changes=_repeated_dict(d, "{changes}", ClusterSettingsChange), has_changes=d.get("{has_changes}", None) - ) + return cls(changes=_repeated_dict(d, "changes", ClusterSettingsChange), has_changes=d.get("has_changes", None)) @dataclass @@ -4845,71 +4839,71 @@ def as_shallow_dict(self) -> dict: """Serializes the EventDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.attributes: - body["{attributes}"] = self.attributes + body["attributes"] = self.attributes if self.cause is not None: - body["{cause}"] = self.cause + body["cause"] = self.cause if self.cluster_size: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.current_num_vcpus is not None: - body["{current_num_vcpus}"] = self.current_num_vcpus + body["current_num_vcpus"] = self.current_num_vcpus if self.current_num_workers is not None: - body["{current_num_workers}"] = self.current_num_workers + body["current_num_workers"] = self.current_num_workers if self.did_not_expand_reason is not None: - body["{did_not_expand_reason}"] = self.did_not_expand_reason + body["did_not_expand_reason"] = self.did_not_expand_reason if self.disk_size is not None: - body["{disk_size}"] = self.disk_size + body["disk_size"] = self.disk_size if self.driver_state_message is not None: - body["{driver_state_message}"] = self.driver_state_message + body["driver_state_message"] = self.driver_state_message if self.enable_termination_for_node_blocklisted is not None: - body["{enable_termination_for_node_blocklisted}"] = self.enable_termination_for_node_blocklisted + body["enable_termination_for_node_blocklisted"] = self.enable_termination_for_node_blocklisted if self.free_space is not None: - body["{free_space}"] = self.free_space + body["free_space"] = self.free_space if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_id is not None: - body["{instance_id}"] = self.instance_id + body["instance_id"] = self.instance_id if self.job_run_name is not None: - body["{job_run_name}"] = self.job_run_name + body["job_run_name"] = self.job_run_name if self.previous_attributes: - body["{previous_attributes}"] = self.previous_attributes + body["previous_attributes"] = self.previous_attributes if self.previous_cluster_size: - body["{previous_cluster_size}"] = self.previous_cluster_size + body["previous_cluster_size"] = self.previous_cluster_size if self.previous_disk_size is not None: - body["{previous_disk_size}"] = self.previous_disk_size + body["previous_disk_size"] = self.previous_disk_size if self.reason: - body["{reason}"] = self.reason + body["reason"] = self.reason if self.target_num_vcpus is not None: - body["{target_num_vcpus}"] = self.target_num_vcpus + body["target_num_vcpus"] = self.target_num_vcpus if self.target_num_workers is not None: - body["{target_num_workers}"] = self.target_num_workers + body["target_num_workers"] = self.target_num_workers if self.user is not None: - body["{user}"] = self.user + body["user"] = self.user return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EventDetails: """Deserializes the EventDetails from a dictionary.""" return cls( - attributes=_from_dict(d, "{attributes}", ClusterAttributes), - cause=_enum(d, "{cause}", EventDetailsCause), - cluster_size=_from_dict(d, "{cluster_size}", ClusterSize), - current_num_vcpus=d.get("{current_num_vcpus}", None), - current_num_workers=d.get("{current_num_workers}", None), - did_not_expand_reason=d.get("{did_not_expand_reason}", None), - disk_size=d.get("{disk_size}", None), - driver_state_message=d.get("{driver_state_message}", None), - enable_termination_for_node_blocklisted=d.get("{enable_termination_for_node_blocklisted}", None), - free_space=d.get("{free_space}", None), - init_scripts=_from_dict(d, "{init_scripts}", InitScriptEventDetails), - instance_id=d.get("{instance_id}", None), - job_run_name=d.get("{job_run_name}", None), - previous_attributes=_from_dict(d, "{previous_attributes}", ClusterAttributes), - previous_cluster_size=_from_dict(d, "{previous_cluster_size}", ClusterSize), - previous_disk_size=d.get("{previous_disk_size}", None), - reason=_from_dict(d, "{reason}", TerminationReason), - target_num_vcpus=d.get("{target_num_vcpus}", None), - target_num_workers=d.get("{target_num_workers}", None), - user=d.get("{user}", None), + attributes=_from_dict(d, "attributes", ClusterAttributes), + cause=_enum(d, "cause", EventDetailsCause), + cluster_size=_from_dict(d, "cluster_size", ClusterSize), + current_num_vcpus=d.get("current_num_vcpus", None), + current_num_workers=d.get("current_num_workers", None), + did_not_expand_reason=d.get("did_not_expand_reason", None), + disk_size=d.get("disk_size", None), + driver_state_message=d.get("driver_state_message", None), + enable_termination_for_node_blocklisted=d.get("enable_termination_for_node_blocklisted", None), + free_space=d.get("free_space", None), + init_scripts=_from_dict(d, "init_scripts", InitScriptEventDetails), + instance_id=d.get("instance_id", None), + job_run_name=d.get("job_run_name", None), + previous_attributes=_from_dict(d, "previous_attributes", ClusterAttributes), + previous_cluster_size=_from_dict(d, "previous_cluster_size", ClusterSize), + previous_disk_size=d.get("previous_disk_size", None), + reason=_from_dict(d, "reason", TerminationReason), + target_num_vcpus=d.get("target_num_vcpus", None), + target_num_workers=d.get("target_num_workers", None), + user=d.get("user", None), ) @@ -5011,29 +5005,29 @@ def as_shallow_dict(self) -> dict: """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.boot_disk_size is not None: - body["{boot_disk_size}"] = self.boot_disk_size + body["boot_disk_size"] = self.boot_disk_size if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count + body["local_ssd_count"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["{use_preemptible_executors}"] = self.use_preemptible_executors + body["use_preemptible_executors"] = self.use_preemptible_executors if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: """Deserializes the GcpAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", GcpAvailability), - boot_disk_size=d.get("{boot_disk_size}", None), - google_service_account=d.get("{google_service_account}", None), - local_ssd_count=d.get("{local_ssd_count}", None), - use_preemptible_executors=d.get("{use_preemptible_executors}", None), - zone_id=d.get("{zone_id}", None), + availability=_enum(d, "availability", GcpAvailability), + boot_disk_size=d.get("boot_disk_size", None), + google_service_account=d.get("google_service_account", None), + local_ssd_count=d.get("local_ssd_count", None), + use_preemptible_executors=d.get("use_preemptible_executors", None), + zone_id=d.get("zone_id", None), ) @@ -5064,13 +5058,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: """Deserializes the GcsStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -5097,15 +5091,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetClusterComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetClusterComplianceResponse: """Deserializes the GetClusterComplianceResponse from a dictionary.""" - return cls(is_compliant=d.get("{is_compliant}", None), violations=d.get("{violations}", None)) + return cls(is_compliant=d.get("is_compliant", None), violations=d.get("violations", None)) @dataclass @@ -5124,13 +5118,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetClusterPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetClusterPermissionLevelsResponse: """Deserializes the GetClusterPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ClusterPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", ClusterPermissionsDescription)) @dataclass @@ -5149,13 +5143,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetClusterPolicyPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetClusterPolicyPermissionLevelsResponse: """Deserializes the GetClusterPolicyPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ClusterPolicyPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", ClusterPolicyPermissionsDescription)) @dataclass @@ -5207,32 +5201,32 @@ def as_shallow_dict(self) -> dict: """Serializes the GetEvents into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.event_types: - body["{event_types}"] = self.event_types + body["event_types"] = self.event_types if self.limit is not None: - body["{limit}"] = self.limit + body["limit"] = self.limit if self.offset is not None: - body["{offset}"] = self.offset + body["offset"] = self.offset if self.order is not None: - body["{order}"] = self.order + body["order"] = self.order if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetEvents: """Deserializes the GetEvents from a dictionary.""" return cls( - cluster_id=d.get("{cluster_id}", None), - end_time=d.get("{end_time}", None), - event_types=_repeated_enum(d, "{event_types}", EventType), - limit=d.get("{limit}", None), - offset=d.get("{offset}", None), - order=_enum(d, "{order}", GetEventsOrder), - start_time=d.get("{start_time}", None), + cluster_id=d.get("cluster_id", None), + end_time=d.get("end_time", None), + event_types=_repeated_enum(d, "event_types", EventType), + limit=d.get("limit", None), + offset=d.get("offset", None), + order=_enum(d, "order", GetEventsOrder), + start_time=d.get("start_time", None), ) @@ -5268,20 +5262,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GetEventsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.events: - body["{events}"] = self.events + body["events"] = self.events if self.next_page: - body["{next_page}"] = self.next_page + body["next_page"] = self.next_page if self.total_count is not None: - body["{total_count}"] = self.total_count + body["total_count"] = self.total_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetEventsResponse: """Deserializes the GetEventsResponse from a dictionary.""" return cls( - events=_repeated_dict(d, "{events}", ClusterEvent), - next_page=_from_dict(d, "{next_page}", GetEvents), - total_count=d.get("{total_count}", None), + events=_repeated_dict(d, "events", ClusterEvent), + next_page=_from_dict(d, "next_page", GetEvents), + total_count=d.get("total_count", None), ) @@ -5415,65 +5409,65 @@ def as_shallow_dict(self) -> dict: """Serializes the GetInstancePool into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.default_tags: - body["{default_tags}"] = self.default_tags + body["default_tags"] = self.default_tags if self.disk_spec: - body["{disk_spec}"] = self.disk_spec + body["disk_spec"] = self.disk_spec if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.preloaded_docker_images: - body["{preloaded_docker_images}"] = self.preloaded_docker_images + body["preloaded_docker_images"] = self.preloaded_docker_images if self.preloaded_spark_versions: - body["{preloaded_spark_versions}"] = self.preloaded_spark_versions + body["preloaded_spark_versions"] = self.preloaded_spark_versions if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.stats: - body["{stats}"] = self.stats + body["stats"] = self.stats if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetInstancePool: """Deserializes the GetInstancePool from a dictionary.""" return cls( - aws_attributes=_from_dict(d, "{aws_attributes}", InstancePoolAwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", InstancePoolAzureAttributes), - custom_tags=d.get("{custom_tags}", None), - default_tags=d.get("{default_tags}", None), - disk_spec=_from_dict(d, "{disk_spec}", DiskSpec), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", InstancePoolGcpAttributes), - idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), - instance_pool_id=d.get("{instance_pool_id}", None), - instance_pool_name=d.get("{instance_pool_name}", None), - max_capacity=d.get("{max_capacity}", None), - min_idle_instances=d.get("{min_idle_instances}", None), - node_type_id=d.get("{node_type_id}", None), - preloaded_docker_images=_repeated_dict(d, "{preloaded_docker_images}", DockerImage), - preloaded_spark_versions=d.get("{preloaded_spark_versions}", None), - state=_enum(d, "{state}", InstancePoolState), - stats=_from_dict(d, "{stats}", InstancePoolStats), - status=_from_dict(d, "{status}", InstancePoolStatus), + aws_attributes=_from_dict(d, "aws_attributes", InstancePoolAwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", InstancePoolAzureAttributes), + custom_tags=d.get("custom_tags", None), + default_tags=d.get("default_tags", None), + disk_spec=_from_dict(d, "disk_spec", DiskSpec), + enable_elastic_disk=d.get("enable_elastic_disk", None), + gcp_attributes=_from_dict(d, "gcp_attributes", InstancePoolGcpAttributes), + idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), + instance_pool_id=d.get("instance_pool_id", None), + instance_pool_name=d.get("instance_pool_name", None), + max_capacity=d.get("max_capacity", None), + min_idle_instances=d.get("min_idle_instances", None), + node_type_id=d.get("node_type_id", None), + preloaded_docker_images=_repeated_dict(d, "preloaded_docker_images", DockerImage), + preloaded_spark_versions=d.get("preloaded_spark_versions", None), + state=_enum(d, "state", InstancePoolState), + stats=_from_dict(d, "stats", InstancePoolStats), + status=_from_dict(d, "status", InstancePoolStatus), ) @@ -5493,13 +5487,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetInstancePoolPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetInstancePoolPermissionLevelsResponse: """Deserializes the GetInstancePoolPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", InstancePoolPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", InstancePoolPermissionsDescription)) @dataclass @@ -5518,13 +5512,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetSparkVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.versions: - body["{versions}"] = self.versions + body["versions"] = self.versions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetSparkVersionsResponse: """Deserializes the GetSparkVersionsResponse from a dictionary.""" - return cls(versions=_repeated_dict(d, "{versions}", SparkVersion)) + return cls(versions=_repeated_dict(d, "versions", SparkVersion)) @dataclass @@ -5566,23 +5560,23 @@ def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptCreateRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script is not None: - body["{script}"] = self.script + body["script"] = self.script return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptCreateRequest: """Deserializes the GlobalInitScriptCreateRequest from a dictionary.""" return cls( - enabled=d.get("{enabled}", None), - name=d.get("{name}", None), - position=d.get("{position}", None), - script=d.get("{script}", None), + enabled=d.get("enabled", None), + name=d.get("name", None), + position=d.get("position", None), + script=d.get("script", None), ) @@ -5638,35 +5632,35 @@ def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptDetails: """Deserializes the GlobalInitScriptDetails from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - enabled=d.get("{enabled}", None), - name=d.get("{name}", None), - position=d.get("{position}", None), - script_id=d.get("{script_id}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + enabled=d.get("enabled", None), + name=d.get("name", None), + position=d.get("position", None), + script_id=d.get("script_id", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -5727,38 +5721,38 @@ def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptDetailsWithContent into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script is not None: - body["{script}"] = self.script + body["script"] = self.script if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptDetailsWithContent: """Deserializes the GlobalInitScriptDetailsWithContent from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - enabled=d.get("{enabled}", None), - name=d.get("{name}", None), - position=d.get("{position}", None), - script=d.get("{script}", None), - script_id=d.get("{script_id}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + enabled=d.get("enabled", None), + name=d.get("name", None), + position=d.get("position", None), + script=d.get("script", None), + script_id=d.get("script_id", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -5806,26 +5800,26 @@ def as_shallow_dict(self) -> dict: """Serializes the GlobalInitScriptUpdateRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.script is not None: - body["{script}"] = self.script + body["script"] = self.script if self.script_id is not None: - body["{script_id}"] = self.script_id + body["script_id"] = self.script_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GlobalInitScriptUpdateRequest: """Deserializes the GlobalInitScriptUpdateRequest from a dictionary.""" return cls( - enabled=d.get("{enabled}", None), - name=d.get("{name}", None), - position=d.get("{position}", None), - script=d.get("{script}", None), - script_id=d.get("{script_id}", None), + enabled=d.get("enabled", None), + name=d.get("name", None), + position=d.get("position", None), + script=d.get("script", None), + script_id=d.get("script_id", None), ) @@ -5859,20 +5853,20 @@ def as_shallow_dict(self) -> dict: """Serializes the InitScriptEventDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster: - body["{cluster}"] = self.cluster + body["cluster"] = self.cluster if self.global_: - body["{global}"] = self.global_ + body["global"] = self.global_ if self.reported_for_node is not None: - body["{reported_for_node}"] = self.reported_for_node + body["reported_for_node"] = self.reported_for_node return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptEventDetails: """Deserializes the InitScriptEventDetails from a dictionary.""" return cls( - cluster=_repeated_dict(d, "{cluster}", InitScriptInfoAndExecutionDetails), - global_=_repeated_dict(d, "{global}", InitScriptInfoAndExecutionDetails), - reported_for_node=d.get("{reported_for_node}", None), + cluster=_repeated_dict(d, "cluster", InitScriptInfoAndExecutionDetails), + global_=_repeated_dict(d, "global", InitScriptInfoAndExecutionDetails), + reported_for_node=d.get("reported_for_node", None), ) @@ -5943,32 +5937,32 @@ def as_shallow_dict(self) -> dict: """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.abfss: - body["{abfss}"] = self.abfss + body["abfss"] = self.abfss if self.dbfs: - body["{dbfs}"] = self.dbfs + body["dbfs"] = self.dbfs if self.file: - body["{file}"] = self.file + body["file"] = self.file if self.gcs: - body["{gcs}"] = self.gcs + body["gcs"] = self.gcs if self.s3: - body["{s3}"] = self.s3 + body["s3"] = self.s3 if self.volumes: - body["{volumes}"] = self.volumes + body["volumes"] = self.volumes if self.workspace: - body["{workspace}"] = self.workspace + body["workspace"] = self.workspace return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: """Deserializes the InitScriptInfo from a dictionary.""" return cls( - abfss=_from_dict(d, "{abfss}", Adlsgen2Info), - dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), - file=_from_dict(d, "{file}", LocalFileInfo), - gcs=_from_dict(d, "{gcs}", GcsStorageInfo), - s3=_from_dict(d, "{s3}", S3StorageInfo), - volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), - workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), + abfss=_from_dict(d, "abfss", Adlsgen2Info), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + file=_from_dict(d, "file", LocalFileInfo), + gcs=_from_dict(d, "gcs", GcsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), ) @@ -6042,41 +6036,41 @@ def as_shallow_dict(self) -> dict: """Serializes the InitScriptInfoAndExecutionDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.abfss: - body["{abfss}"] = self.abfss + body["abfss"] = self.abfss if self.dbfs: - body["{dbfs}"] = self.dbfs + body["dbfs"] = self.dbfs if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.execution_duration_seconds is not None: - body["{execution_duration_seconds}"] = self.execution_duration_seconds + body["execution_duration_seconds"] = self.execution_duration_seconds if self.file: - body["{file}"] = self.file + body["file"] = self.file if self.gcs: - body["{gcs}"] = self.gcs + body["gcs"] = self.gcs if self.s3: - body["{s3}"] = self.s3 + body["s3"] = self.s3 if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.volumes: - body["{volumes}"] = self.volumes + body["volumes"] = self.volumes if self.workspace: - body["{workspace}"] = self.workspace + body["workspace"] = self.workspace return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfoAndExecutionDetails: """Deserializes the InitScriptInfoAndExecutionDetails from a dictionary.""" return cls( - abfss=_from_dict(d, "{abfss}", Adlsgen2Info), - dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), - error_message=d.get("{error_message}", None), - execution_duration_seconds=d.get("{execution_duration_seconds}", None), - file=_from_dict(d, "{file}", LocalFileInfo), - gcs=_from_dict(d, "{gcs}", GcsStorageInfo), - s3=_from_dict(d, "{s3}", S3StorageInfo), - status=_enum(d, "{status}", InitScriptExecutionDetailsInitScriptExecutionStatus), - volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), - workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), + abfss=_from_dict(d, "abfss", Adlsgen2Info), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + error_message=d.get("error_message", None), + execution_duration_seconds=d.get("execution_duration_seconds", None), + file=_from_dict(d, "file", LocalFileInfo), + gcs=_from_dict(d, "gcs", GcsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + status=_enum(d, "status", InitScriptExecutionDetailsInitScriptExecutionStatus), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), ) @@ -6101,15 +6095,15 @@ def as_shallow_dict(self) -> dict: """Serializes the InstallLibraries into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstallLibraries: """Deserializes the InstallLibraries from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), libraries=_repeated_dict(d, "{libraries}", Library)) + return cls(cluster_id=d.get("cluster_id", None), libraries=_repeated_dict(d, "libraries", Library)) @dataclass @@ -6161,23 +6155,23 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAccessControlRequest: """Deserializes the InstancePoolAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", InstancePoolPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -6217,26 +6211,26 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAccessControlResponse: """Deserializes the InstancePoolAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", InstancePoolPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", InstancePoolPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -6370,65 +6364,65 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAndStats into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.default_tags: - body["{default_tags}"] = self.default_tags + body["default_tags"] = self.default_tags if self.disk_spec: - body["{disk_spec}"] = self.disk_spec + body["disk_spec"] = self.disk_spec if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = self.idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = self.idle_instance_autotermination_minutes if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.instance_pool_name is not None: - body["{instance_pool_name}"] = self.instance_pool_name + body["instance_pool_name"] = self.instance_pool_name if self.max_capacity is not None: - body["{max_capacity}"] = self.max_capacity + body["max_capacity"] = self.max_capacity if self.min_idle_instances is not None: - body["{min_idle_instances}"] = self.min_idle_instances + body["min_idle_instances"] = self.min_idle_instances if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.preloaded_docker_images: - body["{preloaded_docker_images}"] = self.preloaded_docker_images + body["preloaded_docker_images"] = self.preloaded_docker_images if self.preloaded_spark_versions: - body["{preloaded_spark_versions}"] = self.preloaded_spark_versions + body["preloaded_spark_versions"] = self.preloaded_spark_versions if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.stats: - body["{stats}"] = self.stats + body["stats"] = self.stats if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAndStats: """Deserializes the InstancePoolAndStats from a dictionary.""" return cls( - aws_attributes=_from_dict(d, "{aws_attributes}", InstancePoolAwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", InstancePoolAzureAttributes), - custom_tags=d.get("{custom_tags}", None), - default_tags=d.get("{default_tags}", None), - disk_spec=_from_dict(d, "{disk_spec}", DiskSpec), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", InstancePoolGcpAttributes), - idle_instance_autotermination_minutes=d.get("{idle_instance_autotermination_minutes}", None), - instance_pool_id=d.get("{instance_pool_id}", None), - instance_pool_name=d.get("{instance_pool_name}", None), - max_capacity=d.get("{max_capacity}", None), - min_idle_instances=d.get("{min_idle_instances}", None), - node_type_id=d.get("{node_type_id}", None), - preloaded_docker_images=_repeated_dict(d, "{preloaded_docker_images}", DockerImage), - preloaded_spark_versions=d.get("{preloaded_spark_versions}", None), - state=_enum(d, "{state}", InstancePoolState), - stats=_from_dict(d, "{stats}", InstancePoolStats), - status=_from_dict(d, "{status}", InstancePoolStatus), + aws_attributes=_from_dict(d, "aws_attributes", InstancePoolAwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", InstancePoolAzureAttributes), + custom_tags=d.get("custom_tags", None), + default_tags=d.get("default_tags", None), + disk_spec=_from_dict(d, "disk_spec", DiskSpec), + enable_elastic_disk=d.get("enable_elastic_disk", None), + gcp_attributes=_from_dict(d, "gcp_attributes", InstancePoolGcpAttributes), + idle_instance_autotermination_minutes=d.get("idle_instance_autotermination_minutes", None), + instance_pool_id=d.get("instance_pool_id", None), + instance_pool_name=d.get("instance_pool_name", None), + max_capacity=d.get("max_capacity", None), + min_idle_instances=d.get("min_idle_instances", None), + node_type_id=d.get("node_type_id", None), + preloaded_docker_images=_repeated_dict(d, "preloaded_docker_images", DockerImage), + preloaded_spark_versions=d.get("preloaded_spark_versions", None), + state=_enum(d, "state", InstancePoolState), + stats=_from_dict(d, "stats", InstancePoolStats), + status=_from_dict(d, "status", InstancePoolStatus), ) @@ -6471,20 +6465,20 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent + body["spot_bid_price_percent"] = self.spot_bid_price_percent if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAwsAttributes: """Deserializes the InstancePoolAwsAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", InstancePoolAwsAttributesAvailability), - spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), - zone_id=d.get("{zone_id}", None), + availability=_enum(d, "availability", InstancePoolAwsAttributesAvailability), + spot_bid_price_percent=d.get("spot_bid_price_percent", None), + zone_id=d.get("zone_id", None), ) @@ -6521,17 +6515,17 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolAzureAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price + body["spot_bid_max_price"] = self.spot_bid_max_price return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolAzureAttributes: """Deserializes the InstancePoolAzureAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", InstancePoolAzureAttributesAvailability), - spot_bid_max_price=d.get("{spot_bid_max_price}", None), + availability=_enum(d, "availability", InstancePoolAzureAttributesAvailability), + spot_bid_max_price=d.get("spot_bid_max_price", None), ) @@ -6586,20 +6580,20 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolGcpAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.gcp_availability is not None: - body["{gcp_availability}"] = self.gcp_availability + body["gcp_availability"] = self.gcp_availability if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count + body["local_ssd_count"] = self.local_ssd_count if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolGcpAttributes: """Deserializes the InstancePoolGcpAttributes from a dictionary.""" return cls( - gcp_availability=_enum(d, "{gcp_availability}", GcpAvailability), - local_ssd_count=d.get("{local_ssd_count}", None), - zone_id=d.get("{zone_id}", None), + gcp_availability=_enum(d, "gcp_availability", GcpAvailability), + local_ssd_count=d.get("local_ssd_count", None), + zone_id=d.get("zone_id", None), ) @@ -6627,20 +6621,20 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermission: """Deserializes the InstancePoolPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", InstancePoolPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), ) @@ -6674,20 +6668,20 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissions: """Deserializes the InstancePoolPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", InstancePoolAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", InstancePoolAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -6711,17 +6705,17 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissionsDescription: """Deserializes the InstancePoolPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", InstancePoolPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", InstancePoolPermissionLevel), ) @@ -6745,17 +6739,17 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolPermissionsRequest: """Deserializes the InstancePoolPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", InstancePoolAccessControlRequest), - instance_pool_id=d.get("{instance_pool_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", InstancePoolAccessControlRequest), + instance_pool_id=d.get("instance_pool_id", None), ) @@ -6801,23 +6795,23 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolStats into a shallow dictionary of its immediate attributes.""" body = {} if self.idle_count is not None: - body["{idle_count}"] = self.idle_count + body["idle_count"] = self.idle_count if self.pending_idle_count is not None: - body["{pending_idle_count}"] = self.pending_idle_count + body["pending_idle_count"] = self.pending_idle_count if self.pending_used_count is not None: - body["{pending_used_count}"] = self.pending_used_count + body["pending_used_count"] = self.pending_used_count if self.used_count is not None: - body["{used_count}"] = self.used_count + body["used_count"] = self.used_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolStats: """Deserializes the InstancePoolStats from a dictionary.""" return cls( - idle_count=d.get("{idle_count}", None), - pending_idle_count=d.get("{pending_idle_count}", None), - pending_used_count=d.get("{pending_used_count}", None), - used_count=d.get("{used_count}", None), + idle_count=d.get("idle_count", None), + pending_idle_count=d.get("pending_idle_count", None), + pending_used_count=d.get("pending_used_count", None), + used_count=d.get("used_count", None), ) @@ -6839,13 +6833,13 @@ def as_shallow_dict(self) -> dict: """Serializes the InstancePoolStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.pending_instance_errors: - body["{pending_instance_errors}"] = self.pending_instance_errors + body["pending_instance_errors"] = self.pending_instance_errors return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstancePoolStatus: """Deserializes the InstancePoolStatus from a dictionary.""" - return cls(pending_instance_errors=_repeated_dict(d, "{pending_instance_errors}", PendingInstanceError)) + return cls(pending_instance_errors=_repeated_dict(d, "pending_instance_errors", PendingInstanceError)) @dataclass @@ -6883,20 +6877,20 @@ def as_shallow_dict(self) -> dict: """Serializes the InstanceProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.iam_role_arn is not None: - body["{iam_role_arn}"] = self.iam_role_arn + body["iam_role_arn"] = self.iam_role_arn if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.is_meta_instance_profile is not None: - body["{is_meta_instance_profile}"] = self.is_meta_instance_profile + body["is_meta_instance_profile"] = self.is_meta_instance_profile return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstanceProfile: """Deserializes the InstanceProfile from a dictionary.""" return cls( - iam_role_arn=d.get("{iam_role_arn}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - is_meta_instance_profile=d.get("{is_meta_instance_profile}", None), + iam_role_arn=d.get("iam_role_arn", None), + instance_profile_arn=d.get("instance_profile_arn", None), + is_meta_instance_profile=d.get("is_meta_instance_profile", None), ) @@ -6983,32 +6977,32 @@ def as_shallow_dict(self) -> dict: """Serializes the Library into a shallow dictionary of its immediate attributes.""" body = {} if self.cran: - body["{cran}"] = self.cran + body["cran"] = self.cran if self.egg is not None: - body["{egg}"] = self.egg + body["egg"] = self.egg if self.jar is not None: - body["{jar}"] = self.jar + body["jar"] = self.jar if self.maven: - body["{maven}"] = self.maven + body["maven"] = self.maven if self.pypi: - body["{pypi}"] = self.pypi + body["pypi"] = self.pypi if self.requirements is not None: - body["{requirements}"] = self.requirements + body["requirements"] = self.requirements if self.whl is not None: - body["{whl}"] = self.whl + body["whl"] = self.whl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Library: """Deserializes the Library from a dictionary.""" return cls( - cran=_from_dict(d, "{cran}", RCranLibrary), - egg=d.get("{egg}", None), - jar=d.get("{jar}", None), - maven=_from_dict(d, "{maven}", MavenLibrary), - pypi=_from_dict(d, "{pypi}", PythonPyPiLibrary), - requirements=d.get("{requirements}", None), - whl=d.get("{whl}", None), + cran=_from_dict(d, "cran", RCranLibrary), + egg=d.get("egg", None), + jar=d.get("jar", None), + maven=_from_dict(d, "maven", MavenLibrary), + pypi=_from_dict(d, "pypi", PythonPyPiLibrary), + requirements=d.get("requirements", None), + whl=d.get("whl", None), ) @@ -7045,23 +7039,23 @@ def as_shallow_dict(self) -> dict: """Serializes the LibraryFullStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.is_library_for_all_clusters is not None: - body["{is_library_for_all_clusters}"] = self.is_library_for_all_clusters + body["is_library_for_all_clusters"] = self.is_library_for_all_clusters if self.library: - body["{library}"] = self.library + body["library"] = self.library if self.messages: - body["{messages}"] = self.messages + body["messages"] = self.messages if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LibraryFullStatus: """Deserializes the LibraryFullStatus from a dictionary.""" return cls( - is_library_for_all_clusters=d.get("{is_library_for_all_clusters}", None), - library=_from_dict(d, "{library}", Library), - messages=d.get("{messages}", None), - status=_enum(d, "{status}", LibraryInstallStatus), + is_library_for_all_clusters=d.get("is_library_for_all_clusters", None), + library=_from_dict(d, "library", Library), + messages=d.get("messages", None), + status=_enum(d, "status", LibraryInstallStatus), ) @@ -7094,13 +7088,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAllClusterLibraryStatusesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.statuses: - body["{statuses}"] = self.statuses + body["statuses"] = self.statuses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAllClusterLibraryStatusesResponse: """Deserializes the ListAllClusterLibraryStatusesResponse from a dictionary.""" - return cls(statuses=_repeated_dict(d, "{statuses}", ClusterLibraryStatuses)) + return cls(statuses=_repeated_dict(d, "statuses", ClusterLibraryStatuses)) @dataclass @@ -7124,15 +7118,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAvailableZonesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.default_zone is not None: - body["{default_zone}"] = self.default_zone + body["default_zone"] = self.default_zone if self.zones: - body["{zones}"] = self.zones + body["zones"] = self.zones return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAvailableZonesResponse: """Deserializes the ListAvailableZonesResponse from a dictionary.""" - return cls(default_zone=d.get("{default_zone}", None), zones=d.get("{zones}", None)) + return cls(default_zone=d.get("default_zone", None), zones=d.get("zones", None)) @dataclass @@ -7163,20 +7157,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListClusterCompliancesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.clusters: - body["{clusters}"] = self.clusters + body["clusters"] = self.clusters if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClusterCompliancesResponse: """Deserializes the ListClusterCompliancesResponse from a dictionary.""" return cls( - clusters=_repeated_dict(d, "{clusters}", ClusterCompliance), - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), + clusters=_repeated_dict(d, "clusters", ClusterCompliance), + next_page_token=d.get("next_page_token", None), + prev_page_token=d.get("prev_page_token", None), ) @@ -7211,23 +7205,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ListClustersFilterBy into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_sources: - body["{cluster_sources}"] = self.cluster_sources + body["cluster_sources"] = self.cluster_sources if self.cluster_states: - body["{cluster_states}"] = self.cluster_states + body["cluster_states"] = self.cluster_states if self.is_pinned is not None: - body["{is_pinned}"] = self.is_pinned + body["is_pinned"] = self.is_pinned if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClustersFilterBy: """Deserializes the ListClustersFilterBy from a dictionary.""" return cls( - cluster_sources=_repeated_enum(d, "{cluster_sources}", ClusterSource), - cluster_states=_repeated_enum(d, "{cluster_states}", State), - is_pinned=d.get("{is_pinned}", None), - policy_id=d.get("{policy_id}", None), + cluster_sources=_repeated_enum(d, "cluster_sources", ClusterSource), + cluster_states=_repeated_enum(d, "cluster_states", State), + is_pinned=d.get("is_pinned", None), + policy_id=d.get("policy_id", None), ) @@ -7258,20 +7252,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListClustersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.clusters: - body["{clusters}"] = self.clusters + body["clusters"] = self.clusters if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClustersResponse: """Deserializes the ListClustersResponse from a dictionary.""" return cls( - clusters=_repeated_dict(d, "{clusters}", ClusterDetails), - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), + clusters=_repeated_dict(d, "clusters", ClusterDetails), + next_page_token=d.get("next_page_token", None), + prev_page_token=d.get("prev_page_token", None), ) @@ -7297,17 +7291,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListClustersSortBy into a shallow dictionary of its immediate attributes.""" body = {} if self.direction is not None: - body["{direction}"] = self.direction + body["direction"] = self.direction if self.field is not None: - body["{field}"] = self.field + body["field"] = self.field return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListClustersSortBy: """Deserializes the ListClustersSortBy from a dictionary.""" return cls( - direction=_enum(d, "{direction}", ListClustersSortByDirection), - field=_enum(d, "{field}", ListClustersSortByField), + direction=_enum(d, "direction", ListClustersSortByDirection), + field=_enum(d, "field", ListClustersSortByField), ) @@ -7338,13 +7332,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListGlobalInitScriptsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.scripts: - body["{scripts}"] = self.scripts + body["scripts"] = self.scripts return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListGlobalInitScriptsResponse: """Deserializes the ListGlobalInitScriptsResponse from a dictionary.""" - return cls(scripts=_repeated_dict(d, "{scripts}", GlobalInitScriptDetails)) + return cls(scripts=_repeated_dict(d, "scripts", GlobalInitScriptDetails)) @dataclass @@ -7362,13 +7356,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListInstancePools into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_pools: - body["{instance_pools}"] = self.instance_pools + body["instance_pools"] = self.instance_pools return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListInstancePools: """Deserializes the ListInstancePools from a dictionary.""" - return cls(instance_pools=_repeated_dict(d, "{instance_pools}", InstancePoolAndStats)) + return cls(instance_pools=_repeated_dict(d, "instance_pools", InstancePoolAndStats)) @dataclass @@ -7387,13 +7381,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListInstanceProfilesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_profiles: - body["{instance_profiles}"] = self.instance_profiles + body["instance_profiles"] = self.instance_profiles return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListInstanceProfilesResponse: """Deserializes the ListInstanceProfilesResponse from a dictionary.""" - return cls(instance_profiles=_repeated_dict(d, "{instance_profiles}", InstanceProfile)) + return cls(instance_profiles=_repeated_dict(d, "instance_profiles", InstanceProfile)) @dataclass @@ -7412,13 +7406,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListNodeTypesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.node_types: - body["{node_types}"] = self.node_types + body["node_types"] = self.node_types return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNodeTypesResponse: """Deserializes the ListNodeTypesResponse from a dictionary.""" - return cls(node_types=_repeated_dict(d, "{node_types}", NodeType)) + return cls(node_types=_repeated_dict(d, "node_types", NodeType)) @dataclass @@ -7437,13 +7431,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListPoliciesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.policies: - body["{policies}"] = self.policies + body["policies"] = self.policies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPoliciesResponse: """Deserializes the ListPoliciesResponse from a dictionary.""" - return cls(policies=_repeated_dict(d, "{policies}", Policy)) + return cls(policies=_repeated_dict(d, "policies", Policy)) @dataclass @@ -7468,17 +7462,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListPolicyFamiliesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.policy_families: - body["{policy_families}"] = self.policy_families + body["policy_families"] = self.policy_families return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPolicyFamiliesResponse: """Deserializes the ListPolicyFamiliesResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - policy_families=_repeated_dict(d, "{policy_families}", PolicyFamily), + next_page_token=d.get("next_page_token", None), + policy_families=_repeated_dict(d, "policy_families", PolicyFamily), ) @@ -7510,13 +7504,13 @@ def as_shallow_dict(self) -> dict: """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: """Deserializes the LocalFileInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -7538,17 +7532,17 @@ def as_shallow_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.log_analytics_primary_key is not None: - body["{log_analytics_primary_key}"] = self.log_analytics_primary_key + body["log_analytics_primary_key"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: """Deserializes the LogAnalyticsInfo from a dictionary.""" return cls( - log_analytics_primary_key=d.get("{log_analytics_primary_key}", None), - log_analytics_workspace_id=d.get("{log_analytics_workspace_id}", None), + log_analytics_primary_key=d.get("log_analytics_primary_key", None), + log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), ) @@ -7577,15 +7571,15 @@ def as_shallow_dict(self) -> dict: """Serializes the LogSyncStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.last_attempted is not None: - body["{last_attempted}"] = self.last_attempted + body["last_attempted"] = self.last_attempted if self.last_exception is not None: - body["{last_exception}"] = self.last_exception + body["last_exception"] = self.last_exception return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogSyncStatus: """Deserializes the LogSyncStatus from a dictionary.""" - return cls(last_attempted=d.get("{last_attempted}", None), last_exception=d.get("{last_exception}", None)) + return cls(last_attempted=d.get("last_attempted", None), last_exception=d.get("last_exception", None)) @dataclass @@ -7618,18 +7612,18 @@ def as_shallow_dict(self) -> dict: """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.coordinates is not None: - body["{coordinates}"] = self.coordinates + body["coordinates"] = self.coordinates if self.exclusions: - body["{exclusions}"] = self.exclusions + body["exclusions"] = self.exclusions if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: """Deserializes the MavenLibrary from a dictionary.""" return cls( - coordinates=d.get("{coordinates}", None), exclusions=d.get("{exclusions}", None), repo=d.get("{repo}", None) + coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) ) @@ -7673,26 +7667,26 @@ def as_shallow_dict(self) -> dict: """Serializes the NodeInstanceType into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_type_id is not None: - body["{instance_type_id}"] = self.instance_type_id + body["instance_type_id"] = self.instance_type_id if self.local_disk_size_gb is not None: - body["{local_disk_size_gb}"] = self.local_disk_size_gb + body["local_disk_size_gb"] = self.local_disk_size_gb if self.local_disks is not None: - body["{local_disks}"] = self.local_disks + body["local_disks"] = self.local_disks if self.local_nvme_disk_size_gb is not None: - body["{local_nvme_disk_size_gb}"] = self.local_nvme_disk_size_gb + body["local_nvme_disk_size_gb"] = self.local_nvme_disk_size_gb if self.local_nvme_disks is not None: - body["{local_nvme_disks}"] = self.local_nvme_disks + body["local_nvme_disks"] = self.local_nvme_disks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NodeInstanceType: """Deserializes the NodeInstanceType from a dictionary.""" return cls( - instance_type_id=d.get("{instance_type_id}", None), - local_disk_size_gb=d.get("{local_disk_size_gb}", None), - local_disks=d.get("{local_disks}", None), - local_nvme_disk_size_gb=d.get("{local_nvme_disk_size_gb}", None), - local_nvme_disks=d.get("{local_nvme_disks}", None), + instance_type_id=d.get("instance_type_id", None), + local_disk_size_gb=d.get("local_disk_size_gb", None), + local_disks=d.get("local_disks", None), + local_nvme_disk_size_gb=d.get("local_nvme_disk_size_gb", None), + local_nvme_disks=d.get("local_nvme_disks", None), ) @@ -7814,71 +7808,71 @@ def as_shallow_dict(self) -> dict: """Serializes the NodeType into a shallow dictionary of its immediate attributes.""" body = {} if self.category is not None: - body["{category}"] = self.category + body["category"] = self.category if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_order is not None: - body["{display_order}"] = self.display_order + body["display_order"] = self.display_order if self.instance_type_id is not None: - body["{instance_type_id}"] = self.instance_type_id + body["instance_type_id"] = self.instance_type_id if self.is_deprecated is not None: - body["{is_deprecated}"] = self.is_deprecated + body["is_deprecated"] = self.is_deprecated if self.is_encrypted_in_transit is not None: - body["{is_encrypted_in_transit}"] = self.is_encrypted_in_transit + body["is_encrypted_in_transit"] = self.is_encrypted_in_transit if self.is_graviton is not None: - body["{is_graviton}"] = self.is_graviton + body["is_graviton"] = self.is_graviton if self.is_hidden is not None: - body["{is_hidden}"] = self.is_hidden + body["is_hidden"] = self.is_hidden if self.is_io_cache_enabled is not None: - body["{is_io_cache_enabled}"] = self.is_io_cache_enabled + body["is_io_cache_enabled"] = self.is_io_cache_enabled if self.memory_mb is not None: - body["{memory_mb}"] = self.memory_mb + body["memory_mb"] = self.memory_mb if self.node_info: - body["{node_info}"] = self.node_info + body["node_info"] = self.node_info if self.node_instance_type: - body["{node_instance_type}"] = self.node_instance_type + body["node_instance_type"] = self.node_instance_type if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_cores is not None: - body["{num_cores}"] = self.num_cores + body["num_cores"] = self.num_cores if self.num_gpus is not None: - body["{num_gpus}"] = self.num_gpus + body["num_gpus"] = self.num_gpus if self.photon_driver_capable is not None: - body["{photon_driver_capable}"] = self.photon_driver_capable + body["photon_driver_capable"] = self.photon_driver_capable if self.photon_worker_capable is not None: - body["{photon_worker_capable}"] = self.photon_worker_capable + body["photon_worker_capable"] = self.photon_worker_capable if self.support_cluster_tags is not None: - body["{support_cluster_tags}"] = self.support_cluster_tags + body["support_cluster_tags"] = self.support_cluster_tags if self.support_ebs_volumes is not None: - body["{support_ebs_volumes}"] = self.support_ebs_volumes + body["support_ebs_volumes"] = self.support_ebs_volumes if self.support_port_forwarding is not None: - body["{support_port_forwarding}"] = self.support_port_forwarding + body["support_port_forwarding"] = self.support_port_forwarding return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NodeType: """Deserializes the NodeType from a dictionary.""" return cls( - category=d.get("{category}", None), - description=d.get("{description}", None), - display_order=d.get("{display_order}", None), - instance_type_id=d.get("{instance_type_id}", None), - is_deprecated=d.get("{is_deprecated}", None), - is_encrypted_in_transit=d.get("{is_encrypted_in_transit}", None), - is_graviton=d.get("{is_graviton}", None), - is_hidden=d.get("{is_hidden}", None), - is_io_cache_enabled=d.get("{is_io_cache_enabled}", None), - memory_mb=d.get("{memory_mb}", None), - node_info=_from_dict(d, "{node_info}", CloudProviderNodeInfo), - node_instance_type=_from_dict(d, "{node_instance_type}", NodeInstanceType), - node_type_id=d.get("{node_type_id}", None), - num_cores=d.get("{num_cores}", None), - num_gpus=d.get("{num_gpus}", None), - photon_driver_capable=d.get("{photon_driver_capable}", None), - photon_worker_capable=d.get("{photon_worker_capable}", None), - support_cluster_tags=d.get("{support_cluster_tags}", None), - support_ebs_volumes=d.get("{support_ebs_volumes}", None), - support_port_forwarding=d.get("{support_port_forwarding}", None), + category=d.get("category", None), + description=d.get("description", None), + display_order=d.get("display_order", None), + instance_type_id=d.get("instance_type_id", None), + is_deprecated=d.get("is_deprecated", None), + is_encrypted_in_transit=d.get("is_encrypted_in_transit", None), + is_graviton=d.get("is_graviton", None), + is_hidden=d.get("is_hidden", None), + is_io_cache_enabled=d.get("is_io_cache_enabled", None), + memory_mb=d.get("memory_mb", None), + node_info=_from_dict(d, "node_info", CloudProviderNodeInfo), + node_instance_type=_from_dict(d, "node_instance_type", NodeInstanceType), + node_type_id=d.get("node_type_id", None), + num_cores=d.get("num_cores", None), + num_gpus=d.get("num_gpus", None), + photon_driver_capable=d.get("photon_driver_capable", None), + photon_worker_capable=d.get("photon_worker_capable", None), + support_cluster_tags=d.get("support_cluster_tags", None), + support_ebs_volumes=d.get("support_ebs_volumes", None), + support_port_forwarding=d.get("support_port_forwarding", None), ) @@ -7903,15 +7897,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PendingInstanceError into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_id is not None: - body["{instance_id}"] = self.instance_id + body["instance_id"] = self.instance_id if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PendingInstanceError: """Deserializes the PendingInstanceError from a dictionary.""" - return cls(instance_id=d.get("{instance_id}", None), message=d.get("{message}", None)) + return cls(instance_id=d.get("instance_id", None), message=d.get("message", None)) @dataclass @@ -7930,13 +7924,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PermanentDeleteCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermanentDeleteCluster: """Deserializes the PermanentDeleteCluster from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None)) + return cls(cluster_id=d.get("cluster_id", None)) @dataclass @@ -7972,13 +7966,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PinCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PinCluster: """Deserializes the PinCluster from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None)) + return cls(cluster_id=d.get("cluster_id", None)) @dataclass @@ -8084,44 +8078,44 @@ def as_shallow_dict(self) -> dict: """Serializes the Policy into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at_timestamp is not None: - body["{created_at_timestamp}"] = self.created_at_timestamp + body["created_at_timestamp"] = self.created_at_timestamp if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.is_default is not None: - body["{is_default}"] = self.is_default + body["is_default"] = self.is_default if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = self.max_clusters_per_user + body["max_clusters_per_user"] = self.max_clusters_per_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = self.policy_family_definition_overrides + body["policy_family_definition_overrides"] = self.policy_family_definition_overrides if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Policy: """Deserializes the Policy from a dictionary.""" return cls( - created_at_timestamp=d.get("{created_at_timestamp}", None), - creator_user_name=d.get("{creator_user_name}", None), - definition=d.get("{definition}", None), - description=d.get("{description}", None), - is_default=d.get("{is_default}", None), - libraries=_repeated_dict(d, "{libraries}", Library), - max_clusters_per_user=d.get("{max_clusters_per_user}", None), - name=d.get("{name}", None), - policy_family_definition_overrides=d.get("{policy_family_definition_overrides}", None), - policy_family_id=d.get("{policy_family_id}", None), - policy_id=d.get("{policy_id}", None), + created_at_timestamp=d.get("created_at_timestamp", None), + creator_user_name=d.get("creator_user_name", None), + definition=d.get("definition", None), + description=d.get("description", None), + is_default=d.get("is_default", None), + libraries=_repeated_dict(d, "libraries", Library), + max_clusters_per_user=d.get("max_clusters_per_user", None), + name=d.get("name", None), + policy_family_definition_overrides=d.get("policy_family_definition_overrides", None), + policy_family_id=d.get("policy_family_id", None), + policy_id=d.get("policy_id", None), ) @@ -8158,23 +8152,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PolicyFamily into a shallow dictionary of its immediate attributes.""" body = {} if self.definition is not None: - body["{definition}"] = self.definition + body["definition"] = self.definition if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.policy_family_id is not None: - body["{policy_family_id}"] = self.policy_family_id + body["policy_family_id"] = self.policy_family_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PolicyFamily: """Deserializes the PolicyFamily from a dictionary.""" return cls( - definition=d.get("{definition}", None), - description=d.get("{description}", None), - name=d.get("{name}", None), - policy_family_id=d.get("{policy_family_id}", None), + definition=d.get("definition", None), + description=d.get("description", None), + name=d.get("name", None), + policy_family_id=d.get("policy_family_id", None), ) @@ -8200,15 +8194,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PythonPyPiLibrary: """Deserializes the PythonPyPiLibrary from a dictionary.""" - return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) + return cls(package=d.get("package", None), repo=d.get("repo", None)) @dataclass @@ -8232,15 +8226,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RCranLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RCranLibrary: """Deserializes the RCranLibrary from a dictionary.""" - return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) + return cls(package=d.get("package", None), repo=d.get("repo", None)) @dataclass @@ -8259,13 +8253,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RemoveInstanceProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RemoveInstanceProfile: """Deserializes the RemoveInstanceProfile from a dictionary.""" - return cls(instance_profile_arn=d.get("{instance_profile_arn}", None)) + return cls(instance_profile_arn=d.get("instance_profile_arn", None)) @dataclass @@ -8320,20 +8314,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ResizeCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResizeCluster: """Deserializes the ResizeCluster from a dictionary.""" return cls( - autoscale=_from_dict(d, "{autoscale}", AutoScale), - cluster_id=d.get("{cluster_id}", None), - num_workers=d.get("{num_workers}", None), + autoscale=_from_dict(d, "autoscale", AutoScale), + cluster_id=d.get("cluster_id", None), + num_workers=d.get("num_workers", None), ) @@ -8375,15 +8369,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RestartCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.restart_user is not None: - body["{restart_user}"] = self.restart_user + body["restart_user"] = self.restart_user return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestartCluster: """Deserializes the RestartCluster from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), restart_user=d.get("{restart_user}", None)) + return cls(cluster_id=d.get("cluster_id", None), restart_user=d.get("restart_user", None)) @dataclass @@ -8471,41 +8465,41 @@ def as_shallow_dict(self) -> dict: """Serializes the Results into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause + body["cause"] = self.cause if self.data: - body["{data}"] = self.data + body["data"] = self.data if self.file_name is not None: - body["{file_name}"] = self.file_name + body["fileName"] = self.file_name if self.file_names: - body["{file_names}"] = self.file_names + body["fileNames"] = self.file_names if self.is_json_schema is not None: - body["{is_json_schema}"] = self.is_json_schema + body["isJsonSchema"] = self.is_json_schema if self.pos is not None: - body["{pos}"] = self.pos + body["pos"] = self.pos if self.result_type is not None: - body["{result_type}"] = self.result_type + body["resultType"] = self.result_type if self.schema: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.summary is not None: - body["{summary}"] = self.summary + body["summary"] = self.summary if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Results: """Deserializes the Results from a dictionary.""" return cls( - cause=d.get("{cause}", None), - data=d.get("{data}", None), - file_name=d.get("{file_name}", None), - file_names=d.get("{file_names}", None), - is_json_schema=d.get("{is_json_schema}", None), - pos=d.get("{pos}", None), - result_type=_enum(d, "{result_type}", ResultType), - schema=d.get("{schema}", None), - summary=d.get("{summary}", None), - truncated=d.get("{truncated}", None), + cause=d.get("cause", None), + data=d.get("data", None), + file_name=d.get("fileName", None), + file_names=d.get("fileNames", None), + is_json_schema=d.get("isJsonSchema", None), + pos=d.get("pos", None), + result_type=_enum(d, "resultType", ResultType), + schema=d.get("schema", None), + summary=d.get("summary", None), + truncated=d.get("truncated", None), ) @@ -8576,32 +8570,32 @@ def as_shallow_dict(self) -> dict: """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.canned_acl is not None: - body["{canned_acl}"] = self.canned_acl + body["canned_acl"] = self.canned_acl if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination if self.enable_encryption is not None: - body["{enable_encryption}"] = self.enable_encryption + body["enable_encryption"] = self.enable_encryption if self.encryption_type is not None: - body["{encryption_type}"] = self.encryption_type + body["encryption_type"] = self.encryption_type if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.kms_key is not None: - body["{kms_key}"] = self.kms_key + body["kms_key"] = self.kms_key if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: """Deserializes the S3StorageInfo from a dictionary.""" return cls( - canned_acl=d.get("{canned_acl}", None), - destination=d.get("{destination}", None), - enable_encryption=d.get("{enable_encryption}", None), - encryption_type=d.get("{encryption_type}", None), - endpoint=d.get("{endpoint}", None), - kms_key=d.get("{kms_key}", None), - region=d.get("{region}", None), + canned_acl=d.get("canned_acl", None), + destination=d.get("destination", None), + enable_encryption=d.get("enable_encryption", None), + encryption_type=d.get("encryption_type", None), + endpoint=d.get("endpoint", None), + kms_key=d.get("kms_key", None), + region=d.get("region", None), ) @@ -8656,32 +8650,32 @@ def as_shallow_dict(self) -> dict: """Serializes the SparkNode into a shallow dictionary of its immediate attributes.""" body = {} if self.host_private_ip is not None: - body["{host_private_ip}"] = self.host_private_ip + body["host_private_ip"] = self.host_private_ip if self.instance_id is not None: - body["{instance_id}"] = self.instance_id + body["instance_id"] = self.instance_id if self.node_aws_attributes: - body["{node_aws_attributes}"] = self.node_aws_attributes + body["node_aws_attributes"] = self.node_aws_attributes if self.node_id is not None: - body["{node_id}"] = self.node_id + body["node_id"] = self.node_id if self.private_ip is not None: - body["{private_ip}"] = self.private_ip + body["private_ip"] = self.private_ip if self.public_dns is not None: - body["{public_dns}"] = self.public_dns + body["public_dns"] = self.public_dns if self.start_timestamp is not None: - body["{start_timestamp}"] = self.start_timestamp + body["start_timestamp"] = self.start_timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkNode: """Deserializes the SparkNode from a dictionary.""" return cls( - host_private_ip=d.get("{host_private_ip}", None), - instance_id=d.get("{instance_id}", None), - node_aws_attributes=_from_dict(d, "{node_aws_attributes}", SparkNodeAwsAttributes), - node_id=d.get("{node_id}", None), - private_ip=d.get("{private_ip}", None), - public_dns=d.get("{public_dns}", None), - start_timestamp=d.get("{start_timestamp}", None), + host_private_ip=d.get("host_private_ip", None), + instance_id=d.get("instance_id", None), + node_aws_attributes=_from_dict(d, "node_aws_attributes", SparkNodeAwsAttributes), + node_id=d.get("node_id", None), + private_ip=d.get("private_ip", None), + public_dns=d.get("public_dns", None), + start_timestamp=d.get("start_timestamp", None), ) @@ -8703,13 +8697,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SparkNodeAwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.is_spot is not None: - body["{is_spot}"] = self.is_spot + body["is_spot"] = self.is_spot return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkNodeAwsAttributes: """Deserializes the SparkNodeAwsAttributes from a dictionary.""" - return cls(is_spot=d.get("{is_spot}", None)) + return cls(is_spot=d.get("is_spot", None)) @dataclass @@ -8736,15 +8730,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SparkVersion into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkVersion: """Deserializes the SparkVersion from a dictionary.""" - return cls(key=d.get("{key}", None), name=d.get("{name}", None)) + return cls(key=d.get("key", None), name=d.get("name", None)) @dataclass @@ -8763,13 +8757,13 @@ def as_shallow_dict(self) -> dict: """Serializes the StartCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StartCluster: """Deserializes the StartCluster from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None)) + return cls(cluster_id=d.get("cluster_id", None)) @dataclass @@ -8834,20 +8828,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TerminationReason into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["{code}"] = self.code + body["code"] = self.code if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TerminationReason: """Deserializes the TerminationReason from a dictionary.""" return cls( - code=_enum(d, "{code}", TerminationReasonCode), - parameters=d.get("{parameters}", None), - type=_enum(d, "{type}", TerminationReasonType), + code=_enum(d, "code", TerminationReasonCode), + parameters=d.get("parameters", None), + type=_enum(d, "type", TerminationReasonType), ) @@ -9044,15 +9038,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UninstallLibraries into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UninstallLibraries: """Deserializes the UninstallLibraries from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), libraries=_repeated_dict(d, "{libraries}", Library)) + return cls(cluster_id=d.get("cluster_id", None), libraries=_repeated_dict(d, "libraries", Library)) @dataclass @@ -9088,13 +9082,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UnpinCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UnpinCluster: """Deserializes the UnpinCluster from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None)) + return cls(cluster_id=d.get("cluster_id", None)) @dataclass @@ -9152,20 +9146,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster: - body["{cluster}"] = self.cluster + body["cluster"] = self.cluster if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCluster: """Deserializes the UpdateCluster from a dictionary.""" return cls( - cluster=_from_dict(d, "{cluster}", UpdateClusterResource), - cluster_id=d.get("{cluster_id}", None), - update_mask=d.get("{update_mask}", None), + cluster=_from_dict(d, "cluster", UpdateClusterResource), + cluster_id=d.get("cluster_id", None), + update_mask=d.get("update_mask", None), ) @@ -9425,98 +9419,98 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateClusterResource into a shallow dictionary of its immediate attributes.""" body = {} if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode + body["data_security_mode"] = self.data_security_mode if self.docker_image: - body["{docker_image}"] = self.docker_image + body["docker_image"] = self.docker_image if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine + body["runtime_engine"] = self.runtime_engine if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateClusterResource: """Deserializes the UpdateClusterResource from a dictionary.""" return cls( - autoscale=_from_dict(d, "{autoscale}", AutoScale), - autotermination_minutes=d.get("{autotermination_minutes}", None), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - cluster_name=d.get("{cluster_name}", None), - custom_tags=d.get("{custom_tags}", None), - data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), - docker_image=_from_dict(d, "{docker_image}", DockerImage), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - is_single_node=d.get("{is_single_node}", None), - kind=_enum(d, "{kind}", Kind), - node_type_id=d.get("{node_type_id}", None), - num_workers=d.get("{num_workers}", None), - policy_id=d.get("{policy_id}", None), - runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), - single_user_name=d.get("{single_user_name}", None), - spark_conf=d.get("{spark_conf}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - spark_version=d.get("{spark_version}", None), - ssh_public_keys=d.get("{ssh_public_keys}", None), - use_ml_runtime=d.get("{use_ml_runtime}", None), - workload_type=_from_dict(d, "{workload_type}", WorkloadType), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), ) @@ -9575,13 +9569,13 @@ def as_shallow_dict(self) -> dict: """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: """Deserializes the VolumesStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -9602,13 +9596,13 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" body = {} if self.clients: - body["{clients}"] = self.clients + body["clients"] = self.clients return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: """Deserializes the WorkloadType from a dictionary.""" - return cls(clients=_from_dict(d, "{clients}", ClientsTypes)) + return cls(clients=_from_dict(d, "clients", ClientsTypes)) @dataclass @@ -9629,13 +9623,13 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: """Deserializes the WorkspaceStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) class ClusterPoliciesAPI: @@ -9709,19 +9703,19 @@ def create( """ body = {} if definition is not None: - body["{definition}"] = definition + body["definition"] = definition if description is not None: - body["{description}"] = description + body["description"] = description if libraries is not None: - body["{libraries}"] = [v.as_dict() for v in libraries] + body["libraries"] = [v.as_dict() for v in libraries] if max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = max_clusters_per_user + body["max_clusters_per_user"] = max_clusters_per_user if name is not None: - body["{name}"] = name + body["name"] = name if policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = policy_family_definition_overrides + body["policy_family_definition_overrides"] = policy_family_definition_overrides if policy_family_id is not None: - body["{policy_family_id}"] = policy_family_id + body["policy_family_id"] = policy_family_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9742,7 +9736,7 @@ def delete(self, policy_id: str): """ body = {} if policy_id is not None: - body["{policy_id}"] = policy_id + body["policy_id"] = policy_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9803,21 +9797,21 @@ def edit( """ body = {} if definition is not None: - body["{definition}"] = definition + body["definition"] = definition if description is not None: - body["{description}"] = description + body["description"] = description if libraries is not None: - body["{libraries}"] = [v.as_dict() for v in libraries] + body["libraries"] = [v.as_dict() for v in libraries] if max_clusters_per_user is not None: - body["{max_clusters_per_user}"] = max_clusters_per_user + body["max_clusters_per_user"] = max_clusters_per_user if name is not None: - body["{name}"] = name + body["name"] = name if policy_family_definition_overrides is not None: - body["{policy_family_definition_overrides}"] = policy_family_definition_overrides + body["policy_family_definition_overrides"] = policy_family_definition_overrides if policy_family_id is not None: - body["{policy_family_id}"] = policy_family_id + body["policy_family_id"] = policy_family_id if policy_id is not None: - body["{policy_id}"] = policy_id + body["policy_id"] = policy_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9838,7 +9832,7 @@ def get(self, policy_id: str) -> Policy: query = {} if policy_id is not None: - query["{policy_id}"] = policy_id + query["policy_id"] = policy_id headers = { "0": "{Accept application/json}", } @@ -9904,9 +9898,9 @@ def list( query = {} if sort_column is not None: - query["{sort_column}"] = sort_column.value + query["sort_column"] = sort_column.value if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sort_order"] = sort_order.value headers = { "0": "{Accept application/json}", } @@ -9931,7 +9925,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9958,7 +9952,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10010,9 +10004,9 @@ def change_owner(self, cluster_id: str, owner_username: str): """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if owner_username is not None: - body["{owner_username}"] = owner_username + body["owner_username"] = owner_username headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10240,67 +10234,67 @@ def create( """ body = {} if apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = apply_policy_default_values + body["apply_policy_default_values"] = apply_policy_default_values if autoscale is not None: - body["{autoscale}"] = autoscale.as_dict() + body["autoscale"] = autoscale.as_dict() if autotermination_minutes is not None: - body["{autotermination_minutes}"] = autotermination_minutes + body["autotermination_minutes"] = autotermination_minutes if aws_attributes is not None: - body["{aws_attributes}"] = aws_attributes.as_dict() + body["aws_attributes"] = aws_attributes.as_dict() if azure_attributes is not None: - body["{azure_attributes}"] = azure_attributes.as_dict() + body["azure_attributes"] = azure_attributes.as_dict() if clone_from is not None: - body["{clone_from}"] = clone_from.as_dict() + body["clone_from"] = clone_from.as_dict() if cluster_log_conf is not None: - body["{cluster_log_conf}"] = cluster_log_conf.as_dict() + body["cluster_log_conf"] = cluster_log_conf.as_dict() if cluster_name is not None: - body["{cluster_name}"] = cluster_name + body["cluster_name"] = cluster_name if custom_tags is not None: - body["{custom_tags}"] = custom_tags + body["custom_tags"] = custom_tags if data_security_mode is not None: - body["{data_security_mode}"] = data_security_mode.value + body["data_security_mode"] = data_security_mode.value if docker_image is not None: - body["{docker_image}"] = docker_image.as_dict() + body["docker_image"] = docker_image.as_dict() if driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = driver_instance_pool_id + body["driver_instance_pool_id"] = driver_instance_pool_id if driver_node_type_id is not None: - body["{driver_node_type_id}"] = driver_node_type_id + body["driver_node_type_id"] = driver_node_type_id if enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = enable_elastic_disk + body["enable_elastic_disk"] = enable_elastic_disk if enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = enable_local_disk_encryption + body["enable_local_disk_encryption"] = enable_local_disk_encryption if gcp_attributes is not None: - body["{gcp_attributes}"] = gcp_attributes.as_dict() + body["gcp_attributes"] = gcp_attributes.as_dict() if init_scripts is not None: - body["{init_scripts}"] = [v.as_dict() for v in init_scripts] + body["init_scripts"] = [v.as_dict() for v in init_scripts] if instance_pool_id is not None: - body["{instance_pool_id}"] = instance_pool_id + body["instance_pool_id"] = instance_pool_id if is_single_node is not None: - body["{is_single_node}"] = is_single_node + body["is_single_node"] = is_single_node if kind is not None: - body["{kind}"] = kind.value + body["kind"] = kind.value if node_type_id is not None: - body["{node_type_id}"] = node_type_id + body["node_type_id"] = node_type_id if num_workers is not None: - body["{num_workers}"] = num_workers + body["num_workers"] = num_workers if policy_id is not None: - body["{policy_id}"] = policy_id + body["policy_id"] = policy_id if runtime_engine is not None: - body["{runtime_engine}"] = runtime_engine.value + body["runtime_engine"] = runtime_engine.value if single_user_name is not None: - body["{single_user_name}"] = single_user_name + body["single_user_name"] = single_user_name if spark_conf is not None: - body["{spark_conf}"] = spark_conf + body["spark_conf"] = spark_conf if spark_env_vars is not None: - body["{spark_env_vars}"] = spark_env_vars + body["spark_env_vars"] = spark_env_vars if spark_version is not None: - body["{spark_version}"] = spark_version + body["spark_version"] = spark_version if ssh_public_keys is not None: - body["{ssh_public_keys}"] = [v for v in ssh_public_keys] + body["ssh_public_keys"] = [v for v in ssh_public_keys] if use_ml_runtime is not None: - body["{use_ml_runtime}"] = use_ml_runtime + body["use_ml_runtime"] = use_ml_runtime if workload_type is not None: - body["{workload_type}"] = workload_type.as_dict() + body["workload_type"] = workload_type.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10310,7 +10304,7 @@ def create( return Wait( self.WaitGetClusterRunning, response=CreateClusterResponse.from_dict(op_response), - cluster_id=op_response["{cluster_id}"], + cluster_id=op_response["cluster_id"], ) def create_and_wait( @@ -10399,7 +10393,7 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10630,67 +10624,67 @@ def edit( """ body = {} if apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = apply_policy_default_values + body["apply_policy_default_values"] = apply_policy_default_values if autoscale is not None: - body["{autoscale}"] = autoscale.as_dict() + body["autoscale"] = autoscale.as_dict() if autotermination_minutes is not None: - body["{autotermination_minutes}"] = autotermination_minutes + body["autotermination_minutes"] = autotermination_minutes if aws_attributes is not None: - body["{aws_attributes}"] = aws_attributes.as_dict() + body["aws_attributes"] = aws_attributes.as_dict() if azure_attributes is not None: - body["{azure_attributes}"] = azure_attributes.as_dict() + body["azure_attributes"] = azure_attributes.as_dict() if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if cluster_log_conf is not None: - body["{cluster_log_conf}"] = cluster_log_conf.as_dict() + body["cluster_log_conf"] = cluster_log_conf.as_dict() if cluster_name is not None: - body["{cluster_name}"] = cluster_name + body["cluster_name"] = cluster_name if custom_tags is not None: - body["{custom_tags}"] = custom_tags + body["custom_tags"] = custom_tags if data_security_mode is not None: - body["{data_security_mode}"] = data_security_mode.value + body["data_security_mode"] = data_security_mode.value if docker_image is not None: - body["{docker_image}"] = docker_image.as_dict() + body["docker_image"] = docker_image.as_dict() if driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = driver_instance_pool_id + body["driver_instance_pool_id"] = driver_instance_pool_id if driver_node_type_id is not None: - body["{driver_node_type_id}"] = driver_node_type_id + body["driver_node_type_id"] = driver_node_type_id if enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = enable_elastic_disk + body["enable_elastic_disk"] = enable_elastic_disk if enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = enable_local_disk_encryption + body["enable_local_disk_encryption"] = enable_local_disk_encryption if gcp_attributes is not None: - body["{gcp_attributes}"] = gcp_attributes.as_dict() + body["gcp_attributes"] = gcp_attributes.as_dict() if init_scripts is not None: - body["{init_scripts}"] = [v.as_dict() for v in init_scripts] + body["init_scripts"] = [v.as_dict() for v in init_scripts] if instance_pool_id is not None: - body["{instance_pool_id}"] = instance_pool_id + body["instance_pool_id"] = instance_pool_id if is_single_node is not None: - body["{is_single_node}"] = is_single_node + body["is_single_node"] = is_single_node if kind is not None: - body["{kind}"] = kind.value + body["kind"] = kind.value if node_type_id is not None: - body["{node_type_id}"] = node_type_id + body["node_type_id"] = node_type_id if num_workers is not None: - body["{num_workers}"] = num_workers + body["num_workers"] = num_workers if policy_id is not None: - body["{policy_id}"] = policy_id + body["policy_id"] = policy_id if runtime_engine is not None: - body["{runtime_engine}"] = runtime_engine.value + body["runtime_engine"] = runtime_engine.value if single_user_name is not None: - body["{single_user_name}"] = single_user_name + body["single_user_name"] = single_user_name if spark_conf is not None: - body["{spark_conf}"] = spark_conf + body["spark_conf"] = spark_conf if spark_env_vars is not None: - body["{spark_env_vars}"] = spark_env_vars + body["spark_env_vars"] = spark_env_vars if spark_version is not None: - body["{spark_version}"] = spark_version + body["spark_version"] = spark_version if ssh_public_keys is not None: - body["{ssh_public_keys}"] = [v for v in ssh_public_keys] + body["ssh_public_keys"] = [v for v in ssh_public_keys] if use_ml_runtime is not None: - body["{use_ml_runtime}"] = use_ml_runtime + body["use_ml_runtime"] = use_ml_runtime if workload_type is not None: - body["{workload_type}"] = workload_type.as_dict() + body["workload_type"] = workload_type.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10808,19 +10802,19 @@ def events( """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if end_time is not None: - body["{end_time}"] = end_time + body["end_time"] = end_time if event_types is not None: - body["{event_types}"] = [v.value for v in event_types] + body["event_types"] = [v.value for v in event_types] if limit is not None: - body["{limit}"] = limit + body["limit"] = limit if offset is not None: - body["{offset}"] = offset + body["offset"] = offset if order is not None: - body["{order}"] = order.value + body["order"] = order.value if start_time is not None: - body["{start_time}"] = start_time + body["start_time"] = start_time headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10828,8 +10822,8 @@ def events( while True: json = self._api.do("POST", "/api/2.1/clusters/events", body=body, headers=headers) - if "{events}" in json: - for v in json["{events}"]: + if "events" in json: + for v in json["events"]: yield ClusterEvent.from_dict(v) if "next_page" not in json or not json["next_page"]: return @@ -10849,7 +10843,7 @@ def get(self, cluster_id: str) -> ClusterDetails: query = {} if cluster_id is not None: - query["{cluster_id}"] = cluster_id + query["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", } @@ -10922,25 +10916,25 @@ def list( query = {} if filter_by is not None: - query["{filter_by}"] = filter_by.as_dict() + query["filter_by"] = filter_by.as_dict() if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if sort_by is not None: - query["{sort_by}"] = sort_by.as_dict() + query["sort_by"] = sort_by.as_dict() headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/clusters/list", query=query, headers=headers) - if "{clusters}" in json: - for v in json["{clusters}"]: + if "clusters" in json: + for v in json["clusters"]: yield ClusterDetails.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_node_types(self) -> ListNodeTypesResponse: """List node types. @@ -10989,7 +10983,7 @@ def permanent_delete(self, cluster_id: str): """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11009,7 +11003,7 @@ def pin(self, cluster_id: str): """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11046,11 +11040,11 @@ def resize( """ body = {} if autoscale is not None: - body["{autoscale}"] = autoscale.as_dict() + body["autoscale"] = autoscale.as_dict() if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if num_workers is not None: - body["{num_workers}"] = num_workers + body["num_workers"] = num_workers headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11087,9 +11081,9 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if restart_user is not None: - body["{restart_user}"] = restart_user + body["restart_user"] = restart_user headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11121,7 +11115,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11163,7 +11157,7 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11190,7 +11184,7 @@ def unpin(self, cluster_id: str): """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11236,11 +11230,11 @@ def update( """ body = {} if cluster is not None: - body["{cluster}"] = cluster.as_dict() + body["cluster"] = cluster.as_dict() if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if update_mask is not None: - body["{update_mask}"] = update_mask + body["update_mask"] = update_mask headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11276,7 +11270,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11312,11 +11306,11 @@ def cancel( """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["clusterId"] = cluster_id if command_id is not None: - body["{command_id}"] = command_id + body["commandId"] = command_id if context_id is not None: - body["{context_id}"] = context_id + body["contextId"] = context_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11357,11 +11351,11 @@ def command_status(self, cluster_id: str, context_id: str, command_id: str) -> C query = {} if cluster_id is not None: - query["{cluster_id}"] = cluster_id + query["clusterId"] = cluster_id if command_id is not None: - query["{command_id}"] = command_id + query["commandId"] = command_id if context_id is not None: - query["{context_id}"] = context_id + query["contextId"] = context_id headers = { "0": "{Accept application/json}", } @@ -11382,9 +11376,9 @@ def context_status(self, cluster_id: str, context_id: str) -> ContextStatusRespo query = {} if cluster_id is not None: - query["{cluster_id}"] = cluster_id + query["clusterId"] = cluster_id if context_id is not None: - query["{context_id}"] = context_id + query["contextId"] = context_id headers = { "0": "{Accept application/json}", } @@ -11411,9 +11405,9 @@ def create( """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["clusterId"] = cluster_id if language is not None: - body["{language}"] = language.value + body["language"] = language.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11424,7 +11418,7 @@ def create( self.WaitContextStatusCommandExecutionRunning, response=Created.from_dict(op_response), cluster_id=cluster_id, - context_id=op_response["{id}"], + context_id=op_response["id"], ) def create_and_wait( @@ -11444,9 +11438,9 @@ def destroy(self, cluster_id: str, context_id: str): """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["clusterId"] = cluster_id if context_id is not None: - body["{context_id}"] = context_id + body["contextId"] = context_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11482,13 +11476,13 @@ def execute( """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["clusterId"] = cluster_id if command is not None: - body["{command}"] = command + body["command"] = command if context_id is not None: - body["{context_id}"] = context_id + body["contextId"] = context_id if language is not None: - body["{language}"] = language.value + body["language"] = language.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11499,7 +11493,7 @@ def execute( self.WaitCommandStatusCommandExecutionFinishedOrError, response=Created.from_dict(op_response), cluster_id=cluster_id, - command_id=op_response["{id}"], + command_id=op_response["id"], context_id=context_id, ) @@ -11557,13 +11551,13 @@ def create( """ body = {} if enabled is not None: - body["{enabled}"] = enabled + body["enabled"] = enabled if name is not None: - body["{name}"] = name + body["name"] = name if position is not None: - body["{position}"] = position + body["position"] = position if script is not None: - body["{script}"] = script + body["script"] = script headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11656,13 +11650,13 @@ def update( """ body = {} if enabled is not None: - body["{enabled}"] = enabled + body["enabled"] = enabled if name is not None: - body["{name}"] = name + body["name"] = name if position is not None: - body["{position}"] = position + body["position"] = position if script is not None: - body["{script}"] = script + body["script"] = script headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11762,31 +11756,31 @@ def create( """ body = {} if aws_attributes is not None: - body["{aws_attributes}"] = aws_attributes.as_dict() + body["aws_attributes"] = aws_attributes.as_dict() if azure_attributes is not None: - body["{azure_attributes}"] = azure_attributes.as_dict() + body["azure_attributes"] = azure_attributes.as_dict() if custom_tags is not None: - body["{custom_tags}"] = custom_tags + body["custom_tags"] = custom_tags if disk_spec is not None: - body["{disk_spec}"] = disk_spec.as_dict() + body["disk_spec"] = disk_spec.as_dict() if enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = enable_elastic_disk + body["enable_elastic_disk"] = enable_elastic_disk if gcp_attributes is not None: - body["{gcp_attributes}"] = gcp_attributes.as_dict() + body["gcp_attributes"] = gcp_attributes.as_dict() if idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = idle_instance_autotermination_minutes if instance_pool_name is not None: - body["{instance_pool_name}"] = instance_pool_name + body["instance_pool_name"] = instance_pool_name if max_capacity is not None: - body["{max_capacity}"] = max_capacity + body["max_capacity"] = max_capacity if min_idle_instances is not None: - body["{min_idle_instances}"] = min_idle_instances + body["min_idle_instances"] = min_idle_instances if node_type_id is not None: - body["{node_type_id}"] = node_type_id + body["node_type_id"] = node_type_id if preloaded_docker_images is not None: - body["{preloaded_docker_images}"] = [v.as_dict() for v in preloaded_docker_images] + body["preloaded_docker_images"] = [v.as_dict() for v in preloaded_docker_images] if preloaded_spark_versions is not None: - body["{preloaded_spark_versions}"] = [v for v in preloaded_spark_versions] + body["preloaded_spark_versions"] = [v for v in preloaded_spark_versions] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11807,7 +11801,7 @@ def delete(self, instance_pool_id: str): """ body = {} if instance_pool_id is not None: - body["{instance_pool_id}"] = instance_pool_id + body["instance_pool_id"] = instance_pool_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11862,19 +11856,19 @@ def edit( """ body = {} if custom_tags is not None: - body["{custom_tags}"] = custom_tags + body["custom_tags"] = custom_tags if idle_instance_autotermination_minutes is not None: - body["{idle_instance_autotermination_minutes}"] = idle_instance_autotermination_minutes + body["idle_instance_autotermination_minutes"] = idle_instance_autotermination_minutes if instance_pool_id is not None: - body["{instance_pool_id}"] = instance_pool_id + body["instance_pool_id"] = instance_pool_id if instance_pool_name is not None: - body["{instance_pool_name}"] = instance_pool_name + body["instance_pool_name"] = instance_pool_name if max_capacity is not None: - body["{max_capacity}"] = max_capacity + body["max_capacity"] = max_capacity if min_idle_instances is not None: - body["{min_idle_instances}"] = min_idle_instances + body["min_idle_instances"] = min_idle_instances if node_type_id is not None: - body["{node_type_id}"] = node_type_id + body["node_type_id"] = node_type_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11895,7 +11889,7 @@ def get(self, instance_pool_id: str) -> GetInstancePool: query = {} if instance_pool_id is not None: - query["{instance_pool_id}"] = instance_pool_id + query["instance_pool_id"] = instance_pool_id headers = { "0": "{Accept application/json}", } @@ -11974,7 +11968,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -11999,7 +11993,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12061,13 +12055,13 @@ def add( """ body = {} if iam_role_arn is not None: - body["{iam_role_arn}"] = iam_role_arn + body["iam_role_arn"] = iam_role_arn if instance_profile_arn is not None: - body["{instance_profile_arn}"] = instance_profile_arn + body["instance_profile_arn"] = instance_profile_arn if is_meta_instance_profile is not None: - body["{is_meta_instance_profile}"] = is_meta_instance_profile + body["is_meta_instance_profile"] = is_meta_instance_profile if skip_validation is not None: - body["{skip_validation}"] = skip_validation + body["skip_validation"] = skip_validation headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12117,11 +12111,11 @@ def edit( """ body = {} if iam_role_arn is not None: - body["{iam_role_arn}"] = iam_role_arn + body["iam_role_arn"] = iam_role_arn if instance_profile_arn is not None: - body["{instance_profile_arn}"] = instance_profile_arn + body["instance_profile_arn"] = instance_profile_arn if is_meta_instance_profile is not None: - body["{is_meta_instance_profile}"] = is_meta_instance_profile + body["is_meta_instance_profile"] = is_meta_instance_profile headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12162,7 +12156,7 @@ def remove(self, instance_profile_arn: str): """ body = {} if instance_profile_arn is not None: - body["{instance_profile_arn}"] = instance_profile_arn + body["instance_profile_arn"] = instance_profile_arn headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12223,7 +12217,7 @@ def cluster_status(self, cluster_id: str) -> Iterator[LibraryFullStatus]: query = {} if cluster_id is not None: - query["{cluster_id}"] = cluster_id + query["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", } @@ -12247,9 +12241,9 @@ def install(self, cluster_id: str, libraries: List[Library]): """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if libraries is not None: - body["{libraries}"] = [v.as_dict() for v in libraries] + body["libraries"] = [v.as_dict() for v in libraries] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12272,9 +12266,9 @@ def uninstall(self, cluster_id: str, libraries: List[Library]): """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if libraries is not None: - body["{libraries}"] = [v.as_dict() for v in libraries] + body["libraries"] = [v.as_dict() for v in libraries] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12323,9 +12317,9 @@ def enforce_compliance( """ body = {} if cluster_id is not None: - body["{cluster_id}"] = cluster_id + body["cluster_id"] = cluster_id if validate_only is not None: - body["{validate_only}"] = validate_only + body["validate_only"] = validate_only headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -12348,7 +12342,7 @@ def get_compliance(self, cluster_id: str) -> GetClusterComplianceResponse: query = {} if cluster_id is not None: - query["{cluster_id}"] = cluster_id + query["cluster_id"] = cluster_id headers = { "0": "{Accept application/json}", } @@ -12378,23 +12372,23 @@ def list_compliance( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if policy_id is not None: - query["{policy_id}"] = policy_id + query["policy_id"] = policy_id headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/policies/clusters/list-compliance", query=query, headers=headers) - if "{clusters}" in json: - for v in json["{clusters}"]: + if "clusters" in json: + for v in json["clusters"]: yield ClusterCompliance.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class PolicyFamiliesAPI: @@ -12426,7 +12420,7 @@ def get(self, policy_family_id: str, *, version: Optional[int] = None) -> Policy query = {} if version is not None: - query["{version}"] = version + query["version"] = version headers = { "0": "{Accept application/json}", } @@ -12450,18 +12444,18 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/policy-families", query=query, headers=headers) - if "{policy_families}" in json: - for v in json["{policy_families}"]: + if "policy_families" in json: + for v in json["policy_families"]: yield PolicyFamily.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] diff --git a/databricks/sdk/dashboards/v2/impl.py b/databricks/sdk/dashboards/v2/impl.py index 4be02c843..4dd4bf3a3 100755 --- a/databricks/sdk/dashboards/v2/impl.py +++ b/databricks/sdk/dashboards/v2/impl.py @@ -50,23 +50,23 @@ def as_shallow_dict(self) -> dict: """Serializes the BaseChunkInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseChunkInfo: """Deserializes the BaseChunkInfo from a dictionary.""" return cls( - byte_count=d.get("{byte_count}", None), - chunk_index=d.get("{chunk_index}", None), - row_count=d.get("{row_count}", None), - row_offset=d.get("{row_offset}", None), + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), ) @@ -85,13 +85,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CancelQueryExecutionResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelQueryExecutionResponse: """Deserializes the CancelQueryExecutionResponse from a dictionary.""" - return cls(status=_repeated_dict(d, "{status}", CancelQueryExecutionResponseStatus)) + return cls(status=_repeated_dict(d, "status", CancelQueryExecutionResponseStatus)) @dataclass @@ -123,20 +123,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CancelQueryExecutionResponseStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.data_token is not None: - body["{data_token}"] = self.data_token + body["data_token"] = self.data_token if self.pending: - body["{pending}"] = self.pending + body["pending"] = self.pending if self.success: - body["{success}"] = self.success + body["success"] = self.success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelQueryExecutionResponseStatus: """Deserializes the CancelQueryExecutionResponseStatus from a dictionary.""" return cls( - data_token=d.get("{data_token}", None), - pending=_from_dict(d, "{pending}", Empty), - success=_from_dict(d, "{success}", Empty), + data_token=d.get("data_token", None), + pending=_from_dict(d, "pending", Empty), + success=_from_dict(d, "success", Empty), ) @@ -188,32 +188,32 @@ def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_name is not None: - body["{type_name}"] = self.type_name + body["type_name"] = self.type_name if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - name=d.get("{name}", None), - position=d.get("{position}", None), - type_interval_type=d.get("{type_interval_type}", None), - type_name=_enum(d, "{type_name}", ColumnInfoTypeName), - type_precision=d.get("{type_precision}", None), - type_scale=d.get("{type_scale}", None), - type_text=d.get("{type_text}", None), + name=d.get("name", None), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_name=_enum(d, "type_name", ColumnInfoTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), ) @@ -269,17 +269,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CronSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.quartz_cron_expression is not None: - body["{quartz_cron_expression}"] = self.quartz_cron_expression + body["quartz_cron_expression"] = self.quartz_cron_expression if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: """Deserializes the CronSchedule from a dictionary.""" - return cls( - quartz_cron_expression=d.get("{quartz_cron_expression}", None), timezone_id=d.get("{timezone_id}", None) - ) + return cls(quartz_cron_expression=d.get("quartz_cron_expression", None), timezone_id=d.get("timezone_id", None)) @dataclass @@ -352,41 +350,41 @@ def as_shallow_dict(self) -> dict: """Serializes the Dashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state + body["lifecycle_state"] = self.lifecycle_state if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.serialized_dashboard is not None: - body["{serialized_dashboard}"] = self.serialized_dashboard + body["serialized_dashboard"] = self.serialized_dashboard if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dashboard: """Deserializes the Dashboard from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - dashboard_id=d.get("{dashboard_id}", None), - display_name=d.get("{display_name}", None), - etag=d.get("{etag}", None), - lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), - parent_path=d.get("{parent_path}", None), - path=d.get("{path}", None), - serialized_dashboard=d.get("{serialized_dashboard}", None), - update_time=d.get("{update_time}", None), - warehouse_id=d.get("{warehouse_id}", None), + create_time=d.get("create_time", None), + dashboard_id=d.get("dashboard_id", None), + display_name=d.get("display_name", None), + etag=d.get("etag", None), + lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), + parent_path=d.get("parent_path", None), + path=d.get("path", None), + serialized_dashboard=d.get("serialized_dashboard", None), + update_time=d.get("update_time", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -484,20 +482,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ExecutePublishedDashboardQueryRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_name is not None: - body["{dashboard_name}"] = self.dashboard_name + body["dashboard_name"] = self.dashboard_name if self.dashboard_revision_id is not None: - body["{dashboard_revision_id}"] = self.dashboard_revision_id + body["dashboard_revision_id"] = self.dashboard_revision_id if self.override_warehouse_id is not None: - body["{override_warehouse_id}"] = self.override_warehouse_id + body["override_warehouse_id"] = self.override_warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExecutePublishedDashboardQueryRequest: """Deserializes the ExecutePublishedDashboardQueryRequest from a dictionary.""" return cls( - dashboard_name=d.get("{dashboard_name}", None), - dashboard_revision_id=d.get("{dashboard_revision_id}", None), - override_warehouse_id=d.get("{override_warehouse_id}", None), + dashboard_name=d.get("dashboard_name", None), + dashboard_revision_id=d.get("dashboard_revision_id", None), + override_warehouse_id=d.get("override_warehouse_id", None), ) @@ -583,38 +581,38 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalLink into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.expiration is not None: - body["{expiration}"] = self.expiration + body["expiration"] = self.expiration if self.external_link is not None: - body["{external_link}"] = self.external_link + body["external_link"] = self.external_link if self.http_headers: - body["{http_headers}"] = self.http_headers + body["http_headers"] = self.http_headers if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalLink: """Deserializes the ExternalLink from a dictionary.""" return cls( - byte_count=d.get("{byte_count}", None), - chunk_index=d.get("{chunk_index}", None), - expiration=d.get("{expiration}", None), - external_link=d.get("{external_link}", None), - http_headers=d.get("{http_headers}", None), - next_chunk_index=d.get("{next_chunk_index}", None), - next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), - row_count=d.get("{row_count}", None), - row_offset=d.get("{row_offset}", None), + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + expiration=d.get("expiration", None), + external_link=d.get("external_link", None), + http_headers=d.get("http_headers", None), + next_chunk_index=d.get("next_chunk_index", None), + next_chunk_internal_link=d.get("next_chunk_internal_link", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), ) @@ -653,20 +651,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieAttachment into a shallow dictionary of its immediate attributes.""" body = {} if self.attachment_id is not None: - body["{attachment_id}"] = self.attachment_id + body["attachment_id"] = self.attachment_id if self.query: - body["{query}"] = self.query + body["query"] = self.query if self.text: - body["{text}"] = self.text + body["text"] = self.text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieAttachment: """Deserializes the GenieAttachment from a dictionary.""" return cls( - attachment_id=d.get("{attachment_id}", None), - query=_from_dict(d, "{query}", GenieQueryAttachment), - text=_from_dict(d, "{text}", TextAttachment), + attachment_id=d.get("attachment_id", None), + query=_from_dict(d, "query", GenieQueryAttachment), + text=_from_dict(d, "text", TextAttachment), ) @@ -716,32 +714,32 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieConversation into a shallow dictionary of its immediate attributes.""" body = {} if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.created_timestamp is not None: - body["{created_timestamp}"] = self.created_timestamp + body["created_timestamp"] = self.created_timestamp if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieConversation: """Deserializes the GenieConversation from a dictionary.""" return cls( - conversation_id=d.get("{conversation_id}", None), - created_timestamp=d.get("{created_timestamp}", None), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - space_id=d.get("{space_id}", None), - title=d.get("{title}", None), - user_id=d.get("{user_id}", None), + conversation_id=d.get("conversation_id", None), + created_timestamp=d.get("created_timestamp", None), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + space_id=d.get("space_id", None), + title=d.get("title", None), + user_id=d.get("user_id", None), ) @@ -771,20 +769,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieCreateConversationMessageRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieCreateConversationMessageRequest: """Deserializes the GenieCreateConversationMessageRequest from a dictionary.""" return cls( - content=d.get("{content}", None), - conversation_id=d.get("{conversation_id}", None), - space_id=d.get("{space_id}", None), + content=d.get("content", None), + conversation_id=d.get("conversation_id", None), + space_id=d.get("space_id", None), ) @@ -814,20 +812,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieGenerateDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.transient_statement_id is not None: - body["{transient_statement_id}"] = self.transient_statement_id + body["transient_statement_id"] = self.transient_statement_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieGenerateDownloadFullQueryResultResponse: """Deserializes the GenieGenerateDownloadFullQueryResultResponse from a dictionary.""" return cls( - error=d.get("{error}", None), - status=_enum(d, "{status}", MessageStatus), - transient_statement_id=d.get("{transient_statement_id}", None), + error=d.get("error", None), + status=_enum(d, "status", MessageStatus), + transient_statement_id=d.get("transient_statement_id", None), ) @@ -853,17 +851,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieGetDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.statement_response: - body["{statement_response}"] = self.statement_response + body["statement_response"] = self.statement_response if self.transient_statement_id is not None: - body["{transient_statement_id}"] = self.transient_statement_id + body["transient_statement_id"] = self.transient_statement_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieGetDownloadFullQueryResultResponse: """Deserializes the GenieGetDownloadFullQueryResultResponse from a dictionary.""" return cls( - statement_response=_from_dict(d, "{statement_response}", StatementResponse), - transient_statement_id=d.get("{transient_statement_id}", None), + statement_response=_from_dict(d, "statement_response", StatementResponse), + transient_statement_id=d.get("transient_statement_id", None), ) @@ -884,13 +882,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieGetMessageQueryResultResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.statement_response: - body["{statement_response}"] = self.statement_response + body["statement_response"] = self.statement_response return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieGetMessageQueryResultResponse: """Deserializes the GenieGetMessageQueryResultResponse from a dictionary.""" - return cls(statement_response=_from_dict(d, "{statement_response}", StatementResponse)) + return cls(statement_response=_from_dict(d, "statement_response", StatementResponse)) @dataclass @@ -978,47 +976,47 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.attachments: - body["{attachments}"] = self.attachments + body["attachments"] = self.attachments if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.created_timestamp is not None: - body["{created_timestamp}"] = self.created_timestamp + body["created_timestamp"] = self.created_timestamp if self.error: - body["{error}"] = self.error + body["error"] = self.error if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.message_id is not None: - body["{message_id}"] = self.message_id + body["message_id"] = self.message_id if self.query_result: - body["{query_result}"] = self.query_result + body["query_result"] = self.query_result if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieMessage: """Deserializes the GenieMessage from a dictionary.""" return cls( - attachments=_repeated_dict(d, "{attachments}", GenieAttachment), - content=d.get("{content}", None), - conversation_id=d.get("{conversation_id}", None), - created_timestamp=d.get("{created_timestamp}", None), - error=_from_dict(d, "{error}", MessageError), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - message_id=d.get("{message_id}", None), - query_result=_from_dict(d, "{query_result}", Result), - space_id=d.get("{space_id}", None), - status=_enum(d, "{status}", MessageStatus), - user_id=d.get("{user_id}", None), + attachments=_repeated_dict(d, "attachments", GenieAttachment), + content=d.get("content", None), + conversation_id=d.get("conversation_id", None), + created_timestamp=d.get("created_timestamp", None), + error=_from_dict(d, "error", MessageError), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + message_id=d.get("message_id", None), + query_result=_from_dict(d, "query_result", Result), + space_id=d.get("space_id", None), + status=_enum(d, "status", MessageStatus), + user_id=d.get("user_id", None), ) @@ -1068,32 +1066,32 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieQueryAttachment into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.query_result_metadata: - body["{query_result_metadata}"] = self.query_result_metadata + body["query_result_metadata"] = self.query_result_metadata if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieQueryAttachment: """Deserializes the GenieQueryAttachment from a dictionary.""" return cls( - description=d.get("{description}", None), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - query=d.get("{query}", None), - query_result_metadata=_from_dict(d, "{query_result_metadata}", GenieResultMetadata), - statement_id=d.get("{statement_id}", None), - title=d.get("{title}", None), + description=d.get("description", None), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + query=d.get("query", None), + query_result_metadata=_from_dict(d, "query_result_metadata", GenieResultMetadata), + statement_id=d.get("statement_id", None), + title=d.get("title", None), ) @@ -1118,15 +1116,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieResultMetadata into a shallow dictionary of its immediate attributes.""" body = {} if self.is_truncated is not None: - body["{is_truncated}"] = self.is_truncated + body["is_truncated"] = self.is_truncated if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieResultMetadata: """Deserializes the GenieResultMetadata from a dictionary.""" - return cls(is_truncated=d.get("{is_truncated}", None), row_count=d.get("{row_count}", None)) + return cls(is_truncated=d.get("is_truncated", None), row_count=d.get("row_count", None)) @dataclass @@ -1155,19 +1153,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieSpace into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieSpace: """Deserializes the GenieSpace from a dictionary.""" - return cls( - description=d.get("{description}", None), space_id=d.get("{space_id}", None), title=d.get("{title}", None) - ) + return cls(description=d.get("description", None), space_id=d.get("space_id", None), title=d.get("title", None)) @dataclass @@ -1191,15 +1187,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieStartConversationMessageRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.space_id is not None: - body["{space_id}"] = self.space_id + body["space_id"] = self.space_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieStartConversationMessageRequest: """Deserializes the GenieStartConversationMessageRequest from a dictionary.""" - return cls(content=d.get("{content}", None), space_id=d.get("{space_id}", None)) + return cls(content=d.get("content", None), space_id=d.get("space_id", None)) @dataclass @@ -1231,23 +1227,23 @@ def as_shallow_dict(self) -> dict: """Serializes the GenieStartConversationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.conversation: - body["{conversation}"] = self.conversation + body["conversation"] = self.conversation if self.conversation_id is not None: - body["{conversation_id}"] = self.conversation_id + body["conversation_id"] = self.conversation_id if self.message: - body["{message}"] = self.message + body["message"] = self.message if self.message_id is not None: - body["{message_id}"] = self.message_id + body["message_id"] = self.message_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenieStartConversationResponse: """Deserializes the GenieStartConversationResponse from a dictionary.""" return cls( - conversation=_from_dict(d, "{conversation}", GenieConversation), - conversation_id=d.get("{conversation_id}", None), - message=_from_dict(d, "{message}", GenieMessage), - message_id=d.get("{message_id}", None), + conversation=_from_dict(d, "conversation", GenieConversation), + conversation_id=d.get("conversation_id", None), + message=_from_dict(d, "message", GenieMessage), + message_id=d.get("message_id", None), ) @@ -1296,16 +1292,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListDashboardsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboards: - body["{dashboards}"] = self.dashboards + body["dashboards"] = self.dashboards if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListDashboardsResponse: """Deserializes the ListDashboardsResponse from a dictionary.""" return cls( - dashboards=_repeated_dict(d, "{dashboards}", Dashboard), next_page_token=d.get("{next_page_token}", None) + dashboards=_repeated_dict(d, "dashboards", Dashboard), next_page_token=d.get("next_page_token", None) ) @@ -1330,17 +1326,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListSchedulesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.schedules: - body["{schedules}"] = self.schedules + body["schedules"] = self.schedules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSchedulesResponse: """Deserializes the ListSchedulesResponse from a dictionary.""" - return cls( - next_page_token=d.get("{next_page_token}", None), schedules=_repeated_dict(d, "{schedules}", Schedule) - ) + return cls(next_page_token=d.get("next_page_token", None), schedules=_repeated_dict(d, "schedules", Schedule)) @dataclass @@ -1364,17 +1358,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListSubscriptionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.subscriptions: - body["{subscriptions}"] = self.subscriptions + body["subscriptions"] = self.subscriptions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSubscriptionsResponse: """Deserializes the ListSubscriptionsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - subscriptions=_repeated_dict(d, "{subscriptions}", Subscription), + next_page_token=d.get("next_page_token", None), + subscriptions=_repeated_dict(d, "subscriptions", Subscription), ) @@ -1397,15 +1391,15 @@ def as_shallow_dict(self) -> dict: """Serializes the MessageError into a shallow dictionary of its immediate attributes.""" body = {} if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MessageError: """Deserializes the MessageError from a dictionary.""" - return cls(error=d.get("{error}", None), type=_enum(d, "{type}", MessageErrorType)) + return cls(error=d.get("error", None), type=_enum(d, "type", MessageErrorType)) class MessageErrorType(Enum): @@ -1518,23 +1512,23 @@ def as_shallow_dict(self) -> dict: """Serializes the MigrateDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.source_dashboard_id is not None: - body["{source_dashboard_id}"] = self.source_dashboard_id + body["source_dashboard_id"] = self.source_dashboard_id if self.update_parameter_syntax is not None: - body["{update_parameter_syntax}"] = self.update_parameter_syntax + body["update_parameter_syntax"] = self.update_parameter_syntax return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MigrateDashboardRequest: """Deserializes the MigrateDashboardRequest from a dictionary.""" return cls( - display_name=d.get("{display_name}", None), - parent_path=d.get("{parent_path}", None), - source_dashboard_id=d.get("{source_dashboard_id}", None), - update_parameter_syntax=d.get("{update_parameter_syntax}", None), + display_name=d.get("display_name", None), + parent_path=d.get("parent_path", None), + source_dashboard_id=d.get("source_dashboard_id", None), + update_parameter_syntax=d.get("update_parameter_syntax", None), ) @@ -1555,13 +1549,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PendingStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.data_token is not None: - body["{data_token}"] = self.data_token + body["data_token"] = self.data_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PendingStatus: """Deserializes the PendingStatus from a dictionary.""" - return cls(data_token=d.get("{data_token}", None)) + return cls(data_token=d.get("data_token", None)) @dataclass @@ -1579,13 +1573,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PollQueryStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.data: - body["{data}"] = self.data + body["data"] = self.data return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PollQueryStatusResponse: """Deserializes the PollQueryStatusResponse from a dictionary.""" - return cls(data=_repeated_dict(d, "{data}", PollQueryStatusResponseData)) + return cls(data=_repeated_dict(d, "data", PollQueryStatusResponseData)) @dataclass @@ -1603,13 +1597,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PollQueryStatusResponseData into a shallow dictionary of its immediate attributes.""" body = {} if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PollQueryStatusResponseData: """Deserializes the PollQueryStatusResponseData from a dictionary.""" - return cls(status=_from_dict(d, "{status}", QueryResponseStatus)) + return cls(status=_from_dict(d, "status", QueryResponseStatus)) @dataclass @@ -1639,20 +1633,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PublishRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.embed_credentials is not None: - body["{embed_credentials}"] = self.embed_credentials + body["embed_credentials"] = self.embed_credentials if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublishRequest: """Deserializes the PublishRequest from a dictionary.""" return cls( - dashboard_id=d.get("{dashboard_id}", None), - embed_credentials=d.get("{embed_credentials}", None), - warehouse_id=d.get("{warehouse_id}", None), + dashboard_id=d.get("dashboard_id", None), + embed_credentials=d.get("embed_credentials", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -1687,23 +1681,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PublishedDashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.embed_credentials is not None: - body["{embed_credentials}"] = self.embed_credentials + body["embed_credentials"] = self.embed_credentials if self.revision_create_time is not None: - body["{revision_create_time}"] = self.revision_create_time + body["revision_create_time"] = self.revision_create_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublishedDashboard: """Deserializes the PublishedDashboard from a dictionary.""" return cls( - display_name=d.get("{display_name}", None), - embed_credentials=d.get("{embed_credentials}", None), - revision_create_time=d.get("{revision_create_time}", None), - warehouse_id=d.get("{warehouse_id}", None), + display_name=d.get("display_name", None), + embed_credentials=d.get("embed_credentials", None), + revision_create_time=d.get("revision_create_time", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -1745,26 +1739,26 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryResponseStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.canceled: - body["{canceled}"] = self.canceled + body["canceled"] = self.canceled if self.closed: - body["{closed}"] = self.closed + body["closed"] = self.closed if self.pending: - body["{pending}"] = self.pending + body["pending"] = self.pending if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.success: - body["{success}"] = self.success + body["success"] = self.success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryResponseStatus: """Deserializes the QueryResponseStatus from a dictionary.""" return cls( - canceled=_from_dict(d, "{canceled}", Empty), - closed=_from_dict(d, "{closed}", Empty), - pending=_from_dict(d, "{pending}", PendingStatus), - statement_id=d.get("{statement_id}", None), - success=_from_dict(d, "{success}", SuccessStatus), + canceled=_from_dict(d, "canceled", Empty), + closed=_from_dict(d, "closed", Empty), + pending=_from_dict(d, "pending", PendingStatus), + statement_id=d.get("statement_id", None), + success=_from_dict(d, "success", SuccessStatus), ) @@ -1795,20 +1789,20 @@ def as_shallow_dict(self) -> dict: """Serializes the Result into a shallow dictionary of its immediate attributes.""" body = {} if self.is_truncated is not None: - body["{is_truncated}"] = self.is_truncated + body["is_truncated"] = self.is_truncated if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Result: """Deserializes the Result from a dictionary.""" return cls( - is_truncated=d.get("{is_truncated}", None), - row_count=d.get("{row_count}", None), - statement_id=d.get("{statement_id}", None), + is_truncated=d.get("is_truncated", None), + row_count=d.get("row_count", None), + statement_id=d.get("statement_id", None), ) @@ -1868,35 +1862,35 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultData into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.data_array: - body["{data_array}"] = self.data_array + body["data_array"] = self.data_array if self.external_links: - body["{external_links}"] = self.external_links + body["external_links"] = self.external_links if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultData: """Deserializes the ResultData from a dictionary.""" return cls( - byte_count=d.get("{byte_count}", None), - chunk_index=d.get("{chunk_index}", None), - data_array=d.get("{data_array}", None), - external_links=_repeated_dict(d, "{external_links}", ExternalLink), - next_chunk_index=d.get("{next_chunk_index}", None), - next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), - row_count=d.get("{row_count}", None), - row_offset=d.get("{row_offset}", None), + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + data_array=d.get("data_array", None), + external_links=_repeated_dict(d, "external_links", ExternalLink), + next_chunk_index=d.get("next_chunk_index", None), + next_chunk_internal_link=d.get("next_chunk_internal_link", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), ) @@ -1948,32 +1942,32 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultManifest into a shallow dictionary of its immediate attributes.""" body = {} if self.chunks: - body["{chunks}"] = self.chunks + body["chunks"] = self.chunks if self.format is not None: - body["{format}"] = self.format + body["format"] = self.format if self.schema: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.total_byte_count is not None: - body["{total_byte_count}"] = self.total_byte_count + body["total_byte_count"] = self.total_byte_count if self.total_chunk_count is not None: - body["{total_chunk_count}"] = self.total_chunk_count + body["total_chunk_count"] = self.total_chunk_count if self.total_row_count is not None: - body["{total_row_count}"] = self.total_row_count + body["total_row_count"] = self.total_row_count if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultManifest: """Deserializes the ResultManifest from a dictionary.""" return cls( - chunks=_repeated_dict(d, "{chunks}", BaseChunkInfo), - format=_enum(d, "{format}", Format), - schema=_from_dict(d, "{schema}", ResultSchema), - total_byte_count=d.get("{total_byte_count}", None), - total_chunk_count=d.get("{total_chunk_count}", None), - total_row_count=d.get("{total_row_count}", None), - truncated=d.get("{truncated}", None), + chunks=_repeated_dict(d, "chunks", BaseChunkInfo), + format=_enum(d, "format", Format), + schema=_from_dict(d, "schema", ResultSchema), + total_byte_count=d.get("total_byte_count", None), + total_chunk_count=d.get("total_chunk_count", None), + total_row_count=d.get("total_row_count", None), + truncated=d.get("truncated", None), ) @@ -1998,15 +1992,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.column_count is not None: - body["{column_count}"] = self.column_count + body["column_count"] = self.column_count if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultSchema: """Deserializes the ResultSchema from a dictionary.""" - return cls(column_count=d.get("{column_count}", None), columns=_repeated_dict(d, "{columns}", ColumnInfo)) + return cls(column_count=d.get("column_count", None), columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -2067,38 +2061,38 @@ def as_shallow_dict(self) -> dict: """Serializes the Schedule into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.cron_schedule: - body["{cron_schedule}"] = self.cron_schedule + body["cron_schedule"] = self.cron_schedule if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.pause_status is not None: - body["{pause_status}"] = self.pause_status + body["pause_status"] = self.pause_status if self.schedule_id is not None: - body["{schedule_id}"] = self.schedule_id + body["schedule_id"] = self.schedule_id if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Schedule: """Deserializes the Schedule from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - cron_schedule=_from_dict(d, "{cron_schedule}", CronSchedule), - dashboard_id=d.get("{dashboard_id}", None), - display_name=d.get("{display_name}", None), - etag=d.get("{etag}", None), - pause_status=_enum(d, "{pause_status}", SchedulePauseStatus), - schedule_id=d.get("{schedule_id}", None), - update_time=d.get("{update_time}", None), - warehouse_id=d.get("{warehouse_id}", None), + create_time=d.get("create_time", None), + cron_schedule=_from_dict(d, "cron_schedule", CronSchedule), + dashboard_id=d.get("dashboard_id", None), + display_name=d.get("display_name", None), + etag=d.get("etag", None), + pause_status=_enum(d, "pause_status", SchedulePauseStatus), + schedule_id=d.get("schedule_id", None), + update_time=d.get("update_time", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -2128,15 +2122,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ServiceError into a shallow dictionary of its immediate attributes.""" body = {} if self.error_code is not None: - body["{error_code}"] = self.error_code + body["error_code"] = self.error_code if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServiceError: """Deserializes the ServiceError from a dictionary.""" - return cls(error_code=_enum(d, "{error_code}", ServiceErrorCode), message=d.get("{message}", None)) + return cls(error_code=_enum(d, "error_code", ServiceErrorCode), message=d.get("message", None)) class ServiceErrorCode(Enum): @@ -2188,23 +2182,23 @@ def as_shallow_dict(self) -> dict: """Serializes the StatementResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.manifest: - body["{manifest}"] = self.manifest + body["manifest"] = self.manifest if self.result: - body["{result}"] = self.result + body["result"] = self.result if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementResponse: """Deserializes the StatementResponse from a dictionary.""" return cls( - manifest=_from_dict(d, "{manifest}", ResultManifest), - result=_from_dict(d, "{result}", ResultData), - statement_id=d.get("{statement_id}", None), - status=_from_dict(d, "{status}", StatementStatus), + manifest=_from_dict(d, "manifest", ResultManifest), + result=_from_dict(d, "result", ResultData), + statement_id=d.get("statement_id", None), + status=_from_dict(d, "status", StatementStatus), ) @@ -2249,15 +2243,15 @@ def as_shallow_dict(self) -> dict: """Serializes the StatementStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.error: - body["{error}"] = self.error + body["error"] = self.error if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementStatus: """Deserializes the StatementStatus from a dictionary.""" - return cls(error=_from_dict(d, "{error}", ServiceError), state=_enum(d, "{state}", StatementState)) + return cls(error=_from_dict(d, "error", ServiceError), state=_enum(d, "state", StatementState)) @dataclass @@ -2283,17 +2277,17 @@ def as_shallow_dict(self) -> dict: """Serializes the Subscriber into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_subscriber: - body["{destination_subscriber}"] = self.destination_subscriber + body["destination_subscriber"] = self.destination_subscriber if self.user_subscriber: - body["{user_subscriber}"] = self.user_subscriber + body["user_subscriber"] = self.user_subscriber return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Subscriber: """Deserializes the Subscriber from a dictionary.""" return cls( - destination_subscriber=_from_dict(d, "{destination_subscriber}", SubscriptionSubscriberDestination), - user_subscriber=_from_dict(d, "{user_subscriber}", SubscriptionSubscriberUser), + destination_subscriber=_from_dict(d, "destination_subscriber", SubscriptionSubscriberDestination), + user_subscriber=_from_dict(d, "user_subscriber", SubscriptionSubscriberUser), ) @@ -2350,35 +2344,35 @@ def as_shallow_dict(self) -> dict: """Serializes the Subscription into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.created_by_user_id is not None: - body["{created_by_user_id}"] = self.created_by_user_id + body["created_by_user_id"] = self.created_by_user_id if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.schedule_id is not None: - body["{schedule_id}"] = self.schedule_id + body["schedule_id"] = self.schedule_id if self.subscriber: - body["{subscriber}"] = self.subscriber + body["subscriber"] = self.subscriber if self.subscription_id is not None: - body["{subscription_id}"] = self.subscription_id + body["subscription_id"] = self.subscription_id if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Subscription: """Deserializes the Subscription from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - created_by_user_id=d.get("{created_by_user_id}", None), - dashboard_id=d.get("{dashboard_id}", None), - etag=d.get("{etag}", None), - schedule_id=d.get("{schedule_id}", None), - subscriber=_from_dict(d, "{subscriber}", Subscriber), - subscription_id=d.get("{subscription_id}", None), - update_time=d.get("{update_time}", None), + create_time=d.get("create_time", None), + created_by_user_id=d.get("created_by_user_id", None), + dashboard_id=d.get("dashboard_id", None), + etag=d.get("etag", None), + schedule_id=d.get("schedule_id", None), + subscriber=_from_dict(d, "subscriber", Subscriber), + subscription_id=d.get("subscription_id", None), + update_time=d.get("update_time", None), ) @@ -2398,13 +2392,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SubscriptionSubscriberDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_id is not None: - body["{destination_id}"] = self.destination_id + body["destination_id"] = self.destination_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubscriptionSubscriberDestination: """Deserializes the SubscriptionSubscriberDestination from a dictionary.""" - return cls(destination_id=d.get("{destination_id}", None)) + return cls(destination_id=d.get("destination_id", None)) @dataclass @@ -2423,13 +2417,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SubscriptionSubscriberUser into a shallow dictionary of its immediate attributes.""" body = {} if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubscriptionSubscriberUser: """Deserializes the SubscriptionSubscriberUser from a dictionary.""" - return cls(user_id=d.get("{user_id}", None)) + return cls(user_id=d.get("user_id", None)) @dataclass @@ -2454,15 +2448,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SuccessStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.data_token is not None: - body["{data_token}"] = self.data_token + body["data_token"] = self.data_token if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SuccessStatus: """Deserializes the SuccessStatus from a dictionary.""" - return cls(data_token=d.get("{data_token}", None), truncated=d.get("{truncated}", None)) + return cls(data_token=d.get("data_token", None), truncated=d.get("truncated", None)) @dataclass @@ -2485,15 +2479,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TextAttachment into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TextAttachment: """Deserializes the TextAttachment from a dictionary.""" - return cls(content=d.get("{content}", None), id=d.get("{id}", None)) + return cls(content=d.get("content", None), id=d.get("id", None)) @dataclass @@ -2560,7 +2554,7 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W """ body = {} if content is not None: - body["{content}"] = content + body["content"] = content headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2576,7 +2570,7 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W self.WaitGetMessageGenieCompleted, response=GenieMessage.from_dict(op_response), conversation_id=conversation_id, - message_id=op_response["{id}"], + message_id=op_response["id"], space_id=space_id, ) @@ -2712,7 +2706,7 @@ def get_download_full_query_result( query = {} if transient_statement_id is not None: - query["{transient_statement_id}"] = transient_statement_id + query["transient_statement_id"] = transient_statement_id headers = { "0": "{Accept application/json}", } @@ -2876,7 +2870,7 @@ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: """ body = {} if content is not None: - body["{content}"] = content + body["content"] = content headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2888,8 +2882,8 @@ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: return Wait( self.WaitGetMessageGenieCompleted, response=GenieStartConversationResponse.from_dict(op_response), - conversation_id=op_response["{conversation_id}"], - message_id=op_response["{message_id}"], + conversation_id=op_response["conversation_id"], + message_id=op_response["message_id"], space_id=space_id, ) @@ -2983,7 +2977,7 @@ def delete_schedule(self, dashboard_id: str, schedule_id: str, *, etag: Optional query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -3015,7 +3009,7 @@ def delete_subscription( query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -3133,25 +3127,25 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if show_trashed is not None: - query["{show_trashed}"] = show_trashed + query["show_trashed"] = show_trashed if view is not None: - query["{view}"] = view.value + query["view"] = view.value headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/lakeview/dashboards", query=query, headers=headers) - if "{dashboards}" in json: - for v in json["{dashboards}"]: + if "dashboards" in json: + for v in json["dashboards"]: yield Dashboard.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_schedules( self, dashboard_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3171,9 +3165,9 @@ def list_schedules( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -3182,12 +3176,12 @@ def list_schedules( json = self._api.do( "GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/schedules", query=query, headers=headers ) - if "{schedules}" in json: - for v in json["{schedules}"]: + if "schedules" in json: + for v in json["schedules"]: yield Schedule.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_subscriptions( self, dashboard_id: str, schedule_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3209,9 +3203,9 @@ def list_subscriptions( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -3223,12 +3217,12 @@ def list_subscriptions( query=query, headers=headers, ) - if "{subscriptions}" in json: - for v in json["{subscriptions}"]: + if "subscriptions" in json: + for v in json["subscriptions"]: yield Subscription.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def migrate( self, @@ -3256,13 +3250,13 @@ def migrate( """ body = {} if display_name is not None: - body["{display_name}"] = display_name + body["display_name"] = display_name if parent_path is not None: - body["{parent_path}"] = parent_path + body["parent_path"] = parent_path if source_dashboard_id is not None: - body["{source_dashboard_id}"] = source_dashboard_id + body["source_dashboard_id"] = source_dashboard_id if update_parameter_syntax is not None: - body["{update_parameter_syntax}"] = update_parameter_syntax + body["update_parameter_syntax"] = update_parameter_syntax headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3290,9 +3284,9 @@ def publish( """ body = {} if embed_credentials is not None: - body["{embed_credentials}"] = embed_credentials + body["embed_credentials"] = embed_credentials if warehouse_id is not None: - body["{warehouse_id}"] = warehouse_id + body["warehouse_id"] = warehouse_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3423,11 +3417,11 @@ def cancel_published_query_execution( query = {} if dashboard_name is not None: - query["{dashboard_name}"] = dashboard_name + query["dashboard_name"] = dashboard_name if dashboard_revision_id is not None: - query["{dashboard_revision_id}"] = dashboard_revision_id + query["dashboard_revision_id"] = dashboard_revision_id if tokens is not None: - query["{tokens}"] = [v for v in tokens] + query["tokens"] = [v for v in tokens] headers = { "0": "{Accept application/json}", } @@ -3452,11 +3446,11 @@ def execute_published_dashboard_query( """ body = {} if dashboard_name is not None: - body["{dashboard_name}"] = dashboard_name + body["dashboard_name"] = dashboard_name if dashboard_revision_id is not None: - body["{dashboard_revision_id}"] = dashboard_revision_id + body["dashboard_revision_id"] = dashboard_revision_id if override_warehouse_id is not None: - body["{override_warehouse_id}"] = override_warehouse_id + body["override_warehouse_id"] = override_warehouse_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3479,11 +3473,11 @@ def poll_published_query_status( query = {} if dashboard_name is not None: - query["{dashboard_name}"] = dashboard_name + query["dashboard_name"] = dashboard_name if dashboard_revision_id is not None: - query["{dashboard_revision_id}"] = dashboard_revision_id + query["dashboard_revision_id"] = dashboard_revision_id if tokens is not None: - query["{tokens}"] = [v for v in tokens] + query["tokens"] = [v for v in tokens] headers = { "0": "{Accept application/json}", } diff --git a/databricks/sdk/files/v2/impl.py b/databricks/sdk/files/v2/impl.py index 6630b7c4b..e9e897eca 100755 --- a/databricks/sdk/files/v2/impl.py +++ b/databricks/sdk/files/v2/impl.py @@ -35,15 +35,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AddBlock into a shallow dictionary of its immediate attributes.""" body = {} if self.data is not None: - body["{data}"] = self.data + body["data"] = self.data if self.handle is not None: - body["{handle}"] = self.handle + body["handle"] = self.handle return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddBlock: """Deserializes the AddBlock from a dictionary.""" - return cls(data=d.get("{data}", None), handle=d.get("{handle}", None)) + return cls(data=d.get("data", None), handle=d.get("handle", None)) @dataclass @@ -80,13 +80,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Close into a shallow dictionary of its immediate attributes.""" body = {} if self.handle is not None: - body["{handle}"] = self.handle + body["handle"] = self.handle return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Close: """Deserializes the Close from a dictionary.""" - return cls(handle=d.get("{handle}", None)) + return cls(handle=d.get("handle", None)) @dataclass @@ -128,15 +128,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Create into a shallow dictionary of its immediate attributes.""" body = {} if self.overwrite is not None: - body["{overwrite}"] = self.overwrite + body["overwrite"] = self.overwrite if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Create: """Deserializes the Create from a dictionary.""" - return cls(overwrite=d.get("{overwrite}", None), path=d.get("{path}", None)) + return cls(overwrite=d.get("overwrite", None), path=d.get("path", None)) @dataclass @@ -174,13 +174,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.handle is not None: - body["{handle}"] = self.handle + body["handle"] = self.handle return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" - return cls(handle=d.get("{handle}", None)) + return cls(handle=d.get("handle", None)) @dataclass @@ -205,15 +205,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Delete into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.recursive is not None: - body["{recursive}"] = self.recursive + body["recursive"] = self.recursive return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Delete: """Deserializes the Delete from a dictionary.""" - return cls(path=d.get("{path}", None), recursive=d.get("{recursive}", None)) + return cls(path=d.get("path", None), recursive=d.get("recursive", None)) @dataclass @@ -288,26 +288,26 @@ def as_shallow_dict(self) -> dict: """Serializes the DirectoryEntry into a shallow dictionary of its immediate attributes.""" body = {} if self.file_size is not None: - body["{file_size}"] = self.file_size + body["file_size"] = self.file_size if self.is_directory is not None: - body["{is_directory}"] = self.is_directory + body["is_directory"] = self.is_directory if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last_modified"] = self.last_modified if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DirectoryEntry: """Deserializes the DirectoryEntry from a dictionary.""" return cls( - file_size=d.get("{file_size}", None), - is_directory=d.get("{is_directory}", None), - last_modified=d.get("{last_modified}", None), - name=d.get("{name}", None), - path=d.get("{path}", None), + file_size=d.get("file_size", None), + is_directory=d.get("is_directory", None), + last_modified=d.get("last_modified", None), + name=d.get("name", None), + path=d.get("path", None), ) @@ -340,23 +340,23 @@ def as_shallow_dict(self) -> dict: """Serializes the DownloadResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.content_length is not None: - body["{content_length}"] = self.content_length + body["content-length"] = self.content_length if self.content_type is not None: - body["{content_type}"] = self.content_type + body["content-type"] = self.content_type if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last-modified"] = self.last_modified return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DownloadResponse: """Deserializes the DownloadResponse from a dictionary.""" return cls( - content_length=int(d.get("{content_length}", None)), - content_type=d.get("{content_type}", None), - contents=d.get("{contents}", None), - last_modified=d.get("{last_modified}", None), + content_length=int(d.get("content-length", None)), + content_type=d.get("content-type", None), + contents=d.get("contents", None), + last_modified=d.get("last-modified", None), ) @@ -391,23 +391,23 @@ def as_shallow_dict(self) -> dict: """Serializes the FileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.file_size is not None: - body["{file_size}"] = self.file_size + body["file_size"] = self.file_size if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["is_dir"] = self.is_dir if self.modification_time is not None: - body["{modification_time}"] = self.modification_time + body["modification_time"] = self.modification_time if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" return cls( - file_size=d.get("{file_size}", None), - is_dir=d.get("{is_dir}", None), - modification_time=d.get("{modification_time}", None), - path=d.get("{path}", None), + file_size=d.get("file_size", None), + is_dir=d.get("is_dir", None), + modification_time=d.get("modification_time", None), + path=d.get("path", None), ) @@ -454,20 +454,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GetMetadataResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.content_length is not None: - body["{content_length}"] = self.content_length + body["content-length"] = self.content_length if self.content_type is not None: - body["{content_type}"] = self.content_type + body["content-type"] = self.content_type if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last-modified"] = self.last_modified return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetMetadataResponse: """Deserializes the GetMetadataResponse from a dictionary.""" return cls( - content_length=int(d.get("{content_length}", None)), - content_type=d.get("{content_type}", None), - last_modified=d.get("{last_modified}", None), + content_length=int(d.get("content-length", None)), + content_type=d.get("content-type", None), + last_modified=d.get("last-modified", None), ) @@ -492,16 +492,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListDirectoryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListDirectoryResponse: """Deserializes the ListDirectoryResponse from a dictionary.""" return cls( - contents=_repeated_dict(d, "{contents}", DirectoryEntry), next_page_token=d.get("{next_page_token}", None) + contents=_repeated_dict(d, "contents", DirectoryEntry), next_page_token=d.get("next_page_token", None) ) @@ -521,13 +521,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListStatusResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.files: - body["{files}"] = self.files + body["files"] = self.files return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListStatusResponse: """Deserializes the ListStatusResponse from a dictionary.""" - return cls(files=_repeated_dict(d, "{files}", FileInfo)) + return cls(files=_repeated_dict(d, "files", FileInfo)) @dataclass @@ -546,13 +546,13 @@ def as_shallow_dict(self) -> dict: """Serializes the MkDirs into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MkDirs: """Deserializes the MkDirs from a dictionary.""" - return cls(path=d.get("{path}", None)) + return cls(path=d.get("path", None)) @dataclass @@ -594,15 +594,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Move into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_path is not None: - body["{destination_path}"] = self.destination_path + body["destination_path"] = self.destination_path if self.source_path is not None: - body["{source_path}"] = self.source_path + body["source_path"] = self.source_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Move: """Deserializes the Move from a dictionary.""" - return cls(destination_path=d.get("{destination_path}", None), source_path=d.get("{source_path}", None)) + return cls(destination_path=d.get("destination_path", None), source_path=d.get("source_path", None)) @dataclass @@ -649,17 +649,17 @@ def as_shallow_dict(self) -> dict: """Serializes the Put into a shallow dictionary of its immediate attributes.""" body = {} if self.contents is not None: - body["{contents}"] = self.contents + body["contents"] = self.contents if self.overwrite is not None: - body["{overwrite}"] = self.overwrite + body["overwrite"] = self.overwrite if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Put: """Deserializes the Put from a dictionary.""" - return cls(contents=d.get("{contents}", None), overwrite=d.get("{overwrite}", None), path=d.get("{path}", None)) + return cls(contents=d.get("contents", None), overwrite=d.get("overwrite", None), path=d.get("path", None)) @dataclass @@ -702,15 +702,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ReadResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.bytes_read is not None: - body["{bytes_read}"] = self.bytes_read + body["bytes_read"] = self.bytes_read if self.data is not None: - body["{data}"] = self.data + body["data"] = self.data return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ReadResponse: """Deserializes the ReadResponse from a dictionary.""" - return cls(bytes_read=d.get("{bytes_read}", None), data=d.get("{data}", None)) + return cls(bytes_read=d.get("bytes_read", None), data=d.get("data", None)) @dataclass @@ -755,9 +755,9 @@ def add_block(self, handle: int, data: str): """ body = {} if data is not None: - body["{data}"] = data + body["data"] = data if handle is not None: - body["{handle}"] = handle + body["handle"] = handle headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -778,7 +778,7 @@ def close(self, handle: int): """ body = {} if handle is not None: - body["{handle}"] = handle + body["handle"] = handle headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -807,9 +807,9 @@ def create(self, path: str, *, overwrite: Optional[bool] = None) -> CreateRespon """ body = {} if overwrite is not None: - body["{overwrite}"] = overwrite + body["overwrite"] = overwrite if path is not None: - body["{path}"] = path + body["path"] = path headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -846,9 +846,9 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): """ body = {} if path is not None: - body["{path}"] = path + body["path"] = path if recursive is not None: - body["{recursive}"] = recursive + body["recursive"] = recursive headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -870,7 +870,7 @@ def get_status(self, path: str) -> FileInfo: query = {} if path is not None: - query["{path}"] = path + query["path"] = path headers = { "0": "{Accept application/json}", } @@ -899,7 +899,7 @@ def list(self, path: str) -> Iterator[FileInfo]: query = {} if path is not None: - query["{path}"] = path + query["path"] = path headers = { "0": "{Accept application/json}", } @@ -923,7 +923,7 @@ def mkdirs(self, path: str): """ body = {} if path is not None: - body["{path}"] = path + body["path"] = path headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -948,9 +948,9 @@ def move(self, source_path: str, destination_path: str): """ body = {} if destination_path is not None: - body["{destination_path}"] = destination_path + body["destination_path"] = destination_path if source_path is not None: - body["{source_path}"] = source_path + body["source_path"] = source_path headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -983,11 +983,11 @@ def put(self, path: str, *, contents: Optional[str] = None, overwrite: Optional[ """ body = {} if contents is not None: - body["{contents}"] = contents + body["contents"] = contents if overwrite is not None: - body["{overwrite}"] = overwrite + body["overwrite"] = overwrite if path is not None: - body["{path}"] = path + body["path"] = path headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1019,11 +1019,11 @@ def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] query = {} if length is not None: - query["{length}"] = length + query["length"] = length if offset is not None: - query["{offset}"] = offset + query["offset"] = offset if path is not None: - query["{path}"] = path + query["path"] = path headers = { "0": "{Accept application/json}", } @@ -1218,9 +1218,9 @@ def list_directory_contents( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -1232,12 +1232,12 @@ def list_directory_contents( query=query, headers=headers, ) - if "{contents}" in json: - for v in json["{contents}"]: + if "contents" in json: + for v in json["contents"]: yield DirectoryEntry.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool] = None): """Upload a file. @@ -1258,7 +1258,7 @@ def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool query = {} if overwrite is not None: - query["{overwrite}"] = overwrite + query["overwrite"] = overwrite headers = { "0": "{Content-Type application/octet-stream}", } diff --git a/databricks/sdk/iam/v2/impl.py b/databricks/sdk/iam/v2/impl.py index 90d91b55c..9922e34fa 100755 --- a/databricks/sdk/iam/v2/impl.py +++ b/databricks/sdk/iam/v2/impl.py @@ -46,23 +46,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccessControlRequest: """Deserializes the AccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", PermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", PermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -102,26 +102,26 @@ def as_shallow_dict(self) -> dict: """Serializes the AccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccessControlResponse: """Deserializes the AccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", Permission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", Permission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -143,13 +143,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Actor into a shallow dictionary of its immediate attributes.""" body = {} if self.actor_id is not None: - body["{actor_id}"] = self.actor_id + body["actor_id"] = self.actor_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Actor: """Deserializes the Actor from a dictionary.""" - return cls(actor_id=d.get("{actor_id}", None)) + return cls(actor_id=d.get("actor_id", None)) @dataclass @@ -171,17 +171,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CheckPolicyResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.consistency_token: - body["{consistency_token}"] = self.consistency_token + body["consistency_token"] = self.consistency_token if self.is_permitted is not None: - body["{is_permitted}"] = self.is_permitted + body["is_permitted"] = self.is_permitted return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CheckPolicyResponse: """Deserializes the CheckPolicyResponse from a dictionary.""" return cls( - consistency_token=_from_dict(d, "{consistency_token}", ConsistencyToken), - is_permitted=d.get("{is_permitted}", None), + consistency_token=_from_dict(d, "consistency_token", ConsistencyToken), + is_permitted=d.get("is_permitted", None), ) @@ -216,26 +216,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ComplexValue into a shallow dictionary of its immediate attributes.""" body = {} if self.display is not None: - body["{display}"] = self.display + body["display"] = self.display if self.primary is not None: - body["{primary}"] = self.primary + body["primary"] = self.primary if self.ref is not None: - body["{ref}"] = self.ref + body["$ref"] = self.ref if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComplexValue: """Deserializes the ComplexValue from a dictionary.""" return cls( - display=d.get("{display}", None), - primary=d.get("{primary}", None), - ref=d.get("{ref}", None), - type=d.get("{type}", None), - value=d.get("{value}", None), + display=d.get("display", None), + primary=d.get("primary", None), + ref=d.get("$ref", None), + type=d.get("type", None), + value=d.get("value", None), ) @@ -254,13 +254,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ConsistencyToken into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConsistencyToken: """Deserializes the ConsistencyToken from a dictionary.""" - return cls(value=d.get("{value}", None)) + return cls(value=d.get("value", None)) @dataclass @@ -314,13 +314,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetAssignableRolesForResourceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.roles: - body["{roles}"] = self.roles + body["roles"] = self.roles return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetAssignableRolesForResourceResponse: """Deserializes the GetAssignableRolesForResourceResponse from a dictionary.""" - return cls(roles=_repeated_dict(d, "{roles}", Role)) + return cls(roles=_repeated_dict(d, "roles", Role)) @dataclass @@ -339,13 +339,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPasswordPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPasswordPermissionLevelsResponse: """Deserializes the GetPasswordPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", PasswordPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", PasswordPermissionsDescription)) @dataclass @@ -364,13 +364,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPermissionLevelsResponse: """Deserializes the GetPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", PermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", PermissionsDescription)) class GetSortOrder(Enum): @@ -400,15 +400,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GrantRule into a shallow dictionary of its immediate attributes.""" body = {} if self.principals: - body["{principals}"] = self.principals + body["principals"] = self.principals if self.role is not None: - body["{role}"] = self.role + body["role"] = self.role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GrantRule: """Deserializes the GrantRule from a dictionary.""" - return cls(principals=d.get("{principals}", None), role=d.get("{role}", None)) + return cls(principals=d.get("principals", None), role=d.get("role", None)) @dataclass @@ -467,38 +467,38 @@ def as_shallow_dict(self) -> dict: """Serializes the Group into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["displayName"] = self.display_name if self.entitlements: - body["{entitlements}"] = self.entitlements + body["entitlements"] = self.entitlements if self.external_id is not None: - body["{external_id}"] = self.external_id + body["externalId"] = self.external_id if self.groups: - body["{groups}"] = self.groups + body["groups"] = self.groups if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.members: - body["{members}"] = self.members + body["members"] = self.members if self.meta: - body["{meta}"] = self.meta + body["meta"] = self.meta if self.roles: - body["{roles}"] = self.roles + body["roles"] = self.roles if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Group: """Deserializes the Group from a dictionary.""" return cls( - display_name=d.get("{display_name}", None), - entitlements=_repeated_dict(d, "{entitlements}", ComplexValue), - external_id=d.get("{external_id}", None), - groups=_repeated_dict(d, "{groups}", ComplexValue), - id=d.get("{id}", None), - members=_repeated_dict(d, "{members}", ComplexValue), - meta=_from_dict(d, "{meta}", ResourceMeta), - roles=_repeated_dict(d, "{roles}", ComplexValue), - schemas=_repeated_enum(d, "{schemas}", GroupSchema), + display_name=d.get("displayName", None), + entitlements=_repeated_dict(d, "entitlements", ComplexValue), + external_id=d.get("externalId", None), + groups=_repeated_dict(d, "groups", ComplexValue), + id=d.get("id", None), + members=_repeated_dict(d, "members", ComplexValue), + meta=_from_dict(d, "meta", ResourceMeta), + roles=_repeated_dict(d, "roles", ComplexValue), + schemas=_repeated_enum(d, "schemas", GroupSchema), ) @@ -543,26 +543,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ListGroupsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items_per_page is not None: - body["{items_per_page}"] = self.items_per_page + body["itemsPerPage"] = self.items_per_page if self.resources: - body["{resources}"] = self.resources + body["Resources"] = self.resources if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas if self.start_index is not None: - body["{start_index}"] = self.start_index + body["startIndex"] = self.start_index if self.total_results is not None: - body["{total_results}"] = self.total_results + body["totalResults"] = self.total_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListGroupsResponse: """Deserializes the ListGroupsResponse from a dictionary.""" return cls( - items_per_page=d.get("{items_per_page}", None), - resources=_repeated_dict(d, "{resources}", Group), - schemas=_repeated_enum(d, "{schemas}", ListResponseSchema), - start_index=d.get("{start_index}", None), - total_results=d.get("{total_results}", None), + items_per_page=d.get("itemsPerPage", None), + resources=_repeated_dict(d, "Resources", Group), + schemas=_repeated_enum(d, "schemas", ListResponseSchema), + start_index=d.get("startIndex", None), + total_results=d.get("totalResults", None), ) @@ -607,26 +607,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ListServicePrincipalResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items_per_page is not None: - body["{items_per_page}"] = self.items_per_page + body["itemsPerPage"] = self.items_per_page if self.resources: - body["{resources}"] = self.resources + body["Resources"] = self.resources if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas if self.start_index is not None: - body["{start_index}"] = self.start_index + body["startIndex"] = self.start_index if self.total_results is not None: - body["{total_results}"] = self.total_results + body["totalResults"] = self.total_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListServicePrincipalResponse: """Deserializes the ListServicePrincipalResponse from a dictionary.""" return cls( - items_per_page=d.get("{items_per_page}", None), - resources=_repeated_dict(d, "{resources}", ServicePrincipal), - schemas=_repeated_enum(d, "{schemas}", ListResponseSchema), - start_index=d.get("{start_index}", None), - total_results=d.get("{total_results}", None), + items_per_page=d.get("itemsPerPage", None), + resources=_repeated_dict(d, "Resources", ServicePrincipal), + schemas=_repeated_enum(d, "schemas", ListResponseSchema), + start_index=d.get("startIndex", None), + total_results=d.get("totalResults", None), ) @@ -672,26 +672,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ListUsersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items_per_page is not None: - body["{items_per_page}"] = self.items_per_page + body["itemsPerPage"] = self.items_per_page if self.resources: - body["{resources}"] = self.resources + body["Resources"] = self.resources if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas if self.start_index is not None: - body["{start_index}"] = self.start_index + body["startIndex"] = self.start_index if self.total_results is not None: - body["{total_results}"] = self.total_results + body["totalResults"] = self.total_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListUsersResponse: """Deserializes the ListUsersResponse from a dictionary.""" return cls( - items_per_page=d.get("{items_per_page}", None), - resources=_repeated_dict(d, "{resources}", User), - schemas=_repeated_enum(d, "{schemas}", ListResponseSchema), - start_index=d.get("{start_index}", None), - total_results=d.get("{total_results}", None), + items_per_page=d.get("itemsPerPage", None), + resources=_repeated_dict(d, "Resources", User), + schemas=_repeated_enum(d, "schemas", ListResponseSchema), + start_index=d.get("startIndex", None), + total_results=d.get("totalResults", None), ) @@ -726,23 +726,23 @@ def as_shallow_dict(self) -> dict: """Serializes the MigratePermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.from_workspace_group_name is not None: - body["{from_workspace_group_name}"] = self.from_workspace_group_name + body["from_workspace_group_name"] = self.from_workspace_group_name if self.size is not None: - body["{size}"] = self.size + body["size"] = self.size if self.to_account_group_name is not None: - body["{to_account_group_name}"] = self.to_account_group_name + body["to_account_group_name"] = self.to_account_group_name if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MigratePermissionsRequest: """Deserializes the MigratePermissionsRequest from a dictionary.""" return cls( - from_workspace_group_name=d.get("{from_workspace_group_name}", None), - size=d.get("{size}", None), - to_account_group_name=d.get("{to_account_group_name}", None), - workspace_id=d.get("{workspace_id}", None), + from_workspace_group_name=d.get("from_workspace_group_name", None), + size=d.get("size", None), + to_account_group_name=d.get("to_account_group_name", None), + workspace_id=d.get("workspace_id", None), ) @@ -762,13 +762,13 @@ def as_shallow_dict(self) -> dict: """Serializes the MigratePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permissions_migrated is not None: - body["{permissions_migrated}"] = self.permissions_migrated + body["permissions_migrated"] = self.permissions_migrated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MigratePermissionsResponse: """Deserializes the MigratePermissionsResponse from a dictionary.""" - return cls(permissions_migrated=d.get("{permissions_migrated}", None)) + return cls(permissions_migrated=d.get("permissions_migrated", None)) @dataclass @@ -792,15 +792,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Name into a shallow dictionary of its immediate attributes.""" body = {} if self.family_name is not None: - body["{family_name}"] = self.family_name + body["familyName"] = self.family_name if self.given_name is not None: - body["{given_name}"] = self.given_name + body["givenName"] = self.given_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Name: """Deserializes the Name from a dictionary.""" - return cls(family_name=d.get("{family_name}", None), given_name=d.get("{given_name}", None)) + return cls(family_name=d.get("familyName", None), given_name=d.get("givenName", None)) @dataclass @@ -826,20 +826,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ObjectPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ObjectPermissions: """Deserializes the ObjectPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", AccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", AccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -868,20 +868,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PartialUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.operations: - body["{operations}"] = self.operations + body["Operations"] = self.operations if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartialUpdate: """Deserializes the PartialUpdate from a dictionary.""" return cls( - id=d.get("{id}", None), - operations=_repeated_dict(d, "{operations}", Patch), - schemas=_repeated_enum(d, "{schemas}", PatchSchema), + id=d.get("id", None), + operations=_repeated_dict(d, "Operations", Patch), + schemas=_repeated_enum(d, "schemas", PatchSchema), ) @@ -916,23 +916,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PasswordAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordAccessControlRequest: """Deserializes the PasswordAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", PasswordPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", PasswordPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -972,26 +972,26 @@ def as_shallow_dict(self) -> dict: """Serializes the PasswordAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordAccessControlResponse: """Deserializes the PasswordAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", PasswordPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", PasswordPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -1019,20 +1019,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PasswordPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermission: """Deserializes the PasswordPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", PasswordPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", PasswordPermissionLevel), ) @@ -1065,20 +1065,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PasswordPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermissions: """Deserializes the PasswordPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", PasswordAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", PasswordAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -1102,17 +1102,17 @@ def as_shallow_dict(self) -> dict: """Serializes the PasswordPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermissionsDescription: """Deserializes the PasswordPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", PasswordPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", PasswordPermissionLevel), ) @@ -1131,13 +1131,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PasswordPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PasswordPermissionsRequest: """Deserializes the PasswordPermissionsRequest from a dictionary.""" - return cls(access_control_list=_repeated_dict(d, "{access_control_list}", PasswordAccessControlRequest)) + return cls(access_control_list=_repeated_dict(d, "access_control_list", PasswordAccessControlRequest)) @dataclass @@ -1166,17 +1166,17 @@ def as_shallow_dict(self) -> dict: """Serializes the Patch into a shallow dictionary of its immediate attributes.""" body = {} if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.value: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Patch: """Deserializes the Patch from a dictionary.""" - return cls(op=_enum(d, "{op}", PatchOp), path=d.get("{path}", None), value=d.get("{value}", None)) + return cls(op=_enum(d, "op", PatchOp), path=d.get("path", None), value=d.get("value", None)) class PatchOp(Enum): @@ -1234,20 +1234,20 @@ def as_shallow_dict(self) -> dict: """Serializes the Permission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Permission: """Deserializes the Permission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", PermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", PermissionLevel), ) @@ -1280,20 +1280,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.permissions: - body["{permissions}"] = self.permissions + body["permissions"] = self.permissions if self.principal: - body["{principal}"] = self.principal + body["principal"] = self.principal return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionAssignment: """Deserializes the PermissionAssignment from a dictionary.""" return cls( - error=d.get("{error}", None), - permissions=_repeated_enum(d, "{permissions}", WorkspacePermission), - principal=_from_dict(d, "{principal}", PrincipalOutput), + error=d.get("error", None), + permissions=_repeated_enum(d, "permissions", WorkspacePermission), + principal=_from_dict(d, "principal", PrincipalOutput), ) @@ -1313,13 +1313,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionAssignments into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_assignments: - body["{permission_assignments}"] = self.permission_assignments + body["permission_assignments"] = self.permission_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionAssignments: """Deserializes the PermissionAssignments from a dictionary.""" - return cls(permission_assignments=_repeated_dict(d, "{permission_assignments}", PermissionAssignment)) + return cls(permission_assignments=_repeated_dict(d, "permission_assignments", PermissionAssignment)) class PermissionLevel(Enum): @@ -1364,17 +1364,16 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionOutput: """Deserializes the PermissionOutput from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", WorkspacePermission), + description=d.get("description", None), permission_level=_enum(d, "permission_level", WorkspacePermission) ) @@ -1398,16 +1397,16 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsDescription: """Deserializes the PermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), permission_level=_enum(d, "{permission_level}", PermissionLevel) + description=d.get("description", None), permission_level=_enum(d, "permission_level", PermissionLevel) ) @@ -1438,20 +1437,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.request_object_id is not None: - body["{request_object_id}"] = self.request_object_id + body["request_object_id"] = self.request_object_id if self.request_object_type is not None: - body["{request_object_type}"] = self.request_object_type + body["request_object_type"] = self.request_object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsRequest: """Deserializes the PermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", AccessControlRequest), - request_object_id=d.get("{request_object_id}", None), - request_object_type=d.get("{request_object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", AccessControlRequest), + request_object_id=d.get("request_object_id", None), + request_object_type=d.get("request_object_type", None), ) @@ -1493,26 +1492,26 @@ def as_shallow_dict(self) -> dict: """Serializes the PrincipalOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.principal_id is not None: - body["{principal_id}"] = self.principal_id + body["principal_id"] = self.principal_id if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrincipalOutput: """Deserializes the PrincipalOutput from a dictionary.""" return cls( - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - principal_id=d.get("{principal_id}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + principal_id=d.get("principal_id", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -1550,20 +1549,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ResourceInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.legacy_acl_path is not None: - body["{legacy_acl_path}"] = self.legacy_acl_path + body["legacy_acl_path"] = self.legacy_acl_path if self.parent_resource_info: - body["{parent_resource_info}"] = self.parent_resource_info + body["parent_resource_info"] = self.parent_resource_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResourceInfo: """Deserializes the ResourceInfo from a dictionary.""" return cls( - id=d.get("{id}", None), - legacy_acl_path=d.get("{legacy_acl_path}", None), - parent_resource_info=_from_dict(d, "{parent_resource_info}", ResourceInfo), + id=d.get("id", None), + legacy_acl_path=d.get("legacy_acl_path", None), + parent_resource_info=_from_dict(d, "parent_resource_info", ResourceInfo), ) @@ -1584,13 +1583,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ResourceMeta into a shallow dictionary of its immediate attributes.""" body = {} if self.resource_type is not None: - body["{resource_type}"] = self.resource_type + body["resourceType"] = self.resource_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResourceMeta: """Deserializes the ResourceMeta from a dictionary.""" - return cls(resource_type=d.get("{resource_type}", None)) + return cls(resource_type=d.get("resourceType", None)) @dataclass @@ -1609,13 +1608,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Role into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Role: """Deserializes the Role from a dictionary.""" - return cls(name=d.get("{name}", None)) + return cls(name=d.get("name", None)) @dataclass @@ -1643,20 +1642,18 @@ def as_shallow_dict(self) -> dict: """Serializes the RuleSetResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.grant_rules: - body["{grant_rules}"] = self.grant_rules + body["grant_rules"] = self.grant_rules if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RuleSetResponse: """Deserializes the RuleSetResponse from a dictionary.""" return cls( - etag=d.get("{etag}", None), - grant_rules=_repeated_dict(d, "{grant_rules}", GrantRule), - name=d.get("{name}", None), + etag=d.get("etag", None), grant_rules=_repeated_dict(d, "grant_rules", GrantRule), name=d.get("name", None) ) @@ -1686,20 +1683,18 @@ def as_shallow_dict(self) -> dict: """Serializes the RuleSetUpdateRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.grant_rules: - body["{grant_rules}"] = self.grant_rules + body["grant_rules"] = self.grant_rules if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RuleSetUpdateRequest: """Deserializes the RuleSetUpdateRequest from a dictionary.""" return cls( - etag=d.get("{etag}", None), - grant_rules=_repeated_dict(d, "{grant_rules}", GrantRule), - name=d.get("{name}", None), + etag=d.get("etag", None), grant_rules=_repeated_dict(d, "grant_rules", GrantRule), name=d.get("name", None) ) @@ -1760,38 +1755,38 @@ def as_shallow_dict(self) -> dict: """Serializes the ServicePrincipal into a shallow dictionary of its immediate attributes.""" body = {} if self.active is not None: - body["{active}"] = self.active + body["active"] = self.active if self.application_id is not None: - body["{application_id}"] = self.application_id + body["applicationId"] = self.application_id if self.display_name is not None: - body["{display_name}"] = self.display_name + body["displayName"] = self.display_name if self.entitlements: - body["{entitlements}"] = self.entitlements + body["entitlements"] = self.entitlements if self.external_id is not None: - body["{external_id}"] = self.external_id + body["externalId"] = self.external_id if self.groups: - body["{groups}"] = self.groups + body["groups"] = self.groups if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.roles: - body["{roles}"] = self.roles + body["roles"] = self.roles if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServicePrincipal: """Deserializes the ServicePrincipal from a dictionary.""" return cls( - active=d.get("{active}", None), - application_id=d.get("{application_id}", None), - display_name=d.get("{display_name}", None), - entitlements=_repeated_dict(d, "{entitlements}", ComplexValue), - external_id=d.get("{external_id}", None), - groups=_repeated_dict(d, "{groups}", ComplexValue), - id=d.get("{id}", None), - roles=_repeated_dict(d, "{roles}", ComplexValue), - schemas=_repeated_enum(d, "{schemas}", ServicePrincipalSchema), + active=d.get("active", None), + application_id=d.get("applicationId", None), + display_name=d.get("displayName", None), + entitlements=_repeated_dict(d, "entitlements", ComplexValue), + external_id=d.get("externalId", None), + groups=_repeated_dict(d, "groups", ComplexValue), + id=d.get("id", None), + roles=_repeated_dict(d, "roles", ComplexValue), + schemas=_repeated_enum(d, "schemas", ServicePrincipalSchema), ) @@ -1838,15 +1833,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRuleSetRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rule_set: - body["{rule_set}"] = self.rule_set + body["rule_set"] = self.rule_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRuleSetRequest: """Deserializes the UpdateRuleSetRequest from a dictionary.""" - return cls(name=d.get("{name}", None), rule_set=_from_dict(d, "{rule_set}", RuleSetUpdateRequest)) + return cls(name=d.get("name", None), rule_set=_from_dict(d, "rule_set", RuleSetUpdateRequest)) @dataclass @@ -1879,20 +1874,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceAssignments into a shallow dictionary of its immediate attributes.""" body = {} if self.permissions: - body["{permissions}"] = self.permissions + body["permissions"] = self.permissions if self.principal_id is not None: - body["{principal_id}"] = self.principal_id + body["principal_id"] = self.principal_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceAssignments: """Deserializes the UpdateWorkspaceAssignments from a dictionary.""" return cls( - permissions=_repeated_enum(d, "{permissions}", WorkspacePermission), - principal_id=d.get("{principal_id}", None), - workspace_id=d.get("{workspace_id}", None), + permissions=_repeated_enum(d, "permissions", WorkspacePermission), + principal_id=d.get("principal_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -1967,44 +1962,44 @@ def as_shallow_dict(self) -> dict: """Serializes the User into a shallow dictionary of its immediate attributes.""" body = {} if self.active is not None: - body["{active}"] = self.active + body["active"] = self.active if self.display_name is not None: - body["{display_name}"] = self.display_name + body["displayName"] = self.display_name if self.emails: - body["{emails}"] = self.emails + body["emails"] = self.emails if self.entitlements: - body["{entitlements}"] = self.entitlements + body["entitlements"] = self.entitlements if self.external_id is not None: - body["{external_id}"] = self.external_id + body["externalId"] = self.external_id if self.groups: - body["{groups}"] = self.groups + body["groups"] = self.groups if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name: - body["{name}"] = self.name + body["name"] = self.name if self.roles: - body["{roles}"] = self.roles + body["roles"] = self.roles if self.schemas: - body["{schemas}"] = self.schemas + body["schemas"] = self.schemas if self.user_name is not None: - body["{user_name}"] = self.user_name + body["userName"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> User: """Deserializes the User from a dictionary.""" return cls( - active=d.get("{active}", None), - display_name=d.get("{display_name}", None), - emails=_repeated_dict(d, "{emails}", ComplexValue), - entitlements=_repeated_dict(d, "{entitlements}", ComplexValue), - external_id=d.get("{external_id}", None), - groups=_repeated_dict(d, "{groups}", ComplexValue), - id=d.get("{id}", None), - name=_from_dict(d, "{name}", Name), - roles=_repeated_dict(d, "{roles}", ComplexValue), - schemas=_repeated_enum(d, "{schemas}", UserSchema), - user_name=d.get("{user_name}", None), + active=d.get("active", None), + display_name=d.get("displayName", None), + emails=_repeated_dict(d, "emails", ComplexValue), + entitlements=_repeated_dict(d, "entitlements", ComplexValue), + external_id=d.get("externalId", None), + groups=_repeated_dict(d, "groups", ComplexValue), + id=d.get("id", None), + name=_from_dict(d, "name", Name), + roles=_repeated_dict(d, "roles", ComplexValue), + schemas=_repeated_enum(d, "schemas", UserSchema), + user_name=d.get("userName", None), ) @@ -2039,13 +2034,13 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspacePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.permissions: - body["{permissions}"] = self.permissions + body["permissions"] = self.permissions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspacePermissions: """Deserializes the WorkspacePermissions from a dictionary.""" - return cls(permissions=_repeated_dict(d, "{permissions}", PermissionOutput)) + return cls(permissions=_repeated_dict(d, "permissions", PermissionOutput)) class AccessControlAPI: @@ -2080,17 +2075,17 @@ def check_policy( query = {} if actor is not None: - query["{actor}"] = actor.as_dict() + query["actor"] = actor.as_dict() if authz_identity is not None: - query["{authz_identity}"] = authz_identity.value + query["authz_identity"] = authz_identity.value if consistency_token is not None: - query["{consistency_token}"] = consistency_token.as_dict() + query["consistency_token"] = consistency_token.as_dict() if permission is not None: - query["{permission}"] = permission + query["permission"] = permission if resource is not None: - query["{resource}"] = resource + query["resource"] = resource if resource_info is not None: - query["{resource_info}"] = resource_info.as_dict() + query["resource_info"] = resource_info.as_dict() headers = { "0": "{Accept application/json}", } @@ -2121,7 +2116,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: - query["{resource}"] = resource + query["resource"] = resource headers = { "0": "{Accept application/json}", } @@ -2155,9 +2150,9 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag if name is not None: - query["{name}"] = name + query["name"] = name headers = { "0": "{Accept application/json}", } @@ -2184,9 +2179,9 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if rule_set is not None: - body["{rule_set}"] = rule_set.as_dict() + body["rule_set"] = rule_set.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2223,7 +2218,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: - query["{resource}"] = resource + query["resource"] = resource headers = { "0": "{Accept application/json}", } @@ -2254,9 +2249,9 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag if name is not None: - query["{name}"] = name + query["name"] = name headers = { "0": "{Accept application/json}", } @@ -2278,9 +2273,9 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if rule_set is not None: - body["{rule_set}"] = rule_set.as_dict() + body["rule_set"] = rule_set.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2341,23 +2336,23 @@ def create( """ body = {} if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if id is not None: - body["{id}"] = id + body["id"] = id if members is not None: - body["{members}"] = [v.as_dict() for v in members] + body["members"] = [v.as_dict() for v in members] if meta is not None: - body["{meta}"] = meta.as_dict() + body["meta"] = meta.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2441,42 +2436,42 @@ def list( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{start_index}"] = 1 - if "{count}" not in query: - query["{count}"] = 100 + query["startIndex"] = 1 + if "count" not in query: + query["count"] = 100 while True: json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups", query=query, headers=headers ) - if "{resources}" in json: - for v in json["{resources}"]: - i = v["{id}"] + if "Resources" in json: + for v in json["Resources"]: + i = v["id"] if i in seen: continue seen.add(i) yield Group.from_dict(v) - if "{resources}" not in json or not json["{resources}"]: + if "Resources" not in json or not json["Resources"]: return - query["{start_index}"] += len(json["{resources}"]) + query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update group details. @@ -2493,9 +2488,9 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["{operations}"] = [v.as_dict() for v in operations] + body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -2544,21 +2539,21 @@ def update( """ body = {} if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if members is not None: - body["{members}"] = [v.as_dict() for v in members] + body["members"] = [v.as_dict() for v in members] if meta is not None: - body["{meta}"] = meta.as_dict() + body["meta"] = meta.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -2617,23 +2612,23 @@ def create( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if application_id is not None: - body["{application_id}"] = application_id + body["applicationId"] = application_id if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if id is not None: - body["{id}"] = id + body["id"] = id if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2721,28 +2716,28 @@ def list( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{start_index}"] = 1 - if "{count}" not in query: - query["{count}"] = 100 + query["startIndex"] = 1 + if "count" not in query: + query["count"] = 100 while True: json = self._api.do( "GET", @@ -2750,16 +2745,16 @@ def list( query=query, headers=headers, ) - if "{resources}" in json: - for v in json["{resources}"]: - i = v["{id}"] + if "Resources" in json: + for v in json["Resources"]: + i = v["id"] if i in seen: continue seen.add(i) yield ServicePrincipal.from_dict(v) - if "{resources}" not in json or not json["{resources}"]: + if "Resources" not in json or not json["Resources"]: return - query["{start_index}"] += len(json["{resources}"]) + query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update service principal details. @@ -2776,9 +2771,9 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["{operations}"] = [v.as_dict() for v in operations] + body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -2833,21 +2828,21 @@ def update( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if application_id is not None: - body["{application_id}"] = application_id + body["applicationId"] = application_id if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -2925,27 +2920,27 @@ def create( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if emails is not None: - body["{emails}"] = [v.as_dict() for v in emails] + body["emails"] = [v.as_dict() for v in emails] if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if id is not None: - body["{id}"] = id + body["id"] = id if name is not None: - body["{name}"] = name.as_dict() + body["name"] = name.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] if user_name is not None: - body["{user_name}"] = user_name + body["userName"] = user_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3016,19 +3011,19 @@ def get( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } @@ -3079,42 +3074,42 @@ def list( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{start_index}"] = 1 - if "{count}" not in query: - query["{count}"] = 100 + query["startIndex"] = 1 + if "count" not in query: + query["count"] = 100 while True: json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users", query=query, headers=headers ) - if "{resources}" in json: - for v in json["{resources}"]: - i = v["{id}"] + if "Resources" in json: + for v in json["Resources"]: + i = v["id"] if i in seen: continue seen.add(i) yield User.from_dict(v) - if "{resources}" not in json or not json["{resources}"]: + if "Resources" not in json or not json["Resources"]: return - query["{start_index}"] += len(json["{resources}"]) + query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update user details. @@ -3131,9 +3126,9 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["{operations}"] = [v.as_dict() for v in operations] + body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -3192,25 +3187,25 @@ def update( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if emails is not None: - body["{emails}"] = [v.as_dict() for v in emails] + body["emails"] = [v.as_dict() for v in emails] if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if name is not None: - body["{name}"] = name.as_dict() + body["name"] = name.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] if user_name is not None: - body["{user_name}"] = user_name + body["userName"] = user_name headers = { "0": "{Content-Type application/json}", } @@ -3291,23 +3286,23 @@ def create( """ body = {} if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if id is not None: - body["{id}"] = id + body["id"] = id if members is not None: - body["{members}"] = [v.as_dict() for v in members] + body["members"] = [v.as_dict() for v in members] if meta is not None: - body["{meta}"] = meta.as_dict() + body["meta"] = meta.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3389,40 +3384,40 @@ def list( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{start_index}"] = 1 - if "{count}" not in query: - query["{count}"] = 100 + query["startIndex"] = 1 + if "count" not in query: + query["count"] = 100 while True: json = self._api.do("GET", "/api/2.0/preview/scim/v2/Groups", query=query, headers=headers) - if "{resources}" in json: - for v in json["{resources}"]: - i = v["{id}"] + if "Resources" in json: + for v in json["Resources"]: + i = v["id"] if i in seen: continue seen.add(i) yield Group.from_dict(v) - if "{resources}" not in json or not json["{resources}"]: + if "Resources" not in json or not json["Resources"]: return - query["{start_index}"] += len(json["{resources}"]) + query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update group details. @@ -3439,9 +3434,9 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["{operations}"] = [v.as_dict() for v in operations] + body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -3488,21 +3483,21 @@ def update( """ body = {} if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if members is not None: - body["{members}"] = [v.as_dict() for v in members] + body["members"] = [v.as_dict() for v in members] if meta is not None: - body["{meta}"] = meta.as_dict() + body["meta"] = meta.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -3539,13 +3534,13 @@ def migrate_permissions( """ body = {} if from_workspace_group_name is not None: - body["{from_workspace_group_name}"] = from_workspace_group_name + body["from_workspace_group_name"] = from_workspace_group_name if size is not None: - body["{size}"] = size + body["size"] = size if to_account_group_name is not None: - body["{to_account_group_name}"] = to_account_group_name + body["to_account_group_name"] = to_account_group_name if workspace_id is not None: - body["{workspace_id}"] = workspace_id + body["workspace_id"] = workspace_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3679,7 +3674,7 @@ def set( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3714,7 +3709,7 @@ def update( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3777,23 +3772,23 @@ def create( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if application_id is not None: - body["{application_id}"] = application_id + body["applicationId"] = application_id if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if id is not None: - body["{id}"] = id + body["id"] = id if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3875,40 +3870,40 @@ def list( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{start_index}"] = 1 - if "{count}" not in query: - query["{count}"] = 100 + query["startIndex"] = 1 + if "count" not in query: + query["count"] = 100 while True: json = self._api.do("GET", "/api/2.0/preview/scim/v2/ServicePrincipals", query=query, headers=headers) - if "{resources}" in json: - for v in json["{resources}"]: - i = v["{id}"] + if "Resources" in json: + for v in json["Resources"]: + i = v["id"] if i in seen: continue seen.add(i) yield ServicePrincipal.from_dict(v) - if "{resources}" not in json or not json["{resources}"]: + if "Resources" not in json or not json["Resources"]: return - query["{start_index}"] += len(json["{resources}"]) + query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update service principal details. @@ -3925,9 +3920,9 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["{operations}"] = [v.as_dict() for v in operations] + body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -3977,21 +3972,21 @@ def update( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if application_id is not None: - body["{application_id}"] = application_id + body["applicationId"] = application_id if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -4064,27 +4059,27 @@ def create( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if emails is not None: - body["{emails}"] = [v.as_dict() for v in emails] + body["emails"] = [v.as_dict() for v in emails] if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if id is not None: - body["{id}"] = id + body["id"] = id if name is not None: - body["{name}"] = name.as_dict() + body["name"] = name.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] if user_name is not None: - body["{user_name}"] = user_name + body["userName"] = user_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4153,19 +4148,19 @@ def get( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } @@ -4244,40 +4239,40 @@ def list( query = {} if attributes is not None: - query["{attributes}"] = attributes + query["attributes"] = attributes if count is not None: - query["{count}"] = count + query["count"] = count if excluded_attributes is not None: - query["{excluded_attributes}"] = excluded_attributes + query["excludedAttributes"] = excluded_attributes if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if sort_by is not None: - query["{sort_by}"] = sort_by + query["sortBy"] = sort_by if sort_order is not None: - query["{sort_order}"] = sort_order.value + query["sortOrder"] = sort_order.value if start_index is not None: - query["{start_index}"] = start_index + query["startIndex"] = start_index headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{start_index}"] = 1 - if "{count}" not in query: - query["{count}"] = 100 + query["startIndex"] = 1 + if "count" not in query: + query["count"] = 100 while True: json = self._api.do("GET", "/api/2.0/preview/scim/v2/Users", query=query, headers=headers) - if "{resources}" in json: - for v in json["{resources}"]: - i = v["{id}"] + if "Resources" in json: + for v in json["Resources"]: + i = v["id"] if i in seen: continue seen.add(i) yield User.from_dict(v) - if "{resources}" not in json or not json["{resources}"]: + if "Resources" not in json or not json["Resources"]: return - query["{start_index}"] += len(json["{resources}"]) + query["startIndex"] += len(json["Resources"]) def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: Optional[List[PatchSchema]] = None): """Update user details. @@ -4294,9 +4289,9 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O """ body = {} if operations is not None: - body["{operations}"] = [v.as_dict() for v in operations] + body["Operations"] = [v.as_dict() for v in operations] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] headers = { "0": "{Content-Type application/json}", } @@ -4317,7 +4312,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4376,25 +4371,25 @@ def update( """ body = {} if active is not None: - body["{active}"] = active + body["active"] = active if display_name is not None: - body["{display_name}"] = display_name + body["displayName"] = display_name if emails is not None: - body["{emails}"] = [v.as_dict() for v in emails] + body["emails"] = [v.as_dict() for v in emails] if entitlements is not None: - body["{entitlements}"] = [v.as_dict() for v in entitlements] + body["entitlements"] = [v.as_dict() for v in entitlements] if external_id is not None: - body["{external_id}"] = external_id + body["externalId"] = external_id if groups is not None: - body["{groups}"] = [v.as_dict() for v in groups] + body["groups"] = [v.as_dict() for v in groups] if name is not None: - body["{name}"] = name.as_dict() + body["name"] = name.as_dict() if roles is not None: - body["{roles}"] = [v.as_dict() for v in roles] + body["roles"] = [v.as_dict() for v in roles] if schemas is not None: - body["{schemas}"] = [v.value for v in schemas] + body["schemas"] = [v.value for v in schemas] if user_name is not None: - body["{user_name}"] = user_name + body["userName"] = user_name headers = { "0": "{Content-Type application/json}", } @@ -4414,7 +4409,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4523,7 +4518,7 @@ def update( """ body = {} if permissions is not None: - body["{permissions}"] = [v.value for v in permissions] + body["permissions"] = [v.value for v in permissions] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/jobs/v2/impl.py b/databricks/sdk/jobs/v2/impl.py index 2075b8736..c0b660253 100755 --- a/databricks/sdk/jobs/v2/impl.py +++ b/databricks/sdk/jobs/v2/impl.py @@ -15,6 +15,297 @@ # all definitions in this file are in alphabetical order +@dataclass +class Adlsgen2Info: + """A storage location in Adls Gen2""" + + destination: str + """abfss destination, e.g. + `abfss://@.dfs.core.windows.net/`.""" + + def as_dict(self) -> dict: + """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: + """Deserializes the Adlsgen2Info from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class AutoScale: + max_workers: Optional[int] = None + """The maximum number of workers to which the cluster can scale up when overloaded. Note that + `max_workers` must be strictly greater than `min_workers`.""" + + min_workers: Optional[int] = None + """The minimum number of workers to which the cluster can scale down when underutilized. It is also + the initial number of workers the cluster will have after creation.""" + + def as_dict(self) -> dict: + """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.max_workers is not None: + body["max_workers"] = self.max_workers + if self.min_workers is not None: + body["min_workers"] = self.min_workers + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" + body = {} + if self.max_workers is not None: + body["max_workers"] = self.max_workers + if self.min_workers is not None: + body["min_workers"] = self.min_workers + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AutoScale: + """Deserializes the AutoScale from a dictionary.""" + return cls(max_workers=d.get("max_workers", None), min_workers=d.get("min_workers", None)) + + +@dataclass +class AwsAttributes: + """Attributes set during cluster creation which are related to Amazon Web Services.""" + + availability: Optional[AwsAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ebs_volume_count: Optional[int] = None + """The number of volumes launched for each instance. Users can choose up to 10 volumes. This + feature is only enabled for supported node types. Legacy node types cannot specify custom EBS + volumes. For node types with no instance store, at least one EBS volume needs to be specified; + otherwise, cluster creation will fail. + + These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. Instance store volumes will be + mounted at `/local_disk0`, `/local_disk1`, and etc. + + If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for + scratch storage because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance + store volumes. + + Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + will be overridden.""" + + ebs_volume_iops: Optional[int] = None + """If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance + of a gp2 volume with the same volume size will be used.""" + + ebs_volume_size: Optional[int] = None + """The size of each EBS volume (in GiB) launched for each instance. For general purpose SSD, this + value must be within the range 100 - 4096. For throughput optimized HDD, this value must be + within the range 500 - 4096.""" + + ebs_volume_throughput: Optional[int] = None + """If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum + performance of a gp2 volume with the same volume size will be used.""" + + ebs_volume_type: Optional[EbsVolumeType] = None + """The type of EBS volumes that will be launched with this cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. If this + value is greater than 0, the cluster driver node in particular will be placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + instance_profile_arn: Optional[str] = None + """Nodes for this cluster will only be placed on AWS instances with this instance profile. If + ommitted, nodes will be placed on instances without an IAM instance profile. The instance + profile must have previously been added to the Databricks environment by an account + administrator. + + This feature may only be available to certain customer plans.""" + + spot_bid_price_percent: Optional[int] = None + """The bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. For example, if this field is set to 50, and the cluster needs a new + `r3.xlarge` spot instance, then the bid price is half of the price of on-demand `r3.xlarge` + instances. Similarly, if this field is set to 200, the bid price is twice the price of on-demand + `r3.xlarge` instances. If not specified, the default value is 100. When spot instances are + requested for this cluster, only spot instances whose bid price percentage matches this field + will be considered. Note that, for safety, we enforce this field to be no more than 10000.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone/datacenter in which the cluster resides. This string will + be of a form like "us-west-2a". The provided availability zone must be in the same region as the + Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks + deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and + if not specified, a default zone will be used. If the zone specified is "auto", will try to + place cluster in a zone with high availability, and will retry placement in a different AZ if + there is not enough capacity. + + The list of available zones as well as the default value can be found by using the `List Zones` + method.""" + + def as_dict(self) -> dict: + """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: + """Deserializes the AwsAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AwsAvailability), + ebs_volume_count=d.get("ebs_volume_count", None), + ebs_volume_iops=d.get("ebs_volume_iops", None), + ebs_volume_size=d.get("ebs_volume_size", None), + ebs_volume_throughput=d.get("ebs_volume_throughput", None), + ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), + first_on_demand=d.get("first_on_demand", None), + instance_profile_arn=d.get("instance_profile_arn", None), + spot_bid_price_percent=d.get("spot_bid_price_percent", None), + zone_id=d.get("zone_id", None), + ) + + +class AwsAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND = "ON_DEMAND" + SPOT = "SPOT" + SPOT_WITH_FALLBACK = "SPOT_WITH_FALLBACK" + + +@dataclass +class AzureAttributes: + """Attributes set during cluster creation which are related to Microsoft Azure.""" + + availability: Optional[AzureAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This + value should be greater than 0, to make sure the cluster driver node is placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + log_analytics_info: Optional[LogAnalyticsInfo] = None + """Defines values necessary to configure and run Azure Log Analytics agent""" + + spot_bid_max_price: Optional[float] = None + """The max bid price to be used for Azure spot instances. The Max price for the bid cannot be + higher than the on-demand price of the instance. If not specified, the default value is -1, + which specifies that the instance cannot be evicted on the basis of price, and only on the basis + of availability. Further, the value should > 0 or -1.""" + + def as_dict(self) -> dict: + """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info.as_dict() + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: + """Deserializes the AzureAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AzureAvailability), + first_on_demand=d.get("first_on_demand", None), + log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), + spot_bid_max_price=d.get("spot_bid_max_price", None), + ) + + +class AzureAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND_AZURE = "ON_DEMAND_AZURE" + SPOT_AZURE = "SPOT_AZURE" + SPOT_WITH_FALLBACK_AZURE = "SPOT_WITH_FALLBACK_AZURE" + + @dataclass class BaseJob: created_time: Optional[int] = None @@ -63,29 +354,29 @@ def as_shallow_dict(self) -> dict: """Serializes the BaseJob into a shallow dictionary of its immediate attributes.""" body = {} if self.created_time is not None: - body["{created_time}"] = self.created_time + body["created_time"] = self.created_time if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.settings: - body["{settings}"] = self.settings + body["settings"] = self.settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseJob: """Deserializes the BaseJob from a dictionary.""" return cls( - created_time=d.get("{created_time}", None), - creator_user_name=d.get("{creator_user_name}", None), - effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), - has_more=d.get("{has_more}", None), - job_id=d.get("{job_id}", None), - settings=_from_dict(d, "{settings}", JobSettings), + created_time=d.get("created_time", None), + creator_user_name=d.get("creator_user_name", None), + effective_budget_policy_id=d.get("effective_budget_policy_id", None), + has_more=d.get("has_more", None), + job_id=d.get("job_id", None), + settings=_from_dict(d, "settings", JobSettings), ) @@ -318,110 +609,110 @@ def as_shallow_dict(self) -> dict: """Serializes the BaseRun into a shallow dictionary of its immediate attributes.""" body = {} if self.attempt_number is not None: - body["{attempt_number}"] = self.attempt_number + body["attempt_number"] = self.attempt_number if self.cleanup_duration is not None: - body["{cleanup_duration}"] = self.cleanup_duration + body["cleanup_duration"] = self.cleanup_duration if self.cluster_instance: - body["{cluster_instance}"] = self.cluster_instance + body["cluster_instance"] = self.cluster_instance if self.cluster_spec: - body["{cluster_spec}"] = self.cluster_spec + body["cluster_spec"] = self.cluster_spec if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.effective_performance_target is not None: - body["{effective_performance_target}"] = self.effective_performance_target + body["effective_performance_target"] = self.effective_performance_target if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.execution_duration is not None: - body["{execution_duration}"] = self.execution_duration + body["execution_duration"] = self.execution_duration if self.git_source: - body["{git_source}"] = self.git_source + body["git_source"] = self.git_source if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.job_clusters: - body["{job_clusters}"] = self.job_clusters + body["job_clusters"] = self.job_clusters if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.job_run_id is not None: - body["{job_run_id}"] = self.job_run_id + body["job_run_id"] = self.job_run_id if self.number_in_job is not None: - body["{number_in_job}"] = self.number_in_job + body["number_in_job"] = self.number_in_job if self.original_attempt_run_id is not None: - body["{original_attempt_run_id}"] = self.original_attempt_run_id + body["original_attempt_run_id"] = self.original_attempt_run_id if self.overriding_parameters: - body["{overriding_parameters}"] = self.overriding_parameters + body["overriding_parameters"] = self.overriding_parameters if self.queue_duration is not None: - body["{queue_duration}"] = self.queue_duration + body["queue_duration"] = self.queue_duration if self.repair_history: - body["{repair_history}"] = self.repair_history + body["repair_history"] = self.repair_history if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_page_url is not None: - body["{run_page_url}"] = self.run_page_url + body["run_page_url"] = self.run_page_url if self.run_type is not None: - body["{run_type}"] = self.run_type + body["run_type"] = self.run_type if self.schedule: - body["{schedule}"] = self.schedule + body["schedule"] = self.schedule if self.setup_duration is not None: - body["{setup_duration}"] = self.setup_duration + body["setup_duration"] = self.setup_duration if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.status: - body["{status}"] = self.status + body["status"] = self.status if self.tasks: - body["{tasks}"] = self.tasks + body["tasks"] = self.tasks if self.trigger is not None: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger if self.trigger_info: - body["{trigger_info}"] = self.trigger_info + body["trigger_info"] = self.trigger_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseRun: """Deserializes the BaseRun from a dictionary.""" return cls( - attempt_number=d.get("{attempt_number}", None), - cleanup_duration=d.get("{cleanup_duration}", None), - cluster_instance=_from_dict(d, "{cluster_instance}", ClusterInstance), - cluster_spec=_from_dict(d, "{cluster_spec}", ClusterSpec), - creator_user_name=d.get("{creator_user_name}", None), - description=d.get("{description}", None), - effective_performance_target=_enum(d, "{effective_performance_target}", PerformanceTarget), - end_time=d.get("{end_time}", None), - execution_duration=d.get("{execution_duration}", None), - git_source=_from_dict(d, "{git_source}", GitSource), - has_more=d.get("{has_more}", None), - job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), - job_id=d.get("{job_id}", None), - job_parameters=_repeated_dict(d, "{job_parameters}", JobParameter), - job_run_id=d.get("{job_run_id}", None), - number_in_job=d.get("{number_in_job}", None), - original_attempt_run_id=d.get("{original_attempt_run_id}", None), - overriding_parameters=_from_dict(d, "{overriding_parameters}", RunParameters), - queue_duration=d.get("{queue_duration}", None), - repair_history=_repeated_dict(d, "{repair_history}", RepairHistoryItem), - run_duration=d.get("{run_duration}", None), - run_id=d.get("{run_id}", None), - run_name=d.get("{run_name}", None), - run_page_url=d.get("{run_page_url}", None), - run_type=_enum(d, "{run_type}", RunType), - schedule=_from_dict(d, "{schedule}", CronSchedule), - setup_duration=d.get("{setup_duration}", None), - start_time=d.get("{start_time}", None), - state=_from_dict(d, "{state}", RunState), - status=_from_dict(d, "{status}", RunStatus), - tasks=_repeated_dict(d, "{tasks}", RunTask), - trigger=_enum(d, "{trigger}", TriggerType), - trigger_info=_from_dict(d, "{trigger_info}", TriggerInfo), + attempt_number=d.get("attempt_number", None), + cleanup_duration=d.get("cleanup_duration", None), + cluster_instance=_from_dict(d, "cluster_instance", ClusterInstance), + cluster_spec=_from_dict(d, "cluster_spec", ClusterSpec), + creator_user_name=d.get("creator_user_name", None), + description=d.get("description", None), + effective_performance_target=_enum(d, "effective_performance_target", PerformanceTarget), + end_time=d.get("end_time", None), + execution_duration=d.get("execution_duration", None), + git_source=_from_dict(d, "git_source", GitSource), + has_more=d.get("has_more", None), + job_clusters=_repeated_dict(d, "job_clusters", JobCluster), + job_id=d.get("job_id", None), + job_parameters=_repeated_dict(d, "job_parameters", JobParameter), + job_run_id=d.get("job_run_id", None), + number_in_job=d.get("number_in_job", None), + original_attempt_run_id=d.get("original_attempt_run_id", None), + overriding_parameters=_from_dict(d, "overriding_parameters", RunParameters), + queue_duration=d.get("queue_duration", None), + repair_history=_repeated_dict(d, "repair_history", RepairHistoryItem), + run_duration=d.get("run_duration", None), + run_id=d.get("run_id", None), + run_name=d.get("run_name", None), + run_page_url=d.get("run_page_url", None), + run_type=_enum(d, "run_type", RunType), + schedule=_from_dict(d, "schedule", CronSchedule), + setup_duration=d.get("setup_duration", None), + start_time=d.get("start_time", None), + state=_from_dict(d, "state", RunState), + status=_from_dict(d, "status", RunStatus), + tasks=_repeated_dict(d, "tasks", RunTask), + trigger=_enum(d, "trigger", TriggerType), + trigger_info=_from_dict(d, "trigger_info", TriggerInfo), ) @@ -447,15 +738,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CancelAllRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.all_queued_runs is not None: - body["{all_queued_runs}"] = self.all_queued_runs + body["all_queued_runs"] = self.all_queued_runs if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelAllRuns: """Deserializes the CancelAllRuns from a dictionary.""" - return cls(all_queued_runs=d.get("{all_queued_runs}", None), job_id=d.get("{job_id}", None)) + return cls(all_queued_runs=d.get("all_queued_runs", None), job_id=d.get("job_id", None)) @dataclass @@ -492,13 +783,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CancelRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CancelRun: """Deserializes the CancelRun from a dictionary.""" - return cls(run_id=d.get("{run_id}", None)) + return cls(run_id=d.get("run_id", None)) @dataclass @@ -578,17 +869,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomTaskRunState into a shallow dictionary of its immediate attributes.""" body = {} if self.life_cycle_state is not None: - body["{life_cycle_state}"] = self.life_cycle_state + body["life_cycle_state"] = self.life_cycle_state if self.result_state is not None: - body["{result_state}"] = self.result_state + body["result_state"] = self.result_state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomTaskRunState: """Deserializes the CleanRoomTaskRunState from a dictionary.""" return cls( - life_cycle_state=_enum(d, "{life_cycle_state}", CleanRoomTaskRunLifeCycleState), - result_state=_enum(d, "{result_state}", CleanRoomTaskRunResultState), + life_cycle_state=_enum(d, "life_cycle_state", CleanRoomTaskRunLifeCycleState), + result_state=_enum(d, "result_state", CleanRoomTaskRunResultState), ) @@ -624,23 +915,23 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomsNotebookTask into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_room_name is not None: - body["{clean_room_name}"] = self.clean_room_name + body["clean_room_name"] = self.clean_room_name if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.notebook_base_parameters: - body["{notebook_base_parameters}"] = self.notebook_base_parameters + body["notebook_base_parameters"] = self.notebook_base_parameters if self.notebook_name is not None: - body["{notebook_name}"] = self.notebook_name + body["notebook_name"] = self.notebook_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTask: """Deserializes the CleanRoomsNotebookTask from a dictionary.""" return cls( - clean_room_name=d.get("{clean_room_name}", None), - etag=d.get("{etag}", None), - notebook_base_parameters=d.get("{notebook_base_parameters}", None), - notebook_name=d.get("{notebook_name}", None), + clean_room_name=d.get("clean_room_name", None), + etag=d.get("etag", None), + notebook_base_parameters=d.get("notebook_base_parameters", None), + notebook_name=d.get("notebook_name", None), ) @@ -670,23 +961,55 @@ def as_shallow_dict(self) -> dict: """Serializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_room_job_run_state: - body["{clean_room_job_run_state}"] = self.clean_room_job_run_state + body["clean_room_job_run_state"] = self.clean_room_job_run_state if self.notebook_output: - body["{notebook_output}"] = self.notebook_output + body["notebook_output"] = self.notebook_output if self.output_schema_info: - body["{output_schema_info}"] = self.output_schema_info + body["output_schema_info"] = self.output_schema_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput: """Deserializes the CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput from a dictionary.""" return cls( - clean_room_job_run_state=_from_dict(d, "{clean_room_job_run_state}", CleanRoomTaskRunState), - notebook_output=_from_dict(d, "{notebook_output}", NotebookOutput), - output_schema_info=_from_dict(d, "{output_schema_info}", OutputSchemaInfo), + clean_room_job_run_state=_from_dict(d, "clean_room_job_run_state", CleanRoomTaskRunState), + notebook_output=_from_dict(d, "notebook_output", NotebookOutput), + output_schema_info=_from_dict(d, "output_schema_info", OutputSchemaInfo), ) +@dataclass +class ClientsTypes: + jobs: Optional[bool] = None + """With jobs set, the cluster can be used for jobs""" + + notebooks: Optional[bool] = None + """With notebooks set, this cluster can be used for notebooks""" + + def as_dict(self) -> dict: + """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.jobs is not None: + body["jobs"] = self.jobs + if self.notebooks is not None: + body["notebooks"] = self.notebooks + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.jobs is not None: + body["jobs"] = self.jobs + if self.notebooks is not None: + body["notebooks"] = self.notebooks + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: + """Deserializes the ClientsTypes from a dictionary.""" + return cls(jobs=d.get("jobs", None), notebooks=d.get("notebooks", None)) + + @dataclass class ClusterInstance: cluster_id: Optional[str] = None @@ -719,15 +1042,65 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterInstance into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.spark_context_id is not None: - body["{spark_context_id}"] = self.spark_context_id + body["spark_context_id"] = self.spark_context_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterInstance: """Deserializes the ClusterInstance from a dictionary.""" - return cls(cluster_id=d.get("{cluster_id}", None), spark_context_id=d.get("{spark_context_id}", None)) + return cls(cluster_id=d.get("cluster_id", None), spark_context_id=d.get("spark_context_id", None)) + + +@dataclass +class ClusterLogConf: + """Cluster log delivery config""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } + }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ "s3": { "destination" + : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` Cluster iam role is used to + access s3, please make sure the cluster iam role in `instance_profile_arn` has permission to + write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided, e.g. `{ "volumes": { "destination": + "/Volumes/catalog/schema/volume/cluster_log" } }`""" + + def as_dict(self) -> dict: + """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: + """Deserializes the ClusterLogConf from a dictionary.""" + return cls( + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + ) @dataclass @@ -765,23 +1138,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.new_cluster: - body["{new_cluster}"] = self.new_cluster + body["new_cluster"] = self.new_cluster return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterSpec: """Deserializes the ClusterSpec from a dictionary.""" return cls( - existing_cluster_id=d.get("{existing_cluster_id}", None), - job_cluster_key=d.get("{job_cluster_key}", None), - libraries=_repeated_dict(d, "{libraries}", Library), - new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), + existing_cluster_id=d.get("existing_cluster_id", None), + job_cluster_key=d.get("job_cluster_key", None), + libraries=_repeated_dict(d, "libraries", Library), + new_cluster=_from_dict(d, "new_cluster", ClusterSpec), ) @@ -813,20 +1186,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ComputeConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.gpu_node_pool_id is not None: - body["{gpu_node_pool_id}"] = self.gpu_node_pool_id + body["gpu_node_pool_id"] = self.gpu_node_pool_id if self.gpu_type is not None: - body["{gpu_type}"] = self.gpu_type + body["gpu_type"] = self.gpu_type if self.num_gpus is not None: - body["{num_gpus}"] = self.num_gpus + body["num_gpus"] = self.num_gpus return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComputeConfig: """Deserializes the ComputeConfig from a dictionary.""" return cls( - gpu_node_pool_id=d.get("{gpu_node_pool_id}", None), - gpu_type=d.get("{gpu_type}", None), - num_gpus=d.get("{num_gpus}", None), + gpu_node_pool_id=d.get("gpu_node_pool_id", None), + gpu_type=d.get("gpu_type", None), + num_gpus=d.get("num_gpus", None), ) @@ -872,17 +1245,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ConditionTask into a shallow dictionary of its immediate attributes.""" body = {} if self.left is not None: - body["{left}"] = self.left + body["left"] = self.left if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.right is not None: - body["{right}"] = self.right + body["right"] = self.right return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConditionTask: """Deserializes the ConditionTask from a dictionary.""" - return cls(left=d.get("{left}", None), op=_enum(d, "{op}", ConditionTaskOp), right=d.get("{right}", None)) + return cls(left=d.get("left", None), op=_enum(d, "op", ConditionTaskOp), right=d.get("right", None)) class ConditionTaskOp(Enum): @@ -920,13 +1293,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Continuous into a shallow dictionary of its immediate attributes.""" body = {} if self.pause_status is not None: - body["{pause_status}"] = self.pause_status + body["pause_status"] = self.pause_status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Continuous: """Deserializes the Continuous from a dictionary.""" - return cls(pause_status=_enum(d, "{pause_status}", PauseStatus)) + return cls(pause_status=_enum(d, "pause_status", PauseStatus)) @dataclass @@ -1106,86 +1479,86 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateJob into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.continuous: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment + body["deployment"] = self.deployment if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.edit_mode is not None: - body["{edit_mode}"] = self.edit_mode + body["edit_mode"] = self.edit_mode if self.email_notifications: - body["{email_notifications}"] = self.email_notifications + body["email_notifications"] = self.email_notifications if self.environments: - body["{environments}"] = self.environments + body["environments"] = self.environments if self.format is not None: - body["{format}"] = self.format + body["format"] = self.format if self.git_source: - body["{git_source}"] = self.git_source + body["git_source"] = self.git_source if self.health: - body["{health}"] = self.health + body["health"] = self.health if self.job_clusters: - body["{job_clusters}"] = self.job_clusters + body["job_clusters"] = self.job_clusters if self.max_concurrent_runs is not None: - body["{max_concurrent_runs}"] = self.max_concurrent_runs + body["max_concurrent_runs"] = self.max_concurrent_runs if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notification_settings: - body["{notification_settings}"] = self.notification_settings + body["notification_settings"] = self.notification_settings if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.performance_target is not None: - body["{performance_target}"] = self.performance_target + body["performance_target"] = self.performance_target if self.queue: - body["{queue}"] = self.queue + body["queue"] = self.queue if self.run_as: - body["{run_as}"] = self.run_as + body["run_as"] = self.run_as if self.schedule: - body["{schedule}"] = self.schedule + body["schedule"] = self.schedule if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.tasks: - body["{tasks}"] = self.tasks + body["tasks"] = self.tasks if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.trigger: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications + body["webhook_notifications"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateJob: """Deserializes the CreateJob from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlRequest), - budget_policy_id=d.get("{budget_policy_id}", None), - continuous=_from_dict(d, "{continuous}", Continuous), - deployment=_from_dict(d, "{deployment}", JobDeployment), - description=d.get("{description}", None), - edit_mode=_enum(d, "{edit_mode}", JobEditMode), - email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), - environments=_repeated_dict(d, "{environments}", JobEnvironment), - format=_enum(d, "{format}", Format), - git_source=_from_dict(d, "{git_source}", GitSource), - health=_from_dict(d, "{health}", JobsHealthRules), - job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), - max_concurrent_runs=d.get("{max_concurrent_runs}", None), - name=d.get("{name}", None), - notification_settings=_from_dict(d, "{notification_settings}", JobNotificationSettings), - parameters=_repeated_dict(d, "{parameters}", JobParameterDefinition), - performance_target=_enum(d, "{performance_target}", PerformanceTarget), - queue=_from_dict(d, "{queue}", QueueSettings), - run_as=_from_dict(d, "{run_as}", JobRunAs), - schedule=_from_dict(d, "{schedule}", CronSchedule), - tags=d.get("{tags}", None), - tasks=_repeated_dict(d, "{tasks}", Task), - timeout_seconds=d.get("{timeout_seconds}", None), - trigger=_from_dict(d, "{trigger}", TriggerSettings), - webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), + access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlRequest), + budget_policy_id=d.get("budget_policy_id", None), + continuous=_from_dict(d, "continuous", Continuous), + deployment=_from_dict(d, "deployment", JobDeployment), + description=d.get("description", None), + edit_mode=_enum(d, "edit_mode", JobEditMode), + email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), + environments=_repeated_dict(d, "environments", JobEnvironment), + format=_enum(d, "format", Format), + git_source=_from_dict(d, "git_source", GitSource), + health=_from_dict(d, "health", JobsHealthRules), + job_clusters=_repeated_dict(d, "job_clusters", JobCluster), + max_concurrent_runs=d.get("max_concurrent_runs", None), + name=d.get("name", None), + notification_settings=_from_dict(d, "notification_settings", JobNotificationSettings), + parameters=_repeated_dict(d, "parameters", JobParameterDefinition), + performance_target=_enum(d, "performance_target", PerformanceTarget), + queue=_from_dict(d, "queue", QueueSettings), + run_as=_from_dict(d, "run_as", JobRunAs), + schedule=_from_dict(d, "schedule", CronSchedule), + tags=d.get("tags", None), + tasks=_repeated_dict(d, "tasks", Task), + timeout_seconds=d.get("timeout_seconds", None), + trigger=_from_dict(d, "trigger", TriggerSettings), + webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), ) @@ -1207,13 +1580,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" - return cls(job_id=d.get("{job_id}", None)) + return cls(job_id=d.get("job_id", None)) @dataclass @@ -1248,23 +1621,88 @@ def as_shallow_dict(self) -> dict: """Serializes the CronSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.pause_status is not None: - body["{pause_status}"] = self.pause_status + body["pause_status"] = self.pause_status if self.quartz_cron_expression is not None: - body["{quartz_cron_expression}"] = self.quartz_cron_expression + body["quartz_cron_expression"] = self.quartz_cron_expression if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: """Deserializes the CronSchedule from a dictionary.""" return cls( - pause_status=_enum(d, "{pause_status}", PauseStatus), - quartz_cron_expression=d.get("{quartz_cron_expression}", None), - timezone_id=d.get("{timezone_id}", None), + pause_status=_enum(d, "pause_status", PauseStatus), + quartz_cron_expression=d.get("quartz_cron_expression", None), + timezone_id=d.get("timezone_id", None), ) +class DataSecurityMode(Enum): + """Data security mode decides what data governance model to use when accessing data from a cluster. + + The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: + Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: + Alias for `SINGLE_USER`. + + The following modes can be used regardless of `kind`. * `NONE`: No security isolation for + multiple users sharing the cluster. Data governance features are not available in this mode. * + `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in + `single_user_name`. Most programming languages, cluster features and data governance features + are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple + users. Cluster users are fully isolated so that they cannot see each other's data and + credentials. Most data governance features are supported in this mode. But programming languages + and cluster features might be limited. + + The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for + future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * + `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high + concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy + Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that + doesn’t have UC nor passthrough enabled.""" + + DATA_SECURITY_MODE_AUTO = "DATA_SECURITY_MODE_AUTO" + DATA_SECURITY_MODE_DEDICATED = "DATA_SECURITY_MODE_DEDICATED" + DATA_SECURITY_MODE_STANDARD = "DATA_SECURITY_MODE_STANDARD" + LEGACY_PASSTHROUGH = "LEGACY_PASSTHROUGH" + LEGACY_SINGLE_USER = "LEGACY_SINGLE_USER" + LEGACY_SINGLE_USER_STANDARD = "LEGACY_SINGLE_USER_STANDARD" + LEGACY_TABLE_ACL = "LEGACY_TABLE_ACL" + NONE = "NONE" + SINGLE_USER = "SINGLE_USER" + USER_ISOLATION = "USER_ISOLATION" + + +@dataclass +class DbfsStorageInfo: + """A storage location in DBFS""" + + destination: str + """dbfs destination, e.g. `dbfs:/my/path`""" + + def as_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: + """Deserializes the DbfsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class DbtOutput: artifacts_headers: Optional[Dict[str, str]] = None @@ -1287,15 +1725,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DbtOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.artifacts_headers: - body["{artifacts_headers}"] = self.artifacts_headers + body["artifacts_headers"] = self.artifacts_headers if self.artifacts_link is not None: - body["{artifacts_link}"] = self.artifacts_link + body["artifacts_link"] = self.artifacts_link return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbtOutput: """Deserializes the DbtOutput from a dictionary.""" - return cls(artifacts_headers=d.get("{artifacts_headers}", None), artifacts_link=d.get("{artifacts_link}", None)) + return cls(artifacts_headers=d.get("artifacts_headers", None), artifacts_link=d.get("artifacts_link", None)) @dataclass @@ -1358,32 +1796,32 @@ def as_shallow_dict(self) -> dict: """Serializes the DbtTask into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.commands: - body["{commands}"] = self.commands + body["commands"] = self.commands if self.profiles_directory is not None: - body["{profiles_directory}"] = self.profiles_directory + body["profiles_directory"] = self.profiles_directory if self.project_directory is not None: - body["{project_directory}"] = self.project_directory + body["project_directory"] = self.project_directory if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbtTask: """Deserializes the DbtTask from a dictionary.""" return cls( - catalog=d.get("{catalog}", None), - commands=d.get("{commands}", None), - profiles_directory=d.get("{profiles_directory}", None), - project_directory=d.get("{project_directory}", None), - schema=d.get("{schema}", None), - source=_enum(d, "{source}", Source), - warehouse_id=d.get("{warehouse_id}", None), + catalog=d.get("catalog", None), + commands=d.get("commands", None), + profiles_directory=d.get("profiles_directory", None), + project_directory=d.get("project_directory", None), + schema=d.get("schema", None), + source=_enum(d, "source", Source), + warehouse_id=d.get("warehouse_id", None), ) @@ -1403,13 +1841,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteJob into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteJob: """Deserializes the DeleteJob from a dictionary.""" - return cls(job_id=d.get("{job_id}", None)) + return cls(job_id=d.get("job_id", None)) @dataclass @@ -1446,13 +1884,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRun: """Deserializes the DeleteRun from a dictionary.""" - return cls(run_id=d.get("{run_id}", None)) + return cls(run_id=d.get("run_id", None)) @dataclass @@ -1473,6 +1911,78 @@ def from_dict(cls, d: Dict[str, Any]) -> DeleteRunResponse: return cls() +@dataclass +class DockerBasicAuth: + password: Optional[str] = None + """Password of the user""" + + username: Optional[str] = None + """Name of the user""" + + def as_dict(self) -> dict: + """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.password is not None: + body["password"] = self.password + if self.username is not None: + body["username"] = self.username + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" + body = {} + if self.password is not None: + body["password"] = self.password + if self.username is not None: + body["username"] = self.username + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: + """Deserializes the DockerBasicAuth from a dictionary.""" + return cls(password=d.get("password", None), username=d.get("username", None)) + + +@dataclass +class DockerImage: + basic_auth: Optional[DockerBasicAuth] = None + """Basic auth with username and password""" + + url: Optional[str] = None + """URL of the docker image.""" + + def as_dict(self) -> dict: + """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.basic_auth: + body["basic_auth"] = self.basic_auth.as_dict() + if self.url is not None: + body["url"] = self.url + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" + body = {} + if self.basic_auth: + body["basic_auth"] = self.basic_auth + if self.url is not None: + body["url"] = self.url + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DockerImage: + """Deserializes the DockerImage from a dictionary.""" + return cls(basic_auth=_from_dict(d, "basic_auth", DockerBasicAuth), url=d.get("url", None)) + + +class EbsVolumeType(Enum): + """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for + details.""" + + GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" + THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" + + @dataclass class EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Represents a change to the job cluster's settings that would be required for the job clusters to @@ -1506,20 +2016,18 @@ def as_shallow_dict(self) -> dict: """Serializes the EnforcePolicyComplianceForJobResponseJobClusterSettingsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.field is not None: - body["{field}"] = self.field + body["field"] = self.field if self.new_value is not None: - body["{new_value}"] = self.new_value + body["new_value"] = self.new_value if self.previous_value is not None: - body["{previous_value}"] = self.previous_value + body["previous_value"] = self.previous_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Deserializes the EnforcePolicyComplianceForJobResponseJobClusterSettingsChange from a dictionary.""" return cls( - field=d.get("{field}", None), - new_value=d.get("{new_value}", None), - previous_value=d.get("{previous_value}", None), + field=d.get("field", None), new_value=d.get("new_value", None), previous_value=d.get("previous_value", None) ) @@ -1544,15 +2052,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EnforcePolicyComplianceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceRequest: """Deserializes the EnforcePolicyComplianceRequest from a dictionary.""" - return cls(job_id=d.get("{job_id}", None), validate_only=d.get("{validate_only}", None)) + return cls(job_id=d.get("job_id", None), validate_only=d.get("validate_only", None)) @dataclass @@ -1586,22 +2094,22 @@ def as_shallow_dict(self) -> dict: """Serializes the EnforcePolicyComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_changes is not None: - body["{has_changes}"] = self.has_changes + body["has_changes"] = self.has_changes if self.job_cluster_changes: - body["{job_cluster_changes}"] = self.job_cluster_changes + body["job_cluster_changes"] = self.job_cluster_changes if self.settings: - body["{settings}"] = self.settings + body["settings"] = self.settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnforcePolicyComplianceResponse: """Deserializes the EnforcePolicyComplianceResponse from a dictionary.""" return cls( - has_changes=d.get("{has_changes}", None), + has_changes=d.get("has_changes", None), job_cluster_changes=_repeated_dict( - d, "{job_cluster_changes}", EnforcePolicyComplianceForJobResponseJobClusterSettingsChange + d, "job_cluster_changes", EnforcePolicyComplianceForJobResponseJobClusterSettingsChange ), - settings=_from_dict(d, "{settings}", JobSettings), + settings=_from_dict(d, "settings", JobSettings), ) @@ -1636,15 +2144,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Environment into a shallow dictionary of its immediate attributes.""" body = {} if self.client is not None: - body["{client}"] = self.client + body["client"] = self.client if self.dependencies: - body["{dependencies}"] = self.dependencies + body["dependencies"] = self.dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Environment: """Deserializes the Environment from a dictionary.""" - return cls(client=d.get("{client}", None), dependencies=d.get("{dependencies}", None)) + return cls(client=d.get("client", None), dependencies=d.get("dependencies", None)) @dataclass @@ -1668,13 +2176,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ExportRunOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.views: - body["{views}"] = self.views + body["views"] = self.views return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExportRunOutput: """Deserializes the ExportRunOutput from a dictionary.""" - return cls(views=_repeated_dict(d, "{views}", ViewItem)) + return cls(views=_repeated_dict(d, "views", ViewItem)) @dataclass @@ -1707,20 +2215,20 @@ def as_shallow_dict(self) -> dict: """Serializes the FileArrivalTriggerConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.min_time_between_triggers_seconds is not None: - body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds + body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.wait_after_last_change_seconds is not None: - body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds + body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileArrivalTriggerConfiguration: """Deserializes the FileArrivalTriggerConfiguration from a dictionary.""" return cls( - min_time_between_triggers_seconds=d.get("{min_time_between_triggers_seconds}", None), - url=d.get("{url}", None), - wait_after_last_change_seconds=d.get("{wait_after_last_change_seconds}", None), + min_time_between_triggers_seconds=d.get("min_time_between_triggers_seconds", None), + url=d.get("url", None), + wait_after_last_change_seconds=d.get("wait_after_last_change_seconds", None), ) @@ -1745,17 +2253,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ForEachStats into a shallow dictionary of its immediate attributes.""" body = {} if self.error_message_stats: - body["{error_message_stats}"] = self.error_message_stats + body["error_message_stats"] = self.error_message_stats if self.task_run_stats: - body["{task_run_stats}"] = self.task_run_stats + body["task_run_stats"] = self.task_run_stats return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachStats: """Deserializes the ForEachStats from a dictionary.""" return cls( - error_message_stats=_repeated_dict(d, "{error_message_stats}", ForEachTaskErrorMessageStats), - task_run_stats=_from_dict(d, "{task_run_stats}", ForEachTaskTaskRunStats), + error_message_stats=_repeated_dict(d, "error_message_stats", ForEachTaskErrorMessageStats), + task_run_stats=_from_dict(d, "task_run_stats", ForEachTaskTaskRunStats), ) @@ -1786,18 +2294,18 @@ def as_shallow_dict(self) -> dict: """Serializes the ForEachTask into a shallow dictionary of its immediate attributes.""" body = {} if self.concurrency is not None: - body["{concurrency}"] = self.concurrency + body["concurrency"] = self.concurrency if self.inputs is not None: - body["{inputs}"] = self.inputs + body["inputs"] = self.inputs if self.task: - body["{task}"] = self.task + body["task"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachTask: """Deserializes the ForEachTask from a dictionary.""" return cls( - concurrency=d.get("{concurrency}", None), inputs=d.get("{inputs}", None), task=_from_dict(d, "{task}", Task) + concurrency=d.get("concurrency", None), inputs=d.get("inputs", None), task=_from_dict(d, "task", Task) ) @@ -1827,20 +2335,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ForEachTaskErrorMessageStats into a shallow dictionary of its immediate attributes.""" body = {} if self.count is not None: - body["{count}"] = self.count + body["count"] = self.count if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.termination_category is not None: - body["{termination_category}"] = self.termination_category + body["termination_category"] = self.termination_category return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachTaskErrorMessageStats: """Deserializes the ForEachTaskErrorMessageStats from a dictionary.""" return cls( - count=d.get("{count}", None), - error_message=d.get("{error_message}", None), - termination_category=d.get("{termination_category}", None), + count=d.get("count", None), + error_message=d.get("error_message", None), + termination_category=d.get("termination_category", None), ) @@ -1885,29 +2393,29 @@ def as_shallow_dict(self) -> dict: """Serializes the ForEachTaskTaskRunStats into a shallow dictionary of its immediate attributes.""" body = {} if self.active_iterations is not None: - body["{active_iterations}"] = self.active_iterations + body["active_iterations"] = self.active_iterations if self.completed_iterations is not None: - body["{completed_iterations}"] = self.completed_iterations + body["completed_iterations"] = self.completed_iterations if self.failed_iterations is not None: - body["{failed_iterations}"] = self.failed_iterations + body["failed_iterations"] = self.failed_iterations if self.scheduled_iterations is not None: - body["{scheduled_iterations}"] = self.scheduled_iterations + body["scheduled_iterations"] = self.scheduled_iterations if self.succeeded_iterations is not None: - body["{succeeded_iterations}"] = self.succeeded_iterations + body["succeeded_iterations"] = self.succeeded_iterations if self.total_iterations is not None: - body["{total_iterations}"] = self.total_iterations + body["total_iterations"] = self.total_iterations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForEachTaskTaskRunStats: """Deserializes the ForEachTaskTaskRunStats from a dictionary.""" return cls( - active_iterations=d.get("{active_iterations}", None), - completed_iterations=d.get("{completed_iterations}", None), - failed_iterations=d.get("{failed_iterations}", None), - scheduled_iterations=d.get("{scheduled_iterations}", None), - succeeded_iterations=d.get("{succeeded_iterations}", None), - total_iterations=d.get("{total_iterations}", None), + active_iterations=d.get("active_iterations", None), + completed_iterations=d.get("completed_iterations", None), + failed_iterations=d.get("failed_iterations", None), + scheduled_iterations=d.get("scheduled_iterations", None), + succeeded_iterations=d.get("succeeded_iterations", None), + total_iterations=d.get("total_iterations", None), ) @@ -1917,6 +2425,124 @@ class Format(Enum): SINGLE_TASK = "SINGLE_TASK" +@dataclass +class GcpAttributes: + """Attributes set during cluster creation which are related to GCP.""" + + availability: Optional[GcpAvailability] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs, + on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + boot_disk_size: Optional[int] = None + """Boot disk size in GB""" + + google_service_account: Optional[str] = None + """If provided, the cluster will impersonate the google service account when accessing gcloud + services (like GCS). The google service account must have previously been added to the + Databricks environment by an account administrator.""" + + local_ssd_count: Optional[int] = None + """If provided, each node (workers and driver) in the cluster will have this number of local SSDs + attached. Each local SSD is 375GB in size. Refer to [GCP documentation] for the supported number + of local SSDs for each instance type. + + [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds""" + + use_preemptible_executors: Optional[bool] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs + (when set to true) versus standard compute engine VMs (when set to false; default). Note: Soon + to be deprecated, use the 'availability' field instead.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone in which the cluster resides. This can be one of the + following: - "HA" => High availability, spread nodes across availability zones for a Databricks + deployment region [default]. - "AUTO" => Databricks picks an availability zone to schedule the + cluster on. - A GCP availability zone => Pick One of the available zones for (machine type + + region) from https://cloud.google.com/compute/docs/regions-zones.""" + + def as_dict(self) -> dict: + """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: + """Deserializes the GcpAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", GcpAvailability), + boot_disk_size=d.get("boot_disk_size", None), + google_service_account=d.get("google_service_account", None), + local_ssd_count=d.get("local_ssd_count", None), + use_preemptible_executors=d.get("use_preemptible_executors", None), + zone_id=d.get("zone_id", None), + ) + + +class GcpAvailability(Enum): + """This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or + preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + ON_DEMAND_GCP = "ON_DEMAND_GCP" + PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" + PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" + + +@dataclass +class GcsStorageInfo: + """A storage location in Google Cloud Platform's GCS""" + + destination: str + """GCS destination/URI, e.g. `gs://my-bucket/some-prefix`""" + + def as_dict(self) -> dict: + """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: + """Deserializes the GcsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class GenAiComputeTask: """Next field: 9""" @@ -1979,35 +2605,35 @@ def as_shallow_dict(self) -> dict: """Serializes the GenAiComputeTask into a shallow dictionary of its immediate attributes.""" body = {} if self.command is not None: - body["{command}"] = self.command + body["command"] = self.command if self.compute: - body["{compute}"] = self.compute + body["compute"] = self.compute if self.dl_runtime_image is not None: - body["{dl_runtime_image}"] = self.dl_runtime_image + body["dl_runtime_image"] = self.dl_runtime_image if self.mlflow_experiment_name is not None: - body["{mlflow_experiment_name}"] = self.mlflow_experiment_name + body["mlflow_experiment_name"] = self.mlflow_experiment_name if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.training_script_path is not None: - body["{training_script_path}"] = self.training_script_path + body["training_script_path"] = self.training_script_path if self.yaml_parameters is not None: - body["{yaml_parameters}"] = self.yaml_parameters + body["yaml_parameters"] = self.yaml_parameters if self.yaml_parameters_file_path is not None: - body["{yaml_parameters_file_path}"] = self.yaml_parameters_file_path + body["yaml_parameters_file_path"] = self.yaml_parameters_file_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenAiComputeTask: """Deserializes the GenAiComputeTask from a dictionary.""" return cls( - command=d.get("{command}", None), - compute=_from_dict(d, "{compute}", ComputeConfig), - dl_runtime_image=d.get("{dl_runtime_image}", None), - mlflow_experiment_name=d.get("{mlflow_experiment_name}", None), - source=_enum(d, "{source}", Source), - training_script_path=d.get("{training_script_path}", None), - yaml_parameters=d.get("{yaml_parameters}", None), - yaml_parameters_file_path=d.get("{yaml_parameters_file_path}", None), + command=d.get("command", None), + compute=_from_dict(d, "compute", ComputeConfig), + dl_runtime_image=d.get("dl_runtime_image", None), + mlflow_experiment_name=d.get("mlflow_experiment_name", None), + source=_enum(d, "source", Source), + training_script_path=d.get("training_script_path", None), + yaml_parameters=d.get("yaml_parameters", None), + yaml_parameters_file_path=d.get("yaml_parameters_file_path", None), ) @@ -2027,13 +2653,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetJobPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetJobPermissionLevelsResponse: """Deserializes the GetJobPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", JobPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", JobPermissionsDescription)) @dataclass @@ -2062,15 +2688,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPolicyComplianceResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPolicyComplianceResponse: """Deserializes the GetPolicyComplianceResponse from a dictionary.""" - return cls(is_compliant=d.get("{is_compliant}", None), violations=d.get("{violations}", None)) + return cls(is_compliant=d.get("is_compliant", None), violations=d.get("violations", None)) class GitProvider(Enum): @@ -2106,13 +2732,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GitSnapshot into a shallow dictionary of its immediate attributes.""" body = {} if self.used_commit is not None: - body["{used_commit}"] = self.used_commit + body["used_commit"] = self.used_commit return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GitSnapshot: """Deserializes the GitSnapshot from a dictionary.""" - return cls(used_commit=d.get("{used_commit}", None)) + return cls(used_commit=d.get("used_commit", None)) @dataclass @@ -2174,32 +2800,116 @@ def as_shallow_dict(self) -> dict: """Serializes the GitSource into a shallow dictionary of its immediate attributes.""" body = {} if self.git_branch is not None: - body["{git_branch}"] = self.git_branch + body["git_branch"] = self.git_branch if self.git_commit is not None: - body["{git_commit}"] = self.git_commit + body["git_commit"] = self.git_commit if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_snapshot: - body["{git_snapshot}"] = self.git_snapshot + body["git_snapshot"] = self.git_snapshot if self.git_tag is not None: - body["{git_tag}"] = self.git_tag + body["git_tag"] = self.git_tag if self.git_url is not None: - body["{git_url}"] = self.git_url + body["git_url"] = self.git_url if self.job_source: - body["{job_source}"] = self.job_source + body["job_source"] = self.job_source return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GitSource: """Deserializes the GitSource from a dictionary.""" return cls( - git_branch=d.get("{git_branch}", None), - git_commit=d.get("{git_commit}", None), - git_provider=_enum(d, "{git_provider}", GitProvider), - git_snapshot=_from_dict(d, "{git_snapshot}", GitSnapshot), - git_tag=d.get("{git_tag}", None), - git_url=d.get("{git_url}", None), - job_source=_from_dict(d, "{job_source}", JobSource), + git_branch=d.get("git_branch", None), + git_commit=d.get("git_commit", None), + git_provider=_enum(d, "git_provider", GitProvider), + git_snapshot=_from_dict(d, "git_snapshot", GitSnapshot), + git_tag=d.get("git_tag", None), + git_url=d.get("git_url", None), + job_source=_from_dict(d, "job_source", JobSource), + ) + + +@dataclass +class InitScriptInfo: + """Config for an individual init script Next ID: 11""" + + abfss: Optional[Adlsgen2Info] = None + """destination needs to be provided, e.g. + `abfss://@.dfs.core.windows.net/`""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } + }`""" + + file: Optional[LocalFileInfo] = None + """destination needs to be provided, e.g. `{ "file": { "destination": "file:/my/local/file.sh" } }`""" + + gcs: Optional[GcsStorageInfo] = None + """destination needs to be provided, e.g. `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ \"s3\": { + \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` Cluster iam + role is used to access s3, please make sure the cluster iam role in `instance_profile_arn` has + permission to write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" : + \"/Volumes/my-init.sh\" } }`""" + + workspace: Optional[WorkspaceStorageInfo] = None + """destination needs to be provided, e.g. `{ "workspace": { "destination": + "/cluster-init-scripts/setup-datadog.sh" } }`""" + + def as_dict(self) -> dict: + """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss.as_dict() + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.file: + body["file"] = self.file.as_dict() + if self.gcs: + body["gcs"] = self.gcs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + if self.workspace: + body["workspace"] = self.workspace.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss + if self.dbfs: + body["dbfs"] = self.dbfs + if self.file: + body["file"] = self.file + if self.gcs: + body["gcs"] = self.gcs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + if self.workspace: + body["workspace"] = self.workspace + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: + """Deserializes the InitScriptInfo from a dictionary.""" + return cls( + abfss=_from_dict(d, "abfss", Adlsgen2Info), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + file=_from_dict(d, "file", LocalFileInfo), + gcs=_from_dict(d, "gcs", GcsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), ) @@ -2269,35 +2979,35 @@ def as_shallow_dict(self) -> dict: """Serializes the Job into a shallow dictionary of its immediate attributes.""" body = {} if self.created_time is not None: - body["{created_time}"] = self.created_time + body["created_time"] = self.created_time if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.run_as_user_name is not None: - body["{run_as_user_name}"] = self.run_as_user_name + body["run_as_user_name"] = self.run_as_user_name if self.settings: - body["{settings}"] = self.settings + body["settings"] = self.settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Job: """Deserializes the Job from a dictionary.""" return cls( - created_time=d.get("{created_time}", None), - creator_user_name=d.get("{creator_user_name}", None), - effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), - has_more=d.get("{has_more}", None), - job_id=d.get("{job_id}", None), - next_page_token=d.get("{next_page_token}", None), - run_as_user_name=d.get("{run_as_user_name}", None), - settings=_from_dict(d, "{settings}", JobSettings), + created_time=d.get("created_time", None), + creator_user_name=d.get("creator_user_name", None), + effective_budget_policy_id=d.get("effective_budget_policy_id", None), + has_more=d.get("has_more", None), + job_id=d.get("job_id", None), + next_page_token=d.get("next_page_token", None), + run_as_user_name=d.get("run_as_user_name", None), + settings=_from_dict(d, "settings", JobSettings), ) @@ -2332,23 +3042,23 @@ def as_shallow_dict(self) -> dict: """Serializes the JobAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobAccessControlRequest: """Deserializes the JobAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", JobPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", JobPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -2388,26 +3098,26 @@ def as_shallow_dict(self) -> dict: """Serializes the JobAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobAccessControlResponse: """Deserializes the JobAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", JobPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", JobPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -2418,7 +3128,7 @@ class JobCluster: `JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution.""" - new_cluster: ClusterSpec + new_cluster: JobsClusterSpec """If new_cluster, a description of a cluster that is created for each task.""" def as_dict(self) -> dict: @@ -2434,16 +3144,16 @@ def as_shallow_dict(self) -> dict: """Serializes the JobCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.new_cluster: - body["{new_cluster}"] = self.new_cluster + body["new_cluster"] = self.new_cluster return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobCluster: """Deserializes the JobCluster from a dictionary.""" return cls( - job_cluster_key=d.get("{job_cluster_key}", None), new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec) + job_cluster_key=d.get("job_cluster_key", None), new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec) ) @@ -2476,20 +3186,18 @@ def as_shallow_dict(self) -> dict: """Serializes the JobCompliance into a shallow dictionary of its immediate attributes.""" body = {} if self.is_compliant is not None: - body["{is_compliant}"] = self.is_compliant + body["is_compliant"] = self.is_compliant if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.violations: - body["{violations}"] = self.violations + body["violations"] = self.violations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobCompliance: """Deserializes the JobCompliance from a dictionary.""" return cls( - is_compliant=d.get("{is_compliant}", None), - job_id=d.get("{job_id}", None), - violations=d.get("{violations}", None), + is_compliant=d.get("is_compliant", None), job_id=d.get("job_id", None), violations=d.get("violations", None) ) @@ -2516,15 +3224,15 @@ def as_shallow_dict(self) -> dict: """Serializes the JobDeployment into a shallow dictionary of its immediate attributes.""" body = {} if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.metadata_file_path is not None: - body["{metadata_file_path}"] = self.metadata_file_path + body["metadata_file_path"] = self.metadata_file_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobDeployment: """Deserializes the JobDeployment from a dictionary.""" - return cls(kind=_enum(d, "{kind}", JobDeploymentKind), metadata_file_path=d.get("{metadata_file_path}", None)) + return cls(kind=_enum(d, "kind", JobDeploymentKind), metadata_file_path=d.get("metadata_file_path", None)) class JobDeploymentKind(Enum): @@ -2599,29 +3307,29 @@ def as_shallow_dict(self) -> dict: """Serializes the JobEmailNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["{on_duration_warning_threshold_exceeded}"] = self.on_duration_warning_threshold_exceeded + body["on_duration_warning_threshold_exceeded"] = self.on_duration_warning_threshold_exceeded if self.on_failure: - body["{on_failure}"] = self.on_failure + body["on_failure"] = self.on_failure if self.on_start: - body["{on_start}"] = self.on_start + body["on_start"] = self.on_start if self.on_streaming_backlog_exceeded: - body["{on_streaming_backlog_exceeded}"] = self.on_streaming_backlog_exceeded + body["on_streaming_backlog_exceeded"] = self.on_streaming_backlog_exceeded if self.on_success: - body["{on_success}"] = self.on_success + body["on_success"] = self.on_success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobEmailNotifications: """Deserializes the JobEmailNotifications from a dictionary.""" return cls( - no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), - on_duration_warning_threshold_exceeded=d.get("{on_duration_warning_threshold_exceeded}", None), - on_failure=d.get("{on_failure}", None), - on_start=d.get("{on_start}", None), - on_streaming_backlog_exceeded=d.get("{on_streaming_backlog_exceeded}", None), - on_success=d.get("{on_success}", None), + no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), + on_duration_warning_threshold_exceeded=d.get("on_duration_warning_threshold_exceeded", None), + on_failure=d.get("on_failure", None), + on_start=d.get("on_start", None), + on_streaming_backlog_exceeded=d.get("on_streaming_backlog_exceeded", None), + on_success=d.get("on_success", None), ) @@ -2647,15 +3355,15 @@ def as_shallow_dict(self) -> dict: """Serializes the JobEnvironment into a shallow dictionary of its immediate attributes.""" body = {} if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.spec: - body["{spec}"] = self.spec + body["spec"] = self.spec return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobEnvironment: """Deserializes the JobEnvironment from a dictionary.""" - return cls(environment_key=d.get("{environment_key}", None), spec=_from_dict(d, "{spec}", Environment)) + return cls(environment_key=d.get("environment_key", None), spec=_from_dict(d, "spec", Environment)) @dataclass @@ -2681,17 +3389,17 @@ def as_shallow_dict(self) -> dict: """Serializes the JobNotificationSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.no_alert_for_canceled_runs is not None: - body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs + body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobNotificationSettings: """Deserializes the JobNotificationSettings from a dictionary.""" return cls( - no_alert_for_canceled_runs=d.get("{no_alert_for_canceled_runs}", None), - no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), + no_alert_for_canceled_runs=d.get("no_alert_for_canceled_runs", None), + no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), ) @@ -2721,17 +3429,17 @@ def as_shallow_dict(self) -> dict: """Serializes the JobParameter into a shallow dictionary of its immediate attributes.""" body = {} if self.default is not None: - body["{default}"] = self.default + body["default"] = self.default if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobParameter: """Deserializes the JobParameter from a dictionary.""" - return cls(default=d.get("{default}", None), name=d.get("{name}", None), value=d.get("{value}", None)) + return cls(default=d.get("default", None), name=d.get("name", None), value=d.get("value", None)) @dataclass @@ -2755,15 +3463,15 @@ def as_shallow_dict(self) -> dict: """Serializes the JobParameterDefinition into a shallow dictionary of its immediate attributes.""" body = {} if self.default is not None: - body["{default}"] = self.default + body["default"] = self.default if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobParameterDefinition: """Deserializes the JobParameterDefinition from a dictionary.""" - return cls(default=d.get("{default}", None), name=d.get("{name}", None)) + return cls(default=d.get("default", None), name=d.get("name", None)) @dataclass @@ -2790,20 +3498,20 @@ def as_shallow_dict(self) -> dict: """Serializes the JobPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermission: """Deserializes the JobPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", JobPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", JobPermissionLevel), ) @@ -2839,20 +3547,20 @@ def as_shallow_dict(self) -> dict: """Serializes the JobPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermissions: """Deserializes the JobPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -2876,17 +3584,16 @@ def as_shallow_dict(self) -> dict: """Serializes the JobPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermissionsDescription: """Deserializes the JobPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", JobPermissionLevel), + description=d.get("description", None), permission_level=_enum(d, "permission_level", JobPermissionLevel) ) @@ -2910,17 +3617,17 @@ def as_shallow_dict(self) -> dict: """Serializes the JobPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobPermissionsRequest: """Deserializes the JobPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlRequest), - job_id=d.get("{job_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlRequest), + job_id=d.get("job_id", None), ) @@ -2952,15 +3659,15 @@ def as_shallow_dict(self) -> dict: """Serializes the JobRunAs into a shallow dictionary of its immediate attributes.""" body = {} if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobRunAs: """Deserializes the JobRunAs from a dictionary.""" - return cls(service_principal_name=d.get("{service_principal_name}", None), user_name=d.get("{user_name}", None)) + return cls(service_principal_name=d.get("service_principal_name", None), user_name=d.get("user_name", None)) @dataclass @@ -3135,83 +3842,83 @@ def as_shallow_dict(self) -> dict: """Serializes the JobSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.continuous: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment + body["deployment"] = self.deployment if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.edit_mode is not None: - body["{edit_mode}"] = self.edit_mode + body["edit_mode"] = self.edit_mode if self.email_notifications: - body["{email_notifications}"] = self.email_notifications + body["email_notifications"] = self.email_notifications if self.environments: - body["{environments}"] = self.environments + body["environments"] = self.environments if self.format is not None: - body["{format}"] = self.format + body["format"] = self.format if self.git_source: - body["{git_source}"] = self.git_source + body["git_source"] = self.git_source if self.health: - body["{health}"] = self.health + body["health"] = self.health if self.job_clusters: - body["{job_clusters}"] = self.job_clusters + body["job_clusters"] = self.job_clusters if self.max_concurrent_runs is not None: - body["{max_concurrent_runs}"] = self.max_concurrent_runs + body["max_concurrent_runs"] = self.max_concurrent_runs if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notification_settings: - body["{notification_settings}"] = self.notification_settings + body["notification_settings"] = self.notification_settings if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.performance_target is not None: - body["{performance_target}"] = self.performance_target + body["performance_target"] = self.performance_target if self.queue: - body["{queue}"] = self.queue + body["queue"] = self.queue if self.run_as: - body["{run_as}"] = self.run_as + body["run_as"] = self.run_as if self.schedule: - body["{schedule}"] = self.schedule + body["schedule"] = self.schedule if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.tasks: - body["{tasks}"] = self.tasks + body["tasks"] = self.tasks if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.trigger: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications + body["webhook_notifications"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSettings: """Deserializes the JobSettings from a dictionary.""" return cls( - budget_policy_id=d.get("{budget_policy_id}", None), - continuous=_from_dict(d, "{continuous}", Continuous), - deployment=_from_dict(d, "{deployment}", JobDeployment), - description=d.get("{description}", None), - edit_mode=_enum(d, "{edit_mode}", JobEditMode), - email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), - environments=_repeated_dict(d, "{environments}", JobEnvironment), - format=_enum(d, "{format}", Format), - git_source=_from_dict(d, "{git_source}", GitSource), - health=_from_dict(d, "{health}", JobsHealthRules), - job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), - max_concurrent_runs=d.get("{max_concurrent_runs}", None), - name=d.get("{name}", None), - notification_settings=_from_dict(d, "{notification_settings}", JobNotificationSettings), - parameters=_repeated_dict(d, "{parameters}", JobParameterDefinition), - performance_target=_enum(d, "{performance_target}", PerformanceTarget), - queue=_from_dict(d, "{queue}", QueueSettings), - run_as=_from_dict(d, "{run_as}", JobRunAs), - schedule=_from_dict(d, "{schedule}", CronSchedule), - tags=d.get("{tags}", None), - tasks=_repeated_dict(d, "{tasks}", Task), - timeout_seconds=d.get("{timeout_seconds}", None), - trigger=_from_dict(d, "{trigger}", TriggerSettings), - webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), + budget_policy_id=d.get("budget_policy_id", None), + continuous=_from_dict(d, "continuous", Continuous), + deployment=_from_dict(d, "deployment", JobDeployment), + description=d.get("description", None), + edit_mode=_enum(d, "edit_mode", JobEditMode), + email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), + environments=_repeated_dict(d, "environments", JobEnvironment), + format=_enum(d, "format", Format), + git_source=_from_dict(d, "git_source", GitSource), + health=_from_dict(d, "health", JobsHealthRules), + job_clusters=_repeated_dict(d, "job_clusters", JobCluster), + max_concurrent_runs=d.get("max_concurrent_runs", None), + name=d.get("name", None), + notification_settings=_from_dict(d, "notification_settings", JobNotificationSettings), + parameters=_repeated_dict(d, "parameters", JobParameterDefinition), + performance_target=_enum(d, "performance_target", PerformanceTarget), + queue=_from_dict(d, "queue", QueueSettings), + run_as=_from_dict(d, "run_as", JobRunAs), + schedule=_from_dict(d, "schedule", CronSchedule), + tags=d.get("tags", None), + tasks=_repeated_dict(d, "tasks", Task), + timeout_seconds=d.get("timeout_seconds", None), + trigger=_from_dict(d, "trigger", TriggerSettings), + webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), ) @@ -3250,20 +3957,20 @@ def as_shallow_dict(self) -> dict: """Serializes the JobSource into a shallow dictionary of its immediate attributes.""" body = {} if self.dirty_state is not None: - body["{dirty_state}"] = self.dirty_state + body["dirty_state"] = self.dirty_state if self.import_from_git_branch is not None: - body["{import_from_git_branch}"] = self.import_from_git_branch + body["import_from_git_branch"] = self.import_from_git_branch if self.job_config_path is not None: - body["{job_config_path}"] = self.job_config_path + body["job_config_path"] = self.job_config_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSource: """Deserializes the JobSource from a dictionary.""" return cls( - dirty_state=_enum(d, "{dirty_state}", JobSourceDirtyState), - import_from_git_branch=d.get("{import_from_git_branch}", None), - job_config_path=d.get("{job_config_path}", None), + dirty_state=_enum(d, "dirty_state", JobSourceDirtyState), + import_from_git_branch=d.get("import_from_git_branch", None), + job_config_path=d.get("job_config_path", None), ) @@ -3546,101 +4253,101 @@ def as_shallow_dict(self) -> dict: """Serializes the JobsClusterSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.autotermination_minutes is not None: - body["{autotermination_minutes}"] = self.autotermination_minutes + body["autotermination_minutes"] = self.autotermination_minutes if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.cluster_name is not None: - body["{cluster_name}"] = self.cluster_name + body["cluster_name"] = self.cluster_name if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.data_security_mode is not None: - body["{data_security_mode}"] = self.data_security_mode + body["data_security_mode"] = self.data_security_mode if self.docker_image: - body["{docker_image}"] = self.docker_image + body["docker_image"] = self.docker_image if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_elastic_disk is not None: - body["{enable_elastic_disk}"] = self.enable_elastic_disk + body["enable_elastic_disk"] = self.enable_elastic_disk if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.is_single_node is not None: - body["{is_single_node}"] = self.is_single_node + body["is_single_node"] = self.is_single_node if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.runtime_engine is not None: - body["{runtime_engine}"] = self.runtime_engine + body["runtime_engine"] = self.runtime_engine if self.single_user_name is not None: - body["{single_user_name}"] = self.single_user_name + body["single_user_name"] = self.single_user_name if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.spark_version is not None: - body["{spark_version}"] = self.spark_version + body["spark_version"] = self.spark_version if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys if self.use_ml_runtime is not None: - body["{use_ml_runtime}"] = self.use_ml_runtime + body["use_ml_runtime"] = self.use_ml_runtime if self.workload_type: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobsClusterSpec: """Deserializes the JobsClusterSpec from a dictionary.""" return cls( - apply_policy_default_values=d.get("{apply_policy_default_values}", None), - autoscale=_from_dict(d, "{autoscale}", AutoScale), - autotermination_minutes=d.get("{autotermination_minutes}", None), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - cluster_name=d.get("{cluster_name}", None), - custom_tags=d.get("{custom_tags}", None), - data_security_mode=_enum(d, "{data_security_mode}", DataSecurityMode), - docker_image=_from_dict(d, "{docker_image}", DockerImage), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_elastic_disk=d.get("{enable_elastic_disk}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - is_single_node=d.get("{is_single_node}", None), - kind=_enum(d, "{kind}", Kind), - node_type_id=d.get("{node_type_id}", None), - num_workers=d.get("{num_workers}", None), - policy_id=d.get("{policy_id}", None), - runtime_engine=_enum(d, "{runtime_engine}", RuntimeEngine), - single_user_name=d.get("{single_user_name}", None), - spark_conf=d.get("{spark_conf}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - spark_version=d.get("{spark_version}", None), - ssh_public_keys=d.get("{ssh_public_keys}", None), - use_ml_runtime=d.get("{use_ml_runtime}", None), - workload_type=_from_dict(d, "{workload_type}", WorkloadType), + apply_policy_default_values=d.get("apply_policy_default_values", None), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), ) @@ -3702,20 +4409,20 @@ def as_shallow_dict(self) -> dict: """Serializes the JobsHealthRule into a shallow dictionary of its immediate attributes.""" body = {} if self.metric is not None: - body["{metric}"] = self.metric + body["metric"] = self.metric if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobsHealthRule: """Deserializes the JobsHealthRule from a dictionary.""" return cls( - metric=_enum(d, "{metric}", JobsHealthMetric), - op=_enum(d, "{op}", JobsHealthOperator), - value=d.get("{value}", None), + metric=_enum(d, "metric", JobsHealthMetric), + op=_enum(d, "op", JobsHealthOperator), + value=d.get("value", None), ) @@ -3736,13 +4443,13 @@ def as_shallow_dict(self) -> dict: """Serializes the JobsHealthRules into a shallow dictionary of its immediate attributes.""" body = {} if self.rules: - body["{rules}"] = self.rules + body["rules"] = self.rules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobsHealthRules: """Deserializes the JobsHealthRules from a dictionary.""" - return cls(rules=_repeated_dict(d, "{rules}", JobsHealthRule)) + return cls(rules=_repeated_dict(d, "rules", JobsHealthRule)) class Kind(Enum): @@ -3821,32 +4528,32 @@ def as_shallow_dict(self) -> dict: """Serializes the Library into a shallow dictionary of its immediate attributes.""" body = {} if self.cran: - body["{cran}"] = self.cran + body["cran"] = self.cran if self.egg is not None: - body["{egg}"] = self.egg + body["egg"] = self.egg if self.jar is not None: - body["{jar}"] = self.jar + body["jar"] = self.jar if self.maven: - body["{maven}"] = self.maven + body["maven"] = self.maven if self.pypi: - body["{pypi}"] = self.pypi + body["pypi"] = self.pypi if self.requirements is not None: - body["{requirements}"] = self.requirements + body["requirements"] = self.requirements if self.whl is not None: - body["{whl}"] = self.whl + body["whl"] = self.whl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Library: """Deserializes the Library from a dictionary.""" return cls( - cran=_from_dict(d, "{cran}", RCranLibrary), - egg=d.get("{egg}", None), - jar=d.get("{jar}", None), - maven=_from_dict(d, "{maven}", MavenLibrary), - pypi=_from_dict(d, "{pypi}", PythonPyPiLibrary), - requirements=d.get("{requirements}", None), - whl=d.get("{whl}", None), + cran=_from_dict(d, "cran", RCranLibrary), + egg=d.get("egg", None), + jar=d.get("jar", None), + maven=_from_dict(d, "maven", MavenLibrary), + pypi=_from_dict(d, "pypi", PythonPyPiLibrary), + requirements=d.get("requirements", None), + whl=d.get("whl", None), ) @@ -3878,20 +4585,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListJobComplianceForPolicyResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.jobs: - body["{jobs}"] = self.jobs + body["jobs"] = self.jobs if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListJobComplianceForPolicyResponse: """Deserializes the ListJobComplianceForPolicyResponse from a dictionary.""" return cls( - jobs=_repeated_dict(d, "{jobs}", JobCompliance), - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), + jobs=_repeated_dict(d, "jobs", JobCompliance), + next_page_token=d.get("next_page_token", None), + prev_page_token=d.get("prev_page_token", None), ) @@ -3928,23 +4635,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ListJobsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.jobs: - body["{jobs}"] = self.jobs + body["jobs"] = self.jobs if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListJobsResponse: """Deserializes the ListJobsResponse from a dictionary.""" return cls( - has_more=d.get("{has_more}", None), - jobs=_repeated_dict(d, "{jobs}", BaseJob), - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), + has_more=d.get("has_more", None), + jobs=_repeated_dict(d, "jobs", BaseJob), + next_page_token=d.get("next_page_token", None), + prev_page_token=d.get("prev_page_token", None), ) @@ -3982,23 +4689,81 @@ def as_shallow_dict(self) -> dict: """Serializes the ListRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token if self.runs: - body["{runs}"] = self.runs + body["runs"] = self.runs + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: + """Deserializes the ListRunsResponse from a dictionary.""" + return cls( + has_more=d.get("has_more", None), + next_page_token=d.get("next_page_token", None), + prev_page_token=d.get("prev_page_token", None), + runs=_repeated_dict(d, "runs", BaseRun), + ) + + +@dataclass +class LocalFileInfo: + destination: str + """local file destination, e.g. `file:/my/local/file.sh`""" + + def as_dict(self) -> dict: + """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: + """Deserializes the LocalFileInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class LogAnalyticsInfo: + log_analytics_primary_key: Optional[str] = None + + log_analytics_workspace_id: Optional[str] = None + + def as_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id return body @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: - """Deserializes the ListRunsResponse from a dictionary.""" + def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: + """Deserializes the LogAnalyticsInfo from a dictionary.""" return cls( - has_more=d.get("{has_more}", None), - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), - runs=_repeated_dict(d, "{runs}", BaseRun), + log_analytics_primary_key=d.get("log_analytics_primary_key", None), + log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), ) @@ -4032,18 +4797,18 @@ def as_shallow_dict(self) -> dict: """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.coordinates is not None: - body["{coordinates}"] = self.coordinates + body["coordinates"] = self.coordinates if self.exclusions: - body["{exclusions}"] = self.exclusions + body["exclusions"] = self.exclusions if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: """Deserializes the MavenLibrary from a dictionary.""" return cls( - coordinates=d.get("{coordinates}", None), exclusions=d.get("{exclusions}", None), repo=d.get("{repo}", None) + coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) ) @@ -4072,15 +4837,15 @@ def as_shallow_dict(self) -> dict: """Serializes the NotebookOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.result is not None: - body["{result}"] = self.result + body["result"] = self.result if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookOutput: """Deserializes the NotebookOutput from a dictionary.""" - return cls(result=d.get("{result}", None), truncated=d.get("{truncated}", None)) + return cls(result=d.get("result", None), truncated=d.get("truncated", None)) @dataclass @@ -4137,23 +4902,23 @@ def as_shallow_dict(self) -> dict: """Serializes the NotebookTask into a shallow dictionary of its immediate attributes.""" body = {} if self.base_parameters: - body["{base_parameters}"] = self.base_parameters + body["base_parameters"] = self.base_parameters if self.notebook_path is not None: - body["{notebook_path}"] = self.notebook_path + body["notebook_path"] = self.notebook_path if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookTask: """Deserializes the NotebookTask from a dictionary.""" return cls( - base_parameters=d.get("{base_parameters}", None), - notebook_path=d.get("{notebook_path}", None), - source=_enum(d, "{source}", Source), - warehouse_id=d.get("{warehouse_id}", None), + base_parameters=d.get("base_parameters", None), + notebook_path=d.get("notebook_path", None), + source=_enum(d, "source", Source), + warehouse_id=d.get("warehouse_id", None), ) @@ -4184,20 +4949,20 @@ def as_shallow_dict(self) -> dict: """Serializes the OutputSchemaInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OutputSchemaInfo: """Deserializes the OutputSchemaInfo from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - expiration_time=d.get("{expiration_time}", None), - schema_name=d.get("{schema_name}", None), + catalog_name=d.get("catalog_name", None), + expiration_time=d.get("expiration_time", None), + schema_name=d.get("schema_name", None), ) @@ -4238,15 +5003,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PeriodicTriggerConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.interval is not None: - body["{interval}"] = self.interval + body["interval"] = self.interval if self.unit is not None: - body["{unit}"] = self.unit + body["unit"] = self.unit return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PeriodicTriggerConfiguration: """Deserializes the PeriodicTriggerConfiguration from a dictionary.""" - return cls(interval=d.get("{interval}", None), unit=_enum(d, "{unit}", PeriodicTriggerConfigurationTimeUnit)) + return cls(interval=d.get("interval", None), unit=_enum(d, "unit", PeriodicTriggerConfigurationTimeUnit)) class PeriodicTriggerConfigurationTimeUnit(Enum): @@ -4272,13 +5037,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineParams into a shallow dictionary of its immediate attributes.""" body = {} if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineParams: """Deserializes the PipelineParams from a dictionary.""" - return cls(full_refresh=d.get("{full_refresh}", None)) + return cls(full_refresh=d.get("full_refresh", None)) @dataclass @@ -4302,15 +5067,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineTask into a shallow dictionary of its immediate attributes.""" body = {} if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineTask: """Deserializes the PipelineTask from a dictionary.""" - return cls(full_refresh=d.get("{full_refresh}", None), pipeline_id=d.get("{pipeline_id}", None)) + return cls(full_refresh=d.get("full_refresh", None), pipeline_id=d.get("pipeline_id", None)) @dataclass @@ -4335,15 +5100,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PythonPyPiLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PythonPyPiLibrary: """Deserializes the PythonPyPiLibrary from a dictionary.""" - return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) + return cls(package=d.get("package", None), repo=d.get("repo", None)) @dataclass @@ -4380,23 +5145,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PythonWheelTask into a shallow dictionary of its immediate attributes.""" body = {} if self.entry_point is not None: - body["{entry_point}"] = self.entry_point + body["entry_point"] = self.entry_point if self.named_parameters: - body["{named_parameters}"] = self.named_parameters + body["named_parameters"] = self.named_parameters if self.package_name is not None: - body["{package_name}"] = self.package_name + body["package_name"] = self.package_name if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PythonWheelTask: """Deserializes the PythonWheelTask from a dictionary.""" return cls( - entry_point=d.get("{entry_point}", None), - named_parameters=d.get("{named_parameters}", None), - package_name=d.get("{package_name}", None), - parameters=d.get("{parameters}", None), + entry_point=d.get("entry_point", None), + named_parameters=d.get("named_parameters", None), + package_name=d.get("package_name", None), + parameters=d.get("parameters", None), ) @@ -4426,15 +5191,15 @@ def as_shallow_dict(self) -> dict: """Serializes the QueueDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["{code}"] = self.code + body["code"] = self.code if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueueDetails: """Deserializes the QueueDetails from a dictionary.""" - return cls(code=_enum(d, "{code}", QueueDetailsCodeCode), message=d.get("{message}", None)) + return cls(code=_enum(d, "code", QueueDetailsCodeCode), message=d.get("message", None)) class QueueDetailsCodeCode(Enum): @@ -4465,13 +5230,13 @@ def as_shallow_dict(self) -> dict: """Serializes the QueueSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueueSettings: """Deserializes the QueueSettings from a dictionary.""" - return cls(enabled=d.get("{enabled}", None)) + return cls(enabled=d.get("enabled", None)) @dataclass @@ -4495,15 +5260,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RCranLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.package is not None: - body["{package}"] = self.package + body["package"] = self.package if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RCranLibrary: """Deserializes the RCranLibrary from a dictionary.""" - return cls(package=d.get("{package}", None), repo=d.get("{repo}", None)) + return cls(package=d.get("package", None), repo=d.get("repo", None)) @dataclass @@ -4552,32 +5317,32 @@ def as_shallow_dict(self) -> dict: """Serializes the RepairHistoryItem into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.status: - body["{status}"] = self.status + body["status"] = self.status if self.task_run_ids: - body["{task_run_ids}"] = self.task_run_ids + body["task_run_ids"] = self.task_run_ids if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepairHistoryItem: """Deserializes the RepairHistoryItem from a dictionary.""" return cls( - end_time=d.get("{end_time}", None), - id=d.get("{id}", None), - start_time=d.get("{start_time}", None), - state=_from_dict(d, "{state}", RunState), - status=_from_dict(d, "{status}", RunStatus), - task_run_ids=d.get("{task_run_ids}", None), - type=_enum(d, "{type}", RepairHistoryItemType), + end_time=d.get("end_time", None), + id=d.get("id", None), + start_time=d.get("start_time", None), + state=_from_dict(d, "state", RunState), + status=_from_dict(d, "status", RunStatus), + task_run_ids=d.get("task_run_ids", None), + type=_enum(d, "type", RepairHistoryItemType), ) @@ -4722,53 +5487,53 @@ def as_shallow_dict(self) -> dict: """Serializes the RepairRun into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = self.dbt_commands + body["dbt_commands"] = self.dbt_commands if self.jar_params: - body["{jar_params}"] = self.jar_params + body["jar_params"] = self.jar_params if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.latest_repair_id is not None: - body["{latest_repair_id}"] = self.latest_repair_id + body["latest_repair_id"] = self.latest_repair_id if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params + body["pipeline_params"] = self.pipeline_params if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = self.python_params + body["python_params"] = self.python_params if self.rerun_all_failed_tasks is not None: - body["{rerun_all_failed_tasks}"] = self.rerun_all_failed_tasks + body["rerun_all_failed_tasks"] = self.rerun_all_failed_tasks if self.rerun_dependent_tasks is not None: - body["{rerun_dependent_tasks}"] = self.rerun_dependent_tasks + body["rerun_dependent_tasks"] = self.rerun_dependent_tasks if self.rerun_tasks: - body["{rerun_tasks}"] = self.rerun_tasks + body["rerun_tasks"] = self.rerun_tasks if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.spark_submit_params: - body["{spark_submit_params}"] = self.spark_submit_params + body["spark_submit_params"] = self.spark_submit_params if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepairRun: """Deserializes the RepairRun from a dictionary.""" return cls( - dbt_commands=d.get("{dbt_commands}", None), - jar_params=d.get("{jar_params}", None), - job_parameters=d.get("{job_parameters}", None), - latest_repair_id=d.get("{latest_repair_id}", None), - notebook_params=d.get("{notebook_params}", None), - pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), - python_named_params=d.get("{python_named_params}", None), - python_params=d.get("{python_params}", None), - rerun_all_failed_tasks=d.get("{rerun_all_failed_tasks}", None), - rerun_dependent_tasks=d.get("{rerun_dependent_tasks}", None), - rerun_tasks=d.get("{rerun_tasks}", None), - run_id=d.get("{run_id}", None), - spark_submit_params=d.get("{spark_submit_params}", None), - sql_params=d.get("{sql_params}", None), + dbt_commands=d.get("dbt_commands", None), + jar_params=d.get("jar_params", None), + job_parameters=d.get("job_parameters", None), + latest_repair_id=d.get("latest_repair_id", None), + notebook_params=d.get("notebook_params", None), + pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), + python_named_params=d.get("python_named_params", None), + python_params=d.get("python_params", None), + rerun_all_failed_tasks=d.get("rerun_all_failed_tasks", None), + rerun_dependent_tasks=d.get("rerun_dependent_tasks", None), + rerun_tasks=d.get("rerun_tasks", None), + run_id=d.get("run_id", None), + spark_submit_params=d.get("spark_submit_params", None), + sql_params=d.get("sql_params", None), ) @@ -4791,13 +5556,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RepairRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.repair_id is not None: - body["{repair_id}"] = self.repair_id + body["repair_id"] = self.repair_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepairRunResponse: """Deserializes the RepairRunResponse from a dictionary.""" - return cls(repair_id=d.get("{repair_id}", None)) + return cls(repair_id=d.get("repair_id", None)) @dataclass @@ -4824,15 +5589,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResetJob into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.new_settings: - body["{new_settings}"] = self.new_settings + body["new_settings"] = self.new_settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResetJob: """Deserializes the ResetJob from a dictionary.""" - return cls(job_id=d.get("{job_id}", None), new_settings=_from_dict(d, "{new_settings}", JobSettings)) + return cls(job_id=d.get("job_id", None), new_settings=_from_dict(d, "new_settings", JobSettings)) @dataclass @@ -4872,15 +5637,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedConditionTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.left is not None: - body["{left}"] = self.left + body["left"] = self.left if self.right is not None: - body["{right}"] = self.right + body["right"] = self.right return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedConditionTaskValues: """Deserializes the ResolvedConditionTaskValues from a dictionary.""" - return cls(left=d.get("{left}", None), right=d.get("{right}", None)) + return cls(left=d.get("left", None), right=d.get("right", None)) @dataclass @@ -4898,13 +5663,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedDbtTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.commands: - body["{commands}"] = self.commands + body["commands"] = self.commands return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedDbtTaskValues: """Deserializes the ResolvedDbtTaskValues from a dictionary.""" - return cls(commands=d.get("{commands}", None)) + return cls(commands=d.get("commands", None)) @dataclass @@ -4922,13 +5687,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedNotebookTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.base_parameters: - body["{base_parameters}"] = self.base_parameters + body["base_parameters"] = self.base_parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedNotebookTaskValues: """Deserializes the ResolvedNotebookTaskValues from a dictionary.""" - return cls(base_parameters=d.get("{base_parameters}", None)) + return cls(base_parameters=d.get("base_parameters", None)) @dataclass @@ -4946,13 +5711,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedParamPairValues into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedParamPairValues: """Deserializes the ResolvedParamPairValues from a dictionary.""" - return cls(parameters=d.get("{parameters}", None)) + return cls(parameters=d.get("parameters", None)) @dataclass @@ -4974,15 +5739,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedPythonWheelTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.named_parameters: - body["{named_parameters}"] = self.named_parameters + body["named_parameters"] = self.named_parameters if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedPythonWheelTaskValues: """Deserializes the ResolvedPythonWheelTaskValues from a dictionary.""" - return cls(named_parameters=d.get("{named_parameters}", None), parameters=d.get("{parameters}", None)) + return cls(named_parameters=d.get("named_parameters", None), parameters=d.get("parameters", None)) @dataclass @@ -5004,15 +5769,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedRunJobTaskValues into a shallow dictionary of its immediate attributes.""" body = {} if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedRunJobTaskValues: """Deserializes the ResolvedRunJobTaskValues from a dictionary.""" - return cls(job_parameters=d.get("{job_parameters}", None), parameters=d.get("{parameters}", None)) + return cls(job_parameters=d.get("job_parameters", None), parameters=d.get("parameters", None)) @dataclass @@ -5030,13 +5795,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedStringParamsValues into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedStringParamsValues: """Deserializes the ResolvedStringParamsValues from a dictionary.""" - return cls(parameters=d.get("{parameters}", None)) + return cls(parameters=d.get("parameters", None)) @dataclass @@ -5090,41 +5855,41 @@ def as_shallow_dict(self) -> dict: """Serializes the ResolvedValues into a shallow dictionary of its immediate attributes.""" body = {} if self.condition_task: - body["{condition_task}"] = self.condition_task + body["condition_task"] = self.condition_task if self.dbt_task: - body["{dbt_task}"] = self.dbt_task + body["dbt_task"] = self.dbt_task if self.notebook_task: - body["{notebook_task}"] = self.notebook_task + body["notebook_task"] = self.notebook_task if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task + body["python_wheel_task"] = self.python_wheel_task if self.run_job_task: - body["{run_job_task}"] = self.run_job_task + body["run_job_task"] = self.run_job_task if self.simulation_task: - body["{simulation_task}"] = self.simulation_task + body["simulation_task"] = self.simulation_task if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task + body["spark_jar_task"] = self.spark_jar_task if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task + body["spark_python_task"] = self.spark_python_task if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task + body["spark_submit_task"] = self.spark_submit_task if self.sql_task: - body["{sql_task}"] = self.sql_task + body["sql_task"] = self.sql_task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResolvedValues: """Deserializes the ResolvedValues from a dictionary.""" return cls( - condition_task=_from_dict(d, "{condition_task}", ResolvedConditionTaskValues), - dbt_task=_from_dict(d, "{dbt_task}", ResolvedDbtTaskValues), - notebook_task=_from_dict(d, "{notebook_task}", ResolvedNotebookTaskValues), - python_wheel_task=_from_dict(d, "{python_wheel_task}", ResolvedPythonWheelTaskValues), - run_job_task=_from_dict(d, "{run_job_task}", ResolvedRunJobTaskValues), - simulation_task=_from_dict(d, "{simulation_task}", ResolvedParamPairValues), - spark_jar_task=_from_dict(d, "{spark_jar_task}", ResolvedStringParamsValues), - spark_python_task=_from_dict(d, "{spark_python_task}", ResolvedStringParamsValues), - spark_submit_task=_from_dict(d, "{spark_submit_task}", ResolvedStringParamsValues), - sql_task=_from_dict(d, "{sql_task}", ResolvedParamPairValues), + condition_task=_from_dict(d, "condition_task", ResolvedConditionTaskValues), + dbt_task=_from_dict(d, "dbt_task", ResolvedDbtTaskValues), + notebook_task=_from_dict(d, "notebook_task", ResolvedNotebookTaskValues), + python_wheel_task=_from_dict(d, "python_wheel_task", ResolvedPythonWheelTaskValues), + run_job_task=_from_dict(d, "run_job_task", ResolvedRunJobTaskValues), + simulation_task=_from_dict(d, "simulation_task", ResolvedParamPairValues), + spark_jar_task=_from_dict(d, "spark_jar_task", ResolvedStringParamsValues), + spark_python_task=_from_dict(d, "spark_python_task", ResolvedStringParamsValues), + spark_submit_task=_from_dict(d, "spark_submit_task", ResolvedStringParamsValues), + sql_task=_from_dict(d, "sql_task", ResolvedParamPairValues), ) @@ -5369,116 +6134,116 @@ def as_shallow_dict(self) -> dict: """Serializes the Run into a shallow dictionary of its immediate attributes.""" body = {} if self.attempt_number is not None: - body["{attempt_number}"] = self.attempt_number + body["attempt_number"] = self.attempt_number if self.cleanup_duration is not None: - body["{cleanup_duration}"] = self.cleanup_duration + body["cleanup_duration"] = self.cleanup_duration if self.cluster_instance: - body["{cluster_instance}"] = self.cluster_instance + body["cluster_instance"] = self.cluster_instance if self.cluster_spec: - body["{cluster_spec}"] = self.cluster_spec + body["cluster_spec"] = self.cluster_spec if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.effective_performance_target is not None: - body["{effective_performance_target}"] = self.effective_performance_target + body["effective_performance_target"] = self.effective_performance_target if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.execution_duration is not None: - body["{execution_duration}"] = self.execution_duration + body["execution_duration"] = self.execution_duration if self.git_source: - body["{git_source}"] = self.git_source + body["git_source"] = self.git_source if self.has_more is not None: - body["{has_more}"] = self.has_more + body["has_more"] = self.has_more if self.iterations: - body["{iterations}"] = self.iterations + body["iterations"] = self.iterations if self.job_clusters: - body["{job_clusters}"] = self.job_clusters + body["job_clusters"] = self.job_clusters if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.job_run_id is not None: - body["{job_run_id}"] = self.job_run_id + body["job_run_id"] = self.job_run_id if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.number_in_job is not None: - body["{number_in_job}"] = self.number_in_job + body["number_in_job"] = self.number_in_job if self.original_attempt_run_id is not None: - body["{original_attempt_run_id}"] = self.original_attempt_run_id + body["original_attempt_run_id"] = self.original_attempt_run_id if self.overriding_parameters: - body["{overriding_parameters}"] = self.overriding_parameters + body["overriding_parameters"] = self.overriding_parameters if self.queue_duration is not None: - body["{queue_duration}"] = self.queue_duration + body["queue_duration"] = self.queue_duration if self.repair_history: - body["{repair_history}"] = self.repair_history + body["repair_history"] = self.repair_history if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_page_url is not None: - body["{run_page_url}"] = self.run_page_url + body["run_page_url"] = self.run_page_url if self.run_type is not None: - body["{run_type}"] = self.run_type + body["run_type"] = self.run_type if self.schedule: - body["{schedule}"] = self.schedule + body["schedule"] = self.schedule if self.setup_duration is not None: - body["{setup_duration}"] = self.setup_duration + body["setup_duration"] = self.setup_duration if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.status: - body["{status}"] = self.status + body["status"] = self.status if self.tasks: - body["{tasks}"] = self.tasks + body["tasks"] = self.tasks if self.trigger is not None: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger if self.trigger_info: - body["{trigger_info}"] = self.trigger_info + body["trigger_info"] = self.trigger_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Run: """Deserializes the Run from a dictionary.""" return cls( - attempt_number=d.get("{attempt_number}", None), - cleanup_duration=d.get("{cleanup_duration}", None), - cluster_instance=_from_dict(d, "{cluster_instance}", ClusterInstance), - cluster_spec=_from_dict(d, "{cluster_spec}", ClusterSpec), - creator_user_name=d.get("{creator_user_name}", None), - description=d.get("{description}", None), - effective_performance_target=_enum(d, "{effective_performance_target}", PerformanceTarget), - end_time=d.get("{end_time}", None), - execution_duration=d.get("{execution_duration}", None), - git_source=_from_dict(d, "{git_source}", GitSource), - has_more=d.get("{has_more}", None), - iterations=_repeated_dict(d, "{iterations}", RunTask), - job_clusters=_repeated_dict(d, "{job_clusters}", JobCluster), - job_id=d.get("{job_id}", None), - job_parameters=_repeated_dict(d, "{job_parameters}", JobParameter), - job_run_id=d.get("{job_run_id}", None), - next_page_token=d.get("{next_page_token}", None), - number_in_job=d.get("{number_in_job}", None), - original_attempt_run_id=d.get("{original_attempt_run_id}", None), - overriding_parameters=_from_dict(d, "{overriding_parameters}", RunParameters), - queue_duration=d.get("{queue_duration}", None), - repair_history=_repeated_dict(d, "{repair_history}", RepairHistoryItem), - run_duration=d.get("{run_duration}", None), - run_id=d.get("{run_id}", None), - run_name=d.get("{run_name}", None), - run_page_url=d.get("{run_page_url}", None), - run_type=_enum(d, "{run_type}", RunType), - schedule=_from_dict(d, "{schedule}", CronSchedule), - setup_duration=d.get("{setup_duration}", None), - start_time=d.get("{start_time}", None), - state=_from_dict(d, "{state}", RunState), - status=_from_dict(d, "{status}", RunStatus), - tasks=_repeated_dict(d, "{tasks}", RunTask), - trigger=_enum(d, "{trigger}", TriggerType), - trigger_info=_from_dict(d, "{trigger_info}", TriggerInfo), + attempt_number=d.get("attempt_number", None), + cleanup_duration=d.get("cleanup_duration", None), + cluster_instance=_from_dict(d, "cluster_instance", ClusterInstance), + cluster_spec=_from_dict(d, "cluster_spec", ClusterSpec), + creator_user_name=d.get("creator_user_name", None), + description=d.get("description", None), + effective_performance_target=_enum(d, "effective_performance_target", PerformanceTarget), + end_time=d.get("end_time", None), + execution_duration=d.get("execution_duration", None), + git_source=_from_dict(d, "git_source", GitSource), + has_more=d.get("has_more", None), + iterations=_repeated_dict(d, "iterations", RunTask), + job_clusters=_repeated_dict(d, "job_clusters", JobCluster), + job_id=d.get("job_id", None), + job_parameters=_repeated_dict(d, "job_parameters", JobParameter), + job_run_id=d.get("job_run_id", None), + next_page_token=d.get("next_page_token", None), + number_in_job=d.get("number_in_job", None), + original_attempt_run_id=d.get("original_attempt_run_id", None), + overriding_parameters=_from_dict(d, "overriding_parameters", RunParameters), + queue_duration=d.get("queue_duration", None), + repair_history=_repeated_dict(d, "repair_history", RepairHistoryItem), + run_duration=d.get("run_duration", None), + run_id=d.get("run_id", None), + run_name=d.get("run_name", None), + run_page_url=d.get("run_page_url", None), + run_type=_enum(d, "run_type", RunType), + schedule=_from_dict(d, "schedule", CronSchedule), + setup_duration=d.get("setup_duration", None), + start_time=d.get("start_time", None), + state=_from_dict(d, "state", RunState), + status=_from_dict(d, "status", RunStatus), + tasks=_repeated_dict(d, "tasks", RunTask), + trigger=_enum(d, "trigger", TriggerType), + trigger_info=_from_dict(d, "trigger_info", TriggerInfo), ) @@ -5524,23 +6289,23 @@ def as_shallow_dict(self) -> dict: """Serializes the RunConditionTask into a shallow dictionary of its immediate attributes.""" body = {} if self.left is not None: - body["{left}"] = self.left + body["left"] = self.left if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.outcome is not None: - body["{outcome}"] = self.outcome + body["outcome"] = self.outcome if self.right is not None: - body["{right}"] = self.right + body["right"] = self.right return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunConditionTask: """Deserializes the RunConditionTask from a dictionary.""" return cls( - left=d.get("{left}", None), - op=_enum(d, "{op}", ConditionTaskOp), - outcome=d.get("{outcome}", None), - right=d.get("{right}", None), + left=d.get("left", None), + op=_enum(d, "op", ConditionTaskOp), + outcome=d.get("outcome", None), + right=d.get("right", None), ) @@ -5577,23 +6342,23 @@ def as_shallow_dict(self) -> dict: """Serializes the RunForEachTask into a shallow dictionary of its immediate attributes.""" body = {} if self.concurrency is not None: - body["{concurrency}"] = self.concurrency + body["concurrency"] = self.concurrency if self.inputs is not None: - body["{inputs}"] = self.inputs + body["inputs"] = self.inputs if self.stats: - body["{stats}"] = self.stats + body["stats"] = self.stats if self.task: - body["{task}"] = self.task + body["task"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunForEachTask: """Deserializes the RunForEachTask from a dictionary.""" return cls( - concurrency=d.get("{concurrency}", None), - inputs=d.get("{inputs}", None), - stats=_from_dict(d, "{stats}", ForEachStats), - task=_from_dict(d, "{task}", Task), + concurrency=d.get("concurrency", None), + inputs=d.get("inputs", None), + stats=_from_dict(d, "stats", ForEachStats), + task=_from_dict(d, "task", Task), ) @@ -5631,13 +6396,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RunJobOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunJobOutput: """Deserializes the RunJobOutput from a dictionary.""" - return cls(run_id=d.get("{run_id}", None)) + return cls(run_id=d.get("run_id", None)) @dataclass @@ -5751,41 +6516,41 @@ def as_shallow_dict(self) -> dict: """Serializes the RunJobTask into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = self.dbt_commands + body["dbt_commands"] = self.dbt_commands if self.jar_params: - body["{jar_params}"] = self.jar_params + body["jar_params"] = self.jar_params if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params + body["pipeline_params"] = self.pipeline_params if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = self.python_params + body["python_params"] = self.python_params if self.spark_submit_params: - body["{spark_submit_params}"] = self.spark_submit_params + body["spark_submit_params"] = self.spark_submit_params if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunJobTask: """Deserializes the RunJobTask from a dictionary.""" return cls( - dbt_commands=d.get("{dbt_commands}", None), - jar_params=d.get("{jar_params}", None), - job_id=d.get("{job_id}", None), - job_parameters=d.get("{job_parameters}", None), - notebook_params=d.get("{notebook_params}", None), - pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), - python_named_params=d.get("{python_named_params}", None), - python_params=d.get("{python_params}", None), - spark_submit_params=d.get("{spark_submit_params}", None), - sql_params=d.get("{sql_params}", None), + dbt_commands=d.get("dbt_commands", None), + jar_params=d.get("jar_params", None), + job_id=d.get("job_id", None), + job_parameters=d.get("job_parameters", None), + notebook_params=d.get("notebook_params", None), + pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), + python_named_params=d.get("python_named_params", None), + python_params=d.get("python_params", None), + spark_submit_params=d.get("spark_submit_params", None), + sql_params=d.get("sql_params", None), ) @@ -5970,53 +6735,53 @@ def as_shallow_dict(self) -> dict: """Serializes the RunNow into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = self.dbt_commands + body["dbt_commands"] = self.dbt_commands if self.idempotency_token is not None: - body["{idempotency_token}"] = self.idempotency_token + body["idempotency_token"] = self.idempotency_token if self.jar_params: - body["{jar_params}"] = self.jar_params + body["jar_params"] = self.jar_params if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_parameters: - body["{job_parameters}"] = self.job_parameters + body["job_parameters"] = self.job_parameters if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.only: - body["{only}"] = self.only + body["only"] = self.only if self.performance_target is not None: - body["{performance_target}"] = self.performance_target + body["performance_target"] = self.performance_target if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params + body["pipeline_params"] = self.pipeline_params if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = self.python_params + body["python_params"] = self.python_params if self.queue: - body["{queue}"] = self.queue + body["queue"] = self.queue if self.spark_submit_params: - body["{spark_submit_params}"] = self.spark_submit_params + body["spark_submit_params"] = self.spark_submit_params if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunNow: """Deserializes the RunNow from a dictionary.""" return cls( - dbt_commands=d.get("{dbt_commands}", None), - idempotency_token=d.get("{idempotency_token}", None), - jar_params=d.get("{jar_params}", None), - job_id=d.get("{job_id}", None), - job_parameters=d.get("{job_parameters}", None), - notebook_params=d.get("{notebook_params}", None), - only=d.get("{only}", None), - performance_target=_enum(d, "{performance_target}", PerformanceTarget), - pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), - python_named_params=d.get("{python_named_params}", None), - python_params=d.get("{python_params}", None), - queue=_from_dict(d, "{queue}", QueueSettings), - spark_submit_params=d.get("{spark_submit_params}", None), - sql_params=d.get("{sql_params}", None), + dbt_commands=d.get("dbt_commands", None), + idempotency_token=d.get("idempotency_token", None), + jar_params=d.get("jar_params", None), + job_id=d.get("job_id", None), + job_parameters=d.get("job_parameters", None), + notebook_params=d.get("notebook_params", None), + only=d.get("only", None), + performance_target=_enum(d, "performance_target", PerformanceTarget), + pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), + python_named_params=d.get("python_named_params", None), + python_params=d.get("python_params", None), + queue=_from_dict(d, "queue", QueueSettings), + spark_submit_params=d.get("spark_submit_params", None), + sql_params=d.get("sql_params", None), ) @@ -6043,15 +6808,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RunNowResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.number_in_job is not None: - body["{number_in_job}"] = self.number_in_job + body["number_in_job"] = self.number_in_job if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunNowResponse: """Deserializes the RunNowResponse from a dictionary.""" - return cls(number_in_job=d.get("{number_in_job}", None), run_id=d.get("{run_id}", None)) + return cls(number_in_job=d.get("number_in_job", None), run_id=d.get("run_id", None)) @dataclass @@ -6133,27 +6898,27 @@ def as_shallow_dict(self) -> dict: """Serializes the RunOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms_notebook_output: - body["{clean_rooms_notebook_output}"] = self.clean_rooms_notebook_output + body["clean_rooms_notebook_output"] = self.clean_rooms_notebook_output if self.dbt_output: - body["{dbt_output}"] = self.dbt_output + body["dbt_output"] = self.dbt_output if self.error is not None: - body["{error}"] = self.error + body["error"] = self.error if self.error_trace is not None: - body["{error_trace}"] = self.error_trace + body["error_trace"] = self.error_trace if self.info is not None: - body["{info}"] = self.info + body["info"] = self.info if self.logs is not None: - body["{logs}"] = self.logs + body["logs"] = self.logs if self.logs_truncated is not None: - body["{logs_truncated}"] = self.logs_truncated + body["logs_truncated"] = self.logs_truncated if self.metadata: - body["{metadata}"] = self.metadata + body["metadata"] = self.metadata if self.notebook_output: - body["{notebook_output}"] = self.notebook_output + body["notebook_output"] = self.notebook_output if self.run_job_output: - body["{run_job_output}"] = self.run_job_output + body["run_job_output"] = self.run_job_output if self.sql_output: - body["{sql_output}"] = self.sql_output + body["sql_output"] = self.sql_output return body @classmethod @@ -6161,18 +6926,18 @@ def from_dict(cls, d: Dict[str, Any]) -> RunOutput: """Deserializes the RunOutput from a dictionary.""" return cls( clean_rooms_notebook_output=_from_dict( - d, "{clean_rooms_notebook_output}", CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput + d, "clean_rooms_notebook_output", CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput ), - dbt_output=_from_dict(d, "{dbt_output}", DbtOutput), - error=d.get("{error}", None), - error_trace=d.get("{error_trace}", None), - info=d.get("{info}", None), - logs=d.get("{logs}", None), - logs_truncated=d.get("{logs_truncated}", None), - metadata=_from_dict(d, "{metadata}", Run), - notebook_output=_from_dict(d, "{notebook_output}", NotebookOutput), - run_job_output=_from_dict(d, "{run_job_output}", RunJobOutput), - sql_output=_from_dict(d, "{sql_output}", SqlOutput), + dbt_output=_from_dict(d, "dbt_output", DbtOutput), + error=d.get("error", None), + error_trace=d.get("error_trace", None), + info=d.get("info", None), + logs=d.get("logs", None), + logs_truncated=d.get("logs_truncated", None), + metadata=_from_dict(d, "metadata", Run), + notebook_output=_from_dict(d, "notebook_output", NotebookOutput), + run_job_output=_from_dict(d, "run_job_output", RunJobOutput), + sql_output=_from_dict(d, "sql_output", SqlOutput), ) @@ -6277,35 +7042,35 @@ def as_shallow_dict(self) -> dict: """Serializes the RunParameters into a shallow dictionary of its immediate attributes.""" body = {} if self.dbt_commands: - body["{dbt_commands}"] = self.dbt_commands + body["dbt_commands"] = self.dbt_commands if self.jar_params: - body["{jar_params}"] = self.jar_params + body["jar_params"] = self.jar_params if self.notebook_params: - body["{notebook_params}"] = self.notebook_params + body["notebook_params"] = self.notebook_params if self.pipeline_params: - body["{pipeline_params}"] = self.pipeline_params + body["pipeline_params"] = self.pipeline_params if self.python_named_params: - body["{python_named_params}"] = self.python_named_params + body["python_named_params"] = self.python_named_params if self.python_params: - body["{python_params}"] = self.python_params + body["python_params"] = self.python_params if self.spark_submit_params: - body["{spark_submit_params}"] = self.spark_submit_params + body["spark_submit_params"] = self.spark_submit_params if self.sql_params: - body["{sql_params}"] = self.sql_params + body["sql_params"] = self.sql_params return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunParameters: """Deserializes the RunParameters from a dictionary.""" return cls( - dbt_commands=d.get("{dbt_commands}", None), - jar_params=d.get("{jar_params}", None), - notebook_params=d.get("{notebook_params}", None), - pipeline_params=_from_dict(d, "{pipeline_params}", PipelineParams), - python_named_params=d.get("{python_named_params}", None), - python_params=d.get("{python_params}", None), - spark_submit_params=d.get("{spark_submit_params}", None), - sql_params=d.get("{sql_params}", None), + dbt_commands=d.get("dbt_commands", None), + jar_params=d.get("jar_params", None), + notebook_params=d.get("notebook_params", None), + pipeline_params=_from_dict(d, "pipeline_params", PipelineParams), + python_named_params=d.get("python_named_params", None), + python_params=d.get("python_params", None), + spark_submit_params=d.get("spark_submit_params", None), + sql_params=d.get("sql_params", None), ) @@ -6373,26 +7138,26 @@ def as_shallow_dict(self) -> dict: """Serializes the RunState into a shallow dictionary of its immediate attributes.""" body = {} if self.life_cycle_state is not None: - body["{life_cycle_state}"] = self.life_cycle_state + body["life_cycle_state"] = self.life_cycle_state if self.queue_reason is not None: - body["{queue_reason}"] = self.queue_reason + body["queue_reason"] = self.queue_reason if self.result_state is not None: - body["{result_state}"] = self.result_state + body["result_state"] = self.result_state if self.state_message is not None: - body["{state_message}"] = self.state_message + body["state_message"] = self.state_message if self.user_cancelled_or_timedout is not None: - body["{user_cancelled_or_timedout}"] = self.user_cancelled_or_timedout + body["user_cancelled_or_timedout"] = self.user_cancelled_or_timedout return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunState: """Deserializes the RunState from a dictionary.""" return cls( - life_cycle_state=_enum(d, "{life_cycle_state}", RunLifeCycleState), - queue_reason=d.get("{queue_reason}", None), - result_state=_enum(d, "{result_state}", RunResultState), - state_message=d.get("{state_message}", None), - user_cancelled_or_timedout=d.get("{user_cancelled_or_timedout}", None), + life_cycle_state=_enum(d, "life_cycle_state", RunLifeCycleState), + queue_reason=d.get("queue_reason", None), + result_state=_enum(d, "result_state", RunResultState), + state_message=d.get("state_message", None), + user_cancelled_or_timedout=d.get("user_cancelled_or_timedout", None), ) @@ -6425,20 +7190,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RunStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.queue_details: - body["{queue_details}"] = self.queue_details + body["queue_details"] = self.queue_details if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.termination_details: - body["{termination_details}"] = self.termination_details + body["termination_details"] = self.termination_details return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunStatus: """Deserializes the RunStatus from a dictionary.""" return cls( - queue_details=_from_dict(d, "{queue_details}", QueueDetails), - state=_enum(d, "{state}", RunLifecycleStateV2State), - termination_details=_from_dict(d, "{termination_details}", TerminationDetails), + queue_details=_from_dict(d, "queue_details", QueueDetails), + state=_enum(d, "state", RunLifecycleStateV2State), + termination_details=_from_dict(d, "termination_details", TerminationDetails), ) @@ -6733,140 +7498,140 @@ def as_shallow_dict(self) -> dict: """Serializes the RunTask into a shallow dictionary of its immediate attributes.""" body = {} if self.attempt_number is not None: - body["{attempt_number}"] = self.attempt_number + body["attempt_number"] = self.attempt_number if self.clean_rooms_notebook_task: - body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task + body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task if self.cleanup_duration is not None: - body["{cleanup_duration}"] = self.cleanup_duration + body["cleanup_duration"] = self.cleanup_duration if self.cluster_instance: - body["{cluster_instance}"] = self.cluster_instance + body["cluster_instance"] = self.cluster_instance if self.condition_task: - body["{condition_task}"] = self.condition_task + body["condition_task"] = self.condition_task if self.dbt_task: - body["{dbt_task}"] = self.dbt_task + body["dbt_task"] = self.dbt_task if self.depends_on: - body["{depends_on}"] = self.depends_on + body["depends_on"] = self.depends_on if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.disabled is not None: - body["{disabled}"] = self.disabled + body["disabled"] = self.disabled if self.effective_performance_target is not None: - body["{effective_performance_target}"] = self.effective_performance_target + body["effective_performance_target"] = self.effective_performance_target if self.email_notifications: - body["{email_notifications}"] = self.email_notifications + body["email_notifications"] = self.email_notifications if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.execution_duration is not None: - body["{execution_duration}"] = self.execution_duration + body["execution_duration"] = self.execution_duration if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.for_each_task: - body["{for_each_task}"] = self.for_each_task + body["for_each_task"] = self.for_each_task if self.gen_ai_compute_task: - body["{gen_ai_compute_task}"] = self.gen_ai_compute_task + body["gen_ai_compute_task"] = self.gen_ai_compute_task if self.git_source: - body["{git_source}"] = self.git_source + body["git_source"] = self.git_source if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.new_cluster: - body["{new_cluster}"] = self.new_cluster + body["new_cluster"] = self.new_cluster if self.notebook_task: - body["{notebook_task}"] = self.notebook_task + body["notebook_task"] = self.notebook_task if self.notification_settings: - body["{notification_settings}"] = self.notification_settings + body["notification_settings"] = self.notification_settings if self.pipeline_task: - body["{pipeline_task}"] = self.pipeline_task + body["pipeline_task"] = self.pipeline_task if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task + body["python_wheel_task"] = self.python_wheel_task if self.queue_duration is not None: - body["{queue_duration}"] = self.queue_duration + body["queue_duration"] = self.queue_duration if self.resolved_values: - body["{resolved_values}"] = self.resolved_values + body["resolved_values"] = self.resolved_values if self.run_duration is not None: - body["{run_duration}"] = self.run_duration + body["run_duration"] = self.run_duration if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_if is not None: - body["{run_if}"] = self.run_if + body["run_if"] = self.run_if if self.run_job_task: - body["{run_job_task}"] = self.run_job_task + body["run_job_task"] = self.run_job_task if self.run_page_url is not None: - body["{run_page_url}"] = self.run_page_url + body["run_page_url"] = self.run_page_url if self.setup_duration is not None: - body["{setup_duration}"] = self.setup_duration + body["setup_duration"] = self.setup_duration if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task + body["spark_jar_task"] = self.spark_jar_task if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task + body["spark_python_task"] = self.spark_python_task if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task + body["spark_submit_task"] = self.spark_submit_task if self.sql_task: - body["{sql_task}"] = self.sql_task + body["sql_task"] = self.sql_task if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.status: - body["{status}"] = self.status + body["status"] = self.status if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications + body["webhook_notifications"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunTask: """Deserializes the RunTask from a dictionary.""" return cls( - attempt_number=d.get("{attempt_number}", None), - clean_rooms_notebook_task=_from_dict(d, "{clean_rooms_notebook_task}", CleanRoomsNotebookTask), - cleanup_duration=d.get("{cleanup_duration}", None), - cluster_instance=_from_dict(d, "{cluster_instance}", ClusterInstance), - condition_task=_from_dict(d, "{condition_task}", RunConditionTask), - dbt_task=_from_dict(d, "{dbt_task}", DbtTask), - depends_on=_repeated_dict(d, "{depends_on}", TaskDependency), - description=d.get("{description}", None), - disabled=d.get("{disabled}", None), - effective_performance_target=_enum(d, "{effective_performance_target}", PerformanceTarget), - email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), - end_time=d.get("{end_time}", None), - environment_key=d.get("{environment_key}", None), - execution_duration=d.get("{execution_duration}", None), - existing_cluster_id=d.get("{existing_cluster_id}", None), - for_each_task=_from_dict(d, "{for_each_task}", RunForEachTask), - gen_ai_compute_task=_from_dict(d, "{gen_ai_compute_task}", GenAiComputeTask), - git_source=_from_dict(d, "{git_source}", GitSource), - job_cluster_key=d.get("{job_cluster_key}", None), - libraries=_repeated_dict(d, "{libraries}", Library), - new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), - notebook_task=_from_dict(d, "{notebook_task}", NotebookTask), - notification_settings=_from_dict(d, "{notification_settings}", TaskNotificationSettings), - pipeline_task=_from_dict(d, "{pipeline_task}", PipelineTask), - python_wheel_task=_from_dict(d, "{python_wheel_task}", PythonWheelTask), - queue_duration=d.get("{queue_duration}", None), - resolved_values=_from_dict(d, "{resolved_values}", ResolvedValues), - run_duration=d.get("{run_duration}", None), - run_id=d.get("{run_id}", None), - run_if=_enum(d, "{run_if}", RunIf), - run_job_task=_from_dict(d, "{run_job_task}", RunJobTask), - run_page_url=d.get("{run_page_url}", None), - setup_duration=d.get("{setup_duration}", None), - spark_jar_task=_from_dict(d, "{spark_jar_task}", SparkJarTask), - spark_python_task=_from_dict(d, "{spark_python_task}", SparkPythonTask), - spark_submit_task=_from_dict(d, "{spark_submit_task}", SparkSubmitTask), - sql_task=_from_dict(d, "{sql_task}", SqlTask), - start_time=d.get("{start_time}", None), - state=_from_dict(d, "{state}", RunState), - status=_from_dict(d, "{status}", RunStatus), - task_key=d.get("{task_key}", None), - timeout_seconds=d.get("{timeout_seconds}", None), - webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), + attempt_number=d.get("attempt_number", None), + clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), + cleanup_duration=d.get("cleanup_duration", None), + cluster_instance=_from_dict(d, "cluster_instance", ClusterInstance), + condition_task=_from_dict(d, "condition_task", RunConditionTask), + dbt_task=_from_dict(d, "dbt_task", DbtTask), + depends_on=_repeated_dict(d, "depends_on", TaskDependency), + description=d.get("description", None), + disabled=d.get("disabled", None), + effective_performance_target=_enum(d, "effective_performance_target", PerformanceTarget), + email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), + end_time=d.get("end_time", None), + environment_key=d.get("environment_key", None), + execution_duration=d.get("execution_duration", None), + existing_cluster_id=d.get("existing_cluster_id", None), + for_each_task=_from_dict(d, "for_each_task", RunForEachTask), + gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), + git_source=_from_dict(d, "git_source", GitSource), + job_cluster_key=d.get("job_cluster_key", None), + libraries=_repeated_dict(d, "libraries", Library), + new_cluster=_from_dict(d, "new_cluster", ClusterSpec), + notebook_task=_from_dict(d, "notebook_task", NotebookTask), + notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), + pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), + python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), + queue_duration=d.get("queue_duration", None), + resolved_values=_from_dict(d, "resolved_values", ResolvedValues), + run_duration=d.get("run_duration", None), + run_id=d.get("run_id", None), + run_if=_enum(d, "run_if", RunIf), + run_job_task=_from_dict(d, "run_job_task", RunJobTask), + run_page_url=d.get("run_page_url", None), + setup_duration=d.get("setup_duration", None), + spark_jar_task=_from_dict(d, "spark_jar_task", SparkJarTask), + spark_python_task=_from_dict(d, "spark_python_task", SparkPythonTask), + spark_submit_task=_from_dict(d, "spark_submit_task", SparkSubmitTask), + sql_task=_from_dict(d, "sql_task", SqlTask), + start_time=d.get("start_time", None), + state=_from_dict(d, "state", RunState), + status=_from_dict(d, "status", RunStatus), + task_key=d.get("task_key", None), + timeout_seconds=d.get("timeout_seconds", None), + webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), ) @@ -6882,6 +7647,102 @@ class RunType(Enum): WORKFLOW_RUN = "WORKFLOW_RUN" +class RuntimeEngine(Enum): + + NULL = "NULL" + PHOTON = "PHOTON" + STANDARD = "STANDARD" + + +@dataclass +class S3StorageInfo: + """A storage location in Amazon S3""" + + destination: str + """S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using cluster + iam role, please make sure you set cluster iam role and the role has write access to the + destination. Please also note that you cannot use AWS keys to deliver logs.""" + + canned_acl: Optional[str] = None + """(Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. If + `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + the destination bucket and prefix. The full list of possible canned acl can be found at + http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. Please also note + that by default only the object owner gets full controls. If you are using cross account role + for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + read the logs.""" + + enable_encryption: Optional[bool] = None + """(Optional) Flag to enable server side encryption, `false` by default.""" + + encryption_type: Optional[str] = None + """(Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + encryption is enabled and the default type is `sse-s3`.""" + + endpoint: Optional[str] = None + """S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be + set. If both are set, endpoint will be used.""" + + kms_key: Optional[str] = None + """(Optional) Kms key which will be used if encryption is enabled and encryption type is set to + `sse-kms`.""" + + region: Optional[str] = None + """S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + endpoint will be used.""" + + def as_dict(self) -> dict: + """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + def as_shallow_dict(self) -> dict: + """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: + """Deserializes the S3StorageInfo from a dictionary.""" + return cls( + canned_acl=d.get("canned_acl", None), + destination=d.get("destination", None), + enable_encryption=d.get("enable_encryption", None), + encryption_type=d.get("encryption_type", None), + endpoint=d.get("endpoint", None), + kms_key=d.get("kms_key", None), + region=d.get("region", None), + ) + + class Source(Enum): """Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\ from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a @@ -6935,23 +7796,23 @@ def as_shallow_dict(self) -> dict: """Serializes the SparkJarTask into a shallow dictionary of its immediate attributes.""" body = {} if self.jar_uri is not None: - body["{jar_uri}"] = self.jar_uri + body["jar_uri"] = self.jar_uri if self.main_class_name is not None: - body["{main_class_name}"] = self.main_class_name + body["main_class_name"] = self.main_class_name if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.run_as_repl is not None: - body["{run_as_repl}"] = self.run_as_repl + body["run_as_repl"] = self.run_as_repl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkJarTask: """Deserializes the SparkJarTask from a dictionary.""" return cls( - jar_uri=d.get("{jar_uri}", None), - main_class_name=d.get("{main_class_name}", None), - parameters=d.get("{parameters}", None), - run_as_repl=d.get("{run_as_repl}", None), + jar_uri=d.get("jar_uri", None), + main_class_name=d.get("main_class_name", None), + parameters=d.get("parameters", None), + run_as_repl=d.get("run_as_repl", None), ) @@ -6994,20 +7855,20 @@ def as_shallow_dict(self) -> dict: """Serializes the SparkPythonTask into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.python_file is not None: - body["{python_file}"] = self.python_file + body["python_file"] = self.python_file if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkPythonTask: """Deserializes the SparkPythonTask from a dictionary.""" return cls( - parameters=d.get("{parameters}", None), - python_file=d.get("{python_file}", None), - source=_enum(d, "{source}", Source), + parameters=d.get("parameters", None), + python_file=d.get("python_file", None), + source=_enum(d, "source", Source), ) @@ -7031,13 +7892,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SparkSubmitTask into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparkSubmitTask: """Deserializes the SparkSubmitTask from a dictionary.""" - return cls(parameters=d.get("{parameters}", None)) + return cls(parameters=d.get("parameters", None)) @dataclass @@ -7080,26 +7941,26 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlAlertOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_state is not None: - body["{alert_state}"] = self.alert_state + body["alert_state"] = self.alert_state if self.output_link is not None: - body["{output_link}"] = self.output_link + body["output_link"] = self.output_link if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.sql_statements: - body["{sql_statements}"] = self.sql_statements + body["sql_statements"] = self.sql_statements if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlAlertOutput: """Deserializes the SqlAlertOutput from a dictionary.""" return cls( - alert_state=_enum(d, "{alert_state}", SqlAlertState), - output_link=d.get("{output_link}", None), - query_text=d.get("{query_text}", None), - sql_statements=_repeated_dict(d, "{sql_statements}", SqlStatementOutput), - warehouse_id=d.get("{warehouse_id}", None), + alert_state=_enum(d, "alert_state", SqlAlertState), + output_link=d.get("output_link", None), + query_text=d.get("query_text", None), + sql_statements=_repeated_dict(d, "sql_statements", SqlStatementOutput), + warehouse_id=d.get("warehouse_id", None), ) @@ -7135,16 +7996,16 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlDashboardOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id if self.widgets: - body["{widgets}"] = self.widgets + body["widgets"] = self.widgets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlDashboardOutput: """Deserializes the SqlDashboardOutput from a dictionary.""" return cls( - warehouse_id=d.get("{warehouse_id}", None), widgets=_repeated_dict(d, "{widgets}", SqlDashboardWidgetOutput) + warehouse_id=d.get("warehouse_id", None), widgets=_repeated_dict(d, "widgets", SqlDashboardWidgetOutput) ) @@ -7194,32 +8055,32 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlDashboardWidgetOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.error: - body["{error}"] = self.error + body["error"] = self.error if self.output_link is not None: - body["{output_link}"] = self.output_link + body["output_link"] = self.output_link if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.widget_id is not None: - body["{widget_id}"] = self.widget_id + body["widget_id"] = self.widget_id if self.widget_title is not None: - body["{widget_title}"] = self.widget_title + body["widget_title"] = self.widget_title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlDashboardWidgetOutput: """Deserializes the SqlDashboardWidgetOutput from a dictionary.""" return cls( - end_time=d.get("{end_time}", None), - error=_from_dict(d, "{error}", SqlOutputError), - output_link=d.get("{output_link}", None), - start_time=d.get("{start_time}", None), - status=_enum(d, "{status}", SqlDashboardWidgetOutputStatus), - widget_id=d.get("{widget_id}", None), - widget_title=d.get("{widget_title}", None), + end_time=d.get("end_time", None), + error=_from_dict(d, "error", SqlOutputError), + output_link=d.get("output_link", None), + start_time=d.get("start_time", None), + status=_enum(d, "status", SqlDashboardWidgetOutputStatus), + widget_id=d.get("widget_id", None), + widget_title=d.get("widget_title", None), ) @@ -7258,20 +8119,20 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_output: - body["{alert_output}"] = self.alert_output + body["alert_output"] = self.alert_output if self.dashboard_output: - body["{dashboard_output}"] = self.dashboard_output + body["dashboard_output"] = self.dashboard_output if self.query_output: - body["{query_output}"] = self.query_output + body["query_output"] = self.query_output return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlOutput: """Deserializes the SqlOutput from a dictionary.""" return cls( - alert_output=_from_dict(d, "{alert_output}", SqlAlertOutput), - dashboard_output=_from_dict(d, "{dashboard_output}", SqlDashboardOutput), - query_output=_from_dict(d, "{query_output}", SqlQueryOutput), + alert_output=_from_dict(d, "alert_output", SqlAlertOutput), + dashboard_output=_from_dict(d, "dashboard_output", SqlDashboardOutput), + query_output=_from_dict(d, "query_output", SqlQueryOutput), ) @@ -7291,13 +8152,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlOutputError into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlOutputError: """Deserializes the SqlOutputError from a dictionary.""" - return cls(message=d.get("{message}", None)) + return cls(message=d.get("message", None)) @dataclass @@ -7335,26 +8196,26 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlQueryOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_id is not None: - body["{endpoint_id}"] = self.endpoint_id + body["endpoint_id"] = self.endpoint_id if self.output_link is not None: - body["{output_link}"] = self.output_link + body["output_link"] = self.output_link if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.sql_statements: - body["{sql_statements}"] = self.sql_statements + body["sql_statements"] = self.sql_statements if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlQueryOutput: """Deserializes the SqlQueryOutput from a dictionary.""" return cls( - endpoint_id=d.get("{endpoint_id}", None), - output_link=d.get("{output_link}", None), - query_text=d.get("{query_text}", None), - sql_statements=_repeated_dict(d, "{sql_statements}", SqlStatementOutput), - warehouse_id=d.get("{warehouse_id}", None), + endpoint_id=d.get("endpoint_id", None), + output_link=d.get("output_link", None), + query_text=d.get("query_text", None), + sql_statements=_repeated_dict(d, "sql_statements", SqlStatementOutput), + warehouse_id=d.get("warehouse_id", None), ) @@ -7374,13 +8235,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlStatementOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.lookup_key is not None: - body["{lookup_key}"] = self.lookup_key + body["lookup_key"] = self.lookup_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlStatementOutput: """Deserializes the SqlStatementOutput from a dictionary.""" - return cls(lookup_key=d.get("{lookup_key}", None)) + return cls(lookup_key=d.get("lookup_key", None)) @dataclass @@ -7427,29 +8288,29 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlTask into a shallow dictionary of its immediate attributes.""" body = {} if self.alert: - body["{alert}"] = self.alert + body["alert"] = self.alert if self.dashboard: - body["{dashboard}"] = self.dashboard + body["dashboard"] = self.dashboard if self.file: - body["{file}"] = self.file + body["file"] = self.file if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.query: - body["{query}"] = self.query + body["query"] = self.query if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTask: """Deserializes the SqlTask from a dictionary.""" return cls( - alert=_from_dict(d, "{alert}", SqlTaskAlert), - dashboard=_from_dict(d, "{dashboard}", SqlTaskDashboard), - file=_from_dict(d, "{file}", SqlTaskFile), - parameters=d.get("{parameters}", None), - query=_from_dict(d, "{query}", SqlTaskQuery), - warehouse_id=d.get("{warehouse_id}", None), + alert=_from_dict(d, "alert", SqlTaskAlert), + dashboard=_from_dict(d, "dashboard", SqlTaskDashboard), + file=_from_dict(d, "file", SqlTaskFile), + parameters=d.get("parameters", None), + query=_from_dict(d, "query", SqlTaskQuery), + warehouse_id=d.get("warehouse_id", None), ) @@ -7479,20 +8340,20 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlTaskAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_id is not None: - body["{alert_id}"] = self.alert_id + body["alert_id"] = self.alert_id if self.pause_subscriptions is not None: - body["{pause_subscriptions}"] = self.pause_subscriptions + body["pause_subscriptions"] = self.pause_subscriptions if self.subscriptions: - body["{subscriptions}"] = self.subscriptions + body["subscriptions"] = self.subscriptions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskAlert: """Deserializes the SqlTaskAlert from a dictionary.""" return cls( - alert_id=d.get("{alert_id}", None), - pause_subscriptions=d.get("{pause_subscriptions}", None), - subscriptions=_repeated_dict(d, "{subscriptions}", SqlTaskSubscription), + alert_id=d.get("alert_id", None), + pause_subscriptions=d.get("pause_subscriptions", None), + subscriptions=_repeated_dict(d, "subscriptions", SqlTaskSubscription), ) @@ -7527,23 +8388,23 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlTaskDashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.pause_subscriptions is not None: - body["{pause_subscriptions}"] = self.pause_subscriptions + body["pause_subscriptions"] = self.pause_subscriptions if self.subscriptions: - body["{subscriptions}"] = self.subscriptions + body["subscriptions"] = self.subscriptions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskDashboard: """Deserializes the SqlTaskDashboard from a dictionary.""" return cls( - custom_subject=d.get("{custom_subject}", None), - dashboard_id=d.get("{dashboard_id}", None), - pause_subscriptions=d.get("{pause_subscriptions}", None), - subscriptions=_repeated_dict(d, "{subscriptions}", SqlTaskSubscription), + custom_subject=d.get("custom_subject", None), + dashboard_id=d.get("dashboard_id", None), + pause_subscriptions=d.get("pause_subscriptions", None), + subscriptions=_repeated_dict(d, "subscriptions", SqlTaskSubscription), ) @@ -7575,15 +8436,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlTaskFile into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskFile: """Deserializes the SqlTaskFile from a dictionary.""" - return cls(path=d.get("{path}", None), source=_enum(d, "{source}", Source)) + return cls(path=d.get("path", None), source=_enum(d, "source", Source)) @dataclass @@ -7602,13 +8463,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlTaskQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskQuery: """Deserializes the SqlTaskQuery from a dictionary.""" - return cls(query_id=d.get("{query_id}", None)) + return cls(query_id=d.get("query_id", None)) @dataclass @@ -7635,15 +8496,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SqlTaskSubscription into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_id is not None: - body["{destination_id}"] = self.destination_id + body["destination_id"] = self.destination_id if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SqlTaskSubscription: """Deserializes the SqlTaskSubscription from a dictionary.""" - return cls(destination_id=d.get("{destination_id}", None), user_name=d.get("{user_name}", None)) + return cls(destination_id=d.get("destination_id", None), user_name=d.get("user_name", None)) @dataclass @@ -7747,53 +8608,53 @@ def as_shallow_dict(self) -> dict: """Serializes the SubmitRun into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.email_notifications: - body["{email_notifications}"] = self.email_notifications + body["email_notifications"] = self.email_notifications if self.environments: - body["{environments}"] = self.environments + body["environments"] = self.environments if self.git_source: - body["{git_source}"] = self.git_source + body["git_source"] = self.git_source if self.health: - body["{health}"] = self.health + body["health"] = self.health if self.idempotency_token is not None: - body["{idempotency_token}"] = self.idempotency_token + body["idempotency_token"] = self.idempotency_token if self.notification_settings: - body["{notification_settings}"] = self.notification_settings + body["notification_settings"] = self.notification_settings if self.queue: - body["{queue}"] = self.queue + body["queue"] = self.queue if self.run_as: - body["{run_as}"] = self.run_as + body["run_as"] = self.run_as if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.tasks: - body["{tasks}"] = self.tasks + body["tasks"] = self.tasks if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications + body["webhook_notifications"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubmitRun: """Deserializes the SubmitRun from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", JobAccessControlRequest), - budget_policy_id=d.get("{budget_policy_id}", None), - email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), - environments=_repeated_dict(d, "{environments}", JobEnvironment), - git_source=_from_dict(d, "{git_source}", GitSource), - health=_from_dict(d, "{health}", JobsHealthRules), - idempotency_token=d.get("{idempotency_token}", None), - notification_settings=_from_dict(d, "{notification_settings}", JobNotificationSettings), - queue=_from_dict(d, "{queue}", QueueSettings), - run_as=_from_dict(d, "{run_as}", JobRunAs), - run_name=d.get("{run_name}", None), - tasks=_repeated_dict(d, "{tasks}", SubmitTask), - timeout_seconds=d.get("{timeout_seconds}", None), - webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), + access_control_list=_repeated_dict(d, "access_control_list", JobAccessControlRequest), + budget_policy_id=d.get("budget_policy_id", None), + email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), + environments=_repeated_dict(d, "environments", JobEnvironment), + git_source=_from_dict(d, "git_source", GitSource), + health=_from_dict(d, "health", JobsHealthRules), + idempotency_token=d.get("idempotency_token", None), + notification_settings=_from_dict(d, "notification_settings", JobNotificationSettings), + queue=_from_dict(d, "queue", QueueSettings), + run_as=_from_dict(d, "run_as", JobRunAs), + run_name=d.get("run_name", None), + tasks=_repeated_dict(d, "tasks", SubmitTask), + timeout_seconds=d.get("timeout_seconds", None), + webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), ) @@ -7815,13 +8676,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SubmitRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubmitRunResponse: """Deserializes the SubmitRunResponse from a dictionary.""" - return cls(run_id=d.get("{run_id}", None)) + return cls(run_id=d.get("run_id", None)) @dataclass @@ -7880,7 +8741,7 @@ class SubmitTask: """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[ClusterSpec] = None + new_cluster: Optional[JobsClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8001,89 +8862,89 @@ def as_shallow_dict(self) -> dict: """Serializes the SubmitTask into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms_notebook_task: - body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task + body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task if self.condition_task: - body["{condition_task}"] = self.condition_task + body["condition_task"] = self.condition_task if self.dbt_task: - body["{dbt_task}"] = self.dbt_task + body["dbt_task"] = self.dbt_task if self.depends_on: - body["{depends_on}"] = self.depends_on + body["depends_on"] = self.depends_on if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.email_notifications: - body["{email_notifications}"] = self.email_notifications + body["email_notifications"] = self.email_notifications if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.for_each_task: - body["{for_each_task}"] = self.for_each_task + body["for_each_task"] = self.for_each_task if self.gen_ai_compute_task: - body["{gen_ai_compute_task}"] = self.gen_ai_compute_task + body["gen_ai_compute_task"] = self.gen_ai_compute_task if self.health: - body["{health}"] = self.health + body["health"] = self.health if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.new_cluster: - body["{new_cluster}"] = self.new_cluster + body["new_cluster"] = self.new_cluster if self.notebook_task: - body["{notebook_task}"] = self.notebook_task + body["notebook_task"] = self.notebook_task if self.notification_settings: - body["{notification_settings}"] = self.notification_settings + body["notification_settings"] = self.notification_settings if self.pipeline_task: - body["{pipeline_task}"] = self.pipeline_task + body["pipeline_task"] = self.pipeline_task if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task + body["python_wheel_task"] = self.python_wheel_task if self.run_if is not None: - body["{run_if}"] = self.run_if + body["run_if"] = self.run_if if self.run_job_task: - body["{run_job_task}"] = self.run_job_task + body["run_job_task"] = self.run_job_task if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task + body["spark_jar_task"] = self.spark_jar_task if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task + body["spark_python_task"] = self.spark_python_task if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task + body["spark_submit_task"] = self.spark_submit_task if self.sql_task: - body["{sql_task}"] = self.sql_task + body["sql_task"] = self.sql_task if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications + body["webhook_notifications"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: """Deserializes the SubmitTask from a dictionary.""" return cls( - clean_rooms_notebook_task=_from_dict(d, "{clean_rooms_notebook_task}", CleanRoomsNotebookTask), - condition_task=_from_dict(d, "{condition_task}", ConditionTask), - dbt_task=_from_dict(d, "{dbt_task}", DbtTask), - depends_on=_repeated_dict(d, "{depends_on}", TaskDependency), - description=d.get("{description}", None), - email_notifications=_from_dict(d, "{email_notifications}", JobEmailNotifications), - environment_key=d.get("{environment_key}", None), - existing_cluster_id=d.get("{existing_cluster_id}", None), - for_each_task=_from_dict(d, "{for_each_task}", ForEachTask), - gen_ai_compute_task=_from_dict(d, "{gen_ai_compute_task}", GenAiComputeTask), - health=_from_dict(d, "{health}", JobsHealthRules), - libraries=_repeated_dict(d, "{libraries}", Library), - new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), - notebook_task=_from_dict(d, "{notebook_task}", NotebookTask), - notification_settings=_from_dict(d, "{notification_settings}", TaskNotificationSettings), - pipeline_task=_from_dict(d, "{pipeline_task}", PipelineTask), - python_wheel_task=_from_dict(d, "{python_wheel_task}", PythonWheelTask), - run_if=_enum(d, "{run_if}", RunIf), - run_job_task=_from_dict(d, "{run_job_task}", RunJobTask), - spark_jar_task=_from_dict(d, "{spark_jar_task}", SparkJarTask), - spark_python_task=_from_dict(d, "{spark_python_task}", SparkPythonTask), - spark_submit_task=_from_dict(d, "{spark_submit_task}", SparkSubmitTask), - sql_task=_from_dict(d, "{sql_task}", SqlTask), - task_key=d.get("{task_key}", None), - timeout_seconds=d.get("{timeout_seconds}", None), - webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), + clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), + condition_task=_from_dict(d, "condition_task", ConditionTask), + dbt_task=_from_dict(d, "dbt_task", DbtTask), + depends_on=_repeated_dict(d, "depends_on", TaskDependency), + description=d.get("description", None), + email_notifications=_from_dict(d, "email_notifications", JobEmailNotifications), + environment_key=d.get("environment_key", None), + existing_cluster_id=d.get("existing_cluster_id", None), + for_each_task=_from_dict(d, "for_each_task", ForEachTask), + gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), + health=_from_dict(d, "health", JobsHealthRules), + libraries=_repeated_dict(d, "libraries", Library), + new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), + notebook_task=_from_dict(d, "notebook_task", NotebookTask), + notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), + pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), + python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), + run_if=_enum(d, "run_if", RunIf), + run_job_task=_from_dict(d, "run_job_task", RunJobTask), + spark_jar_task=_from_dict(d, "spark_jar_task", SparkJarTask), + spark_python_task=_from_dict(d, "spark_python_task", SparkPythonTask), + spark_submit_task=_from_dict(d, "spark_submit_task", SparkSubmitTask), + sql_task=_from_dict(d, "sql_task", SqlTask), + task_key=d.get("task_key", None), + timeout_seconds=d.get("timeout_seconds", None), + webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), ) @@ -8122,23 +8983,23 @@ def as_shallow_dict(self) -> dict: """Serializes the TableUpdateTriggerConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.condition is not None: - body["{condition}"] = self.condition + body["condition"] = self.condition if self.min_time_between_triggers_seconds is not None: - body["{min_time_between_triggers_seconds}"] = self.min_time_between_triggers_seconds + body["min_time_between_triggers_seconds"] = self.min_time_between_triggers_seconds if self.table_names: - body["{table_names}"] = self.table_names + body["table_names"] = self.table_names if self.wait_after_last_change_seconds is not None: - body["{wait_after_last_change_seconds}"] = self.wait_after_last_change_seconds + body["wait_after_last_change_seconds"] = self.wait_after_last_change_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableUpdateTriggerConfiguration: """Deserializes the TableUpdateTriggerConfiguration from a dictionary.""" return cls( - condition=_enum(d, "{condition}", Condition), - min_time_between_triggers_seconds=d.get("{min_time_between_triggers_seconds}", None), - table_names=d.get("{table_names}", None), - wait_after_last_change_seconds=d.get("{wait_after_last_change_seconds}", None), + condition=_enum(d, "condition", Condition), + min_time_between_triggers_seconds=d.get("min_time_between_triggers_seconds", None), + table_names=d.get("table_names", None), + wait_after_last_change_seconds=d.get("wait_after_last_change_seconds", None), ) @@ -8216,7 +9077,7 @@ class Task: """An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.""" - new_cluster: Optional[ClusterSpec] = None + new_cluster: Optional[JobsClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8354,104 +9215,104 @@ def as_shallow_dict(self) -> dict: """Serializes the Task into a shallow dictionary of its immediate attributes.""" body = {} if self.clean_rooms_notebook_task: - body["{clean_rooms_notebook_task}"] = self.clean_rooms_notebook_task + body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task if self.condition_task: - body["{condition_task}"] = self.condition_task + body["condition_task"] = self.condition_task if self.dbt_task: - body["{dbt_task}"] = self.dbt_task + body["dbt_task"] = self.dbt_task if self.depends_on: - body["{depends_on}"] = self.depends_on + body["depends_on"] = self.depends_on if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.disable_auto_optimization is not None: - body["{disable_auto_optimization}"] = self.disable_auto_optimization + body["disable_auto_optimization"] = self.disable_auto_optimization if self.email_notifications: - body["{email_notifications}"] = self.email_notifications + body["email_notifications"] = self.email_notifications if self.environment_key is not None: - body["{environment_key}"] = self.environment_key + body["environment_key"] = self.environment_key if self.existing_cluster_id is not None: - body["{existing_cluster_id}"] = self.existing_cluster_id + body["existing_cluster_id"] = self.existing_cluster_id if self.for_each_task: - body["{for_each_task}"] = self.for_each_task + body["for_each_task"] = self.for_each_task if self.gen_ai_compute_task: - body["{gen_ai_compute_task}"] = self.gen_ai_compute_task + body["gen_ai_compute_task"] = self.gen_ai_compute_task if self.health: - body["{health}"] = self.health + body["health"] = self.health if self.job_cluster_key is not None: - body["{job_cluster_key}"] = self.job_cluster_key + body["job_cluster_key"] = self.job_cluster_key if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.max_retries is not None: - body["{max_retries}"] = self.max_retries + body["max_retries"] = self.max_retries if self.min_retry_interval_millis is not None: - body["{min_retry_interval_millis}"] = self.min_retry_interval_millis + body["min_retry_interval_millis"] = self.min_retry_interval_millis if self.new_cluster: - body["{new_cluster}"] = self.new_cluster + body["new_cluster"] = self.new_cluster if self.notebook_task: - body["{notebook_task}"] = self.notebook_task + body["notebook_task"] = self.notebook_task if self.notification_settings: - body["{notification_settings}"] = self.notification_settings + body["notification_settings"] = self.notification_settings if self.pipeline_task: - body["{pipeline_task}"] = self.pipeline_task + body["pipeline_task"] = self.pipeline_task if self.python_wheel_task: - body["{python_wheel_task}"] = self.python_wheel_task + body["python_wheel_task"] = self.python_wheel_task if self.retry_on_timeout is not None: - body["{retry_on_timeout}"] = self.retry_on_timeout + body["retry_on_timeout"] = self.retry_on_timeout if self.run_if is not None: - body["{run_if}"] = self.run_if + body["run_if"] = self.run_if if self.run_job_task: - body["{run_job_task}"] = self.run_job_task + body["run_job_task"] = self.run_job_task if self.spark_jar_task: - body["{spark_jar_task}"] = self.spark_jar_task + body["spark_jar_task"] = self.spark_jar_task if self.spark_python_task: - body["{spark_python_task}"] = self.spark_python_task + body["spark_python_task"] = self.spark_python_task if self.spark_submit_task: - body["{spark_submit_task}"] = self.spark_submit_task + body["spark_submit_task"] = self.spark_submit_task if self.sql_task: - body["{sql_task}"] = self.sql_task + body["sql_task"] = self.sql_task if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key if self.timeout_seconds is not None: - body["{timeout_seconds}"] = self.timeout_seconds + body["timeout_seconds"] = self.timeout_seconds if self.webhook_notifications: - body["{webhook_notifications}"] = self.webhook_notifications + body["webhook_notifications"] = self.webhook_notifications return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Task: """Deserializes the Task from a dictionary.""" return cls( - clean_rooms_notebook_task=_from_dict(d, "{clean_rooms_notebook_task}", CleanRoomsNotebookTask), - condition_task=_from_dict(d, "{condition_task}", ConditionTask), - dbt_task=_from_dict(d, "{dbt_task}", DbtTask), - depends_on=_repeated_dict(d, "{depends_on}", TaskDependency), - description=d.get("{description}", None), - disable_auto_optimization=d.get("{disable_auto_optimization}", None), - email_notifications=_from_dict(d, "{email_notifications}", TaskEmailNotifications), - environment_key=d.get("{environment_key}", None), - existing_cluster_id=d.get("{existing_cluster_id}", None), - for_each_task=_from_dict(d, "{for_each_task}", ForEachTask), - gen_ai_compute_task=_from_dict(d, "{gen_ai_compute_task}", GenAiComputeTask), - health=_from_dict(d, "{health}", JobsHealthRules), - job_cluster_key=d.get("{job_cluster_key}", None), - libraries=_repeated_dict(d, "{libraries}", Library), - max_retries=d.get("{max_retries}", None), - min_retry_interval_millis=d.get("{min_retry_interval_millis}", None), - new_cluster=_from_dict(d, "{new_cluster}", ClusterSpec), - notebook_task=_from_dict(d, "{notebook_task}", NotebookTask), - notification_settings=_from_dict(d, "{notification_settings}", TaskNotificationSettings), - pipeline_task=_from_dict(d, "{pipeline_task}", PipelineTask), - python_wheel_task=_from_dict(d, "{python_wheel_task}", PythonWheelTask), - retry_on_timeout=d.get("{retry_on_timeout}", None), - run_if=_enum(d, "{run_if}", RunIf), - run_job_task=_from_dict(d, "{run_job_task}", RunJobTask), - spark_jar_task=_from_dict(d, "{spark_jar_task}", SparkJarTask), - spark_python_task=_from_dict(d, "{spark_python_task}", SparkPythonTask), - spark_submit_task=_from_dict(d, "{spark_submit_task}", SparkSubmitTask), - sql_task=_from_dict(d, "{sql_task}", SqlTask), - task_key=d.get("{task_key}", None), - timeout_seconds=d.get("{timeout_seconds}", None), - webhook_notifications=_from_dict(d, "{webhook_notifications}", WebhookNotifications), + clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), + condition_task=_from_dict(d, "condition_task", ConditionTask), + dbt_task=_from_dict(d, "dbt_task", DbtTask), + depends_on=_repeated_dict(d, "depends_on", TaskDependency), + description=d.get("description", None), + disable_auto_optimization=d.get("disable_auto_optimization", None), + email_notifications=_from_dict(d, "email_notifications", TaskEmailNotifications), + environment_key=d.get("environment_key", None), + existing_cluster_id=d.get("existing_cluster_id", None), + for_each_task=_from_dict(d, "for_each_task", ForEachTask), + gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), + health=_from_dict(d, "health", JobsHealthRules), + job_cluster_key=d.get("job_cluster_key", None), + libraries=_repeated_dict(d, "libraries", Library), + max_retries=d.get("max_retries", None), + min_retry_interval_millis=d.get("min_retry_interval_millis", None), + new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), + notebook_task=_from_dict(d, "notebook_task", NotebookTask), + notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), + pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), + python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), + retry_on_timeout=d.get("retry_on_timeout", None), + run_if=_enum(d, "run_if", RunIf), + run_job_task=_from_dict(d, "run_job_task", RunJobTask), + spark_jar_task=_from_dict(d, "spark_jar_task", SparkJarTask), + spark_python_task=_from_dict(d, "spark_python_task", SparkPythonTask), + spark_submit_task=_from_dict(d, "spark_submit_task", SparkSubmitTask), + sql_task=_from_dict(d, "sql_task", SqlTask), + task_key=d.get("task_key", None), + timeout_seconds=d.get("timeout_seconds", None), + webhook_notifications=_from_dict(d, "webhook_notifications", WebhookNotifications), ) @@ -8477,15 +9338,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TaskDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.outcome is not None: - body["{outcome}"] = self.outcome + body["outcome"] = self.outcome if self.task_key is not None: - body["{task_key}"] = self.task_key + body["task_key"] = self.task_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TaskDependency: """Deserializes the TaskDependency from a dictionary.""" - return cls(outcome=d.get("{outcome}", None), task_key=d.get("{task_key}", None)) + return cls(outcome=d.get("outcome", None), task_key=d.get("task_key", None)) @dataclass @@ -8544,29 +9405,29 @@ def as_shallow_dict(self) -> dict: """Serializes the TaskEmailNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs if self.on_duration_warning_threshold_exceeded: - body["{on_duration_warning_threshold_exceeded}"] = self.on_duration_warning_threshold_exceeded + body["on_duration_warning_threshold_exceeded"] = self.on_duration_warning_threshold_exceeded if self.on_failure: - body["{on_failure}"] = self.on_failure + body["on_failure"] = self.on_failure if self.on_start: - body["{on_start}"] = self.on_start + body["on_start"] = self.on_start if self.on_streaming_backlog_exceeded: - body["{on_streaming_backlog_exceeded}"] = self.on_streaming_backlog_exceeded + body["on_streaming_backlog_exceeded"] = self.on_streaming_backlog_exceeded if self.on_success: - body["{on_success}"] = self.on_success + body["on_success"] = self.on_success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TaskEmailNotifications: """Deserializes the TaskEmailNotifications from a dictionary.""" return cls( - no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), - on_duration_warning_threshold_exceeded=d.get("{on_duration_warning_threshold_exceeded}", None), - on_failure=d.get("{on_failure}", None), - on_start=d.get("{on_start}", None), - on_streaming_backlog_exceeded=d.get("{on_streaming_backlog_exceeded}", None), - on_success=d.get("{on_success}", None), + no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), + on_duration_warning_threshold_exceeded=d.get("on_duration_warning_threshold_exceeded", None), + on_failure=d.get("on_failure", None), + on_start=d.get("on_start", None), + on_streaming_backlog_exceeded=d.get("on_streaming_backlog_exceeded", None), + on_success=d.get("on_success", None), ) @@ -8600,20 +9461,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TaskNotificationSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_on_last_attempt is not None: - body["{alert_on_last_attempt}"] = self.alert_on_last_attempt + body["alert_on_last_attempt"] = self.alert_on_last_attempt if self.no_alert_for_canceled_runs is not None: - body["{no_alert_for_canceled_runs}"] = self.no_alert_for_canceled_runs + body["no_alert_for_canceled_runs"] = self.no_alert_for_canceled_runs if self.no_alert_for_skipped_runs is not None: - body["{no_alert_for_skipped_runs}"] = self.no_alert_for_skipped_runs + body["no_alert_for_skipped_runs"] = self.no_alert_for_skipped_runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TaskNotificationSettings: """Deserializes the TaskNotificationSettings from a dictionary.""" return cls( - alert_on_last_attempt=d.get("{alert_on_last_attempt}", None), - no_alert_for_canceled_runs=d.get("{no_alert_for_canceled_runs}", None), - no_alert_for_skipped_runs=d.get("{no_alert_for_skipped_runs}", None), + alert_on_last_attempt=d.get("alert_on_last_attempt", None), + no_alert_for_canceled_runs=d.get("no_alert_for_canceled_runs", None), + no_alert_for_skipped_runs=d.get("no_alert_for_skipped_runs", None), ) @@ -8746,20 +9607,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TerminationDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["{code}"] = self.code + body["code"] = self.code if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TerminationDetails: """Deserializes the TerminationDetails from a dictionary.""" return cls( - code=_enum(d, "{code}", TerminationCodeCode), - message=d.get("{message}", None), - type=_enum(d, "{type}", TerminationTypeType), + code=_enum(d, "code", TerminationCodeCode), + message=d.get("message", None), + type=_enum(d, "type", TerminationTypeType), ) @@ -8796,13 +9657,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TriggerInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TriggerInfo: """Deserializes the TriggerInfo from a dictionary.""" - return cls(run_id=d.get("{run_id}", None)) + return cls(run_id=d.get("run_id", None)) @dataclass @@ -8840,26 +9701,26 @@ def as_shallow_dict(self) -> dict: """Serializes the TriggerSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.file_arrival: - body["{file_arrival}"] = self.file_arrival + body["file_arrival"] = self.file_arrival if self.pause_status is not None: - body["{pause_status}"] = self.pause_status + body["pause_status"] = self.pause_status if self.periodic: - body["{periodic}"] = self.periodic + body["periodic"] = self.periodic if self.table: - body["{table}"] = self.table + body["table"] = self.table if self.table_update: - body["{table_update}"] = self.table_update + body["table_update"] = self.table_update return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TriggerSettings: """Deserializes the TriggerSettings from a dictionary.""" return cls( - file_arrival=_from_dict(d, "{file_arrival}", FileArrivalTriggerConfiguration), - pause_status=_enum(d, "{pause_status}", PauseStatus), - periodic=_from_dict(d, "{periodic}", PeriodicTriggerConfiguration), - table=_from_dict(d, "{table}", TableUpdateTriggerConfiguration), - table_update=_from_dict(d, "{table_update}", TableUpdateTriggerConfiguration), + file_arrival=_from_dict(d, "file_arrival", FileArrivalTriggerConfiguration), + pause_status=_enum(d, "pause_status", PauseStatus), + periodic=_from_dict(d, "periodic", PeriodicTriggerConfiguration), + table=_from_dict(d, "table", TableUpdateTriggerConfiguration), + table_update=_from_dict(d, "table_update", TableUpdateTriggerConfiguration), ) @@ -8919,20 +9780,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateJob into a shallow dictionary of its immediate attributes.""" body = {} if self.fields_to_remove: - body["{fields_to_remove}"] = self.fields_to_remove + body["fields_to_remove"] = self.fields_to_remove if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.new_settings: - body["{new_settings}"] = self.new_settings + body["new_settings"] = self.new_settings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateJob: """Deserializes the UpdateJob from a dictionary.""" return cls( - fields_to_remove=d.get("{fields_to_remove}", None), - job_id=d.get("{job_id}", None), - new_settings=_from_dict(d, "{new_settings}", JobSettings), + fields_to_remove=d.get("fields_to_remove", None), + job_id=d.get("job_id", None), + new_settings=_from_dict(d, "new_settings", JobSettings), ) @@ -8981,17 +9842,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ViewItem into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ViewItem: """Deserializes the ViewItem from a dictionary.""" - return cls(content=d.get("{content}", None), name=d.get("{name}", None), type=_enum(d, "{type}", ViewType)) + return cls(content=d.get("content", None), name=d.get("name", None), type=_enum(d, "type", ViewType)) class ViewType(Enum): @@ -9010,6 +9871,34 @@ class ViewsToExport(Enum): DASHBOARDS = "DASHBOARDS" +@dataclass +class VolumesStorageInfo: + """A storage location back by UC Volumes.""" + + destination: str + """UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` or + `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: + """Deserializes the VolumesStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class Webhook: id: str @@ -9025,13 +9914,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Webhook into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Webhook: """Deserializes the Webhook from a dictionary.""" - return cls(id=d.get("{id}", None)) + return cls(id=d.get("id", None)) @dataclass @@ -9082,31 +9971,83 @@ def as_shallow_dict(self) -> dict: """Serializes the WebhookNotifications into a shallow dictionary of its immediate attributes.""" body = {} if self.on_duration_warning_threshold_exceeded: - body["{on_duration_warning_threshold_exceeded}"] = self.on_duration_warning_threshold_exceeded + body["on_duration_warning_threshold_exceeded"] = self.on_duration_warning_threshold_exceeded if self.on_failure: - body["{on_failure}"] = self.on_failure + body["on_failure"] = self.on_failure if self.on_start: - body["{on_start}"] = self.on_start + body["on_start"] = self.on_start if self.on_streaming_backlog_exceeded: - body["{on_streaming_backlog_exceeded}"] = self.on_streaming_backlog_exceeded + body["on_streaming_backlog_exceeded"] = self.on_streaming_backlog_exceeded if self.on_success: - body["{on_success}"] = self.on_success + body["on_success"] = self.on_success return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WebhookNotifications: """Deserializes the WebhookNotifications from a dictionary.""" return cls( - on_duration_warning_threshold_exceeded=_repeated_dict( - d, "{on_duration_warning_threshold_exceeded}", Webhook - ), - on_failure=_repeated_dict(d, "{on_failure}", Webhook), - on_start=_repeated_dict(d, "{on_start}", Webhook), - on_streaming_backlog_exceeded=_repeated_dict(d, "{on_streaming_backlog_exceeded}", Webhook), - on_success=_repeated_dict(d, "{on_success}", Webhook), + on_duration_warning_threshold_exceeded=_repeated_dict(d, "on_duration_warning_threshold_exceeded", Webhook), + on_failure=_repeated_dict(d, "on_failure", Webhook), + on_start=_repeated_dict(d, "on_start", Webhook), + on_streaming_backlog_exceeded=_repeated_dict(d, "on_streaming_backlog_exceeded", Webhook), + on_success=_repeated_dict(d, "on_success", Webhook), ) +@dataclass +class WorkloadType: + """Cluster Attributes showing for clusters workload types.""" + + clients: ClientsTypes + """defined what type of clients can use the cluster. E.g. Notebooks, Jobs""" + + def as_dict(self) -> dict: + """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.clients: + body["clients"] = self.clients.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" + body = {} + if self.clients: + body["clients"] = self.clients + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: + """Deserializes the WorkloadType from a dictionary.""" + return cls(clients=_from_dict(d, "clients", ClientsTypes)) + + +@dataclass +class WorkspaceStorageInfo: + """A storage location in Workspace Filesystem (WSFS)""" + + destination: str + """wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: + """Deserializes the WorkspaceStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + class JobsAPI: """The Jobs API allows you to create, edit, and delete jobs. @@ -9143,9 +10084,9 @@ def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Opt """ body = {} if all_queued_runs is not None: - body["{all_queued_runs}"] = all_queued_runs + body["all_queued_runs"] = all_queued_runs if job_id is not None: - body["{job_id}"] = job_id + body["job_id"] = job_id headers = { "0": "{Content-Type application/json}", } @@ -9167,7 +10108,7 @@ def cancel_run(self, run_id: int) -> Wait[Run]: """ body = {} if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id headers = { "0": "{Content-Type application/json}", } @@ -9307,55 +10248,55 @@ def create( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] if budget_policy_id is not None: - body["{budget_policy_id}"] = budget_policy_id + body["budget_policy_id"] = budget_policy_id if continuous is not None: - body["{continuous}"] = continuous.as_dict() + body["continuous"] = continuous.as_dict() if deployment is not None: - body["{deployment}"] = deployment.as_dict() + body["deployment"] = deployment.as_dict() if description is not None: - body["{description}"] = description + body["description"] = description if edit_mode is not None: - body["{edit_mode}"] = edit_mode.value + body["edit_mode"] = edit_mode.value if email_notifications is not None: - body["{email_notifications}"] = email_notifications.as_dict() + body["email_notifications"] = email_notifications.as_dict() if environments is not None: - body["{environments}"] = [v.as_dict() for v in environments] + body["environments"] = [v.as_dict() for v in environments] if format is not None: - body["{format}"] = format.value + body["format"] = format.value if git_source is not None: - body["{git_source}"] = git_source.as_dict() + body["git_source"] = git_source.as_dict() if health is not None: - body["{health}"] = health.as_dict() + body["health"] = health.as_dict() if job_clusters is not None: - body["{job_clusters}"] = [v.as_dict() for v in job_clusters] + body["job_clusters"] = [v.as_dict() for v in job_clusters] if max_concurrent_runs is not None: - body["{max_concurrent_runs}"] = max_concurrent_runs + body["max_concurrent_runs"] = max_concurrent_runs if name is not None: - body["{name}"] = name + body["name"] = name if notification_settings is not None: - body["{notification_settings}"] = notification_settings.as_dict() + body["notification_settings"] = notification_settings.as_dict() if parameters is not None: - body["{parameters}"] = [v.as_dict() for v in parameters] + body["parameters"] = [v.as_dict() for v in parameters] if performance_target is not None: - body["{performance_target}"] = performance_target.value + body["performance_target"] = performance_target.value if queue is not None: - body["{queue}"] = queue.as_dict() + body["queue"] = queue.as_dict() if run_as is not None: - body["{run_as}"] = run_as.as_dict() + body["run_as"] = run_as.as_dict() if schedule is not None: - body["{schedule}"] = schedule.as_dict() + body["schedule"] = schedule.as_dict() if tags is not None: - body["{tags}"] = tags + body["tags"] = tags if tasks is not None: - body["{tasks}"] = [v.as_dict() for v in tasks] + body["tasks"] = [v.as_dict() for v in tasks] if timeout_seconds is not None: - body["{timeout_seconds}"] = timeout_seconds + body["timeout_seconds"] = timeout_seconds if trigger is not None: - body["{trigger}"] = trigger.as_dict() + body["trigger"] = trigger.as_dict() if webhook_notifications is not None: - body["{webhook_notifications}"] = webhook_notifications.as_dict() + body["webhook_notifications"] = webhook_notifications.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9376,7 +10317,7 @@ def delete(self, job_id: int): """ body = {} if job_id is not None: - body["{job_id}"] = job_id + body["job_id"] = job_id headers = { "0": "{Content-Type application/json}", } @@ -9395,7 +10336,7 @@ def delete_run(self, run_id: int): """ body = {} if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id headers = { "0": "{Content-Type application/json}", } @@ -9417,9 +10358,9 @@ def export_run(self, run_id: int, *, views_to_export: Optional[ViewsToExport] = query = {} if run_id is not None: - query["{run_id}"] = run_id + query["run_id"] = run_id if views_to_export is not None: - query["{views_to_export}"] = views_to_export.value + query["views_to_export"] = views_to_export.value headers = { "0": "{Accept application/json}", } @@ -9450,9 +10391,9 @@ def get(self, job_id: int, *, page_token: Optional[str] = None) -> Job: query = {} if job_id is not None: - query["{job_id}"] = job_id + query["job_id"] = job_id if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -9530,13 +10471,13 @@ def get_run( query = {} if include_history is not None: - query["{include_history}"] = include_history + query["include_history"] = include_history if include_resolved_values is not None: - query["{include_resolved_values}"] = include_resolved_values + query["include_resolved_values"] = include_resolved_values if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if run_id is not None: - query["{run_id}"] = run_id + query["run_id"] = run_id headers = { "0": "{Accept application/json}", } @@ -9564,7 +10505,7 @@ def get_run_output(self, run_id: int) -> RunOutput: query = {} if run_id is not None: - query["{run_id}"] = run_id + query["run_id"] = run_id headers = { "0": "{Accept application/json}", } @@ -9605,27 +10546,27 @@ def list( query = {} if expand_tasks is not None: - query["{expand_tasks}"] = expand_tasks + query["expand_tasks"] = expand_tasks if limit is not None: - query["{limit}"] = limit + query["limit"] = limit if name is not None: - query["{name}"] = name + query["name"] = name if offset is not None: - query["{offset}"] = offset + query["offset"] = offset if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.2/jobs/list", query=query, headers=headers) - if "{jobs}" in json: - for v in json["{jobs}"]: + if "jobs" in json: + for v in json["jobs"]: yield BaseJob.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_runs( self, @@ -9680,37 +10621,37 @@ def list_runs( query = {} if active_only is not None: - query["{active_only}"] = active_only + query["active_only"] = active_only if completed_only is not None: - query["{completed_only}"] = completed_only + query["completed_only"] = completed_only if expand_tasks is not None: - query["{expand_tasks}"] = expand_tasks + query["expand_tasks"] = expand_tasks if job_id is not None: - query["{job_id}"] = job_id + query["job_id"] = job_id if limit is not None: - query["{limit}"] = limit + query["limit"] = limit if offset is not None: - query["{offset}"] = offset + query["offset"] = offset if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if run_type is not None: - query["{run_type}"] = run_type.value + query["run_type"] = run_type.value if start_time_from is not None: - query["{start_time_from}"] = start_time_from + query["start_time_from"] = start_time_from if start_time_to is not None: - query["{start_time_to}"] = start_time_to + query["start_time_to"] = start_time_to headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.2/jobs/runs/list", query=query, headers=headers) - if "{runs}" in json: - for v in json["{runs}"]: + if "runs" in json: + for v in json["runs"]: yield BaseRun.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def repair_run( self, @@ -9822,33 +10763,33 @@ def repair_run( """ body = {} if dbt_commands is not None: - body["{dbt_commands}"] = [v for v in dbt_commands] + body["dbt_commands"] = [v for v in dbt_commands] if jar_params is not None: - body["{jar_params}"] = [v for v in jar_params] + body["jar_params"] = [v for v in jar_params] if job_parameters is not None: - body["{job_parameters}"] = job_parameters + body["job_parameters"] = job_parameters if latest_repair_id is not None: - body["{latest_repair_id}"] = latest_repair_id + body["latest_repair_id"] = latest_repair_id if notebook_params is not None: - body["{notebook_params}"] = notebook_params + body["notebook_params"] = notebook_params if pipeline_params is not None: - body["{pipeline_params}"] = pipeline_params.as_dict() + body["pipeline_params"] = pipeline_params.as_dict() if python_named_params is not None: - body["{python_named_params}"] = python_named_params + body["python_named_params"] = python_named_params if python_params is not None: - body["{python_params}"] = [v for v in python_params] + body["python_params"] = [v for v in python_params] if rerun_all_failed_tasks is not None: - body["{rerun_all_failed_tasks}"] = rerun_all_failed_tasks + body["rerun_all_failed_tasks"] = rerun_all_failed_tasks if rerun_dependent_tasks is not None: - body["{rerun_dependent_tasks}"] = rerun_dependent_tasks + body["rerun_dependent_tasks"] = rerun_dependent_tasks if rerun_tasks is not None: - body["{rerun_tasks}"] = [v for v in rerun_tasks] + body["rerun_tasks"] = [v for v in rerun_tasks] if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id if spark_submit_params is not None: - body["{spark_submit_params}"] = [v for v in spark_submit_params] + body["spark_submit_params"] = [v for v in spark_submit_params] if sql_params is not None: - body["{sql_params}"] = sql_params + body["sql_params"] = sql_params headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9913,9 +10854,9 @@ def reset(self, job_id: int, new_settings: JobSettings): """ body = {} if job_id is not None: - body["{job_id}"] = job_id + body["job_id"] = job_id if new_settings is not None: - body["{new_settings}"] = new_settings.as_dict() + body["new_settings"] = new_settings.as_dict() headers = { "0": "{Content-Type application/json}", } @@ -10043,33 +10984,33 @@ def run_now( """ body = {} if dbt_commands is not None: - body["{dbt_commands}"] = [v for v in dbt_commands] + body["dbt_commands"] = [v for v in dbt_commands] if idempotency_token is not None: - body["{idempotency_token}"] = idempotency_token + body["idempotency_token"] = idempotency_token if jar_params is not None: - body["{jar_params}"] = [v for v in jar_params] + body["jar_params"] = [v for v in jar_params] if job_id is not None: - body["{job_id}"] = job_id + body["job_id"] = job_id if job_parameters is not None: - body["{job_parameters}"] = job_parameters + body["job_parameters"] = job_parameters if notebook_params is not None: - body["{notebook_params}"] = notebook_params + body["notebook_params"] = notebook_params if only is not None: - body["{only}"] = [v for v in only] + body["only"] = [v for v in only] if performance_target is not None: - body["{performance_target}"] = performance_target.value + body["performance_target"] = performance_target.value if pipeline_params is not None: - body["{pipeline_params}"] = pipeline_params.as_dict() + body["pipeline_params"] = pipeline_params.as_dict() if python_named_params is not None: - body["{python_named_params}"] = python_named_params + body["python_named_params"] = python_named_params if python_params is not None: - body["{python_params}"] = [v for v in python_params] + body["python_params"] = [v for v in python_params] if queue is not None: - body["{queue}"] = queue.as_dict() + body["queue"] = queue.as_dict() if spark_submit_params is not None: - body["{spark_submit_params}"] = [v for v in spark_submit_params] + body["spark_submit_params"] = [v for v in spark_submit_params] if sql_params is not None: - body["{sql_params}"] = sql_params + body["sql_params"] = sql_params headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10079,7 +11020,7 @@ def run_now( return Wait( self.WaitGetRunJobTerminatedOrSkipped, response=RunNowResponse.from_dict(op_response), - run_id=op_response["{run_id}"], + run_id=op_response["run_id"], ) def run_now_and_wait( @@ -10134,7 +11075,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10222,33 +11163,33 @@ def submit( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] if budget_policy_id is not None: - body["{budget_policy_id}"] = budget_policy_id + body["budget_policy_id"] = budget_policy_id if email_notifications is not None: - body["{email_notifications}"] = email_notifications.as_dict() + body["email_notifications"] = email_notifications.as_dict() if environments is not None: - body["{environments}"] = [v.as_dict() for v in environments] + body["environments"] = [v.as_dict() for v in environments] if git_source is not None: - body["{git_source}"] = git_source.as_dict() + body["git_source"] = git_source.as_dict() if health is not None: - body["{health}"] = health.as_dict() + body["health"] = health.as_dict() if idempotency_token is not None: - body["{idempotency_token}"] = idempotency_token + body["idempotency_token"] = idempotency_token if notification_settings is not None: - body["{notification_settings}"] = notification_settings.as_dict() + body["notification_settings"] = notification_settings.as_dict() if queue is not None: - body["{queue}"] = queue.as_dict() + body["queue"] = queue.as_dict() if run_as is not None: - body["{run_as}"] = run_as.as_dict() + body["run_as"] = run_as.as_dict() if run_name is not None: - body["{run_name}"] = run_name + body["run_name"] = run_name if tasks is not None: - body["{tasks}"] = [v.as_dict() for v in tasks] + body["tasks"] = [v.as_dict() for v in tasks] if timeout_seconds is not None: - body["{timeout_seconds}"] = timeout_seconds + body["timeout_seconds"] = timeout_seconds if webhook_notifications is not None: - body["{webhook_notifications}"] = webhook_notifications.as_dict() + body["webhook_notifications"] = webhook_notifications.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10258,7 +11199,7 @@ def submit( return Wait( self.WaitGetRunJobTerminatedOrSkipped, response=SubmitRunResponse.from_dict(op_response), - run_id=op_response["{run_id}"], + run_id=op_response["run_id"], ) def submit_and_wait( @@ -10326,11 +11267,11 @@ def update( """ body = {} if fields_to_remove is not None: - body["{fields_to_remove}"] = [v for v in fields_to_remove] + body["fields_to_remove"] = [v for v in fields_to_remove] if job_id is not None: - body["{job_id}"] = job_id + body["job_id"] = job_id if new_settings is not None: - body["{new_settings}"] = new_settings.as_dict() + body["new_settings"] = new_settings.as_dict() headers = { "0": "{Content-Type application/json}", } @@ -10352,7 +11293,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10395,9 +11336,9 @@ def enforce_compliance( """ body = {} if job_id is not None: - body["{job_id}"] = job_id + body["job_id"] = job_id if validate_only is not None: - body["{validate_only}"] = validate_only + body["validate_only"] = validate_only headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10421,7 +11362,7 @@ def get_compliance(self, job_id: int) -> GetPolicyComplianceResponse: query = {} if job_id is not None: - query["{job_id}"] = job_id + query["job_id"] = job_id headers = { "0": "{Accept application/json}", } @@ -10452,20 +11393,20 @@ def list_compliance( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if policy_id is not None: - query["{policy_id}"] = policy_id + query["policy_id"] = policy_id headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/policies/jobs/list-compliance", query=query, headers=headers) - if "{jobs}" in json: - for v in json["{jobs}"]: + if "jobs" in json: + for v in json["jobs"]: yield JobCompliance.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] diff --git a/databricks/sdk/marketplace/v2/impl.py b/databricks/sdk/marketplace/v2/impl.py index d0f2b650b..c9d6ccc53 100755 --- a/databricks/sdk/marketplace/v2/impl.py +++ b/databricks/sdk/marketplace/v2/impl.py @@ -34,15 +34,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AddExchangeForListingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddExchangeForListingRequest: """Deserializes the AddExchangeForListingRequest from a dictionary.""" - return cls(exchange_id=d.get("{exchange_id}", None), listing_id=d.get("{listing_id}", None)) + return cls(exchange_id=d.get("exchange_id", None), listing_id=d.get("listing_id", None)) @dataclass @@ -60,13 +60,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AddExchangeForListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_for_listing: - body["{exchange_for_listing}"] = self.exchange_for_listing + body["exchange_for_listing"] = self.exchange_for_listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AddExchangeForListingResponse: """Deserializes the AddExchangeForListingResponse from a dictionary.""" - return cls(exchange_for_listing=_from_dict(d, "{exchange_for_listing}", ExchangeListing)) + return cls(exchange_for_listing=_from_dict(d, "exchange_for_listing", ExchangeListing)) class AssetType(Enum): @@ -95,13 +95,13 @@ def as_shallow_dict(self) -> dict: """Serializes the BatchGetListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["{listings}"] = self.listings + body["listings"] = self.listings return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BatchGetListingsResponse: """Deserializes the BatchGetListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "{listings}", Listing)) + return cls(listings=_repeated_dict(d, "listings", Listing)) @dataclass @@ -119,13 +119,13 @@ def as_shallow_dict(self) -> dict: """Serializes the BatchGetProvidersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.providers: - body["{providers}"] = self.providers + body["providers"] = self.providers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BatchGetProvidersResponse: """Deserializes the BatchGetProvidersResponse from a dictionary.""" - return cls(providers=_repeated_dict(d, "{providers}", ProviderInfo)) + return cls(providers=_repeated_dict(d, "providers", ProviderInfo)) class Category(Enum): @@ -169,13 +169,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ConsumerTerms into a shallow dictionary of its immediate attributes.""" body = {} if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ConsumerTerms: """Deserializes the ConsumerTerms from a dictionary.""" - return cls(version=d.get("{version}", None)) + return cls(version=d.get("version", None)) @dataclass @@ -207,23 +207,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ContactInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.company is not None: - body["{company}"] = self.company + body["company"] = self.company if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email if self.first_name is not None: - body["{first_name}"] = self.first_name + body["first_name"] = self.first_name if self.last_name is not None: - body["{last_name}"] = self.last_name + body["last_name"] = self.last_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ContactInfo: """Deserializes the ContactInfo from a dictionary.""" return cls( - company=d.get("{company}", None), - email=d.get("{email}", None), - first_name=d.get("{first_name}", None), - last_name=d.get("{last_name}", None), + company=d.get("company", None), + email=d.get("email", None), + first_name=d.get("first_name", None), + last_name=d.get("last_name", None), ) @@ -248,13 +248,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeFilterRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.filter: - body["{filter}"] = self.filter + body["filter"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeFilterRequest: """Deserializes the CreateExchangeFilterRequest from a dictionary.""" - return cls(filter=_from_dict(d, "{filter}", ExchangeFilter)) + return cls(filter=_from_dict(d, "filter", ExchangeFilter)) @dataclass @@ -272,13 +272,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeFilterResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.filter_id is not None: - body["{filter_id}"] = self.filter_id + body["filter_id"] = self.filter_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeFilterResponse: """Deserializes the CreateExchangeFilterResponse from a dictionary.""" - return cls(filter_id=d.get("{filter_id}", None)) + return cls(filter_id=d.get("filter_id", None)) @dataclass @@ -296,13 +296,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange + body["exchange"] = self.exchange return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeRequest: """Deserializes the CreateExchangeRequest from a dictionary.""" - return cls(exchange=_from_dict(d, "{exchange}", Exchange)) + return cls(exchange=_from_dict(d, "exchange", Exchange)) @dataclass @@ -320,13 +320,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExchangeResponse: """Deserializes the CreateExchangeResponse from a dictionary.""" - return cls(exchange_id=d.get("{exchange_id}", None)) + return cls(exchange_id=d.get("exchange_id", None)) @dataclass @@ -356,23 +356,23 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateFileRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.file_parent: - body["{file_parent}"] = self.file_parent + body["file_parent"] = self.file_parent if self.marketplace_file_type is not None: - body["{marketplace_file_type}"] = self.marketplace_file_type + body["marketplace_file_type"] = self.marketplace_file_type if self.mime_type is not None: - body["{mime_type}"] = self.mime_type + body["mime_type"] = self.mime_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFileRequest: """Deserializes the CreateFileRequest from a dictionary.""" return cls( - display_name=d.get("{display_name}", None), - file_parent=_from_dict(d, "{file_parent}", FileParent), - marketplace_file_type=_enum(d, "{marketplace_file_type}", MarketplaceFileType), - mime_type=d.get("{mime_type}", None), + display_name=d.get("display_name", None), + file_parent=_from_dict(d, "file_parent", FileParent), + marketplace_file_type=_enum(d, "marketplace_file_type", MarketplaceFileType), + mime_type=d.get("mime_type", None), ) @@ -396,15 +396,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateFileResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.file_info: - body["{file_info}"] = self.file_info + body["file_info"] = self.file_info if self.upload_url is not None: - body["{upload_url}"] = self.upload_url + body["upload_url"] = self.upload_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateFileResponse: """Deserializes the CreateFileResponse from a dictionary.""" - return cls(file_info=_from_dict(d, "{file_info}", FileInfo), upload_url=d.get("{upload_url}", None)) + return cls(file_info=_from_dict(d, "file_info", FileInfo), upload_url=d.get("upload_url", None)) @dataclass @@ -443,29 +443,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateInstallationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.accepted_consumer_terms: - body["{accepted_consumer_terms}"] = self.accepted_consumer_terms + body["accepted_consumer_terms"] = self.accepted_consumer_terms if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type + body["recipient_type"] = self.recipient_type if self.repo_detail: - body["{repo_detail}"] = self.repo_detail + body["repo_detail"] = self.repo_detail if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateInstallationRequest: """Deserializes the CreateInstallationRequest from a dictionary.""" return cls( - accepted_consumer_terms=_from_dict(d, "{accepted_consumer_terms}", ConsumerTerms), - catalog_name=d.get("{catalog_name}", None), - listing_id=d.get("{listing_id}", None), - recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), - repo_detail=_from_dict(d, "{repo_detail}", RepoInstallation), - share_name=d.get("{share_name}", None), + accepted_consumer_terms=_from_dict(d, "accepted_consumer_terms", ConsumerTerms), + catalog_name=d.get("catalog_name", None), + listing_id=d.get("listing_id", None), + recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), + repo_detail=_from_dict(d, "repo_detail", RepoInstallation), + share_name=d.get("share_name", None), ) @@ -484,13 +484,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateListingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.listing: - body["{listing}"] = self.listing + body["listing"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateListingRequest: """Deserializes the CreateListingRequest from a dictionary.""" - return cls(listing=_from_dict(d, "{listing}", Listing)) + return cls(listing=_from_dict(d, "listing", Listing)) @dataclass @@ -508,13 +508,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateListingResponse: """Deserializes the CreateListingResponse from a dictionary.""" - return cls(listing_id=d.get("{listing_id}", None)) + return cls(listing_id=d.get("listing_id", None)) @dataclass @@ -566,38 +566,38 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePersonalizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.accepted_consumer_terms: - body["{accepted_consumer_terms}"] = self.accepted_consumer_terms + body["accepted_consumer_terms"] = self.accepted_consumer_terms if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.company is not None: - body["{company}"] = self.company + body["company"] = self.company if self.first_name is not None: - body["{first_name}"] = self.first_name + body["first_name"] = self.first_name if self.intended_use is not None: - body["{intended_use}"] = self.intended_use + body["intended_use"] = self.intended_use if self.is_from_lighthouse is not None: - body["{is_from_lighthouse}"] = self.is_from_lighthouse + body["is_from_lighthouse"] = self.is_from_lighthouse if self.last_name is not None: - body["{last_name}"] = self.last_name + body["last_name"] = self.last_name if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type + body["recipient_type"] = self.recipient_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePersonalizationRequest: """Deserializes the CreatePersonalizationRequest from a dictionary.""" return cls( - accepted_consumer_terms=_from_dict(d, "{accepted_consumer_terms}", ConsumerTerms), - comment=d.get("{comment}", None), - company=d.get("{company}", None), - first_name=d.get("{first_name}", None), - intended_use=d.get("{intended_use}", None), - is_from_lighthouse=d.get("{is_from_lighthouse}", None), - last_name=d.get("{last_name}", None), - listing_id=d.get("{listing_id}", None), - recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), + accepted_consumer_terms=_from_dict(d, "accepted_consumer_terms", ConsumerTerms), + comment=d.get("comment", None), + company=d.get("company", None), + first_name=d.get("first_name", None), + intended_use=d.get("intended_use", None), + is_from_lighthouse=d.get("is_from_lighthouse", None), + last_name=d.get("last_name", None), + listing_id=d.get("listing_id", None), + recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), ) @@ -616,13 +616,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePersonalizationRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePersonalizationRequestResponse: """Deserializes the CreatePersonalizationRequestResponse from a dictionary.""" - return cls(id=d.get("{id}", None)) + return cls(id=d.get("id", None)) @dataclass @@ -640,13 +640,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateProviderRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.provider: - body["{provider}"] = self.provider + body["provider"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateProviderRequest: """Deserializes the CreateProviderRequest from a dictionary.""" - return cls(provider=_from_dict(d, "{provider}", ProviderInfo)) + return cls(provider=_from_dict(d, "provider", ProviderInfo)) @dataclass @@ -664,13 +664,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateProviderResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateProviderResponse: """Deserializes the CreateProviderResponse from a dictionary.""" - return cls(id=d.get("{id}", None)) + return cls(id=d.get("id", None)) class DataRefresh(Enum): @@ -705,15 +705,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DataRefreshInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.interval is not None: - body["{interval}"] = self.interval + body["interval"] = self.interval if self.unit is not None: - body["{unit}"] = self.unit + body["unit"] = self.unit return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataRefreshInfo: """Deserializes the DataRefreshInfo from a dictionary.""" - return cls(interval=d.get("{interval}", None), unit=_enum(d, "{unit}", DataRefresh)) + return cls(interval=d.get("interval", None), unit=_enum(d, "unit", DataRefresh)) @dataclass @@ -877,38 +877,38 @@ def as_shallow_dict(self) -> dict: """Serializes the Exchange into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.filters: - body["{filters}"] = self.filters + body["filters"] = self.filters if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.linked_listings: - body["{linked_listings}"] = self.linked_listings + body["linked_listings"] = self.linked_listings if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Exchange: """Deserializes the Exchange from a dictionary.""" return cls( - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - filters=_repeated_dict(d, "{filters}", ExchangeFilter), - id=d.get("{id}", None), - linked_listings=_repeated_dict(d, "{linked_listings}", ExchangeListing), - name=d.get("{name}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + filters=_repeated_dict(d, "filters", ExchangeFilter), + id=d.get("id", None), + linked_listings=_repeated_dict(d, "linked_listings", ExchangeListing), + name=d.get("name", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -959,38 +959,38 @@ def as_shallow_dict(self) -> dict: """Serializes the ExchangeFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id if self.filter_type is not None: - body["{filter_type}"] = self.filter_type + body["filter_type"] = self.filter_type if self.filter_value is not None: - body["{filter_value}"] = self.filter_value + body["filter_value"] = self.filter_value if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeFilter: """Deserializes the ExchangeFilter from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - exchange_id=d.get("{exchange_id}", None), - filter_type=_enum(d, "{filter_type}", ExchangeFilterType), - filter_value=d.get("{filter_value}", None), - id=d.get("{id}", None), - name=d.get("{name}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + exchange_id=d.get("exchange_id", None), + filter_type=_enum(d, "filter_type", ExchangeFilterType), + filter_value=d.get("filter_value", None), + id=d.get("id", None), + name=d.get("name", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -1038,32 +1038,32 @@ def as_shallow_dict(self) -> dict: """Serializes the ExchangeListing into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.exchange_id is not None: - body["{exchange_id}"] = self.exchange_id + body["exchange_id"] = self.exchange_id if self.exchange_name is not None: - body["{exchange_name}"] = self.exchange_name + body["exchange_name"] = self.exchange_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.listing_name is not None: - body["{listing_name}"] = self.listing_name + body["listing_name"] = self.listing_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeListing: """Deserializes the ExchangeListing from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - exchange_id=d.get("{exchange_id}", None), - exchange_name=d.get("{exchange_name}", None), - id=d.get("{id}", None), - listing_id=d.get("{listing_id}", None), - listing_name=d.get("{listing_name}", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + exchange_id=d.get("exchange_id", None), + exchange_name=d.get("exchange_name", None), + id=d.get("id", None), + listing_id=d.get("listing_id", None), + listing_name=d.get("listing_name", None), ) @@ -1120,41 +1120,41 @@ def as_shallow_dict(self) -> dict: """Serializes the FileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.download_link is not None: - body["{download_link}"] = self.download_link + body["download_link"] = self.download_link if self.file_parent: - body["{file_parent}"] = self.file_parent + body["file_parent"] = self.file_parent if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.marketplace_file_type is not None: - body["{marketplace_file_type}"] = self.marketplace_file_type + body["marketplace_file_type"] = self.marketplace_file_type if self.mime_type is not None: - body["{mime_type}"] = self.mime_type + body["mime_type"] = self.mime_type if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - display_name=d.get("{display_name}", None), - download_link=d.get("{download_link}", None), - file_parent=_from_dict(d, "{file_parent}", FileParent), - id=d.get("{id}", None), - marketplace_file_type=_enum(d, "{marketplace_file_type}", MarketplaceFileType), - mime_type=d.get("{mime_type}", None), - status=_enum(d, "{status}", FileStatus), - status_message=d.get("{status_message}", None), - updated_at=d.get("{updated_at}", None), + created_at=d.get("created_at", None), + display_name=d.get("display_name", None), + download_link=d.get("download_link", None), + file_parent=_from_dict(d, "file_parent", FileParent), + id=d.get("id", None), + marketplace_file_type=_enum(d, "marketplace_file_type", MarketplaceFileType), + mime_type=d.get("mime_type", None), + status=_enum(d, "status", FileStatus), + status_message=d.get("status_message", None), + updated_at=d.get("updated_at", None), ) @@ -1178,17 +1178,15 @@ def as_shallow_dict(self) -> dict: """Serializes the FileParent into a shallow dictionary of its immediate attributes.""" body = {} if self.file_parent_type is not None: - body["{file_parent_type}"] = self.file_parent_type + body["file_parent_type"] = self.file_parent_type if self.parent_id is not None: - body["{parent_id}"] = self.parent_id + body["parent_id"] = self.parent_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileParent: """Deserializes the FileParent from a dictionary.""" - return cls( - file_parent_type=_enum(d, "{file_parent_type}", FileParentType), parent_id=d.get("{parent_id}", None) - ) + return cls(file_parent_type=_enum(d, "file_parent_type", FileParentType), parent_id=d.get("parent_id", None)) class FileParentType(Enum): @@ -1227,13 +1225,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange + body["exchange"] = self.exchange return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExchangeResponse: """Deserializes the GetExchangeResponse from a dictionary.""" - return cls(exchange=_from_dict(d, "{exchange}", Exchange)) + return cls(exchange=_from_dict(d, "exchange", Exchange)) @dataclass @@ -1251,13 +1249,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetFileResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.file_info: - body["{file_info}"] = self.file_info + body["file_info"] = self.file_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetFileResponse: """Deserializes the GetFileResponse from a dictionary.""" - return cls(file_info=_from_dict(d, "{file_info}", FileInfo)) + return cls(file_info=_from_dict(d, "file_info", FileInfo)) @dataclass @@ -1276,13 +1274,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetLatestVersionProviderAnalyticsDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetLatestVersionProviderAnalyticsDashboardResponse: """Deserializes the GetLatestVersionProviderAnalyticsDashboardResponse from a dictionary.""" - return cls(version=d.get("{version}", None)) + return cls(version=d.get("version", None)) @dataclass @@ -1304,17 +1302,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GetListingContentMetadataResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.shared_data_objects: - body["{shared_data_objects}"] = self.shared_data_objects + body["shared_data_objects"] = self.shared_data_objects return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetListingContentMetadataResponse: """Deserializes the GetListingContentMetadataResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - shared_data_objects=_repeated_dict(d, "{shared_data_objects}", SharedDataObject), + next_page_token=d.get("next_page_token", None), + shared_data_objects=_repeated_dict(d, "shared_data_objects", SharedDataObject), ) @@ -1333,13 +1331,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listing: - body["{listing}"] = self.listing + body["listing"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetListingResponse: """Deserializes the GetListingResponse from a dictionary.""" - return cls(listing=_from_dict(d, "{listing}", Listing)) + return cls(listing=_from_dict(d, "listing", Listing)) @dataclass @@ -1361,15 +1359,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["{listings}"] = self.listings + body["listings"] = self.listings if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetListingsResponse: """Deserializes the GetListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "{listings}", Listing), next_page_token=d.get("{next_page_token}", None)) + return cls(listings=_repeated_dict(d, "listings", Listing), next_page_token=d.get("next_page_token", None)) @dataclass @@ -1387,13 +1385,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPersonalizationRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.personalization_requests: - body["{personalization_requests}"] = self.personalization_requests + body["personalization_requests"] = self.personalization_requests return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPersonalizationRequestResponse: """Deserializes the GetPersonalizationRequestResponse from a dictionary.""" - return cls(personalization_requests=_repeated_dict(d, "{personalization_requests}", PersonalizationRequest)) + return cls(personalization_requests=_repeated_dict(d, "personalization_requests", PersonalizationRequest)) @dataclass @@ -1411,13 +1409,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetProviderResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.provider: - body["{provider}"] = self.provider + body["provider"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetProviderResponse: """Deserializes the GetProviderResponse from a dictionary.""" - return cls(provider=_from_dict(d, "{provider}", ProviderInfo)) + return cls(provider=_from_dict(d, "provider", ProviderInfo)) @dataclass @@ -1435,13 +1433,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Installation into a shallow dictionary of its immediate attributes.""" body = {} if self.installation: - body["{installation}"] = self.installation + body["installation"] = self.installation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Installation: """Deserializes the Installation from a dictionary.""" - return cls(installation=_from_dict(d, "{installation}", InstallationDetail)) + return cls(installation=_from_dict(d, "installation", InstallationDetail)) @dataclass @@ -1507,50 +1505,50 @@ def as_shallow_dict(self) -> dict: """Serializes the InstallationDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.installed_on is not None: - body["{installed_on}"] = self.installed_on + body["installed_on"] = self.installed_on if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.listing_name is not None: - body["{listing_name}"] = self.listing_name + body["listing_name"] = self.listing_name if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type + body["recipient_type"] = self.recipient_type if self.repo_name is not None: - body["{repo_name}"] = self.repo_name + body["repo_name"] = self.repo_name if self.repo_path is not None: - body["{repo_path}"] = self.repo_path + body["repo_path"] = self.repo_path if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.token_detail: - body["{token_detail}"] = self.token_detail + body["token_detail"] = self.token_detail if self.tokens: - body["{tokens}"] = self.tokens + body["tokens"] = self.tokens return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InstallationDetail: """Deserializes the InstallationDetail from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - error_message=d.get("{error_message}", None), - id=d.get("{id}", None), - installed_on=d.get("{installed_on}", None), - listing_id=d.get("{listing_id}", None), - listing_name=d.get("{listing_name}", None), - recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), - repo_name=d.get("{repo_name}", None), - repo_path=d.get("{repo_path}", None), - share_name=d.get("{share_name}", None), - status=_enum(d, "{status}", InstallationStatus), - token_detail=_from_dict(d, "{token_detail}", TokenDetail), - tokens=_repeated_dict(d, "{tokens}", TokenInfo), + catalog_name=d.get("catalog_name", None), + error_message=d.get("error_message", None), + id=d.get("id", None), + installed_on=d.get("installed_on", None), + listing_id=d.get("listing_id", None), + listing_name=d.get("listing_name", None), + recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), + repo_name=d.get("repo_name", None), + repo_path=d.get("repo_path", None), + share_name=d.get("share_name", None), + status=_enum(d, "status", InstallationStatus), + token_detail=_from_dict(d, "token_detail", TokenDetail), + tokens=_repeated_dict(d, "tokens", TokenInfo), ) @@ -1579,17 +1577,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAllInstallationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.installations: - body["{installations}"] = self.installations + body["installations"] = self.installations if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAllInstallationsResponse: """Deserializes the ListAllInstallationsResponse from a dictionary.""" return cls( - installations=_repeated_dict(d, "{installations}", InstallationDetail), - next_page_token=d.get("{next_page_token}", None), + installations=_repeated_dict(d, "installations", InstallationDetail), + next_page_token=d.get("next_page_token", None), ) @@ -1612,17 +1610,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAllPersonalizationRequestsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.personalization_requests: - body["{personalization_requests}"] = self.personalization_requests + body["personalization_requests"] = self.personalization_requests return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAllPersonalizationRequestsResponse: """Deserializes the ListAllPersonalizationRequestsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - personalization_requests=_repeated_dict(d, "{personalization_requests}", PersonalizationRequest), + next_page_token=d.get("next_page_token", None), + personalization_requests=_repeated_dict(d, "personalization_requests", PersonalizationRequest), ) @@ -1645,17 +1643,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListExchangeFiltersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.filters: - body["{filters}"] = self.filters + body["filters"] = self.filters if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExchangeFiltersResponse: """Deserializes the ListExchangeFiltersResponse from a dictionary.""" - return cls( - filters=_repeated_dict(d, "{filters}", ExchangeFilter), next_page_token=d.get("{next_page_token}", None) - ) + return cls(filters=_repeated_dict(d, "filters", ExchangeFilter), next_page_token=d.get("next_page_token", None)) @dataclass @@ -1677,17 +1673,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListExchangesForListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_listing: - body["{exchange_listing}"] = self.exchange_listing + body["exchange_listing"] = self.exchange_listing if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExchangesForListingResponse: """Deserializes the ListExchangesForListingResponse from a dictionary.""" return cls( - exchange_listing=_repeated_dict(d, "{exchange_listing}", ExchangeListing), - next_page_token=d.get("{next_page_token}", None), + exchange_listing=_repeated_dict(d, "exchange_listing", ExchangeListing), + next_page_token=d.get("next_page_token", None), ) @@ -1710,17 +1706,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListExchangesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchanges: - body["{exchanges}"] = self.exchanges + body["exchanges"] = self.exchanges if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExchangesResponse: """Deserializes the ListExchangesResponse from a dictionary.""" - return cls( - exchanges=_repeated_dict(d, "{exchanges}", Exchange), next_page_token=d.get("{next_page_token}", None) - ) + return cls(exchanges=_repeated_dict(d, "exchanges", Exchange), next_page_token=d.get("next_page_token", None)) @dataclass @@ -1742,17 +1736,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListFilesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.file_infos: - body["{file_infos}"] = self.file_infos + body["file_infos"] = self.file_infos if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFilesResponse: """Deserializes the ListFilesResponse from a dictionary.""" - return cls( - file_infos=_repeated_dict(d, "{file_infos}", FileInfo), next_page_token=d.get("{next_page_token}", None) - ) + return cls(file_infos=_repeated_dict(d, "file_infos", FileInfo), next_page_token=d.get("next_page_token", None)) @dataclass @@ -1774,17 +1766,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListFulfillmentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.fulfillments: - body["{fulfillments}"] = self.fulfillments + body["fulfillments"] = self.fulfillments if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFulfillmentsResponse: """Deserializes the ListFulfillmentsResponse from a dictionary.""" return cls( - fulfillments=_repeated_dict(d, "{fulfillments}", ListingFulfillment), - next_page_token=d.get("{next_page_token}", None), + fulfillments=_repeated_dict(d, "fulfillments", ListingFulfillment), + next_page_token=d.get("next_page_token", None), ) @@ -1807,17 +1799,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListInstallationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.installations: - body["{installations}"] = self.installations + body["installations"] = self.installations if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListInstallationsResponse: """Deserializes the ListInstallationsResponse from a dictionary.""" return cls( - installations=_repeated_dict(d, "{installations}", InstallationDetail), - next_page_token=d.get("{next_page_token}", None), + installations=_repeated_dict(d, "installations", InstallationDetail), + next_page_token=d.get("next_page_token", None), ) @@ -1840,17 +1832,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListListingsForExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange_listings: - body["{exchange_listings}"] = self.exchange_listings + body["exchange_listings"] = self.exchange_listings if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListListingsForExchangeResponse: """Deserializes the ListListingsForExchangeResponse from a dictionary.""" return cls( - exchange_listings=_repeated_dict(d, "{exchange_listings}", ExchangeListing), - next_page_token=d.get("{next_page_token}", None), + exchange_listings=_repeated_dict(d, "exchange_listings", ExchangeListing), + next_page_token=d.get("next_page_token", None), ) @@ -1873,15 +1865,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["{listings}"] = self.listings + body["listings"] = self.listings if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListListingsResponse: """Deserializes the ListListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "{listings}", Listing), next_page_token=d.get("{next_page_token}", None)) + return cls(listings=_repeated_dict(d, "listings", Listing), next_page_token=d.get("next_page_token", None)) @dataclass @@ -1908,17 +1900,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListProviderAnalyticsDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProviderAnalyticsDashboardResponse: """Deserializes the ListProviderAnalyticsDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("{dashboard_id}", None), id=d.get("{id}", None), version=d.get("{version}", None)) + return cls(dashboard_id=d.get("dashboard_id", None), id=d.get("id", None), version=d.get("version", None)) @dataclass @@ -1940,16 +1932,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListProvidersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.providers: - body["{providers}"] = self.providers + body["providers"] = self.providers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProvidersResponse: """Deserializes the ListProvidersResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), providers=_repeated_dict(d, "{providers}", ProviderInfo) + next_page_token=d.get("next_page_token", None), providers=_repeated_dict(d, "providers", ProviderInfo) ) @@ -1976,20 +1968,20 @@ def as_shallow_dict(self) -> dict: """Serializes the Listing into a shallow dictionary of its immediate attributes.""" body = {} if self.detail: - body["{detail}"] = self.detail + body["detail"] = self.detail if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.summary: - body["{summary}"] = self.summary + body["summary"] = self.summary return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Listing: """Deserializes the Listing from a dictionary.""" return cls( - detail=_from_dict(d, "{detail}", ListingDetail), - id=d.get("{id}", None), - summary=_from_dict(d, "{summary}", ListingSummary), + detail=_from_dict(d, "detail", ListingDetail), + id=d.get("id", None), + summary=_from_dict(d, "summary", ListingSummary), ) @@ -2099,68 +2091,68 @@ def as_shallow_dict(self) -> dict: """Serializes the ListingDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.assets: - body["{assets}"] = self.assets + body["assets"] = self.assets if self.collection_date_end is not None: - body["{collection_date_end}"] = self.collection_date_end + body["collection_date_end"] = self.collection_date_end if self.collection_date_start is not None: - body["{collection_date_start}"] = self.collection_date_start + body["collection_date_start"] = self.collection_date_start if self.collection_granularity: - body["{collection_granularity}"] = self.collection_granularity + body["collection_granularity"] = self.collection_granularity if self.cost is not None: - body["{cost}"] = self.cost + body["cost"] = self.cost if self.data_source is not None: - body["{data_source}"] = self.data_source + body["data_source"] = self.data_source if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.documentation_link is not None: - body["{documentation_link}"] = self.documentation_link + body["documentation_link"] = self.documentation_link if self.embedded_notebook_file_infos: - body["{embedded_notebook_file_infos}"] = self.embedded_notebook_file_infos + body["embedded_notebook_file_infos"] = self.embedded_notebook_file_infos if self.file_ids: - body["{file_ids}"] = self.file_ids + body["file_ids"] = self.file_ids if self.geographical_coverage is not None: - body["{geographical_coverage}"] = self.geographical_coverage + body["geographical_coverage"] = self.geographical_coverage if self.license is not None: - body["{license}"] = self.license + body["license"] = self.license if self.pricing_model is not None: - body["{pricing_model}"] = self.pricing_model + body["pricing_model"] = self.pricing_model if self.privacy_policy_link is not None: - body["{privacy_policy_link}"] = self.privacy_policy_link + body["privacy_policy_link"] = self.privacy_policy_link if self.size is not None: - body["{size}"] = self.size + body["size"] = self.size if self.support_link is not None: - body["{support_link}"] = self.support_link + body["support_link"] = self.support_link if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.terms_of_service is not None: - body["{terms_of_service}"] = self.terms_of_service + body["terms_of_service"] = self.terms_of_service if self.update_frequency: - body["{update_frequency}"] = self.update_frequency + body["update_frequency"] = self.update_frequency return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingDetail: """Deserializes the ListingDetail from a dictionary.""" return cls( - assets=_repeated_enum(d, "{assets}", AssetType), - collection_date_end=d.get("{collection_date_end}", None), - collection_date_start=d.get("{collection_date_start}", None), - collection_granularity=_from_dict(d, "{collection_granularity}", DataRefreshInfo), - cost=_enum(d, "{cost}", Cost), - data_source=d.get("{data_source}", None), - description=d.get("{description}", None), - documentation_link=d.get("{documentation_link}", None), - embedded_notebook_file_infos=_repeated_dict(d, "{embedded_notebook_file_infos}", FileInfo), - file_ids=d.get("{file_ids}", None), - geographical_coverage=d.get("{geographical_coverage}", None), - license=d.get("{license}", None), - pricing_model=d.get("{pricing_model}", None), - privacy_policy_link=d.get("{privacy_policy_link}", None), - size=d.get("{size}", None), - support_link=d.get("{support_link}", None), - tags=_repeated_dict(d, "{tags}", ListingTag), - terms_of_service=d.get("{terms_of_service}", None), - update_frequency=_from_dict(d, "{update_frequency}", DataRefreshInfo), + assets=_repeated_enum(d, "assets", AssetType), + collection_date_end=d.get("collection_date_end", None), + collection_date_start=d.get("collection_date_start", None), + collection_granularity=_from_dict(d, "collection_granularity", DataRefreshInfo), + cost=_enum(d, "cost", Cost), + data_source=d.get("data_source", None), + description=d.get("description", None), + documentation_link=d.get("documentation_link", None), + embedded_notebook_file_infos=_repeated_dict(d, "embedded_notebook_file_infos", FileInfo), + file_ids=d.get("file_ids", None), + geographical_coverage=d.get("geographical_coverage", None), + license=d.get("license", None), + pricing_model=d.get("pricing_model", None), + privacy_policy_link=d.get("privacy_policy_link", None), + size=d.get("size", None), + support_link=d.get("support_link", None), + tags=_repeated_dict(d, "tags", ListingTag), + terms_of_service=d.get("terms_of_service", None), + update_frequency=_from_dict(d, "update_frequency", DataRefreshInfo), ) @@ -2195,26 +2187,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ListingFulfillment into a shallow dictionary of its immediate attributes.""" body = {} if self.fulfillment_type is not None: - body["{fulfillment_type}"] = self.fulfillment_type + body["fulfillment_type"] = self.fulfillment_type if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type + body["recipient_type"] = self.recipient_type if self.repo_info: - body["{repo_info}"] = self.repo_info + body["repo_info"] = self.repo_info if self.share_info: - body["{share_info}"] = self.share_info + body["share_info"] = self.share_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingFulfillment: """Deserializes the ListingFulfillment from a dictionary.""" return cls( - fulfillment_type=_enum(d, "{fulfillment_type}", FulfillmentType), - listing_id=d.get("{listing_id}", None), - recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), - repo_info=_from_dict(d, "{repo_info}", RepoInfo), - share_info=_from_dict(d, "{share_info}", ShareInfo), + fulfillment_type=_enum(d, "fulfillment_type", FulfillmentType), + listing_id=d.get("listing_id", None), + recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), + repo_info=_from_dict(d, "repo_info", RepoInfo), + share_info=_from_dict(d, "share_info", ShareInfo), ) @@ -2233,13 +2225,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListingSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.visibility is not None: - body["{visibility}"] = self.visibility + body["visibility"] = self.visibility return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingSetting: """Deserializes the ListingSetting from a dictionary.""" - return cls(visibility=_enum(d, "{visibility}", Visibility)) + return cls(visibility=_enum(d, "visibility", Visibility)) class ListingShareType(Enum): @@ -2347,68 +2339,68 @@ def as_shallow_dict(self) -> dict: """Serializes the ListingSummary into a shallow dictionary of its immediate attributes.""" body = {} if self.categories: - body["{categories}"] = self.categories + body["categories"] = self.categories if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.created_by_id is not None: - body["{created_by_id}"] = self.created_by_id + body["created_by_id"] = self.created_by_id if self.exchange_ids: - body["{exchange_ids}"] = self.exchange_ids + body["exchange_ids"] = self.exchange_ids if self.git_repo: - body["{git_repo}"] = self.git_repo + body["git_repo"] = self.git_repo if self.listing_type is not None: - body["{listing_type}"] = self.listing_type + body["listingType"] = self.listing_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.provider_id is not None: - body["{provider_id}"] = self.provider_id + body["provider_id"] = self.provider_id if self.provider_region: - body["{provider_region}"] = self.provider_region + body["provider_region"] = self.provider_region if self.published_at is not None: - body["{published_at}"] = self.published_at + body["published_at"] = self.published_at if self.published_by is not None: - body["{published_by}"] = self.published_by + body["published_by"] = self.published_by if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting if self.share: - body["{share}"] = self.share + body["share"] = self.share if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.subtitle is not None: - body["{subtitle}"] = self.subtitle + body["subtitle"] = self.subtitle if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by if self.updated_by_id is not None: - body["{updated_by_id}"] = self.updated_by_id + body["updated_by_id"] = self.updated_by_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingSummary: """Deserializes the ListingSummary from a dictionary.""" return cls( - categories=_repeated_enum(d, "{categories}", Category), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - created_by_id=d.get("{created_by_id}", None), - exchange_ids=d.get("{exchange_ids}", None), - git_repo=_from_dict(d, "{git_repo}", RepoInfo), - listing_type=_enum(d, "{listing_type}", ListingType), - name=d.get("{name}", None), - provider_id=d.get("{provider_id}", None), - provider_region=_from_dict(d, "{provider_region}", RegionInfo), - published_at=d.get("{published_at}", None), - published_by=d.get("{published_by}", None), - setting=_from_dict(d, "{setting}", ListingSetting), - share=_from_dict(d, "{share}", ShareInfo), - status=_enum(d, "{status}", ListingStatus), - subtitle=d.get("{subtitle}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), - updated_by_id=d.get("{updated_by_id}", None), + categories=_repeated_enum(d, "categories", Category), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + created_by_id=d.get("created_by_id", None), + exchange_ids=d.get("exchange_ids", None), + git_repo=_from_dict(d, "git_repo", RepoInfo), + listing_type=_enum(d, "listingType", ListingType), + name=d.get("name", None), + provider_id=d.get("provider_id", None), + provider_region=_from_dict(d, "provider_region", RegionInfo), + published_at=d.get("published_at", None), + published_by=d.get("published_by", None), + setting=_from_dict(d, "setting", ListingSetting), + share=_from_dict(d, "share", ShareInfo), + status=_enum(d, "status", ListingStatus), + subtitle=d.get("subtitle", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), + updated_by_id=d.get("updated_by_id", None), ) @@ -2433,15 +2425,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListingTag into a shallow dictionary of its immediate attributes.""" body = {} if self.tag_name is not None: - body["{tag_name}"] = self.tag_name + body["tag_name"] = self.tag_name if self.tag_values: - body["{tag_values}"] = self.tag_values + body["tag_values"] = self.tag_values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListingTag: """Deserializes the ListingTag from a dictionary.""" - return cls(tag_name=_enum(d, "{tag_name}", ListingTagType), tag_values=d.get("{tag_values}", None)) + return cls(tag_name=_enum(d, "tag_name", ListingTagType), tag_values=d.get("tag_values", None)) class ListingTagType(Enum): @@ -2539,59 +2531,59 @@ def as_shallow_dict(self) -> dict: """Serializes the PersonalizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.consumer_region: - body["{consumer_region}"] = self.consumer_region + body["consumer_region"] = self.consumer_region if self.contact_info: - body["{contact_info}"] = self.contact_info + body["contact_info"] = self.contact_info if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.intended_use is not None: - body["{intended_use}"] = self.intended_use + body["intended_use"] = self.intended_use if self.is_from_lighthouse is not None: - body["{is_from_lighthouse}"] = self.is_from_lighthouse + body["is_from_lighthouse"] = self.is_from_lighthouse if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.listing_name is not None: - body["{listing_name}"] = self.listing_name + body["listing_name"] = self.listing_name if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.provider_id is not None: - body["{provider_id}"] = self.provider_id + body["provider_id"] = self.provider_id if self.recipient_type is not None: - body["{recipient_type}"] = self.recipient_type + body["recipient_type"] = self.recipient_type if self.share: - body["{share}"] = self.share + body["share"] = self.share if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PersonalizationRequest: """Deserializes the PersonalizationRequest from a dictionary.""" return cls( - comment=d.get("{comment}", None), - consumer_region=_from_dict(d, "{consumer_region}", RegionInfo), - contact_info=_from_dict(d, "{contact_info}", ContactInfo), - created_at=d.get("{created_at}", None), - id=d.get("{id}", None), - intended_use=d.get("{intended_use}", None), - is_from_lighthouse=d.get("{is_from_lighthouse}", None), - listing_id=d.get("{listing_id}", None), - listing_name=d.get("{listing_name}", None), - metastore_id=d.get("{metastore_id}", None), - provider_id=d.get("{provider_id}", None), - recipient_type=_enum(d, "{recipient_type}", DeltaSharingRecipientType), - share=_from_dict(d, "{share}", ShareInfo), - status=_enum(d, "{status}", PersonalizationRequestStatus), - status_message=d.get("{status_message}", None), - updated_at=d.get("{updated_at}", None), + comment=d.get("comment", None), + consumer_region=_from_dict(d, "consumer_region", RegionInfo), + contact_info=_from_dict(d, "contact_info", ContactInfo), + created_at=d.get("created_at", None), + id=d.get("id", None), + intended_use=d.get("intended_use", None), + is_from_lighthouse=d.get("is_from_lighthouse", None), + listing_id=d.get("listing_id", None), + listing_name=d.get("listing_name", None), + metastore_id=d.get("metastore_id", None), + provider_id=d.get("provider_id", None), + recipient_type=_enum(d, "recipient_type", DeltaSharingRecipientType), + share=_from_dict(d, "share", ShareInfo), + status=_enum(d, "status", PersonalizationRequestStatus), + status_message=d.get("status_message", None), + updated_at=d.get("updated_at", None), ) @@ -2618,13 +2610,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ProviderAnalyticsDashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderAnalyticsDashboard: """Deserializes the ProviderAnalyticsDashboard from a dictionary.""" - return cls(id=d.get("{id}", None)) + return cls(id=d.get("id", None)) @dataclass @@ -2696,53 +2688,53 @@ def as_shallow_dict(self) -> dict: """Serializes the ProviderInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.business_contact_email is not None: - body["{business_contact_email}"] = self.business_contact_email + body["business_contact_email"] = self.business_contact_email if self.company_website_link is not None: - body["{company_website_link}"] = self.company_website_link + body["company_website_link"] = self.company_website_link if self.dark_mode_icon_file_id is not None: - body["{dark_mode_icon_file_id}"] = self.dark_mode_icon_file_id + body["dark_mode_icon_file_id"] = self.dark_mode_icon_file_id if self.dark_mode_icon_file_path is not None: - body["{dark_mode_icon_file_path}"] = self.dark_mode_icon_file_path + body["dark_mode_icon_file_path"] = self.dark_mode_icon_file_path if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.icon_file_id is not None: - body["{icon_file_id}"] = self.icon_file_id + body["icon_file_id"] = self.icon_file_id if self.icon_file_path is not None: - body["{icon_file_path}"] = self.icon_file_path + body["icon_file_path"] = self.icon_file_path if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_featured is not None: - body["{is_featured}"] = self.is_featured + body["is_featured"] = self.is_featured if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.privacy_policy_link is not None: - body["{privacy_policy_link}"] = self.privacy_policy_link + body["privacy_policy_link"] = self.privacy_policy_link if self.published_by is not None: - body["{published_by}"] = self.published_by + body["published_by"] = self.published_by if self.support_contact_email is not None: - body["{support_contact_email}"] = self.support_contact_email + body["support_contact_email"] = self.support_contact_email if self.term_of_service_link is not None: - body["{term_of_service_link}"] = self.term_of_service_link + body["term_of_service_link"] = self.term_of_service_link return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderInfo: """Deserializes the ProviderInfo from a dictionary.""" return cls( - business_contact_email=d.get("{business_contact_email}", None), - company_website_link=d.get("{company_website_link}", None), - dark_mode_icon_file_id=d.get("{dark_mode_icon_file_id}", None), - dark_mode_icon_file_path=d.get("{dark_mode_icon_file_path}", None), - description=d.get("{description}", None), - icon_file_id=d.get("{icon_file_id}", None), - icon_file_path=d.get("{icon_file_path}", None), - id=d.get("{id}", None), - is_featured=d.get("{is_featured}", None), - name=d.get("{name}", None), - privacy_policy_link=d.get("{privacy_policy_link}", None), - published_by=d.get("{published_by}", None), - support_contact_email=d.get("{support_contact_email}", None), - term_of_service_link=d.get("{term_of_service_link}", None), + business_contact_email=d.get("business_contact_email", None), + company_website_link=d.get("company_website_link", None), + dark_mode_icon_file_id=d.get("dark_mode_icon_file_id", None), + dark_mode_icon_file_path=d.get("dark_mode_icon_file_path", None), + description=d.get("description", None), + icon_file_id=d.get("icon_file_id", None), + icon_file_path=d.get("icon_file_path", None), + id=d.get("id", None), + is_featured=d.get("is_featured", None), + name=d.get("name", None), + privacy_policy_link=d.get("privacy_policy_link", None), + published_by=d.get("published_by", None), + support_contact_email=d.get("support_contact_email", None), + term_of_service_link=d.get("term_of_service_link", None), ) @@ -2765,15 +2757,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RegionInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegionInfo: """Deserializes the RegionInfo from a dictionary.""" - return cls(cloud=d.get("{cloud}", None), region=d.get("{region}", None)) + return cls(cloud=d.get("cloud", None), region=d.get("region", None)) @dataclass @@ -2810,13 +2802,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.git_repo_url is not None: - body["{git_repo_url}"] = self.git_repo_url + body["git_repo_url"] = self.git_repo_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoInfo: """Deserializes the RepoInfo from a dictionary.""" - return cls(git_repo_url=d.get("{git_repo_url}", None)) + return cls(git_repo_url=d.get("git_repo_url", None)) @dataclass @@ -2841,15 +2833,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoInstallation into a shallow dictionary of its immediate attributes.""" body = {} if self.repo_name is not None: - body["{repo_name}"] = self.repo_name + body["repo_name"] = self.repo_name if self.repo_path is not None: - body["{repo_path}"] = self.repo_path + body["repo_path"] = self.repo_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoInstallation: """Deserializes the RepoInstallation from a dictionary.""" - return cls(repo_name=d.get("{repo_name}", None), repo_path=d.get("{repo_path}", None)) + return cls(repo_name=d.get("repo_name", None), repo_path=d.get("repo_path", None)) @dataclass @@ -2871,15 +2863,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SearchListingsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listings: - body["{listings}"] = self.listings + body["listings"] = self.listings if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchListingsResponse: """Deserializes the SearchListingsResponse from a dictionary.""" - return cls(listings=_repeated_dict(d, "{listings}", Listing), next_page_token=d.get("{next_page_token}", None)) + return cls(listings=_repeated_dict(d, "listings", Listing), next_page_token=d.get("next_page_token", None)) @dataclass @@ -2901,15 +2893,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ShareInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ShareInfo: """Deserializes the ShareInfo from a dictionary.""" - return cls(name=d.get("{name}", None), type=_enum(d, "{type}", ListingShareType)) + return cls(name=d.get("name", None), type=_enum(d, "type", ListingShareType)) @dataclass @@ -2933,15 +2925,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SharedDataObject into a shallow dictionary of its immediate attributes.""" body = {} if self.data_object_type is not None: - body["{data_object_type}"] = self.data_object_type + body["data_object_type"] = self.data_object_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SharedDataObject: """Deserializes the SharedDataObject from a dictionary.""" - return cls(data_object_type=d.get("{data_object_type}", None), name=d.get("{name}", None)) + return cls(data_object_type=d.get("data_object_type", None), name=d.get("name", None)) @dataclass @@ -2973,23 +2965,23 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.bearer_token is not None: - body["{bearer_token}"] = self.bearer_token + body["bearerToken"] = self.bearer_token if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expirationTime"] = self.expiration_time if self.share_credentials_version is not None: - body["{share_credentials_version}"] = self.share_credentials_version + body["shareCredentialsVersion"] = self.share_credentials_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenDetail: """Deserializes the TokenDetail from a dictionary.""" return cls( - bearer_token=d.get("{bearer_token}", None), - endpoint=d.get("{endpoint}", None), - expiration_time=d.get("{expiration_time}", None), - share_credentials_version=d.get("{share_credentials_version}", None), + bearer_token=d.get("bearerToken", None), + endpoint=d.get("endpoint", None), + expiration_time=d.get("expirationTime", None), + share_credentials_version=d.get("shareCredentialsVersion", None), ) @@ -3040,32 +3032,32 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.activation_url is not None: - body["{activation_url}"] = self.activation_url + body["activation_url"] = self.activation_url if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenInfo: """Deserializes the TokenInfo from a dictionary.""" return cls( - activation_url=d.get("{activation_url}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - expiration_time=d.get("{expiration_time}", None), - id=d.get("{id}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + activation_url=d.get("activation_url", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + expiration_time=d.get("expiration_time", None), + id=d.get("id", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -3088,15 +3080,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeFilterRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.filter: - body["{filter}"] = self.filter + body["filter"] = self.filter if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeFilterRequest: """Deserializes the UpdateExchangeFilterRequest from a dictionary.""" - return cls(filter=_from_dict(d, "{filter}", ExchangeFilter), id=d.get("{id}", None)) + return cls(filter=_from_dict(d, "filter", ExchangeFilter), id=d.get("id", None)) @dataclass @@ -3114,13 +3106,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeFilterResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.filter: - body["{filter}"] = self.filter + body["filter"] = self.filter return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeFilterResponse: """Deserializes the UpdateExchangeFilterResponse from a dictionary.""" - return cls(filter=_from_dict(d, "{filter}", ExchangeFilter)) + return cls(filter=_from_dict(d, "filter", ExchangeFilter)) @dataclass @@ -3142,15 +3134,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange + body["exchange"] = self.exchange if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeRequest: """Deserializes the UpdateExchangeRequest from a dictionary.""" - return cls(exchange=_from_dict(d, "{exchange}", Exchange), id=d.get("{id}", None)) + return cls(exchange=_from_dict(d, "exchange", Exchange), id=d.get("id", None)) @dataclass @@ -3168,13 +3160,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateExchangeResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.exchange: - body["{exchange}"] = self.exchange + body["exchange"] = self.exchange return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExchangeResponse: """Deserializes the UpdateExchangeResponse from a dictionary.""" - return cls(exchange=_from_dict(d, "{exchange}", Exchange)) + return cls(exchange=_from_dict(d, "exchange", Exchange)) @dataclass @@ -3204,23 +3196,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateInstallationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.installation: - body["{installation}"] = self.installation + body["installation"] = self.installation if self.installation_id is not None: - body["{installation_id}"] = self.installation_id + body["installation_id"] = self.installation_id if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.rotate_token is not None: - body["{rotate_token}"] = self.rotate_token + body["rotate_token"] = self.rotate_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateInstallationRequest: """Deserializes the UpdateInstallationRequest from a dictionary.""" return cls( - installation=_from_dict(d, "{installation}", InstallationDetail), - installation_id=d.get("{installation_id}", None), - listing_id=d.get("{listing_id}", None), - rotate_token=d.get("{rotate_token}", None), + installation=_from_dict(d, "installation", InstallationDetail), + installation_id=d.get("installation_id", None), + listing_id=d.get("listing_id", None), + rotate_token=d.get("rotate_token", None), ) @@ -3239,13 +3231,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateInstallationResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.installation: - body["{installation}"] = self.installation + body["installation"] = self.installation return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateInstallationResponse: """Deserializes the UpdateInstallationResponse from a dictionary.""" - return cls(installation=_from_dict(d, "{installation}", InstallationDetail)) + return cls(installation=_from_dict(d, "installation", InstallationDetail)) @dataclass @@ -3267,15 +3259,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateListingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.listing: - body["{listing}"] = self.listing + body["listing"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateListingRequest: """Deserializes the UpdateListingRequest from a dictionary.""" - return cls(id=d.get("{id}", None), listing=_from_dict(d, "{listing}", Listing)) + return cls(id=d.get("id", None), listing=_from_dict(d, "listing", Listing)) @dataclass @@ -3293,13 +3285,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateListingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.listing: - body["{listing}"] = self.listing + body["listing"] = self.listing return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateListingResponse: """Deserializes the UpdateListingResponse from a dictionary.""" - return cls(listing=_from_dict(d, "{listing}", Listing)) + return cls(listing=_from_dict(d, "listing", Listing)) @dataclass @@ -3333,26 +3325,26 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.listing_id is not None: - body["{listing_id}"] = self.listing_id + body["listing_id"] = self.listing_id if self.reason is not None: - body["{reason}"] = self.reason + body["reason"] = self.reason if self.request_id is not None: - body["{request_id}"] = self.request_id + body["request_id"] = self.request_id if self.share: - body["{share}"] = self.share + body["share"] = self.share if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePersonalizationRequestRequest: """Deserializes the UpdatePersonalizationRequestRequest from a dictionary.""" return cls( - listing_id=d.get("{listing_id}", None), - reason=d.get("{reason}", None), - request_id=d.get("{request_id}", None), - share=_from_dict(d, "{share}", ShareInfo), - status=_enum(d, "{status}", PersonalizationRequestStatus), + listing_id=d.get("listing_id", None), + reason=d.get("reason", None), + request_id=d.get("request_id", None), + share=_from_dict(d, "share", ShareInfo), + status=_enum(d, "status", PersonalizationRequestStatus), ) @@ -3371,13 +3363,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdatePersonalizationRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.request: - body["{request}"] = self.request + body["request"] = self.request return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePersonalizationRequestResponse: """Deserializes the UpdatePersonalizationRequestResponse from a dictionary.""" - return cls(request=_from_dict(d, "{request}", PersonalizationRequest)) + return cls(request=_from_dict(d, "request", PersonalizationRequest)) @dataclass @@ -3402,15 +3394,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderAnalyticsDashboardRequest: """Deserializes the UpdateProviderAnalyticsDashboardRequest from a dictionary.""" - return cls(id=d.get("{id}", None), version=d.get("{version}", None)) + return cls(id=d.get("id", None), version=d.get("version", None)) @dataclass @@ -3438,17 +3430,17 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderAnalyticsDashboardResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderAnalyticsDashboardResponse: """Deserializes the UpdateProviderAnalyticsDashboardResponse from a dictionary.""" - return cls(dashboard_id=d.get("{dashboard_id}", None), id=d.get("{id}", None), version=d.get("{version}", None)) + return cls(dashboard_id=d.get("dashboard_id", None), id=d.get("id", None), version=d.get("version", None)) @dataclass @@ -3470,15 +3462,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.provider: - body["{provider}"] = self.provider + body["provider"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderRequest: """Deserializes the UpdateProviderRequest from a dictionary.""" - return cls(id=d.get("{id}", None), provider=_from_dict(d, "{provider}", ProviderInfo)) + return cls(id=d.get("id", None), provider=_from_dict(d, "provider", ProviderInfo)) @dataclass @@ -3496,13 +3488,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateProviderResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.provider: - body["{provider}"] = self.provider + body["provider"] = self.provider return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProviderResponse: """Deserializes the UpdateProviderResponse from a dictionary.""" - return cls(provider=_from_dict(d, "{provider}", ProviderInfo)) + return cls(provider=_from_dict(d, "provider", ProviderInfo)) class Visibility(Enum): @@ -3533,9 +3525,9 @@ def get( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -3544,12 +3536,12 @@ def get( json = self._api.do( "GET", f"/api/2.1/marketplace-consumer/listings/{listing_id}/content", query=query, headers=headers ) - if "{shared_data_objects}" in json: - for v in json["{shared_data_objects}"]: + if "shared_data_objects" in json: + for v in json["shared_data_objects"]: yield SharedDataObject.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list( self, listing_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3570,9 +3562,9 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -3581,12 +3573,12 @@ def list( json = self._api.do( "GET", f"/api/2.1/marketplace-consumer/listings/{listing_id}/fulfillments", query=query, headers=headers ) - if "{fulfillments}" in json: - for v in json["{fulfillments}"]: + if "fulfillments" in json: + for v in json["fulfillments"]: yield ListingFulfillment.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class ConsumerInstallationsAPI: @@ -3621,15 +3613,15 @@ def create( """ body = {} if accepted_consumer_terms is not None: - body["{accepted_consumer_terms}"] = accepted_consumer_terms.as_dict() + body["accepted_consumer_terms"] = accepted_consumer_terms.as_dict() if catalog_name is not None: - body["{catalog_name}"] = catalog_name + body["catalog_name"] = catalog_name if recipient_type is not None: - body["{recipient_type}"] = recipient_type.value + body["recipient_type"] = recipient_type.value if repo_detail is not None: - body["{repo_detail}"] = repo_detail.as_dict() + body["repo_detail"] = repo_detail.as_dict() if share_name is not None: - body["{share_name}"] = share_name + body["share_name"] = share_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3676,21 +3668,21 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/installations", query=query, headers=headers) - if "{installations}" in json: - for v in json["{installations}"]: + if "installations" in json: + for v in json["installations"]: yield InstallationDetail.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_listing_installations( self, listing_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -3708,9 +3700,9 @@ def list_listing_installations( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -3722,12 +3714,12 @@ def list_listing_installations( query=query, headers=headers, ) - if "{installations}" in json: - for v in json["{installations}"]: + if "installations" in json: + for v in json["installations"]: yield InstallationDetail.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -3753,9 +3745,9 @@ def update( """ body = {} if installation is not None: - body["{installation}"] = installation.as_dict() + body["installation"] = installation.as_dict() if rotate_token is not None: - body["{rotate_token}"] = rotate_token + body["rotate_token"] = rotate_token headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3789,7 +3781,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetListingsRespo query = {} if ids is not None: - query["{ids}"] = [v for v in ids] + query["ids"] = [v for v in ids] headers = { "0": "{Accept application/json}", } @@ -3853,35 +3845,35 @@ def list( query = {} if assets is not None: - query["{assets}"] = [v.value for v in assets] + query["assets"] = [v.value for v in assets] if categories is not None: - query["{categories}"] = [v.value for v in categories] + query["categories"] = [v.value for v in categories] if is_free is not None: - query["{is_free}"] = is_free + query["is_free"] = is_free if is_private_exchange is not None: - query["{is_private_exchange}"] = is_private_exchange + query["is_private_exchange"] = is_private_exchange if is_staff_pick is not None: - query["{is_staff_pick}"] = is_staff_pick + query["is_staff_pick"] = is_staff_pick if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if provider_ids is not None: - query["{provider_ids}"] = [v for v in provider_ids] + query["provider_ids"] = [v for v in provider_ids] if tags is not None: - query["{tags}"] = [v.as_dict() for v in tags] + query["tags"] = [v.as_dict() for v in tags] headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/listings", query=query, headers=headers) - if "{listings}" in json: - for v in json["{listings}"]: + if "listings" in json: + for v in json["listings"]: yield Listing.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def search( self, @@ -3918,33 +3910,33 @@ def search( query = {} if assets is not None: - query["{assets}"] = [v.value for v in assets] + query["assets"] = [v.value for v in assets] if categories is not None: - query["{categories}"] = [v.value for v in categories] + query["categories"] = [v.value for v in categories] if is_free is not None: - query["{is_free}"] = is_free + query["is_free"] = is_free if is_private_exchange is not None: - query["{is_private_exchange}"] = is_private_exchange + query["is_private_exchange"] = is_private_exchange if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if provider_ids is not None: - query["{provider_ids}"] = [v for v in provider_ids] + query["provider_ids"] = [v for v in provider_ids] if query is not None: - query["{query}"] = query + query["query"] = query headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/search-listings", query=query, headers=headers) - if "{listings}" in json: - for v in json["{listings}"]: + if "listings" in json: + for v in json["listings"]: yield Listing.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class ConsumerPersonalizationRequestsAPI: @@ -3984,21 +3976,21 @@ def create( """ body = {} if accepted_consumer_terms is not None: - body["{accepted_consumer_terms}"] = accepted_consumer_terms.as_dict() + body["accepted_consumer_terms"] = accepted_consumer_terms.as_dict() if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if company is not None: - body["{company}"] = company + body["company"] = company if first_name is not None: - body["{first_name}"] = first_name + body["first_name"] = first_name if intended_use is not None: - body["{intended_use}"] = intended_use + body["intended_use"] = intended_use if is_from_lighthouse is not None: - body["{is_from_lighthouse}"] = is_from_lighthouse + body["is_from_lighthouse"] = is_from_lighthouse if last_name is not None: - body["{last_name}"] = last_name + body["last_name"] = last_name if recipient_type is not None: - body["{recipient_type}"] = recipient_type.value + body["recipient_type"] = recipient_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4047,9 +4039,9 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -4058,12 +4050,12 @@ def list( json = self._api.do( "GET", "/api/2.1/marketplace-consumer/personalization-requests", query=query, headers=headers ) - if "{personalization_requests}" in json: - for v in json["{personalization_requests}"]: + if "personalization_requests" in json: + for v in json["personalization_requests"]: yield PersonalizationRequest.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class ConsumerProvidersAPI: @@ -4084,7 +4076,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetProvidersResp query = {} if ids is not None: - query["{ids}"] = [v for v in ids] + query["ids"] = [v for v in ids] headers = { "0": "{Accept application/json}", } @@ -4125,23 +4117,23 @@ def list( query = {} if is_featured is not None: - query["{is_featured}"] = is_featured + query["is_featured"] = is_featured if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/providers", query=query, headers=headers) - if "{providers}" in json: - for v in json["{providers}"]: + if "providers" in json: + for v in json["providers"]: yield ProviderInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class ProviderExchangeFiltersAPI: @@ -4161,7 +4153,7 @@ def create(self, filter: ExchangeFilter) -> CreateExchangeFilterResponse: """ body = {} if filter is not None: - body["{filter}"] = filter.as_dict() + body["filter"] = filter.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4202,23 +4194,23 @@ def list( query = {} if exchange_id is not None: - query["{exchange_id}"] = exchange_id + query["exchange_id"] = exchange_id if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-exchange/filters", query=query, headers=headers) - if "{filters}" in json: - for v in json["{filters}"]: + if "filters" in json: + for v in json["filters"]: yield ExchangeFilter.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterResponse: """Update exchange filter. @@ -4232,7 +4224,7 @@ def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterRespons """ body = {} if filter is not None: - body["{filter}"] = filter.as_dict() + body["filter"] = filter.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4260,9 +4252,9 @@ def add_listing_to_exchange(self, listing_id: str, exchange_id: str) -> AddExcha """ body = {} if exchange_id is not None: - body["{exchange_id}"] = exchange_id + body["exchange_id"] = exchange_id if listing_id is not None: - body["{listing_id}"] = listing_id + body["listing_id"] = listing_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4282,7 +4274,7 @@ def create(self, exchange: Exchange) -> CreateExchangeResponse: """ body = {} if exchange is not None: - body["{exchange}"] = exchange.as_dict() + body["exchange"] = exchange.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4353,21 +4345,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-exchange/exchanges", query=query, headers=headers) - if "{exchanges}" in json: - for v in json["{exchanges}"]: + if "exchanges" in json: + for v in json["exchanges"]: yield Exchange.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_exchanges_for_listing( self, listing_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -4385,11 +4377,11 @@ def list_exchanges_for_listing( query = {} if listing_id is not None: - query["{listing_id}"] = listing_id + query["listing_id"] = listing_id if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -4398,12 +4390,12 @@ def list_exchanges_for_listing( json = self._api.do( "GET", "/api/2.0/marketplace-exchange/exchanges-for-listing", query=query, headers=headers ) - if "{exchange_listing}" in json: - for v in json["{exchange_listing}"]: + if "exchange_listing" in json: + for v in json["exchange_listing"]: yield ExchangeListing.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_listings_for_exchange( self, exchange_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -4421,11 +4413,11 @@ def list_listings_for_exchange( query = {} if exchange_id is not None: - query["{exchange_id}"] = exchange_id + query["exchange_id"] = exchange_id if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -4434,12 +4426,12 @@ def list_listings_for_exchange( json = self._api.do( "GET", "/api/2.0/marketplace-exchange/listings-for-exchange", query=query, headers=headers ) - if "{exchange_listings}" in json: - for v in json["{exchange_listings}"]: + if "exchange_listings" in json: + for v in json["exchange_listings"]: yield ExchangeListing.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: """Update exchange. @@ -4453,7 +4445,7 @@ def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: """ body = {} if exchange is not None: - body["{exchange}"] = exchange.as_dict() + body["exchange"] = exchange.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4490,13 +4482,13 @@ def create( """ body = {} if display_name is not None: - body["{display_name}"] = display_name + body["display_name"] = display_name if file_parent is not None: - body["{file_parent}"] = file_parent.as_dict() + body["file_parent"] = file_parent.as_dict() if marketplace_file_type is not None: - body["{marketplace_file_type}"] = marketplace_file_type.value + body["marketplace_file_type"] = marketplace_file_type.value if mime_type is not None: - body["{mime_type}"] = mime_type + body["mime_type"] = mime_type headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4554,23 +4546,23 @@ def list( query = {} if file_parent is not None: - query["{file_parent}"] = file_parent.as_dict() + query["file_parent"] = file_parent.as_dict() if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/files", query=query, headers=headers) - if "{file_infos}" in json: - for v in json["{file_infos}"]: + if "file_infos" in json: + for v in json["file_infos"]: yield FileInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class ProviderListingsAPI: @@ -4591,7 +4583,7 @@ def create(self, listing: Listing) -> CreateListingResponse: """ body = {} if listing is not None: - body["{listing}"] = listing.as_dict() + body["listing"] = listing.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4646,21 +4638,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/listings", query=query, headers=headers) - if "{listings}" in json: - for v in json["{listings}"]: + if "listings" in json: + for v in json["listings"]: yield Listing.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, id: str, listing: Listing) -> UpdateListingResponse: """Update listing. @@ -4674,7 +4666,7 @@ def update(self, id: str, listing: Listing) -> UpdateListingResponse: """ body = {} if listing is not None: - body["{listing}"] = listing.as_dict() + body["listing"] = listing.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4707,9 +4699,9 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -4718,12 +4710,12 @@ def list( json = self._api.do( "GET", "/api/2.0/marketplace-provider/personalization-requests", query=query, headers=headers ) - if "{personalization_requests}" in json: - for v in json["{personalization_requests}"]: + if "personalization_requests" in json: + for v in json["personalization_requests"]: yield PersonalizationRequest.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -4748,11 +4740,11 @@ def update( """ body = {} if reason is not None: - body["{reason}"] = reason + body["reason"] = reason if share is not None: - body["{share}"] = share.as_dict() + body["share"] = share.as_dict() if status is not None: - body["{status}"] = status.value + body["status"] = status.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4834,7 +4826,7 @@ def update(self, id: str, *, version: Optional[int] = None) -> UpdateProviderAna """ body = {} if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4861,7 +4853,7 @@ def create(self, provider: ProviderInfo) -> CreateProviderResponse: """ body = {} if provider is not None: - body["{provider}"] = provider.as_dict() + body["provider"] = provider.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4916,21 +4908,21 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/providers", query=query, headers=headers) - if "{providers}" in json: - for v in json["{providers}"]: + if "providers" in json: + for v in json["providers"]: yield ProviderInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse: """Update provider. @@ -4944,7 +4936,7 @@ def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse: """ body = {} if provider is not None: - body["{provider}"] = provider.as_dict() + body["provider"] = provider.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/ml/v2/impl.py b/databricks/sdk/ml/v2/impl.py index d4a08bbc5..2da3695c4 100755 --- a/databricks/sdk/ml/v2/impl.py +++ b/databricks/sdk/ml/v2/impl.py @@ -104,38 +104,38 @@ def as_shallow_dict(self) -> dict: """Serializes the Activity into a shallow dictionary of its immediate attributes.""" body = {} if self.activity_type is not None: - body["{activity_type}"] = self.activity_type + body["activity_type"] = self.activity_type if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.from_stage is not None: - body["{from_stage}"] = self.from_stage + body["from_stage"] = self.from_stage if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.system_comment is not None: - body["{system_comment}"] = self.system_comment + body["system_comment"] = self.system_comment if self.to_stage is not None: - body["{to_stage}"] = self.to_stage + body["to_stage"] = self.to_stage if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Activity: """Deserializes the Activity from a dictionary.""" return cls( - activity_type=_enum(d, "{activity_type}", ActivityType), - comment=d.get("{comment}", None), - creation_timestamp=d.get("{creation_timestamp}", None), - from_stage=_enum(d, "{from_stage}", Stage), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - system_comment=d.get("{system_comment}", None), - to_stage=_enum(d, "{to_stage}", Stage), - user_id=d.get("{user_id}", None), + activity_type=_enum(d, "activity_type", ActivityType), + comment=d.get("comment", None), + creation_timestamp=d.get("creation_timestamp", None), + from_stage=_enum(d, "from_stage", Stage), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + system_comment=d.get("system_comment", None), + to_stage=_enum(d, "to_stage", Stage), + user_id=d.get("user_id", None), ) @@ -220,26 +220,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ApproveTransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.archive_existing_versions is not None: - body["{archive_existing_versions}"] = self.archive_existing_versions + body["archive_existing_versions"] = self.archive_existing_versions if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage + body["stage"] = self.stage if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApproveTransitionRequest: """Deserializes the ApproveTransitionRequest from a dictionary.""" return cls( - archive_existing_versions=d.get("{archive_existing_versions}", None), - comment=d.get("{comment}", None), - name=d.get("{name}", None), - stage=_enum(d, "{stage}", Stage), - version=d.get("{version}", None), + archive_existing_versions=d.get("archive_existing_versions", None), + comment=d.get("comment", None), + name=d.get("name", None), + stage=_enum(d, "stage", Stage), + version=d.get("version", None), ) @@ -259,13 +259,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ApproveTransitionRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.activity: - body["{activity}"] = self.activity + body["activity"] = self.activity return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApproveTransitionRequestResponse: """Deserializes the ApproveTransitionRequestResponse from a dictionary.""" - return cls(activity=_from_dict(d, "{activity}", Activity)) + return cls(activity=_from_dict(d, "activity", Activity)) class CommentActivityAction(Enum): @@ -321,29 +321,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CommentObject into a shallow dictionary of its immediate attributes.""" body = {} if self.available_actions: - body["{available_actions}"] = self.available_actions + body["available_actions"] = self.available_actions if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CommentObject: """Deserializes the CommentObject from a dictionary.""" return cls( - available_actions=_repeated_enum(d, "{available_actions}", CommentActivityAction), - comment=d.get("{comment}", None), - creation_timestamp=d.get("{creation_timestamp}", None), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - user_id=d.get("{user_id}", None), + available_actions=_repeated_enum(d, "available_actions", CommentActivityAction), + comment=d.get("comment", None), + creation_timestamp=d.get("creation_timestamp", None), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + user_id=d.get("user_id", None), ) @@ -373,17 +373,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateComment into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateComment: """Deserializes the CreateComment from a dictionary.""" - return cls(comment=d.get("{comment}", None), name=d.get("{name}", None), version=d.get("{version}", None)) + return cls(comment=d.get("comment", None), name=d.get("name", None), version=d.get("version", None)) @dataclass @@ -402,13 +402,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCommentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.comment: - body["{comment}"] = self.comment + body["comment"] = self.comment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCommentResponse: """Deserializes the CreateCommentResponse from a dictionary.""" - return cls(comment=_from_dict(d, "{comment}", CommentObject)) + return cls(comment=_from_dict(d, "comment", CommentObject)) @dataclass @@ -441,20 +441,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_location is not None: - body["{artifact_location}"] = self.artifact_location + body["artifact_location"] = self.artifact_location if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExperiment: """Deserializes the CreateExperiment from a dictionary.""" return cls( - artifact_location=d.get("{artifact_location}", None), - name=d.get("{name}", None), - tags=_repeated_dict(d, "{tags}", ExperimentTag), + artifact_location=d.get("artifact_location", None), + name=d.get("name", None), + tags=_repeated_dict(d, "tags", ExperimentTag), ) @@ -474,13 +474,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateExperimentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateExperimentResponse: """Deserializes the CreateExperimentResponse from a dictionary.""" - return cls(experiment_id=d.get("{experiment_id}", None)) + return cls(experiment_id=d.get("experiment_id", None)) @dataclass @@ -580,56 +580,56 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateForecastingExperimentRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_weights_column is not None: - body["{custom_weights_column}"] = self.custom_weights_column + body["custom_weights_column"] = self.custom_weights_column if self.experiment_path is not None: - body["{experiment_path}"] = self.experiment_path + body["experiment_path"] = self.experiment_path if self.forecast_granularity is not None: - body["{forecast_granularity}"] = self.forecast_granularity + body["forecast_granularity"] = self.forecast_granularity if self.forecast_horizon is not None: - body["{forecast_horizon}"] = self.forecast_horizon + body["forecast_horizon"] = self.forecast_horizon if self.holiday_regions: - body["{holiday_regions}"] = self.holiday_regions + body["holiday_regions"] = self.holiday_regions if self.max_runtime is not None: - body["{max_runtime}"] = self.max_runtime + body["max_runtime"] = self.max_runtime if self.prediction_data_path is not None: - body["{prediction_data_path}"] = self.prediction_data_path + body["prediction_data_path"] = self.prediction_data_path if self.primary_metric is not None: - body["{primary_metric}"] = self.primary_metric + body["primary_metric"] = self.primary_metric if self.register_to is not None: - body["{register_to}"] = self.register_to + body["register_to"] = self.register_to if self.split_column is not None: - body["{split_column}"] = self.split_column + body["split_column"] = self.split_column if self.target_column is not None: - body["{target_column}"] = self.target_column + body["target_column"] = self.target_column if self.time_column is not None: - body["{time_column}"] = self.time_column + body["time_column"] = self.time_column if self.timeseries_identifier_columns: - body["{timeseries_identifier_columns}"] = self.timeseries_identifier_columns + body["timeseries_identifier_columns"] = self.timeseries_identifier_columns if self.train_data_path is not None: - body["{train_data_path}"] = self.train_data_path + body["train_data_path"] = self.train_data_path if self.training_frameworks: - body["{training_frameworks}"] = self.training_frameworks + body["training_frameworks"] = self.training_frameworks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateForecastingExperimentRequest: """Deserializes the CreateForecastingExperimentRequest from a dictionary.""" return cls( - custom_weights_column=d.get("{custom_weights_column}", None), - experiment_path=d.get("{experiment_path}", None), - forecast_granularity=d.get("{forecast_granularity}", None), - forecast_horizon=d.get("{forecast_horizon}", None), - holiday_regions=d.get("{holiday_regions}", None), - max_runtime=d.get("{max_runtime}", None), - prediction_data_path=d.get("{prediction_data_path}", None), - primary_metric=d.get("{primary_metric}", None), - register_to=d.get("{register_to}", None), - split_column=d.get("{split_column}", None), - target_column=d.get("{target_column}", None), - time_column=d.get("{time_column}", None), - timeseries_identifier_columns=d.get("{timeseries_identifier_columns}", None), - train_data_path=d.get("{train_data_path}", None), - training_frameworks=d.get("{training_frameworks}", None), + custom_weights_column=d.get("custom_weights_column", None), + experiment_path=d.get("experiment_path", None), + forecast_granularity=d.get("forecast_granularity", None), + forecast_horizon=d.get("forecast_horizon", None), + holiday_regions=d.get("holiday_regions", None), + max_runtime=d.get("max_runtime", None), + prediction_data_path=d.get("prediction_data_path", None), + primary_metric=d.get("primary_metric", None), + register_to=d.get("register_to", None), + split_column=d.get("split_column", None), + target_column=d.get("target_column", None), + time_column=d.get("time_column", None), + timeseries_identifier_columns=d.get("timeseries_identifier_columns", None), + train_data_path=d.get("train_data_path", None), + training_frameworks=d.get("training_frameworks", None), ) @@ -649,13 +649,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateForecastingExperimentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateForecastingExperimentResponse: """Deserializes the CreateForecastingExperimentResponse from a dictionary.""" - return cls(experiment_id=d.get("{experiment_id}", None)) + return cls(experiment_id=d.get("experiment_id", None)) @dataclass @@ -684,20 +684,18 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelRequest: """Deserializes the CreateModelRequest from a dictionary.""" return cls( - description=d.get("{description}", None), - name=d.get("{name}", None), - tags=_repeated_dict(d, "{tags}", ModelTag), + description=d.get("description", None), name=d.get("name", None), tags=_repeated_dict(d, "tags", ModelTag) ) @@ -716,13 +714,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateModelResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.registered_model: - body["{registered_model}"] = self.registered_model + body["registered_model"] = self.registered_model return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelResponse: """Deserializes the CreateModelResponse from a dictionary.""" - return cls(registered_model=_from_dict(d, "{registered_model}", Model)) + return cls(registered_model=_from_dict(d, "registered_model", Model)) @dataclass @@ -768,29 +766,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateModelVersionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_link is not None: - body["{run_link}"] = self.run_link + body["run_link"] = self.run_link if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionRequest: """Deserializes the CreateModelVersionRequest from a dictionary.""" return cls( - description=d.get("{description}", None), - name=d.get("{name}", None), - run_id=d.get("{run_id}", None), - run_link=d.get("{run_link}", None), - source=d.get("{source}", None), - tags=_repeated_dict(d, "{tags}", ModelVersionTag), + description=d.get("description", None), + name=d.get("name", None), + run_id=d.get("run_id", None), + run_link=d.get("run_link", None), + source=d.get("source", None), + tags=_repeated_dict(d, "tags", ModelVersionTag), ) @@ -810,13 +808,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateModelVersionResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_version: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionResponse: """Deserializes the CreateModelVersionResponse from a dictionary.""" - return cls(model_version=_from_dict(d, "{model_version}", ModelVersion)) + return cls(model_version=_from_dict(d, "model_version", ModelVersion)) @dataclass @@ -891,29 +889,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateRegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.events: - body["{events}"] = self.events + body["events"] = self.events if self.http_url_spec: - body["{http_url_spec}"] = self.http_url_spec + body["http_url_spec"] = self.http_url_spec if self.job_spec: - body["{job_spec}"] = self.job_spec + body["job_spec"] = self.job_spec if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRegistryWebhook: """Deserializes the CreateRegistryWebhook from a dictionary.""" return cls( - description=d.get("{description}", None), - events=_repeated_enum(d, "{events}", RegistryWebhookEvent), - http_url_spec=_from_dict(d, "{http_url_spec}", HttpUrlSpec), - job_spec=_from_dict(d, "{job_spec}", JobSpec), - model_name=d.get("{model_name}", None), - status=_enum(d, "{status}", RegistryWebhookStatus), + description=d.get("description", None), + events=_repeated_enum(d, "events", RegistryWebhookEvent), + http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec), + job_spec=_from_dict(d, "job_spec", JobSpec), + model_name=d.get("model_name", None), + status=_enum(d, "status", RegistryWebhookStatus), ) @@ -954,26 +952,26 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateRun into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRun: """Deserializes the CreateRun from a dictionary.""" return cls( - experiment_id=d.get("{experiment_id}", None), - run_name=d.get("{run_name}", None), - start_time=d.get("{start_time}", None), - tags=_repeated_dict(d, "{tags}", RunTag), - user_id=d.get("{user_id}", None), + experiment_id=d.get("experiment_id", None), + run_name=d.get("run_name", None), + start_time=d.get("start_time", None), + tags=_repeated_dict(d, "tags", RunTag), + user_id=d.get("user_id", None), ) @@ -993,13 +991,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run: - body["{run}"] = self.run + body["run"] = self.run return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRunResponse: """Deserializes the CreateRunResponse from a dictionary.""" - return cls(run=_from_dict(d, "{run}", Run)) + return cls(run=_from_dict(d, "run", Run)) @dataclass @@ -1041,23 +1039,23 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateTransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage + body["stage"] = self.stage if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTransitionRequest: """Deserializes the CreateTransitionRequest from a dictionary.""" return cls( - comment=d.get("{comment}", None), - name=d.get("{name}", None), - stage=_enum(d, "{stage}", Stage), - version=d.get("{version}", None), + comment=d.get("comment", None), + name=d.get("name", None), + stage=_enum(d, "stage", Stage), + version=d.get("version", None), ) @@ -1077,13 +1075,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateTransitionRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.request: - body["{request}"] = self.request + body["request"] = self.request return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTransitionRequestResponse: """Deserializes the CreateTransitionRequestResponse from a dictionary.""" - return cls(request=_from_dict(d, "{request}", TransitionRequest)) + return cls(request=_from_dict(d, "request", TransitionRequest)) @dataclass @@ -1101,13 +1099,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateWebhookResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.webhook: - body["{webhook}"] = self.webhook + body["webhook"] = self.webhook return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWebhookResponse: """Deserializes the CreateWebhookResponse from a dictionary.""" - return cls(webhook=_from_dict(d, "{webhook}", RegistryWebhook)) + return cls(webhook=_from_dict(d, "webhook", RegistryWebhook)) @dataclass @@ -1158,29 +1156,29 @@ def as_shallow_dict(self) -> dict: """Serializes the Dataset into a shallow dictionary of its immediate attributes.""" body = {} if self.digest is not None: - body["{digest}"] = self.digest + body["digest"] = self.digest if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.profile is not None: - body["{profile}"] = self.profile + body["profile"] = self.profile if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.source_type is not None: - body["{source_type}"] = self.source_type + body["source_type"] = self.source_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dataset: """Deserializes the Dataset from a dictionary.""" return cls( - digest=d.get("{digest}", None), - name=d.get("{name}", None), - profile=d.get("{profile}", None), - schema=d.get("{schema}", None), - source=d.get("{source}", None), - source_type=d.get("{source_type}", None), + digest=d.get("digest", None), + name=d.get("name", None), + profile=d.get("profile", None), + schema=d.get("schema", None), + source=d.get("source", None), + source_type=d.get("source_type", None), ) @@ -1207,15 +1205,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DatasetInput into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset: - body["{dataset}"] = self.dataset + body["dataset"] = self.dataset if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatasetInput: """Deserializes the DatasetInput from a dictionary.""" - return cls(dataset=_from_dict(d, "{dataset}", Dataset), tags=_repeated_dict(d, "{tags}", InputTag)) + return cls(dataset=_from_dict(d, "dataset", Dataset), tags=_repeated_dict(d, "tags", InputTag)) @dataclass @@ -1252,13 +1250,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteExperiment: """Deserializes the DeleteExperiment from a dictionary.""" - return cls(experiment_id=d.get("{experiment_id}", None)) + return cls(experiment_id=d.get("experiment_id", None)) @dataclass @@ -1367,13 +1365,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRun: """Deserializes the DeleteRun from a dictionary.""" - return cls(run_id=d.get("{run_id}", None)) + return cls(run_id=d.get("run_id", None)) @dataclass @@ -1422,20 +1420,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.max_runs is not None: - body["{max_runs}"] = self.max_runs + body["max_runs"] = self.max_runs if self.max_timestamp_millis is not None: - body["{max_timestamp_millis}"] = self.max_timestamp_millis + body["max_timestamp_millis"] = self.max_timestamp_millis return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRuns: """Deserializes the DeleteRuns from a dictionary.""" return cls( - experiment_id=d.get("{experiment_id}", None), - max_runs=d.get("{max_runs}", None), - max_timestamp_millis=d.get("{max_timestamp_millis}", None), + experiment_id=d.get("experiment_id", None), + max_runs=d.get("max_runs", None), + max_timestamp_millis=d.get("max_timestamp_millis", None), ) @@ -1455,13 +1453,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.runs_deleted is not None: - body["{runs_deleted}"] = self.runs_deleted + body["runs_deleted"] = self.runs_deleted return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRunsResponse: """Deserializes the DeleteRunsResponse from a dictionary.""" - return cls(runs_deleted=d.get("{runs_deleted}", None)) + return cls(runs_deleted=d.get("runs_deleted", None)) @dataclass @@ -1485,15 +1483,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteTag: """Deserializes the DeleteTag from a dictionary.""" - return cls(key=d.get("{key}", None), run_id=d.get("{run_id}", None)) + return cls(key=d.get("key", None), run_id=d.get("run_id", None)) @dataclass @@ -1607,32 +1605,32 @@ def as_shallow_dict(self) -> dict: """Serializes the Experiment into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_location is not None: - body["{artifact_location}"] = self.artifact_location + body["artifact_location"] = self.artifact_location if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.last_update_time is not None: - body["{last_update_time}"] = self.last_update_time + body["last_update_time"] = self.last_update_time if self.lifecycle_stage is not None: - body["{lifecycle_stage}"] = self.lifecycle_stage + body["lifecycle_stage"] = self.lifecycle_stage if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Experiment: """Deserializes the Experiment from a dictionary.""" return cls( - artifact_location=d.get("{artifact_location}", None), - creation_time=d.get("{creation_time}", None), - experiment_id=d.get("{experiment_id}", None), - last_update_time=d.get("{last_update_time}", None), - lifecycle_stage=d.get("{lifecycle_stage}", None), - name=d.get("{name}", None), - tags=_repeated_dict(d, "{tags}", ExperimentTag), + artifact_location=d.get("artifact_location", None), + creation_time=d.get("creation_time", None), + experiment_id=d.get("experiment_id", None), + last_update_time=d.get("last_update_time", None), + lifecycle_stage=d.get("lifecycle_stage", None), + name=d.get("name", None), + tags=_repeated_dict(d, "tags", ExperimentTag), ) @@ -1667,23 +1665,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ExperimentAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentAccessControlRequest: """Deserializes the ExperimentAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", ExperimentPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -1723,26 +1721,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ExperimentAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentAccessControlResponse: """Deserializes the ExperimentAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", ExperimentPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", ExperimentPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -1770,20 +1768,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermission: """Deserializes the ExperimentPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", ExperimentPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), ) @@ -1818,20 +1816,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissions: """Deserializes the ExperimentPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ExperimentAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", ExperimentAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -1855,17 +1853,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissionsDescription: """Deserializes the ExperimentPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", ExperimentPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", ExperimentPermissionLevel), ) @@ -1889,17 +1887,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ExperimentPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissionsRequest: """Deserializes the ExperimentPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ExperimentAccessControlRequest), - experiment_id=d.get("{experiment_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", ExperimentAccessControlRequest), + experiment_id=d.get("experiment_id", None), ) @@ -1926,15 +1924,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ExperimentTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExperimentTag: """Deserializes the ExperimentTag from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -1965,17 +1963,17 @@ def as_shallow_dict(self) -> dict: """Serializes the FileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.file_size is not None: - body["{file_size}"] = self.file_size + body["file_size"] = self.file_size if self.is_dir is not None: - body["{is_dir}"] = self.is_dir + body["is_dir"] = self.is_dir if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" - return cls(file_size=d.get("{file_size}", None), is_dir=d.get("{is_dir}", None), path=d.get("{path}", None)) + return cls(file_size=d.get("file_size", None), is_dir=d.get("is_dir", None), path=d.get("path", None)) @dataclass @@ -2006,20 +2004,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ForecastingExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.experiment_page_url is not None: - body["{experiment_page_url}"] = self.experiment_page_url + body["experiment_page_url"] = self.experiment_page_url if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ForecastingExperiment: """Deserializes the ForecastingExperiment from a dictionary.""" return cls( - experiment_id=d.get("{experiment_id}", None), - experiment_page_url=d.get("{experiment_page_url}", None), - state=_enum(d, "{state}", ForecastingExperimentState), + experiment_id=d.get("experiment_id", None), + experiment_page_url=d.get("experiment_page_url", None), + state=_enum(d, "state", ForecastingExperimentState), ) @@ -2048,13 +2046,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetExperimentByNameResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment: - body["{experiment}"] = self.experiment + body["experiment"] = self.experiment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExperimentByNameResponse: """Deserializes the GetExperimentByNameResponse from a dictionary.""" - return cls(experiment=_from_dict(d, "{experiment}", Experiment)) + return cls(experiment=_from_dict(d, "experiment", Experiment)) @dataclass @@ -2073,13 +2071,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetExperimentPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExperimentPermissionLevelsResponse: """Deserializes the GetExperimentPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ExperimentPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", ExperimentPermissionsDescription)) @dataclass @@ -2098,13 +2096,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetExperimentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment: - body["{experiment}"] = self.experiment + body["experiment"] = self.experiment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetExperimentResponse: """Deserializes the GetExperimentResponse from a dictionary.""" - return cls(experiment=_from_dict(d, "{experiment}", Experiment)) + return cls(experiment=_from_dict(d, "experiment", Experiment)) @dataclass @@ -2128,15 +2126,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetLatestVersionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stages: - body["{stages}"] = self.stages + body["stages"] = self.stages return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetLatestVersionsRequest: """Deserializes the GetLatestVersionsRequest from a dictionary.""" - return cls(name=d.get("{name}", None), stages=d.get("{stages}", None)) + return cls(name=d.get("name", None), stages=d.get("stages", None)) @dataclass @@ -2156,13 +2154,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetLatestVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_versions: - body["{model_versions}"] = self.model_versions + body["model_versions"] = self.model_versions return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetLatestVersionsResponse: """Deserializes the GetLatestVersionsResponse from a dictionary.""" - return cls(model_versions=_repeated_dict(d, "{model_versions}", ModelVersion)) + return cls(model_versions=_repeated_dict(d, "model_versions", ModelVersion)) @dataclass @@ -2189,15 +2187,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetMetricHistoryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.metrics: - body["{metrics}"] = self.metrics + body["metrics"] = self.metrics if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetMetricHistoryResponse: """Deserializes the GetMetricHistoryResponse from a dictionary.""" - return cls(metrics=_repeated_dict(d, "{metrics}", Metric), next_page_token=d.get("{next_page_token}", None)) + return cls(metrics=_repeated_dict(d, "metrics", Metric), next_page_token=d.get("next_page_token", None)) @dataclass @@ -2215,13 +2213,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetModelResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.registered_model_databricks: - body["{registered_model_databricks}"] = self.registered_model_databricks + body["registered_model_databricks"] = self.registered_model_databricks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetModelResponse: """Deserializes the GetModelResponse from a dictionary.""" - return cls(registered_model_databricks=_from_dict(d, "{registered_model_databricks}", ModelDatabricks)) + return cls(registered_model_databricks=_from_dict(d, "registered_model_databricks", ModelDatabricks)) @dataclass @@ -2240,13 +2238,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetModelVersionDownloadUriResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_uri is not None: - body["{artifact_uri}"] = self.artifact_uri + body["artifact_uri"] = self.artifact_uri return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetModelVersionDownloadUriResponse: """Deserializes the GetModelVersionDownloadUriResponse from a dictionary.""" - return cls(artifact_uri=d.get("{artifact_uri}", None)) + return cls(artifact_uri=d.get("artifact_uri", None)) @dataclass @@ -2264,13 +2262,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetModelVersionResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_version: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetModelVersionResponse: """Deserializes the GetModelVersionResponse from a dictionary.""" - return cls(model_version=_from_dict(d, "{model_version}", ModelVersion)) + return cls(model_version=_from_dict(d, "model_version", ModelVersion)) @dataclass @@ -2289,13 +2287,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetRegisteredModelPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRegisteredModelPermissionLevelsResponse: """Deserializes the GetRegisteredModelPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", RegisteredModelPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", RegisteredModelPermissionsDescription)) @dataclass @@ -2314,13 +2312,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run: - body["{run}"] = self.run + body["run"] = self.run return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRunResponse: """Deserializes the GetRunResponse from a dictionary.""" - return cls(run=_from_dict(d, "{run}", Run)) + return cls(run=_from_dict(d, "run", Run)) @dataclass @@ -2361,23 +2359,23 @@ def as_shallow_dict(self) -> dict: """Serializes the HttpUrlSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.authorization is not None: - body["{authorization}"] = self.authorization + body["authorization"] = self.authorization if self.enable_ssl_verification is not None: - body["{enable_ssl_verification}"] = self.enable_ssl_verification + body["enable_ssl_verification"] = self.enable_ssl_verification if self.secret is not None: - body["{secret}"] = self.secret + body["secret"] = self.secret if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> HttpUrlSpec: """Deserializes the HttpUrlSpec from a dictionary.""" return cls( - authorization=d.get("{authorization}", None), - enable_ssl_verification=d.get("{enable_ssl_verification}", None), - secret=d.get("{secret}", None), - url=d.get("{url}", None), + authorization=d.get("authorization", None), + enable_ssl_verification=d.get("enable_ssl_verification", None), + secret=d.get("secret", None), + url=d.get("url", None), ) @@ -2406,15 +2404,15 @@ def as_shallow_dict(self) -> dict: """Serializes the HttpUrlSpecWithoutSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.enable_ssl_verification is not None: - body["{enable_ssl_verification}"] = self.enable_ssl_verification + body["enable_ssl_verification"] = self.enable_ssl_verification if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> HttpUrlSpecWithoutSecret: """Deserializes the HttpUrlSpecWithoutSecret from a dictionary.""" - return cls(enable_ssl_verification=d.get("{enable_ssl_verification}", None), url=d.get("{url}", None)) + return cls(enable_ssl_verification=d.get("enable_ssl_verification", None), url=d.get("url", None)) @dataclass @@ -2440,15 +2438,15 @@ def as_shallow_dict(self) -> dict: """Serializes the InputTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InputTag: """Deserializes the InputTag from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -2478,20 +2476,20 @@ def as_shallow_dict(self) -> dict: """Serializes the JobSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.access_token is not None: - body["{access_token}"] = self.access_token + body["access_token"] = self.access_token if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.workspace_url is not None: - body["{workspace_url}"] = self.workspace_url + body["workspace_url"] = self.workspace_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSpec: """Deserializes the JobSpec from a dictionary.""" return cls( - access_token=d.get("{access_token}", None), - job_id=d.get("{job_id}", None), - workspace_url=d.get("{workspace_url}", None), + access_token=d.get("access_token", None), + job_id=d.get("job_id", None), + workspace_url=d.get("workspace_url", None), ) @@ -2518,15 +2516,15 @@ def as_shallow_dict(self) -> dict: """Serializes the JobSpecWithoutSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.workspace_url is not None: - body["{workspace_url}"] = self.workspace_url + body["workspace_url"] = self.workspace_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> JobSpecWithoutSecret: """Deserializes the JobSpecWithoutSecret from a dictionary.""" - return cls(job_id=d.get("{job_id}", None), workspace_url=d.get("{workspace_url}", None)) + return cls(job_id=d.get("job_id", None), workspace_url=d.get("workspace_url", None)) @dataclass @@ -2555,20 +2553,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListArtifactsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.files: - body["{files}"] = self.files + body["files"] = self.files if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.root_uri is not None: - body["{root_uri}"] = self.root_uri + body["root_uri"] = self.root_uri return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListArtifactsResponse: """Deserializes the ListArtifactsResponse from a dictionary.""" return cls( - files=_repeated_dict(d, "{files}", FileInfo), - next_page_token=d.get("{next_page_token}", None), - root_uri=d.get("{root_uri}", None), + files=_repeated_dict(d, "files", FileInfo), + next_page_token=d.get("next_page_token", None), + root_uri=d.get("root_uri", None), ) @@ -2594,16 +2592,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListExperimentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiments: - body["{experiments}"] = self.experiments + body["experiments"] = self.experiments if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListExperimentsResponse: """Deserializes the ListExperimentsResponse from a dictionary.""" return cls( - experiments=_repeated_dict(d, "{experiments}", Experiment), next_page_token=d.get("{next_page_token}", None) + experiments=_repeated_dict(d, "experiments", Experiment), next_page_token=d.get("next_page_token", None) ) @@ -2627,17 +2625,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListModelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.registered_models: - body["{registered_models}"] = self.registered_models + body["registered_models"] = self.registered_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListModelsResponse: """Deserializes the ListModelsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - registered_models=_repeated_dict(d, "{registered_models}", Model), + next_page_token=d.get("next_page_token", None), + registered_models=_repeated_dict(d, "registered_models", Model), ) @@ -2662,16 +2660,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListRegistryWebhooks into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.webhooks: - body["{webhooks}"] = self.webhooks + body["webhooks"] = self.webhooks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListRegistryWebhooks: """Deserializes the ListRegistryWebhooks from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), webhooks=_repeated_dict(d, "{webhooks}", RegistryWebhook) + next_page_token=d.get("next_page_token", None), webhooks=_repeated_dict(d, "webhooks", RegistryWebhook) ) @@ -2691,13 +2689,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListTransitionRequestsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.requests: - body["{requests}"] = self.requests + body["requests"] = self.requests return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTransitionRequestsResponse: """Deserializes the ListTransitionRequestsResponse from a dictionary.""" - return cls(requests=_repeated_dict(d, "{requests}", Activity)) + return cls(requests=_repeated_dict(d, "requests", Activity)) @dataclass @@ -2734,23 +2732,23 @@ def as_shallow_dict(self) -> dict: """Serializes the LogBatch into a shallow dictionary of its immediate attributes.""" body = {} if self.metrics: - body["{metrics}"] = self.metrics + body["metrics"] = self.metrics if self.params: - body["{params}"] = self.params + body["params"] = self.params if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogBatch: """Deserializes the LogBatch from a dictionary.""" return cls( - metrics=_repeated_dict(d, "{metrics}", Metric), - params=_repeated_dict(d, "{params}", Param), - run_id=d.get("{run_id}", None), - tags=_repeated_dict(d, "{tags}", RunTag), + metrics=_repeated_dict(d, "metrics", Metric), + params=_repeated_dict(d, "params", Param), + run_id=d.get("run_id", None), + tags=_repeated_dict(d, "tags", RunTag), ) @@ -2798,20 +2796,20 @@ def as_shallow_dict(self) -> dict: """Serializes the LogInputs into a shallow dictionary of its immediate attributes.""" body = {} if self.datasets: - body["{datasets}"] = self.datasets + body["datasets"] = self.datasets if self.models: - body["{models}"] = self.models + body["models"] = self.models if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogInputs: """Deserializes the LogInputs from a dictionary.""" return cls( - datasets=_repeated_dict(d, "{datasets}", DatasetInput), - models=_repeated_dict(d, "{models}", ModelInput), - run_id=d.get("{run_id}", None), + datasets=_repeated_dict(d, "datasets", DatasetInput), + models=_repeated_dict(d, "models", ModelInput), + run_id=d.get("run_id", None), ) @@ -2892,38 +2890,38 @@ def as_shallow_dict(self) -> dict: """Serializes the LogMetric into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset_digest is not None: - body["{dataset_digest}"] = self.dataset_digest + body["dataset_digest"] = self.dataset_digest if self.dataset_name is not None: - body["{dataset_name}"] = self.dataset_name + body["dataset_name"] = self.dataset_name if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.model_id is not None: - body["{model_id}"] = self.model_id + body["model_id"] = self.model_id if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.step is not None: - body["{step}"] = self.step + body["step"] = self.step if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogMetric: """Deserializes the LogMetric from a dictionary.""" return cls( - dataset_digest=d.get("{dataset_digest}", None), - dataset_name=d.get("{dataset_name}", None), - key=d.get("{key}", None), - model_id=d.get("{model_id}", None), - run_id=d.get("{run_id}", None), - run_uuid=d.get("{run_uuid}", None), - step=d.get("{step}", None), - timestamp=d.get("{timestamp}", None), - value=d.get("{value}", None), + dataset_digest=d.get("dataset_digest", None), + dataset_name=d.get("dataset_name", None), + key=d.get("key", None), + model_id=d.get("model_id", None), + run_id=d.get("run_id", None), + run_uuid=d.get("run_uuid", None), + step=d.get("step", None), + timestamp=d.get("timestamp", None), + value=d.get("value", None), ) @@ -2966,15 +2964,15 @@ def as_shallow_dict(self) -> dict: """Serializes the LogModel into a shallow dictionary of its immediate attributes.""" body = {} if self.model_json is not None: - body["{model_json}"] = self.model_json + body["model_json"] = self.model_json if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogModel: """Deserializes the LogModel from a dictionary.""" - return cls(model_json=d.get("{model_json}", None), run_id=d.get("{run_id}", None)) + return cls(model_json=d.get("model_json", None), run_id=d.get("run_id", None)) @dataclass @@ -3016,15 +3014,15 @@ def as_shallow_dict(self) -> dict: """Serializes the LogOutputsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.models: - body["{models}"] = self.models + body["models"] = self.models if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogOutputsRequest: """Deserializes the LogOutputsRequest from a dictionary.""" - return cls(models=_repeated_dict(d, "{models}", ModelOutput), run_id=d.get("{run_id}", None)) + return cls(models=_repeated_dict(d, "models", ModelOutput), run_id=d.get("run_id", None)) @dataclass @@ -3059,23 +3057,23 @@ def as_shallow_dict(self) -> dict: """Serializes the LogParam into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogParam: """Deserializes the LogParam from a dictionary.""" return cls( - key=d.get("{key}", None), - run_id=d.get("{run_id}", None), - run_uuid=d.get("{run_uuid}", None), - value=d.get("{value}", None), + key=d.get("key", None), + run_id=d.get("run_id", None), + run_uuid=d.get("run_uuid", None), + value=d.get("value", None), ) @@ -3153,35 +3151,35 @@ def as_shallow_dict(self) -> dict: """Serializes the Metric into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset_digest is not None: - body["{dataset_digest}"] = self.dataset_digest + body["dataset_digest"] = self.dataset_digest if self.dataset_name is not None: - body["{dataset_name}"] = self.dataset_name + body["dataset_name"] = self.dataset_name if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.model_id is not None: - body["{model_id}"] = self.model_id + body["model_id"] = self.model_id if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.step is not None: - body["{step}"] = self.step + body["step"] = self.step if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Metric: """Deserializes the Metric from a dictionary.""" return cls( - dataset_digest=d.get("{dataset_digest}", None), - dataset_name=d.get("{dataset_name}", None), - key=d.get("{key}", None), - model_id=d.get("{model_id}", None), - run_id=d.get("{run_id}", None), - step=d.get("{step}", None), - timestamp=d.get("{timestamp}", None), - value=d.get("{value}", None), + dataset_digest=d.get("dataset_digest", None), + dataset_name=d.get("dataset_name", None), + key=d.get("key", None), + model_id=d.get("model_id", None), + run_id=d.get("run_id", None), + step=d.get("step", None), + timestamp=d.get("timestamp", None), + value=d.get("value", None), ) @@ -3232,32 +3230,32 @@ def as_shallow_dict(self) -> dict: """Serializes the Model into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.latest_versions: - body["{latest_versions}"] = self.latest_versions + body["latest_versions"] = self.latest_versions if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Model: """Deserializes the Model from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - description=d.get("{description}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - latest_versions=_repeated_dict(d, "{latest_versions}", ModelVersion), - name=d.get("{name}", None), - tags=_repeated_dict(d, "{tags}", ModelTag), - user_id=d.get("{user_id}", None), + creation_timestamp=d.get("creation_timestamp", None), + description=d.get("description", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + latest_versions=_repeated_dict(d, "latest_versions", ModelVersion), + name=d.get("name", None), + tags=_repeated_dict(d, "tags", ModelTag), + user_id=d.get("user_id", None), ) @@ -3318,38 +3316,38 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelDatabricks into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.latest_versions: - body["{latest_versions}"] = self.latest_versions + body["latest_versions"] = self.latest_versions if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelDatabricks: """Deserializes the ModelDatabricks from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - description=d.get("{description}", None), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - latest_versions=_repeated_dict(d, "{latest_versions}", ModelVersion), - name=d.get("{name}", None), - permission_level=_enum(d, "{permission_level}", PermissionLevel), - tags=_repeated_dict(d, "{tags}", ModelTag), - user_id=d.get("{user_id}", None), + creation_timestamp=d.get("creation_timestamp", None), + description=d.get("description", None), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + latest_versions=_repeated_dict(d, "latest_versions", ModelVersion), + name=d.get("name", None), + permission_level=_enum(d, "permission_level", PermissionLevel), + tags=_repeated_dict(d, "tags", ModelTag), + user_id=d.get("user_id", None), ) @@ -3371,13 +3369,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelInput into a shallow dictionary of its immediate attributes.""" body = {} if self.model_id is not None: - body["{model_id}"] = self.model_id + body["model_id"] = self.model_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelInput: """Deserializes the ModelInput from a dictionary.""" - return cls(model_id=d.get("{model_id}", None)) + return cls(model_id=d.get("model_id", None)) @dataclass @@ -3401,15 +3399,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelTag: """Deserializes the ModelTag from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -3489,50 +3487,50 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelVersion into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.current_stage is not None: - body["{current_stage}"] = self.current_stage + body["current_stage"] = self.current_stage if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_link is not None: - body["{run_link}"] = self.run_link + body["run_link"] = self.run_link if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersion: """Deserializes the ModelVersion from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - current_stage=d.get("{current_stage}", None), - description=d.get("{description}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - name=d.get("{name}", None), - run_id=d.get("{run_id}", None), - run_link=d.get("{run_link}", None), - source=d.get("{source}", None), - status=_enum(d, "{status}", ModelVersionStatus), - status_message=d.get("{status_message}", None), - tags=_repeated_dict(d, "{tags}", ModelVersionTag), - user_id=d.get("{user_id}", None), - version=d.get("{version}", None), + creation_timestamp=d.get("creation_timestamp", None), + current_stage=d.get("current_stage", None), + description=d.get("description", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + name=d.get("name", None), + run_id=d.get("run_id", None), + run_link=d.get("run_link", None), + source=d.get("source", None), + status=_enum(d, "status", ModelVersionStatus), + status_message=d.get("status_message", None), + tags=_repeated_dict(d, "tags", ModelVersionTag), + user_id=d.get("user_id", None), + version=d.get("version", None), ) @@ -3634,53 +3632,53 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelVersionDatabricks into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.current_stage is not None: - body["{current_stage}"] = self.current_stage + body["current_stage"] = self.current_stage if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_link is not None: - body["{run_link}"] = self.run_link + body["run_link"] = self.run_link if self.source is not None: - body["{source}"] = self.source + body["source"] = self.source if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersionDatabricks: """Deserializes the ModelVersionDatabricks from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - current_stage=_enum(d, "{current_stage}", Stage), - description=d.get("{description}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - name=d.get("{name}", None), - permission_level=_enum(d, "{permission_level}", PermissionLevel), - run_id=d.get("{run_id}", None), - run_link=d.get("{run_link}", None), - source=d.get("{source}", None), - status=_enum(d, "{status}", Status), - status_message=d.get("{status_message}", None), - tags=_repeated_dict(d, "{tags}", ModelVersionTag), - user_id=d.get("{user_id}", None), - version=d.get("{version}", None), + creation_timestamp=d.get("creation_timestamp", None), + current_stage=_enum(d, "current_stage", Stage), + description=d.get("description", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + name=d.get("name", None), + permission_level=_enum(d, "permission_level", PermissionLevel), + run_id=d.get("run_id", None), + run_link=d.get("run_link", None), + source=d.get("source", None), + status=_enum(d, "status", Status), + status_message=d.get("status_message", None), + tags=_repeated_dict(d, "tags", ModelVersionTag), + user_id=d.get("user_id", None), + version=d.get("version", None), ) @@ -3713,15 +3711,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelVersionTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelVersionTag: """Deserializes the ModelVersionTag from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -3747,15 +3745,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Param into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Param: """Deserializes the Param from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) class PermissionLevel(Enum): @@ -3800,23 +3798,23 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAccessControlRequest: """Deserializes the RegisteredModelAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", RegisteredModelPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -3856,26 +3854,26 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAccessControlResponse: """Deserializes the RegisteredModelAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", RegisteredModelPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", RegisteredModelPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -3903,20 +3901,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermission: """Deserializes the RegisteredModelPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", RegisteredModelPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), ) @@ -3953,20 +3951,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissions: """Deserializes the RegisteredModelPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", RegisteredModelAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", RegisteredModelAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -3990,17 +3988,17 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissionsDescription: """Deserializes the RegisteredModelPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", RegisteredModelPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", RegisteredModelPermissionLevel), ) @@ -4024,17 +4022,17 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.registered_model_id is not None: - body["{registered_model_id}"] = self.registered_model_id + body["registered_model_id"] = self.registered_model_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissionsRequest: """Deserializes the RegisteredModelPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", RegisteredModelAccessControlRequest), - registered_model_id=d.get("{registered_model_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", RegisteredModelAccessControlRequest), + registered_model_id=d.get("registered_model_id", None), ) @@ -4125,38 +4123,38 @@ def as_shallow_dict(self) -> dict: """Serializes the RegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.events: - body["{events}"] = self.events + body["events"] = self.events if self.http_url_spec: - body["{http_url_spec}"] = self.http_url_spec + body["http_url_spec"] = self.http_url_spec if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.job_spec: - body["{job_spec}"] = self.job_spec + body["job_spec"] = self.job_spec if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegistryWebhook: """Deserializes the RegistryWebhook from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - description=d.get("{description}", None), - events=_repeated_enum(d, "{events}", RegistryWebhookEvent), - http_url_spec=_from_dict(d, "{http_url_spec}", HttpUrlSpecWithoutSecret), - id=d.get("{id}", None), - job_spec=_from_dict(d, "{job_spec}", JobSpecWithoutSecret), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - model_name=d.get("{model_name}", None), - status=_enum(d, "{status}", RegistryWebhookStatus), + creation_timestamp=d.get("creation_timestamp", None), + description=d.get("description", None), + events=_repeated_enum(d, "events", RegistryWebhookEvent), + http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpecWithoutSecret), + id=d.get("id", None), + job_spec=_from_dict(d, "job_spec", JobSpecWithoutSecret), + last_updated_timestamp=d.get("last_updated_timestamp", None), + model_name=d.get("model_name", None), + status=_enum(d, "status", RegistryWebhookStatus), ) @@ -4229,23 +4227,23 @@ def as_shallow_dict(self) -> dict: """Serializes the RejectTransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage + body["stage"] = self.stage if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RejectTransitionRequest: """Deserializes the RejectTransitionRequest from a dictionary.""" return cls( - comment=d.get("{comment}", None), - name=d.get("{name}", None), - stage=_enum(d, "{stage}", Stage), - version=d.get("{version}", None), + comment=d.get("comment", None), + name=d.get("name", None), + stage=_enum(d, "stage", Stage), + version=d.get("version", None), ) @@ -4265,13 +4263,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RejectTransitionRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.activity: - body["{activity}"] = self.activity + body["activity"] = self.activity return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RejectTransitionRequestResponse: """Deserializes the RejectTransitionRequestResponse from a dictionary.""" - return cls(activity=_from_dict(d, "{activity}", Activity)) + return cls(activity=_from_dict(d, "activity", Activity)) @dataclass @@ -4295,15 +4293,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RenameModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RenameModelRequest: """Deserializes the RenameModelRequest from a dictionary.""" - return cls(name=d.get("{name}", None), new_name=d.get("{new_name}", None)) + return cls(name=d.get("name", None), new_name=d.get("new_name", None)) @dataclass @@ -4321,13 +4319,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RenameModelResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.registered_model: - body["{registered_model}"] = self.registered_model + body["registered_model"] = self.registered_model return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RenameModelResponse: """Deserializes the RenameModelResponse from a dictionary.""" - return cls(registered_model=_from_dict(d, "{registered_model}", Model)) + return cls(registered_model=_from_dict(d, "registered_model", Model)) @dataclass @@ -4346,13 +4344,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RestoreExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreExperiment: """Deserializes the RestoreExperiment from a dictionary.""" - return cls(experiment_id=d.get("{experiment_id}", None)) + return cls(experiment_id=d.get("experiment_id", None)) @dataclass @@ -4389,13 +4387,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RestoreRun into a shallow dictionary of its immediate attributes.""" body = {} if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreRun: """Deserializes the RestoreRun from a dictionary.""" - return cls(run_id=d.get("{run_id}", None)) + return cls(run_id=d.get("run_id", None)) @dataclass @@ -4444,20 +4442,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RestoreRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.max_runs is not None: - body["{max_runs}"] = self.max_runs + body["max_runs"] = self.max_runs if self.min_timestamp_millis is not None: - body["{min_timestamp_millis}"] = self.min_timestamp_millis + body["min_timestamp_millis"] = self.min_timestamp_millis return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreRuns: """Deserializes the RestoreRuns from a dictionary.""" return cls( - experiment_id=d.get("{experiment_id}", None), - max_runs=d.get("{max_runs}", None), - min_timestamp_millis=d.get("{min_timestamp_millis}", None), + experiment_id=d.get("experiment_id", None), + max_runs=d.get("max_runs", None), + min_timestamp_millis=d.get("min_timestamp_millis", None), ) @@ -4477,13 +4475,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RestoreRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.runs_restored is not None: - body["{runs_restored}"] = self.runs_restored + body["runs_restored"] = self.runs_restored return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestoreRunsResponse: """Deserializes the RestoreRunsResponse from a dictionary.""" - return cls(runs_restored=d.get("{runs_restored}", None)) + return cls(runs_restored=d.get("runs_restored", None)) @dataclass @@ -4514,20 +4512,20 @@ def as_shallow_dict(self) -> dict: """Serializes the Run into a shallow dictionary of its immediate attributes.""" body = {} if self.data: - body["{data}"] = self.data + body["data"] = self.data if self.info: - body["{info}"] = self.info + body["info"] = self.info if self.inputs: - body["{inputs}"] = self.inputs + body["inputs"] = self.inputs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Run: """Deserializes the Run from a dictionary.""" return cls( - data=_from_dict(d, "{data}", RunData), - info=_from_dict(d, "{info}", RunInfo), - inputs=_from_dict(d, "{inputs}", RunInputs), + data=_from_dict(d, "data", RunData), + info=_from_dict(d, "info", RunInfo), + inputs=_from_dict(d, "inputs", RunInputs), ) @@ -4559,20 +4557,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RunData into a shallow dictionary of its immediate attributes.""" body = {} if self.metrics: - body["{metrics}"] = self.metrics + body["metrics"] = self.metrics if self.params: - body["{params}"] = self.params + body["params"] = self.params if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunData: """Deserializes the RunData from a dictionary.""" return cls( - metrics=_repeated_dict(d, "{metrics}", Metric), - params=_repeated_dict(d, "{params}", Param), - tags=_repeated_dict(d, "{tags}", RunTag), + metrics=_repeated_dict(d, "metrics", Metric), + params=_repeated_dict(d, "params", Param), + tags=_repeated_dict(d, "tags", RunTag), ) @@ -4643,41 +4641,41 @@ def as_shallow_dict(self) -> dict: """Serializes the RunInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.artifact_uri is not None: - body["{artifact_uri}"] = self.artifact_uri + body["artifact_uri"] = self.artifact_uri if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.lifecycle_stage is not None: - body["{lifecycle_stage}"] = self.lifecycle_stage + body["lifecycle_stage"] = self.lifecycle_stage if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunInfo: """Deserializes the RunInfo from a dictionary.""" return cls( - artifact_uri=d.get("{artifact_uri}", None), - end_time=d.get("{end_time}", None), - experiment_id=d.get("{experiment_id}", None), - lifecycle_stage=d.get("{lifecycle_stage}", None), - run_id=d.get("{run_id}", None), - run_name=d.get("{run_name}", None), - run_uuid=d.get("{run_uuid}", None), - start_time=d.get("{start_time}", None), - status=_enum(d, "{status}", RunInfoStatus), - user_id=d.get("{user_id}", None), + artifact_uri=d.get("artifact_uri", None), + end_time=d.get("end_time", None), + experiment_id=d.get("experiment_id", None), + lifecycle_stage=d.get("lifecycle_stage", None), + run_id=d.get("run_id", None), + run_name=d.get("run_name", None), + run_uuid=d.get("run_uuid", None), + start_time=d.get("start_time", None), + status=_enum(d, "status", RunInfoStatus), + user_id=d.get("user_id", None), ) @@ -4717,17 +4715,17 @@ def as_shallow_dict(self) -> dict: """Serializes the RunInputs into a shallow dictionary of its immediate attributes.""" body = {} if self.dataset_inputs: - body["{dataset_inputs}"] = self.dataset_inputs + body["dataset_inputs"] = self.dataset_inputs if self.model_inputs: - body["{model_inputs}"] = self.model_inputs + body["model_inputs"] = self.model_inputs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunInputs: """Deserializes the RunInputs from a dictionary.""" return cls( - dataset_inputs=_repeated_dict(d, "{dataset_inputs}", DatasetInput), - model_inputs=_repeated_dict(d, "{model_inputs}", ModelInput), + dataset_inputs=_repeated_dict(d, "dataset_inputs", DatasetInput), + model_inputs=_repeated_dict(d, "model_inputs", ModelInput), ) @@ -4754,15 +4752,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RunTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunTag: """Deserializes the RunTag from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -4804,26 +4802,26 @@ def as_shallow_dict(self) -> dict: """Serializes the SearchExperiments into a shallow dictionary of its immediate attributes.""" body = {} if self.filter is not None: - body["{filter}"] = self.filter + body["filter"] = self.filter if self.max_results is not None: - body["{max_results}"] = self.max_results + body["max_results"] = self.max_results if self.order_by: - body["{order_by}"] = self.order_by + body["order_by"] = self.order_by if self.page_token is not None: - body["{page_token}"] = self.page_token + body["page_token"] = self.page_token if self.view_type is not None: - body["{view_type}"] = self.view_type + body["view_type"] = self.view_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchExperiments: """Deserializes the SearchExperiments from a dictionary.""" return cls( - filter=d.get("{filter}", None), - max_results=d.get("{max_results}", None), - order_by=d.get("{order_by}", None), - page_token=d.get("{page_token}", None), - view_type=_enum(d, "{view_type}", ViewType), + filter=d.get("filter", None), + max_results=d.get("max_results", None), + order_by=d.get("order_by", None), + page_token=d.get("page_token", None), + view_type=_enum(d, "view_type", ViewType), ) @@ -4849,16 +4847,16 @@ def as_shallow_dict(self) -> dict: """Serializes the SearchExperimentsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.experiments: - body["{experiments}"] = self.experiments + body["experiments"] = self.experiments if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchExperimentsResponse: """Deserializes the SearchExperimentsResponse from a dictionary.""" return cls( - experiments=_repeated_dict(d, "{experiments}", Experiment), next_page_token=d.get("{next_page_token}", None) + experiments=_repeated_dict(d, "experiments", Experiment), next_page_token=d.get("next_page_token", None) ) @@ -4883,17 +4881,17 @@ def as_shallow_dict(self) -> dict: """Serializes the SearchModelVersionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_versions: - body["{model_versions}"] = self.model_versions + body["model_versions"] = self.model_versions if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchModelVersionsResponse: """Deserializes the SearchModelVersionsResponse from a dictionary.""" return cls( - model_versions=_repeated_dict(d, "{model_versions}", ModelVersion), - next_page_token=d.get("{next_page_token}", None), + model_versions=_repeated_dict(d, "model_versions", ModelVersion), + next_page_token=d.get("next_page_token", None), ) @@ -4918,17 +4916,17 @@ def as_shallow_dict(self) -> dict: """Serializes the SearchModelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.registered_models: - body["{registered_models}"] = self.registered_models + body["registered_models"] = self.registered_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchModelsResponse: """Deserializes the SearchModelsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - registered_models=_repeated_dict(d, "{registered_models}", Model), + next_page_token=d.get("next_page_token", None), + registered_models=_repeated_dict(d, "registered_models", Model), ) @@ -4986,29 +4984,29 @@ def as_shallow_dict(self) -> dict: """Serializes the SearchRuns into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_ids: - body["{experiment_ids}"] = self.experiment_ids + body["experiment_ids"] = self.experiment_ids if self.filter is not None: - body["{filter}"] = self.filter + body["filter"] = self.filter if self.max_results is not None: - body["{max_results}"] = self.max_results + body["max_results"] = self.max_results if self.order_by: - body["{order_by}"] = self.order_by + body["order_by"] = self.order_by if self.page_token is not None: - body["{page_token}"] = self.page_token + body["page_token"] = self.page_token if self.run_view_type is not None: - body["{run_view_type}"] = self.run_view_type + body["run_view_type"] = self.run_view_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchRuns: """Deserializes the SearchRuns from a dictionary.""" return cls( - experiment_ids=d.get("{experiment_ids}", None), - filter=d.get("{filter}", None), - max_results=d.get("{max_results}", None), - order_by=d.get("{order_by}", None), - page_token=d.get("{page_token}", None), - run_view_type=_enum(d, "{run_view_type}", ViewType), + experiment_ids=d.get("experiment_ids", None), + filter=d.get("filter", None), + max_results=d.get("max_results", None), + order_by=d.get("order_by", None), + page_token=d.get("page_token", None), + run_view_type=_enum(d, "run_view_type", ViewType), ) @@ -5033,15 +5031,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SearchRunsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.runs: - body["{runs}"] = self.runs + body["runs"] = self.runs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SearchRunsResponse: """Deserializes the SearchRunsResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), runs=_repeated_dict(d, "{runs}", Run)) + return cls(next_page_token=d.get("next_page_token", None), runs=_repeated_dict(d, "runs", Run)) @dataclass @@ -5070,17 +5068,17 @@ def as_shallow_dict(self) -> dict: """Serializes the SetExperimentTag into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetExperimentTag: """Deserializes the SetExperimentTag from a dictionary.""" - return cls(experiment_id=d.get("{experiment_id}", None), key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(experiment_id=d.get("experiment_id", None), key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -5130,17 +5128,17 @@ def as_shallow_dict(self) -> dict: """Serializes the SetModelTagRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetModelTagRequest: """Deserializes the SetModelTagRequest from a dictionary.""" - return cls(key=d.get("{key}", None), name=d.get("{name}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), name=d.get("name", None), value=d.get("value", None)) @dataclass @@ -5195,23 +5193,20 @@ def as_shallow_dict(self) -> dict: """Serializes the SetModelVersionTagRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetModelVersionTagRequest: """Deserializes the SetModelVersionTagRequest from a dictionary.""" return cls( - key=d.get("{key}", None), - name=d.get("{name}", None), - value=d.get("{value}", None), - version=d.get("{version}", None), + key=d.get("key", None), name=d.get("name", None), value=d.get("value", None), version=d.get("version", None) ) @@ -5265,23 +5260,23 @@ def as_shallow_dict(self) -> dict: """Serializes the SetTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetTag: """Deserializes the SetTag from a dictionary.""" return cls( - key=d.get("{key}", None), - run_id=d.get("{run_id}", None), - run_uuid=d.get("{run_uuid}", None), - value=d.get("{value}", None), + key=d.get("key", None), + run_id=d.get("run_id", None), + run_uuid=d.get("run_uuid", None), + value=d.get("value", None), ) @@ -5356,15 +5351,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TestRegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.body is not None: - body["{body}"] = self.body + body["body"] = self.body if self.status_code is not None: - body["{status_code}"] = self.status_code + body["status_code"] = self.status_code return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhook: """Deserializes the TestRegistryWebhook from a dictionary.""" - return cls(body=d.get("{body}", None), status_code=d.get("{status_code}", None)) + return cls(body=d.get("body", None), status_code=d.get("status_code", None)) @dataclass @@ -5389,15 +5384,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TestRegistryWebhookRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.event is not None: - body["{event}"] = self.event + body["event"] = self.event if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookRequest: """Deserializes the TestRegistryWebhookRequest from a dictionary.""" - return cls(event=_enum(d, "{event}", RegistryWebhookEvent), id=d.get("{id}", None)) + return cls(event=_enum(d, "event", RegistryWebhookEvent), id=d.get("id", None)) @dataclass @@ -5416,13 +5411,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TestRegistryWebhookResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.webhook: - body["{webhook}"] = self.webhook + body["webhook"] = self.webhook return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookResponse: """Deserializes the TestRegistryWebhookResponse from a dictionary.""" - return cls(webhook=_from_dict(d, "{webhook}", TestRegistryWebhook)) + return cls(webhook=_from_dict(d, "webhook", TestRegistryWebhook)) @dataclass @@ -5469,26 +5464,26 @@ def as_shallow_dict(self) -> dict: """Serializes the TransitionModelVersionStageDatabricks into a shallow dictionary of its immediate attributes.""" body = {} if self.archive_existing_versions is not None: - body["{archive_existing_versions}"] = self.archive_existing_versions + body["archive_existing_versions"] = self.archive_existing_versions if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.stage is not None: - body["{stage}"] = self.stage + body["stage"] = self.stage if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransitionModelVersionStageDatabricks: """Deserializes the TransitionModelVersionStageDatabricks from a dictionary.""" return cls( - archive_existing_versions=d.get("{archive_existing_versions}", None), - comment=d.get("{comment}", None), - name=d.get("{name}", None), - stage=_enum(d, "{stage}", Stage), - version=d.get("{version}", None), + archive_existing_versions=d.get("archive_existing_versions", None), + comment=d.get("comment", None), + name=d.get("name", None), + stage=_enum(d, "stage", Stage), + version=d.get("version", None), ) @@ -5538,26 +5533,26 @@ def as_shallow_dict(self) -> dict: """Serializes the TransitionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.available_actions: - body["{available_actions}"] = self.available_actions + body["available_actions"] = self.available_actions if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.to_stage is not None: - body["{to_stage}"] = self.to_stage + body["to_stage"] = self.to_stage if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransitionRequest: """Deserializes the TransitionRequest from a dictionary.""" return cls( - available_actions=_repeated_enum(d, "{available_actions}", ActivityAction), - comment=d.get("{comment}", None), - creation_timestamp=d.get("{creation_timestamp}", None), - to_stage=_enum(d, "{to_stage}", Stage), - user_id=d.get("{user_id}", None), + available_actions=_repeated_enum(d, "available_actions", ActivityAction), + comment=d.get("comment", None), + creation_timestamp=d.get("creation_timestamp", None), + to_stage=_enum(d, "to_stage", Stage), + user_id=d.get("user_id", None), ) @@ -5576,13 +5571,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TransitionStageResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.model_version: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransitionStageResponse: """Deserializes the TransitionStageResponse from a dictionary.""" - return cls(model_version=_from_dict(d, "{model_version}", ModelVersionDatabricks)) + return cls(model_version=_from_dict(d, "model_version", ModelVersionDatabricks)) @dataclass @@ -5606,15 +5601,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateComment into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateComment: """Deserializes the UpdateComment from a dictionary.""" - return cls(comment=d.get("{comment}", None), id=d.get("{id}", None)) + return cls(comment=d.get("comment", None), id=d.get("id", None)) @dataclass @@ -5633,13 +5628,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCommentResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.comment: - body["{comment}"] = self.comment + body["comment"] = self.comment return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCommentResponse: """Deserializes the UpdateCommentResponse from a dictionary.""" - return cls(comment=_from_dict(d, "{comment}", CommentObject)) + return cls(comment=_from_dict(d, "comment", CommentObject)) @dataclass @@ -5663,15 +5658,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateExperiment into a shallow dictionary of its immediate attributes.""" body = {} if self.experiment_id is not None: - body["{experiment_id}"] = self.experiment_id + body["experiment_id"] = self.experiment_id if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateExperiment: """Deserializes the UpdateExperiment from a dictionary.""" - return cls(experiment_id=d.get("{experiment_id}", None), new_name=d.get("{new_name}", None)) + return cls(experiment_id=d.get("experiment_id", None), new_name=d.get("new_name", None)) @dataclass @@ -5713,15 +5708,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateModelRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateModelRequest: """Deserializes the UpdateModelRequest from a dictionary.""" - return cls(description=d.get("{description}", None), name=d.get("{name}", None)) + return cls(description=d.get("description", None), name=d.get("name", None)) @dataclass @@ -5768,19 +5763,17 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateModelVersionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.version is not None: - body["{version}"] = self.version + body["version"] = self.version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionRequest: """Deserializes the UpdateModelVersionRequest from a dictionary.""" - return cls( - description=d.get("{description}", None), name=d.get("{name}", None), version=d.get("{version}", None) - ) + return cls(description=d.get("description", None), name=d.get("name", None), version=d.get("version", None)) @dataclass @@ -5873,29 +5866,29 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRegistryWebhook into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.events: - body["{events}"] = self.events + body["events"] = self.events if self.http_url_spec: - body["{http_url_spec}"] = self.http_url_spec + body["http_url_spec"] = self.http_url_spec if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.job_spec: - body["{job_spec}"] = self.job_spec + body["job_spec"] = self.job_spec if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRegistryWebhook: """Deserializes the UpdateRegistryWebhook from a dictionary.""" return cls( - description=d.get("{description}", None), - events=_repeated_enum(d, "{events}", RegistryWebhookEvent), - http_url_spec=_from_dict(d, "{http_url_spec}", HttpUrlSpec), - id=d.get("{id}", None), - job_spec=_from_dict(d, "{job_spec}", JobSpec), - status=_enum(d, "{status}", RegistryWebhookStatus), + description=d.get("description", None), + events=_repeated_enum(d, "events", RegistryWebhookEvent), + http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec), + id=d.get("id", None), + job_spec=_from_dict(d, "job_spec", JobSpec), + status=_enum(d, "status", RegistryWebhookStatus), ) @@ -5936,26 +5929,26 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRun into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time is not None: - body["{end_time}"] = self.end_time + body["end_time"] = self.end_time if self.run_id is not None: - body["{run_id}"] = self.run_id + body["run_id"] = self.run_id if self.run_name is not None: - body["{run_name}"] = self.run_name + body["run_name"] = self.run_name if self.run_uuid is not None: - body["{run_uuid}"] = self.run_uuid + body["run_uuid"] = self.run_uuid if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRun: """Deserializes the UpdateRun from a dictionary.""" return cls( - end_time=d.get("{end_time}", None), - run_id=d.get("{run_id}", None), - run_name=d.get("{run_name}", None), - run_uuid=d.get("{run_uuid}", None), - status=_enum(d, "{status}", UpdateRunStatus), + end_time=d.get("end_time", None), + run_id=d.get("run_id", None), + run_name=d.get("run_name", None), + run_uuid=d.get("run_uuid", None), + status=_enum(d, "status", UpdateRunStatus), ) @@ -5975,13 +5968,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRunResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.run_info: - body["{run_info}"] = self.run_info + body["run_info"] = self.run_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRunResponse: """Deserializes the UpdateRunResponse from a dictionary.""" - return cls(run_info=_from_dict(d, "{run_info}", RunInfo)) + return cls(run_info=_from_dict(d, "run_info", RunInfo)) class UpdateRunStatus(Enum): @@ -6057,11 +6050,11 @@ def create_experiment( """ body = {} if artifact_location is not None: - body["{artifact_location}"] = artifact_location + body["artifact_location"] = artifact_location if name is not None: - body["{name}"] = name + body["name"] = name if tags is not None: - body["{tags}"] = [v.as_dict() for v in tags] + body["tags"] = [v.as_dict() for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6101,15 +6094,15 @@ def create_run( """ body = {} if experiment_id is not None: - body["{experiment_id}"] = experiment_id + body["experiment_id"] = experiment_id if run_name is not None: - body["{run_name}"] = run_name + body["run_name"] = run_name if start_time is not None: - body["{start_time}"] = start_time + body["start_time"] = start_time if tags is not None: - body["{tags}"] = [v.as_dict() for v in tags] + body["tags"] = [v.as_dict() for v in tags] if user_id is not None: - body["{user_id}"] = user_id + body["user_id"] = user_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6131,7 +6124,7 @@ def delete_experiment(self, experiment_id: str): """ body = {} if experiment_id is not None: - body["{experiment_id}"] = experiment_id + body["experiment_id"] = experiment_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6151,7 +6144,7 @@ def delete_run(self, run_id: str): """ body = {} if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6181,11 +6174,11 @@ def delete_runs( """ body = {} if experiment_id is not None: - body["{experiment_id}"] = experiment_id + body["experiment_id"] = experiment_id if max_runs is not None: - body["{max_runs}"] = max_runs + body["max_runs"] = max_runs if max_timestamp_millis is not None: - body["{max_timestamp_millis}"] = max_timestamp_millis + body["max_timestamp_millis"] = max_timestamp_millis headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6209,9 +6202,9 @@ def delete_tag(self, run_id: str, key: str): """ body = {} if key is not None: - body["{key}"] = key + body["key"] = key if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6238,7 +6231,7 @@ def get_by_name(self, experiment_name: str) -> GetExperimentByNameResponse: query = {} if experiment_name is not None: - query["{experiment_name}"] = experiment_name + query["experiment_name"] = experiment_name headers = { "0": "{Accept application/json}", } @@ -6259,7 +6252,7 @@ def get_experiment(self, experiment_id: str) -> GetExperimentResponse: query = {} if experiment_id is not None: - query["{experiment_id}"] = experiment_id + query["experiment_id"] = experiment_id headers = { "0": "{Accept application/json}", } @@ -6298,27 +6291,27 @@ def get_history( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if metric_key is not None: - query["{metric_key}"] = metric_key + query["metric_key"] = metric_key if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if run_id is not None: - query["{run_id}"] = run_id + query["run_id"] = run_id if run_uuid is not None: - query["{run_uuid}"] = run_uuid + query["run_uuid"] = run_uuid headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/metrics/get-history", query=query, headers=headers) - if "{metrics}" in json: - for v in json["{metrics}"]: + if "metrics" in json: + for v in json["metrics"]: yield Metric.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLevelsResponse: """Get experiment permission levels. @@ -6375,9 +6368,9 @@ def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunRespo query = {} if run_id is not None: - query["{run_id}"] = run_id + query["run_id"] = run_id if run_uuid is not None: - query["{run_uuid}"] = run_uuid + query["run_uuid"] = run_uuid headers = { "0": "{Accept application/json}", } @@ -6420,25 +6413,25 @@ def list_artifacts( query = {} if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if path is not None: - query["{path}"] = path + query["path"] = path if run_id is not None: - query["{run_id}"] = run_id + query["run_id"] = run_id if run_uuid is not None: - query["{run_uuid}"] = run_uuid + query["run_uuid"] = run_uuid headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/artifacts/list", query=query, headers=headers) - if "{files}" in json: - for v in json["{files}"]: + if "files" in json: + for v in json["files"]: yield FileInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_experiments( self, @@ -6465,23 +6458,23 @@ def list_experiments( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if view_type is not None: - query["{view_type}"] = view_type.value + query["view_type"] = view_type.value headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/experiments/list", query=query, headers=headers) - if "{experiments}" in json: - for v in json["{experiments}"]: + if "experiments" in json: + for v in json["experiments"]: yield Experiment.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def log_batch( self, @@ -6550,13 +6543,13 @@ def log_batch( """ body = {} if metrics is not None: - body["{metrics}"] = [v.as_dict() for v in metrics] + body["metrics"] = [v.as_dict() for v in metrics] if params is not None: - body["{params}"] = [v.as_dict() for v in params] + body["params"] = [v.as_dict() for v in params] if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id if tags is not None: - body["{tags}"] = [v.as_dict() for v in tags] + body["tags"] = [v.as_dict() for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6584,11 +6577,11 @@ def log_inputs( """ body = {} if datasets is not None: - body["{datasets}"] = [v.as_dict() for v in datasets] + body["datasets"] = [v.as_dict() for v in datasets] if models is not None: - body["{models}"] = [v.as_dict() for v in models] + body["models"] = [v.as_dict() for v in models] if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6641,23 +6634,23 @@ def log_metric( """ body = {} if dataset_digest is not None: - body["{dataset_digest}"] = dataset_digest + body["dataset_digest"] = dataset_digest if dataset_name is not None: - body["{dataset_name}"] = dataset_name + body["dataset_name"] = dataset_name if key is not None: - body["{key}"] = key + body["key"] = key if model_id is not None: - body["{model_id}"] = model_id + body["model_id"] = model_id if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id if run_uuid is not None: - body["{run_uuid}"] = run_uuid + body["run_uuid"] = run_uuid if step is not None: - body["{step}"] = step + body["step"] = step if timestamp is not None: - body["{timestamp}"] = timestamp + body["timestamp"] = timestamp if value is not None: - body["{value}"] = value + body["value"] = value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6679,9 +6672,9 @@ def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = """ body = {} if model_json is not None: - body["{model_json}"] = model_json + body["model_json"] = model_json if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6710,13 +6703,13 @@ def log_param(self, key: str, value: str, *, run_id: Optional[str] = None, run_u """ body = {} if key is not None: - body["{key}"] = key + body["key"] = key if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id if run_uuid is not None: - body["{run_uuid}"] = run_uuid + body["run_uuid"] = run_uuid if value is not None: - body["{value}"] = value + body["value"] = value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6740,7 +6733,7 @@ def restore_experiment(self, experiment_id: str): """ body = {} if experiment_id is not None: - body["{experiment_id}"] = experiment_id + body["experiment_id"] = experiment_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6762,7 +6755,7 @@ def restore_run(self, run_id: str): """ body = {} if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6792,11 +6785,11 @@ def restore_runs( """ body = {} if experiment_id is not None: - body["{experiment_id}"] = experiment_id + body["experiment_id"] = experiment_id if max_runs is not None: - body["{max_runs}"] = max_runs + body["max_runs"] = max_runs if min_timestamp_millis is not None: - body["{min_timestamp_millis}"] = min_timestamp_millis + body["min_timestamp_millis"] = min_timestamp_millis headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6835,15 +6828,15 @@ def search_experiments( """ body = {} if filter is not None: - body["{filter}"] = filter + body["filter"] = filter if max_results is not None: - body["{max_results}"] = max_results + body["max_results"] = max_results if order_by is not None: - body["{order_by}"] = [v for v in order_by] + body["order_by"] = [v for v in order_by] if page_token is not None: - body["{page_token}"] = page_token + body["page_token"] = page_token if view_type is not None: - body["{view_type}"] = view_type.value + body["view_type"] = view_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6851,12 +6844,12 @@ def search_experiments( while True: json = self._api.do("POST", "/api/2.0/mlflow/experiments/search", body=body, headers=headers) - if "{experiments}" in json: - for v in json["{experiments}"]: + if "experiments" in json: + for v in json["experiments"]: yield Experiment.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - body["{page_token}"] = json["{next_page_token}"] + body["page_token"] = json["next_page_token"] def search_runs( self, @@ -6904,17 +6897,17 @@ def search_runs( """ body = {} if experiment_ids is not None: - body["{experiment_ids}"] = [v for v in experiment_ids] + body["experiment_ids"] = [v for v in experiment_ids] if filter is not None: - body["{filter}"] = filter + body["filter"] = filter if max_results is not None: - body["{max_results}"] = max_results + body["max_results"] = max_results if order_by is not None: - body["{order_by}"] = [v for v in order_by] + body["order_by"] = [v for v in order_by] if page_token is not None: - body["{page_token}"] = page_token + body["page_token"] = page_token if run_view_type is not None: - body["{run_view_type}"] = run_view_type.value + body["run_view_type"] = run_view_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6922,12 +6915,12 @@ def search_runs( while True: json = self._api.do("POST", "/api/2.0/mlflow/runs/search", body=body, headers=headers) - if "{runs}" in json: - for v in json["{runs}"]: + if "runs" in json: + for v in json["runs"]: yield Run.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - body["{page_token}"] = json["{next_page_token}"] + body["page_token"] = json["next_page_token"] def set_experiment_tag(self, experiment_id: str, key: str, value: str): """Set a tag for an experiment. @@ -6945,11 +6938,11 @@ def set_experiment_tag(self, experiment_id: str, key: str, value: str): """ body = {} if experiment_id is not None: - body["{experiment_id}"] = experiment_id + body["experiment_id"] = experiment_id if key is not None: - body["{key}"] = key + body["key"] = key if value is not None: - body["{value}"] = value + body["value"] = value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6973,7 +6966,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7001,13 +6994,13 @@ def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uui """ body = {} if key is not None: - body["{key}"] = key + body["key"] = key if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id if run_uuid is not None: - body["{run_uuid}"] = run_uuid + body["run_uuid"] = run_uuid if value is not None: - body["{value}"] = value + body["value"] = value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7029,9 +7022,9 @@ def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = Non """ body = {} if experiment_id is not None: - body["{experiment_id}"] = experiment_id + body["experiment_id"] = experiment_id if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7054,7 +7047,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7092,15 +7085,15 @@ def update_run( """ body = {} if end_time is not None: - body["{end_time}"] = end_time + body["end_time"] = end_time if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id if run_name is not None: - body["{run_name}"] = run_name + body["run_name"] = run_name if run_uuid is not None: - body["{run_uuid}"] = run_uuid + body["run_uuid"] = run_uuid if status is not None: - body["{status}"] = status.value + body["status"] = status.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7186,35 +7179,35 @@ def create_experiment( """ body = {} if custom_weights_column is not None: - body["{custom_weights_column}"] = custom_weights_column + body["custom_weights_column"] = custom_weights_column if experiment_path is not None: - body["{experiment_path}"] = experiment_path + body["experiment_path"] = experiment_path if forecast_granularity is not None: - body["{forecast_granularity}"] = forecast_granularity + body["forecast_granularity"] = forecast_granularity if forecast_horizon is not None: - body["{forecast_horizon}"] = forecast_horizon + body["forecast_horizon"] = forecast_horizon if holiday_regions is not None: - body["{holiday_regions}"] = [v for v in holiday_regions] + body["holiday_regions"] = [v for v in holiday_regions] if max_runtime is not None: - body["{max_runtime}"] = max_runtime + body["max_runtime"] = max_runtime if prediction_data_path is not None: - body["{prediction_data_path}"] = prediction_data_path + body["prediction_data_path"] = prediction_data_path if primary_metric is not None: - body["{primary_metric}"] = primary_metric + body["primary_metric"] = primary_metric if register_to is not None: - body["{register_to}"] = register_to + body["register_to"] = register_to if split_column is not None: - body["{split_column}"] = split_column + body["split_column"] = split_column if target_column is not None: - body["{target_column}"] = target_column + body["target_column"] = target_column if time_column is not None: - body["{time_column}"] = time_column + body["time_column"] = time_column if timeseries_identifier_columns is not None: - body["{timeseries_identifier_columns}"] = [v for v in timeseries_identifier_columns] + body["timeseries_identifier_columns"] = [v for v in timeseries_identifier_columns] if train_data_path is not None: - body["{train_data_path}"] = train_data_path + body["train_data_path"] = train_data_path if training_frameworks is not None: - body["{training_frameworks}"] = [v for v in training_frameworks] + body["training_frameworks"] = [v for v in training_frameworks] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7224,7 +7217,7 @@ def create_experiment( return Wait( self.WaitGetExperimentForecastingSucceeded, response=CreateForecastingExperimentResponse.from_dict(op_response), - experiment_id=op_response["{experiment_id}"], + experiment_id=op_response["experiment_id"], ) def create_experiment_and_wait( @@ -7326,15 +7319,15 @@ def approve_transition_request( """ body = {} if archive_existing_versions is not None: - body["{archive_existing_versions}"] = archive_existing_versions + body["archive_existing_versions"] = archive_existing_versions if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if stage is not None: - body["{stage}"] = stage.value + body["stage"] = stage.value if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7360,11 +7353,11 @@ def create_comment(self, name: str, version: str, comment: str) -> CreateComment """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7393,11 +7386,11 @@ def create_model( """ body = {} if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name if tags is not None: - body["{tags}"] = [v.as_dict() for v in tags] + body["tags"] = [v.as_dict() for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7439,17 +7432,17 @@ def create_model_version( """ body = {} if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name if run_id is not None: - body["{run_id}"] = run_id + body["run_id"] = run_id if run_link is not None: - body["{run_link}"] = run_link + body["run_link"] = run_link if source is not None: - body["{source}"] = source + body["source"] = source if tags is not None: - body["{tags}"] = [v.as_dict() for v in tags] + body["tags"] = [v.as_dict() for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7486,13 +7479,13 @@ def create_transition_request( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if stage is not None: - body["{stage}"] = stage.value + body["stage"] = stage.value if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7565,17 +7558,17 @@ def create_webhook( """ body = {} if description is not None: - body["{description}"] = description + body["description"] = description if events is not None: - body["{events}"] = [v.value for v in events] + body["events"] = [v.value for v in events] if http_url_spec is not None: - body["{http_url_spec}"] = http_url_spec.as_dict() + body["http_url_spec"] = http_url_spec.as_dict() if job_spec is not None: - body["{job_spec}"] = job_spec.as_dict() + body["job_spec"] = job_spec.as_dict() if model_name is not None: - body["{model_name}"] = model_name + body["model_name"] = model_name if status is not None: - body["{status}"] = status.value + body["status"] = status.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7596,7 +7589,7 @@ def delete_comment(self, id: str): query = {} if id is not None: - query["{id}"] = id + query["id"] = id headers = { "0": "{Accept application/json}", } @@ -7616,7 +7609,7 @@ def delete_model(self, name: str): query = {} if name is not None: - query["{name}"] = name + query["name"] = name headers = { "0": "{Accept application/json}", } @@ -7639,9 +7632,9 @@ def delete_model_tag(self, name: str, key: str): query = {} if key is not None: - query["{key}"] = key + query["key"] = key if name is not None: - query["{name}"] = name + query["name"] = name headers = { "0": "{Accept application/json}", } @@ -7663,9 +7656,9 @@ def delete_model_version(self, name: str, version: str): query = {} if name is not None: - query["{name}"] = name + query["name"] = name if version is not None: - query["{version}"] = version + query["version"] = version headers = { "0": "{Accept application/json}", } @@ -7690,11 +7683,11 @@ def delete_model_version_tag(self, name: str, version: str, key: str): query = {} if key is not None: - query["{key}"] = key + query["key"] = key if name is not None: - query["{name}"] = name + query["name"] = name if version is not None: - query["{version}"] = version + query["version"] = version headers = { "0": "{Accept application/json}", } @@ -7739,15 +7732,15 @@ def delete_transition_request( query = {} if comment is not None: - query["{comment}"] = comment + query["comment"] = comment if creator is not None: - query["{creator}"] = creator + query["creator"] = creator if name is not None: - query["{name}"] = name + query["name"] = name if stage is not None: - query["{stage}"] = stage.value + query["stage"] = stage.value if version is not None: - query["{version}"] = version + query["version"] = version headers = { "0": "{Accept application/json}", } @@ -7769,7 +7762,7 @@ def delete_webhook(self, *, id: Optional[str] = None): query = {} if id is not None: - query["{id}"] = id + query["id"] = id headers = { "0": "{Accept application/json}", } @@ -7790,9 +7783,9 @@ def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if stages is not None: - body["{stages}"] = [v for v in stages] + body["stages"] = [v for v in stages] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7819,7 +7812,7 @@ def get_model(self, name: str) -> GetModelResponse: query = {} if name is not None: - query["{name}"] = name + query["name"] = name headers = { "0": "{Accept application/json}", } @@ -7842,9 +7835,9 @@ def get_model_version(self, name: str, version: str) -> GetModelVersionResponse: query = {} if name is not None: - query["{name}"] = name + query["name"] = name if version is not None: - query["{version}"] = version + query["version"] = version headers = { "0": "{Accept application/json}", } @@ -7867,9 +7860,9 @@ def get_model_version_download_uri(self, name: str, version: str) -> GetModelVer query = {} if name is not None: - query["{name}"] = name + query["name"] = name if version is not None: - query["{version}"] = version + query["version"] = version headers = { "0": "{Accept application/json}", } @@ -7931,21 +7924,21 @@ def list_models(self, *, max_results: Optional[int] = None, page_token: Optional query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/registered-models/list", query=query, headers=headers) - if "{registered_models}" in json: - for v in json["{registered_models}"]: + if "registered_models" in json: + for v in json["registered_models"]: yield Model.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_transition_requests(self, name: str, version: str) -> Iterator[Activity]: """List transition requests. @@ -7962,9 +7955,9 @@ def list_transition_requests(self, name: str, version: str) -> Iterator[Activity query = {} if name is not None: - query["{name}"] = name + query["name"] = name if version is not None: - query["{version}"] = version + query["version"] = version headers = { "0": "{Accept application/json}", } @@ -8000,23 +7993,23 @@ def list_webhooks( query = {} if events is not None: - query["{events}"] = [v.value for v in events] + query["events"] = [v.value for v in events] if model_name is not None: - query["{model_name}"] = model_name + query["model_name"] = model_name if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/registry-webhooks/list", query=query, headers=headers) - if "{webhooks}" in json: - for v in json["{webhooks}"]: + if "webhooks" in json: + for v in json["webhooks"]: yield RegistryWebhook.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def reject_transition_request( self, name: str, version: str, stage: Stage, *, comment: Optional[str] = None @@ -8046,13 +8039,13 @@ def reject_transition_request( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if stage is not None: - body["{stage}"] = stage.value + body["stage"] = stage.value if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8075,9 +8068,9 @@ def rename_model(self, name: str, *, new_name: Optional[str] = None) -> RenameMo """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8115,25 +8108,25 @@ def search_model_versions( query = {} if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if order_by is not None: - query["{order_by}"] = [v for v in order_by] + query["order_by"] = [v for v in order_by] if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/model-versions/search", query=query, headers=headers) - if "{model_versions}" in json: - for v in json["{model_versions}"]: + if "model_versions" in json: + for v in json["model_versions"]: yield ModelVersion.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def search_models( self, @@ -8165,25 +8158,25 @@ def search_models( query = {} if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if order_by is not None: - query["{order_by}"] = [v for v in order_by] + query["order_by"] = [v for v in order_by] if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/mlflow/registered-models/search", query=query, headers=headers) - if "{registered_models}" in json: - for v in json["{registered_models}"]: + if "registered_models" in json: + for v in json["registered_models"]: yield Model.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def set_model_tag(self, name: str, key: str, value: str): """Set a tag. @@ -8204,11 +8197,11 @@ def set_model_tag(self, name: str, key: str, value: str): """ body = {} if key is not None: - body["{key}"] = key + body["key"] = key if name is not None: - body["{name}"] = name + body["name"] = name if value is not None: - body["{value}"] = value + body["value"] = value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8237,13 +8230,13 @@ def set_model_version_tag(self, name: str, version: str, key: str, value: str): """ body = {} if key is not None: - body["{key}"] = key + body["key"] = key if name is not None: - body["{name}"] = name + body["name"] = name if value is not None: - body["{value}"] = value + body["value"] = value if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8270,7 +8263,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8300,9 +8293,9 @@ def test_registry_webhook( """ body = {} if event is not None: - body["{event}"] = event.value + body["event"] = event.value if id is not None: - body["{id}"] = id + body["id"] = id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8344,15 +8337,15 @@ def transition_stage( """ body = {} if archive_existing_versions is not None: - body["{archive_existing_versions}"] = archive_existing_versions + body["archive_existing_versions"] = archive_existing_versions if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if stage is not None: - body["{stage}"] = stage.value + body["stage"] = stage.value if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8377,9 +8370,9 @@ def update_comment(self, id: str, comment: str) -> UpdateCommentResponse: """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if id is not None: - body["{id}"] = id + body["id"] = id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8402,9 +8395,9 @@ def update_model(self, name: str, *, description: Optional[str] = None): """ body = {} if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8428,11 +8421,11 @@ def update_model_version(self, name: str, version: str, *, description: Optional """ body = {} if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name if version is not None: - body["{version}"] = version + body["version"] = version headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8459,7 +8452,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8534,17 +8527,17 @@ def update_webhook( """ body = {} if description is not None: - body["{description}"] = description + body["description"] = description if events is not None: - body["{events}"] = [v.value for v in events] + body["events"] = [v.value for v in events] if http_url_spec is not None: - body["{http_url_spec}"] = http_url_spec.as_dict() + body["http_url_spec"] = http_url_spec.as_dict() if id is not None: - body["{id}"] = id + body["id"] = id if job_spec is not None: - body["{job_spec}"] = job_spec.as_dict() + body["job_spec"] = job_spec.as_dict() if status is not None: - body["{status}"] = status.value + body["status"] = status.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/oauth2/v2/impl.py b/databricks/sdk/oauth2/v2/impl.py index 490887b9a..65425f72a 100755 --- a/databricks/sdk/oauth2/v2/impl.py +++ b/databricks/sdk/oauth2/v2/impl.py @@ -56,29 +56,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCustomAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.confidential is not None: - body["{confidential}"] = self.confidential + body["confidential"] = self.confidential if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.redirect_urls: - body["{redirect_urls}"] = self.redirect_urls + body["redirect_urls"] = self.redirect_urls if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy + body["token_access_policy"] = self.token_access_policy if self.user_authorized_scopes: - body["{user_authorized_scopes}"] = self.user_authorized_scopes + body["user_authorized_scopes"] = self.user_authorized_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCustomAppIntegration: """Deserializes the CreateCustomAppIntegration from a dictionary.""" return cls( - confidential=d.get("{confidential}", None), - name=d.get("{name}", None), - redirect_urls=d.get("{redirect_urls}", None), - scopes=d.get("{scopes}", None), - token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), - user_authorized_scopes=d.get("{user_authorized_scopes}", None), + confidential=d.get("confidential", None), + name=d.get("name", None), + redirect_urls=d.get("redirect_urls", None), + scopes=d.get("scopes", None), + token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), + user_authorized_scopes=d.get("user_authorized_scopes", None), ) @@ -109,20 +109,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCustomAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.client_id is not None: - body["{client_id}"] = self.client_id + body["client_id"] = self.client_id if self.client_secret is not None: - body["{client_secret}"] = self.client_secret + body["client_secret"] = self.client_secret if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCustomAppIntegrationOutput: """Deserializes the CreateCustomAppIntegrationOutput from a dictionary.""" return cls( - client_id=d.get("{client_id}", None), - client_secret=d.get("{client_secret}", None), - integration_id=d.get("{integration_id}", None), + client_id=d.get("client_id", None), + client_secret=d.get("client_secret", None), + integration_id=d.get("integration_id", None), ) @@ -147,17 +147,16 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePublishedAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.app_id is not None: - body["{app_id}"] = self.app_id + body["app_id"] = self.app_id if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy + body["token_access_policy"] = self.token_access_policy return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePublishedAppIntegration: """Deserializes the CreatePublishedAppIntegration from a dictionary.""" return cls( - app_id=d.get("{app_id}", None), - token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), + app_id=d.get("app_id", None), token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy) ) @@ -177,13 +176,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePublishedAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePublishedAppIntegrationOutput: """Deserializes the CreatePublishedAppIntegrationOutput from a dictionary.""" - return cls(integration_id=d.get("{integration_id}", None)) + return cls(integration_id=d.get("integration_id", None)) @dataclass @@ -208,15 +207,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.lifetime is not None: - body["{lifetime}"] = self.lifetime + body["lifetime"] = self.lifetime if self.service_principal_id is not None: - body["{service_principal_id}"] = self.service_principal_id + body["service_principal_id"] = self.service_principal_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateServicePrincipalSecretRequest: """Deserializes the CreateServicePrincipalSecretRequest from a dictionary.""" - return cls(lifetime=d.get("{lifetime}", None), service_principal_id=d.get("{service_principal_id}", None)) + return cls(lifetime=d.get("lifetime", None), service_principal_id=d.get("service_principal_id", None)) @dataclass @@ -265,32 +264,32 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateServicePrincipalSecretResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.expire_time is not None: - body["{expire_time}"] = self.expire_time + body["expire_time"] = self.expire_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.secret is not None: - body["{secret}"] = self.secret + body["secret"] = self.secret if self.secret_hash is not None: - body["{secret_hash}"] = self.secret_hash + body["secret_hash"] = self.secret_hash if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateServicePrincipalSecretResponse: """Deserializes the CreateServicePrincipalSecretResponse from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - expire_time=d.get("{expire_time}", None), - id=d.get("{id}", None), - secret=d.get("{secret}", None), - secret_hash=d.get("{secret_hash}", None), - status=d.get("{status}", None), - update_time=d.get("{update_time}", None), + create_time=d.get("create_time", None), + expire_time=d.get("expire_time", None), + id=d.get("id", None), + secret=d.get("secret", None), + secret_hash=d.get("secret_hash", None), + status=d.get("status", None), + update_time=d.get("update_time", None), ) @@ -395,29 +394,29 @@ def as_shallow_dict(self) -> dict: """Serializes the FederationPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.oidc_policy: - body["{oidc_policy}"] = self.oidc_policy + body["oidc_policy"] = self.oidc_policy if self.uid is not None: - body["{uid}"] = self.uid + body["uid"] = self.uid if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FederationPolicy: """Deserializes the FederationPolicy from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - description=d.get("{description}", None), - name=d.get("{name}", None), - oidc_policy=_from_dict(d, "{oidc_policy}", OidcFederationPolicy), - uid=d.get("{uid}", None), - update_time=d.get("{update_time}", None), + create_time=d.get("create_time", None), + description=d.get("description", None), + name=d.get("name", None), + oidc_policy=_from_dict(d, "oidc_policy", OidcFederationPolicy), + uid=d.get("uid", None), + update_time=d.get("update_time", None), ) @@ -484,44 +483,44 @@ def as_shallow_dict(self) -> dict: """Serializes the GetCustomAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.client_id is not None: - body["{client_id}"] = self.client_id + body["client_id"] = self.client_id if self.confidential is not None: - body["{confidential}"] = self.confidential + body["confidential"] = self.confidential if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.creator_username is not None: - body["{creator_username}"] = self.creator_username + body["creator_username"] = self.creator_username if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.redirect_urls: - body["{redirect_urls}"] = self.redirect_urls + body["redirect_urls"] = self.redirect_urls if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy + body["token_access_policy"] = self.token_access_policy if self.user_authorized_scopes: - body["{user_authorized_scopes}"] = self.user_authorized_scopes + body["user_authorized_scopes"] = self.user_authorized_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetCustomAppIntegrationOutput: """Deserializes the GetCustomAppIntegrationOutput from a dictionary.""" return cls( - client_id=d.get("{client_id}", None), - confidential=d.get("{confidential}", None), - create_time=d.get("{create_time}", None), - created_by=d.get("{created_by}", None), - creator_username=d.get("{creator_username}", None), - integration_id=d.get("{integration_id}", None), - name=d.get("{name}", None), - redirect_urls=d.get("{redirect_urls}", None), - scopes=d.get("{scopes}", None), - token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), - user_authorized_scopes=d.get("{user_authorized_scopes}", None), + client_id=d.get("client_id", None), + confidential=d.get("confidential", None), + create_time=d.get("create_time", None), + created_by=d.get("created_by", None), + creator_username=d.get("creator_username", None), + integration_id=d.get("integration_id", None), + name=d.get("name", None), + redirect_urls=d.get("redirect_urls", None), + scopes=d.get("scopes", None), + token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), + user_authorized_scopes=d.get("user_authorized_scopes", None), ) @@ -545,17 +544,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GetCustomAppIntegrationsOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["{apps}"] = self.apps + body["apps"] = self.apps if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetCustomAppIntegrationsOutput: """Deserializes the GetCustomAppIntegrationsOutput from a dictionary.""" return cls( - apps=_repeated_dict(d, "{apps}", GetCustomAppIntegrationOutput), - next_page_token=d.get("{next_page_token}", None), + apps=_repeated_dict(d, "apps", GetCustomAppIntegrationOutput), + next_page_token=d.get("next_page_token", None), ) @@ -598,29 +597,29 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.app_id is not None: - body["{app_id}"] = self.app_id + body["app_id"] = self.app_id if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy + body["token_access_policy"] = self.token_access_policy return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPublishedAppIntegrationOutput: """Deserializes the GetPublishedAppIntegrationOutput from a dictionary.""" return cls( - app_id=d.get("{app_id}", None), - create_time=d.get("{create_time}", None), - created_by=d.get("{created_by}", None), - integration_id=d.get("{integration_id}", None), - name=d.get("{name}", None), - token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), + app_id=d.get("app_id", None), + create_time=d.get("create_time", None), + created_by=d.get("created_by", None), + integration_id=d.get("integration_id", None), + name=d.get("name", None), + token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), ) @@ -644,17 +643,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPublishedAppIntegrationsOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["{apps}"] = self.apps + body["apps"] = self.apps if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPublishedAppIntegrationsOutput: """Deserializes the GetPublishedAppIntegrationsOutput from a dictionary.""" return cls( - apps=_repeated_dict(d, "{apps}", GetPublishedAppIntegrationOutput), - next_page_token=d.get("{next_page_token}", None), + apps=_repeated_dict(d, "apps", GetPublishedAppIntegrationOutput), + next_page_token=d.get("next_page_token", None), ) @@ -680,17 +679,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPublishedAppsOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.apps: - body["{apps}"] = self.apps + body["apps"] = self.apps if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPublishedAppsOutput: """Deserializes the GetPublishedAppsOutput from a dictionary.""" - return cls( - apps=_repeated_dict(d, "{apps}", PublishedAppOutput), next_page_token=d.get("{next_page_token}", None) - ) + return cls(apps=_repeated_dict(d, "apps", PublishedAppOutput), next_page_token=d.get("next_page_token", None)) @dataclass @@ -712,16 +709,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListFederationPoliciesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.policies: - body["{policies}"] = self.policies + body["policies"] = self.policies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListFederationPoliciesResponse: """Deserializes the ListFederationPoliciesResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), policies=_repeated_dict(d, "{policies}", FederationPolicy) + next_page_token=d.get("next_page_token", None), policies=_repeated_dict(d, "policies", FederationPolicy) ) @@ -746,15 +743,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListServicePrincipalSecretsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.secrets: - body["{secrets}"] = self.secrets + body["secrets"] = self.secrets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListServicePrincipalSecretsResponse: """Deserializes the ListServicePrincipalSecretsResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), secrets=_repeated_dict(d, "{secrets}", SecretInfo)) + return cls(next_page_token=d.get("next_page_token", None), secrets=_repeated_dict(d, "secrets", SecretInfo)) @dataclass @@ -814,29 +811,29 @@ def as_shallow_dict(self) -> dict: """Serializes the OidcFederationPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.audiences: - body["{audiences}"] = self.audiences + body["audiences"] = self.audiences if self.issuer is not None: - body["{issuer}"] = self.issuer + body["issuer"] = self.issuer if self.jwks_json is not None: - body["{jwks_json}"] = self.jwks_json + body["jwks_json"] = self.jwks_json if self.jwks_uri is not None: - body["{jwks_uri}"] = self.jwks_uri + body["jwks_uri"] = self.jwks_uri if self.subject is not None: - body["{subject}"] = self.subject + body["subject"] = self.subject if self.subject_claim is not None: - body["{subject_claim}"] = self.subject_claim + body["subject_claim"] = self.subject_claim return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OidcFederationPolicy: """Deserializes the OidcFederationPolicy from a dictionary.""" return cls( - audiences=d.get("{audiences}", None), - issuer=d.get("{issuer}", None), - jwks_json=d.get("{jwks_json}", None), - jwks_uri=d.get("{jwks_uri}", None), - subject=d.get("{subject}", None), - subject_claim=d.get("{subject_claim}", None), + audiences=d.get("audiences", None), + issuer=d.get("issuer", None), + jwks_json=d.get("jwks_json", None), + jwks_uri=d.get("jwks_uri", None), + subject=d.get("subject", None), + subject_claim=d.get("subject_claim", None), ) @@ -887,32 +884,32 @@ def as_shallow_dict(self) -> dict: """Serializes the PublishedAppOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.app_id is not None: - body["{app_id}"] = self.app_id + body["app_id"] = self.app_id if self.client_id is not None: - body["{client_id}"] = self.client_id + body["client_id"] = self.client_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.is_confidential_client is not None: - body["{is_confidential_client}"] = self.is_confidential_client + body["is_confidential_client"] = self.is_confidential_client if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.redirect_urls: - body["{redirect_urls}"] = self.redirect_urls + body["redirect_urls"] = self.redirect_urls if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublishedAppOutput: """Deserializes the PublishedAppOutput from a dictionary.""" return cls( - app_id=d.get("{app_id}", None), - client_id=d.get("{client_id}", None), - description=d.get("{description}", None), - is_confidential_client=d.get("{is_confidential_client}", None), - name=d.get("{name}", None), - redirect_urls=d.get("{redirect_urls}", None), - scopes=d.get("{scopes}", None), + app_id=d.get("app_id", None), + client_id=d.get("client_id", None), + description=d.get("description", None), + is_confidential_client=d.get("is_confidential_client", None), + name=d.get("name", None), + redirect_urls=d.get("redirect_urls", None), + scopes=d.get("scopes", None), ) @@ -957,29 +954,29 @@ def as_shallow_dict(self) -> dict: """Serializes the SecretInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.expire_time is not None: - body["{expire_time}"] = self.expire_time + body["expire_time"] = self.expire_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.secret_hash is not None: - body["{secret_hash}"] = self.secret_hash + body["secret_hash"] = self.secret_hash if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecretInfo: """Deserializes the SecretInfo from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - expire_time=d.get("{expire_time}", None), - id=d.get("{id}", None), - secret_hash=d.get("{secret_hash}", None), - status=d.get("{status}", None), - update_time=d.get("{update_time}", None), + create_time=d.get("create_time", None), + expire_time=d.get("expire_time", None), + id=d.get("id", None), + secret_hash=d.get("secret_hash", None), + status=d.get("status", None), + update_time=d.get("update_time", None), ) @@ -1004,17 +1001,17 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenAccessPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.access_token_ttl_in_minutes is not None: - body["{access_token_ttl_in_minutes}"] = self.access_token_ttl_in_minutes + body["access_token_ttl_in_minutes"] = self.access_token_ttl_in_minutes if self.refresh_token_ttl_in_minutes is not None: - body["{refresh_token_ttl_in_minutes}"] = self.refresh_token_ttl_in_minutes + body["refresh_token_ttl_in_minutes"] = self.refresh_token_ttl_in_minutes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenAccessPolicy: """Deserializes the TokenAccessPolicy from a dictionary.""" return cls( - access_token_ttl_in_minutes=d.get("{access_token_ttl_in_minutes}", None), - refresh_token_ttl_in_minutes=d.get("{refresh_token_ttl_in_minutes}", None), + access_token_ttl_in_minutes=d.get("access_token_ttl_in_minutes", None), + refresh_token_ttl_in_minutes=d.get("refresh_token_ttl_in_minutes", None), ) @@ -1055,26 +1052,26 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCustomAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.redirect_urls: - body["{redirect_urls}"] = self.redirect_urls + body["redirect_urls"] = self.redirect_urls if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy + body["token_access_policy"] = self.token_access_policy if self.user_authorized_scopes: - body["{user_authorized_scopes}"] = self.user_authorized_scopes + body["user_authorized_scopes"] = self.user_authorized_scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCustomAppIntegration: """Deserializes the UpdateCustomAppIntegration from a dictionary.""" return cls( - integration_id=d.get("{integration_id}", None), - redirect_urls=d.get("{redirect_urls}", None), - scopes=d.get("{scopes}", None), - token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), - user_authorized_scopes=d.get("{user_authorized_scopes}", None), + integration_id=d.get("integration_id", None), + redirect_urls=d.get("redirect_urls", None), + scopes=d.get("scopes", None), + token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), + user_authorized_scopes=d.get("user_authorized_scopes", None), ) @@ -1116,17 +1113,17 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdatePublishedAppIntegration into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_id is not None: - body["{integration_id}"] = self.integration_id + body["integration_id"] = self.integration_id if self.token_access_policy: - body["{token_access_policy}"] = self.token_access_policy + body["token_access_policy"] = self.token_access_policy return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePublishedAppIntegration: """Deserializes the UpdatePublishedAppIntegration from a dictionary.""" return cls( - integration_id=d.get("{integration_id}", None), - token_access_policy=_from_dict(d, "{token_access_policy}", TokenAccessPolicy), + integration_id=d.get("integration_id", None), + token_access_policy=_from_dict(d, "token_access_policy", TokenAccessPolicy), ) @@ -1206,7 +1203,7 @@ def create(self, *, policy: Optional[FederationPolicy] = None, policy_id: Option body = policy.as_dict() query = {} if policy_id is not None: - query["{policy_id}"] = policy_id + query["policy_id"] = policy_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1267,9 +1264,9 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -1278,12 +1275,12 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/federationPolicies", query=query, headers=headers ) - if "{policies}" in json: - for v in json["{policies}"]: + if "policies" in json: + for v in json["policies"]: yield FederationPolicy.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, policy_id: str, *, policy: Optional[FederationPolicy] = None, update_mask: Optional[str] = None @@ -1305,7 +1302,7 @@ def update( body = policy.as_dict() query = {} if update_mask is not None: - query["{update_mask}"] = update_mask + query["update_mask"] = update_mask headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1363,17 +1360,17 @@ def create( """ body = {} if confidential is not None: - body["{confidential}"] = confidential + body["confidential"] = confidential if name is not None: - body["{name}"] = name + body["name"] = name if redirect_urls is not None: - body["{redirect_urls}"] = [v for v in redirect_urls] + body["redirect_urls"] = [v for v in redirect_urls] if scopes is not None: - body["{scopes}"] = [v for v in scopes] + body["scopes"] = [v for v in scopes] if token_access_policy is not None: - body["{token_access_policy}"] = token_access_policy.as_dict() + body["token_access_policy"] = token_access_policy.as_dict() if user_authorized_scopes is not None: - body["{user_authorized_scopes}"] = [v for v in user_authorized_scopes] + body["user_authorized_scopes"] = [v for v in user_authorized_scopes] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1450,11 +1447,11 @@ def list( query = {} if include_creator_username is not None: - query["{include_creator_username}"] = include_creator_username + query["include_creator_username"] = include_creator_username if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -1466,12 +1463,12 @@ def list( query=query, headers=headers, ) - if "{apps}" in json: - for v in json["{apps}"]: + if "apps" in json: + for v in json["apps"]: yield GetCustomAppIntegrationOutput.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -1503,13 +1500,13 @@ def update( """ body = {} if redirect_urls is not None: - body["{redirect_urls}"] = [v for v in redirect_urls] + body["redirect_urls"] = [v for v in redirect_urls] if scopes is not None: - body["{scopes}"] = [v for v in scopes] + body["scopes"] = [v for v in scopes] if token_access_policy is not None: - body["{token_access_policy}"] = token_access_policy.as_dict() + body["token_access_policy"] = token_access_policy.as_dict() if user_authorized_scopes is not None: - body["{user_authorized_scopes}"] = [v for v in user_authorized_scopes] + body["user_authorized_scopes"] = [v for v in user_authorized_scopes] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1548,9 +1545,9 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -1559,12 +1556,12 @@ def list( json = self._api.do( "GET", f"/api/2.0/accounts/{self._api.account_id}/oauth2/published-apps", query=query, headers=headers ) - if "{apps}" in json: - for v in json["{apps}"]: + if "apps" in json: + for v in json["apps"]: yield PublishedAppOutput.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class PublishedAppIntegrationAPI: @@ -1592,9 +1589,9 @@ def create( """ body = {} if app_id is not None: - body["{app_id}"] = app_id + body["app_id"] = app_id if token_access_policy is not None: - body["{token_access_policy}"] = token_access_policy.as_dict() + body["token_access_policy"] = token_access_policy.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1665,9 +1662,9 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -1679,12 +1676,12 @@ def list( query=query, headers=headers, ) - if "{apps}" in json: - for v in json["{apps}"]: + if "apps" in json: + for v in json["apps"]: yield GetPublishedAppIntegrationOutput.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, integration_id: str, *, token_access_policy: Optional[TokenAccessPolicy] = None): """Updates Published OAuth App Integration. @@ -1700,7 +1697,7 @@ def update(self, integration_id: str, *, token_access_policy: Optional[TokenAcce """ body = {} if token_access_policy is not None: - body["{token_access_policy}"] = token_access_policy.as_dict() + body["token_access_policy"] = token_access_policy.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1776,7 +1773,7 @@ def create( body = policy.as_dict() query = {} if policy_id is not None: - query["{policy_id}"] = policy_id + query["policy_id"] = policy_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1849,9 +1846,9 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -1863,12 +1860,12 @@ def list( query=query, headers=headers, ) - if "{policies}" in json: - for v in json["{policies}"]: + if "policies" in json: + for v in json["policies"]: yield FederationPolicy.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -1897,7 +1894,7 @@ def update( body = policy.as_dict() query = {} if update_mask is not None: - query["{update_mask}"] = update_mask + query["update_mask"] = update_mask headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1947,7 +1944,7 @@ def create( """ body = {} if lifetime is not None: - body["{lifetime}"] = lifetime + body["lifetime"] = lifetime headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2003,7 +2000,7 @@ def list(self, service_principal_id: int, *, page_token: Optional[str] = None) - query = {} if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -2015,9 +2012,9 @@ def list(self, service_principal_id: int, *, page_token: Optional[str] = None) - query=query, headers=headers, ) - if "{secrets}" in json: - for v in json["{secrets}"]: + if "secrets" in json: + for v in json["secrets"]: yield SecretInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] diff --git a/databricks/sdk/pipelines/v2/impl.py b/databricks/sdk/pipelines/v2/impl.py index 5786adc41..819f8c81d 100755 --- a/databricks/sdk/pipelines/v2/impl.py +++ b/databricks/sdk/pipelines/v2/impl.py @@ -35,13 +35,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: """Deserializes the Adlsgen2Info from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -153,41 +153,41 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.ebs_volume_count is not None: - body["{ebs_volume_count}"] = self.ebs_volume_count + body["ebs_volume_count"] = self.ebs_volume_count if self.ebs_volume_iops is not None: - body["{ebs_volume_iops}"] = self.ebs_volume_iops + body["ebs_volume_iops"] = self.ebs_volume_iops if self.ebs_volume_size is not None: - body["{ebs_volume_size}"] = self.ebs_volume_size + body["ebs_volume_size"] = self.ebs_volume_size if self.ebs_volume_throughput is not None: - body["{ebs_volume_throughput}"] = self.ebs_volume_throughput + body["ebs_volume_throughput"] = self.ebs_volume_throughput if self.ebs_volume_type is not None: - body["{ebs_volume_type}"] = self.ebs_volume_type + body["ebs_volume_type"] = self.ebs_volume_type if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.spot_bid_price_percent is not None: - body["{spot_bid_price_percent}"] = self.spot_bid_price_percent + body["spot_bid_price_percent"] = self.spot_bid_price_percent if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: """Deserializes the AwsAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", AwsAvailability), - ebs_volume_count=d.get("{ebs_volume_count}", None), - ebs_volume_iops=d.get("{ebs_volume_iops}", None), - ebs_volume_size=d.get("{ebs_volume_size}", None), - ebs_volume_throughput=d.get("{ebs_volume_throughput}", None), - ebs_volume_type=_enum(d, "{ebs_volume_type}", EbsVolumeType), - first_on_demand=d.get("{first_on_demand}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - spot_bid_price_percent=d.get("{spot_bid_price_percent}", None), - zone_id=d.get("{zone_id}", None), + availability=_enum(d, "availability", AwsAvailability), + ebs_volume_count=d.get("ebs_volume_count", None), + ebs_volume_iops=d.get("ebs_volume_iops", None), + ebs_volume_size=d.get("ebs_volume_size", None), + ebs_volume_throughput=d.get("ebs_volume_throughput", None), + ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), + first_on_demand=d.get("first_on_demand", None), + instance_profile_arn=d.get("instance_profile_arn", None), + spot_bid_price_percent=d.get("spot_bid_price_percent", None), + zone_id=d.get("zone_id", None), ) @@ -244,23 +244,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.first_on_demand is not None: - body["{first_on_demand}"] = self.first_on_demand + body["first_on_demand"] = self.first_on_demand if self.log_analytics_info: - body["{log_analytics_info}"] = self.log_analytics_info + body["log_analytics_info"] = self.log_analytics_info if self.spot_bid_max_price is not None: - body["{spot_bid_max_price}"] = self.spot_bid_max_price + body["spot_bid_max_price"] = self.spot_bid_max_price return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: """Deserializes the AzureAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", AzureAvailability), - first_on_demand=d.get("{first_on_demand}", None), - log_analytics_info=_from_dict(d, "{log_analytics_info}", LogAnalyticsInfo), - spot_bid_max_price=d.get("{spot_bid_max_price}", None), + availability=_enum(d, "availability", AzureAvailability), + first_on_demand=d.get("first_on_demand", None), + log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), + spot_bid_max_price=d.get("spot_bid_max_price", None), ) @@ -306,20 +306,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" body = {} if self.dbfs: - body["{dbfs}"] = self.dbfs + body["dbfs"] = self.dbfs if self.s3: - body["{s3}"] = self.s3 + body["s3"] = self.s3 if self.volumes: - body["{volumes}"] = self.volumes + body["volumes"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: """Deserializes the ClusterLogConf from a dictionary.""" return cls( - dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), - s3=_from_dict(d, "{s3}", S3StorageInfo), - volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), ) @@ -479,92 +479,92 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePipeline into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_duplicate_names is not None: - body["{allow_duplicate_names}"] = self.allow_duplicate_names + body["allow_duplicate_names"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.channel is not None: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.clusters: - body["{clusters}"] = self.clusters + body["clusters"] = self.clusters if self.configuration: - body["{configuration}"] = self.configuration + body["configuration"] = self.configuration if self.continuous is not None: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment + body["deployment"] = self.deployment if self.development is not None: - body["{development}"] = self.development + body["development"] = self.development if self.dry_run is not None: - body["{dry_run}"] = self.dry_run + body["dry_run"] = self.dry_run if self.edition is not None: - body["{edition}"] = self.edition + body["edition"] = self.edition if self.event_log: - body["{event_log}"] = self.event_log + body["event_log"] = self.event_log if self.filters: - body["{filters}"] = self.filters + body["filters"] = self.filters if self.gateway_definition: - body["{gateway_definition}"] = self.gateway_definition + body["gateway_definition"] = self.gateway_definition if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.ingestion_definition: - body["{ingestion_definition}"] = self.ingestion_definition + body["ingestion_definition"] = self.ingestion_definition if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notifications: - body["{notifications}"] = self.notifications + body["notifications"] = self.notifications if self.photon is not None: - body["{photon}"] = self.photon + body["photon"] = self.photon if self.restart_window: - body["{restart_window}"] = self.restart_window + body["restart_window"] = self.restart_window if self.run_as: - body["{run_as}"] = self.run_as + body["run_as"] = self.run_as if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.serverless is not None: - body["{serverless}"] = self.serverless + body["serverless"] = self.serverless if self.storage is not None: - body["{storage}"] = self.storage + body["storage"] = self.storage if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target if self.trigger: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePipeline: """Deserializes the CreatePipeline from a dictionary.""" return cls( - allow_duplicate_names=d.get("{allow_duplicate_names}", None), - budget_policy_id=d.get("{budget_policy_id}", None), - catalog=d.get("{catalog}", None), - channel=d.get("{channel}", None), - clusters=_repeated_dict(d, "{clusters}", PipelineCluster), - configuration=d.get("{configuration}", None), - continuous=d.get("{continuous}", None), - deployment=_from_dict(d, "{deployment}", PipelineDeployment), - development=d.get("{development}", None), - dry_run=d.get("{dry_run}", None), - edition=d.get("{edition}", None), - event_log=_from_dict(d, "{event_log}", EventLogSpec), - filters=_from_dict(d, "{filters}", Filters), - gateway_definition=_from_dict(d, "{gateway_definition}", IngestionGatewayPipelineDefinition), - id=d.get("{id}", None), - ingestion_definition=_from_dict(d, "{ingestion_definition}", IngestionPipelineDefinition), - libraries=_repeated_dict(d, "{libraries}", PipelineLibrary), - name=d.get("{name}", None), - notifications=_repeated_dict(d, "{notifications}", Notifications), - photon=d.get("{photon}", None), - restart_window=_from_dict(d, "{restart_window}", RestartWindow), - run_as=_from_dict(d, "{run_as}", RunAs), - schema=d.get("{schema}", None), - serverless=d.get("{serverless}", None), - storage=d.get("{storage}", None), - target=d.get("{target}", None), - trigger=_from_dict(d, "{trigger}", PipelineTrigger), + allow_duplicate_names=d.get("allow_duplicate_names", None), + budget_policy_id=d.get("budget_policy_id", None), + catalog=d.get("catalog", None), + channel=d.get("channel", None), + clusters=_repeated_dict(d, "clusters", PipelineCluster), + configuration=d.get("configuration", None), + continuous=d.get("continuous", None), + deployment=_from_dict(d, "deployment", PipelineDeployment), + development=d.get("development", None), + dry_run=d.get("dry_run", None), + edition=d.get("edition", None), + event_log=_from_dict(d, "event_log", EventLogSpec), + filters=_from_dict(d, "filters", Filters), + gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), + id=d.get("id", None), + ingestion_definition=_from_dict(d, "ingestion_definition", IngestionPipelineDefinition), + libraries=_repeated_dict(d, "libraries", PipelineLibrary), + name=d.get("name", None), + notifications=_repeated_dict(d, "notifications", Notifications), + photon=d.get("photon", None), + restart_window=_from_dict(d, "restart_window", RestartWindow), + run_as=_from_dict(d, "run_as", RunAs), + schema=d.get("schema", None), + serverless=d.get("serverless", None), + storage=d.get("storage", None), + target=d.get("target", None), + trigger=_from_dict(d, "trigger", PipelineTrigger), ) @@ -589,17 +589,16 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePipelineResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.effective_settings: - body["{effective_settings}"] = self.effective_settings + body["effective_settings"] = self.effective_settings if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePipelineResponse: """Deserializes the CreatePipelineResponse from a dictionary.""" return cls( - effective_settings=_from_dict(d, "{effective_settings}", PipelineSpec), - pipeline_id=d.get("{pipeline_id}", None), + effective_settings=_from_dict(d, "effective_settings", PipelineSpec), pipeline_id=d.get("pipeline_id", None) ) @@ -622,15 +621,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CronTrigger into a shallow dictionary of its immediate attributes.""" body = {} if self.quartz_cron_schedule is not None: - body["{quartz_cron_schedule}"] = self.quartz_cron_schedule + body["quartz_cron_schedule"] = self.quartz_cron_schedule if self.timezone_id is not None: - body["{timezone_id}"] = self.timezone_id + body["timezone_id"] = self.timezone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CronTrigger: """Deserializes the CronTrigger from a dictionary.""" - return cls(quartz_cron_schedule=d.get("{quartz_cron_schedule}", None), timezone_id=d.get("{timezone_id}", None)) + return cls(quartz_cron_schedule=d.get("quartz_cron_schedule", None), timezone_id=d.get("timezone_id", None)) @dataclass @@ -654,15 +653,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DataPlaneId into a shallow dictionary of its immediate attributes.""" body = {} if self.instance is not None: - body["{instance}"] = self.instance + body["instance"] = self.instance if self.seq_no is not None: - body["{seq_no}"] = self.seq_no + body["seq_no"] = self.seq_no return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataPlaneId: """Deserializes the DataPlaneId from a dictionary.""" - return cls(instance=d.get("{instance}", None), seq_no=d.get("{seq_no}", None)) + return cls(instance=d.get("instance", None), seq_no=d.get("seq_no", None)) class DayOfWeek(Enum): @@ -696,13 +695,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: """Deserializes the DbfsStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -901,95 +900,95 @@ def as_shallow_dict(self) -> dict: """Serializes the EditPipeline into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_duplicate_names is not None: - body["{allow_duplicate_names}"] = self.allow_duplicate_names + body["allow_duplicate_names"] = self.allow_duplicate_names if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.channel is not None: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.clusters: - body["{clusters}"] = self.clusters + body["clusters"] = self.clusters if self.configuration: - body["{configuration}"] = self.configuration + body["configuration"] = self.configuration if self.continuous is not None: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment + body["deployment"] = self.deployment if self.development is not None: - body["{development}"] = self.development + body["development"] = self.development if self.edition is not None: - body["{edition}"] = self.edition + body["edition"] = self.edition if self.event_log: - body["{event_log}"] = self.event_log + body["event_log"] = self.event_log if self.expected_last_modified is not None: - body["{expected_last_modified}"] = self.expected_last_modified + body["expected_last_modified"] = self.expected_last_modified if self.filters: - body["{filters}"] = self.filters + body["filters"] = self.filters if self.gateway_definition: - body["{gateway_definition}"] = self.gateway_definition + body["gateway_definition"] = self.gateway_definition if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.ingestion_definition: - body["{ingestion_definition}"] = self.ingestion_definition + body["ingestion_definition"] = self.ingestion_definition if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notifications: - body["{notifications}"] = self.notifications + body["notifications"] = self.notifications if self.photon is not None: - body["{photon}"] = self.photon + body["photon"] = self.photon if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.restart_window: - body["{restart_window}"] = self.restart_window + body["restart_window"] = self.restart_window if self.run_as: - body["{run_as}"] = self.run_as + body["run_as"] = self.run_as if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.serverless is not None: - body["{serverless}"] = self.serverless + body["serverless"] = self.serverless if self.storage is not None: - body["{storage}"] = self.storage + body["storage"] = self.storage if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target if self.trigger: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditPipeline: """Deserializes the EditPipeline from a dictionary.""" return cls( - allow_duplicate_names=d.get("{allow_duplicate_names}", None), - budget_policy_id=d.get("{budget_policy_id}", None), - catalog=d.get("{catalog}", None), - channel=d.get("{channel}", None), - clusters=_repeated_dict(d, "{clusters}", PipelineCluster), - configuration=d.get("{configuration}", None), - continuous=d.get("{continuous}", None), - deployment=_from_dict(d, "{deployment}", PipelineDeployment), - development=d.get("{development}", None), - edition=d.get("{edition}", None), - event_log=_from_dict(d, "{event_log}", EventLogSpec), - expected_last_modified=d.get("{expected_last_modified}", None), - filters=_from_dict(d, "{filters}", Filters), - gateway_definition=_from_dict(d, "{gateway_definition}", IngestionGatewayPipelineDefinition), - id=d.get("{id}", None), - ingestion_definition=_from_dict(d, "{ingestion_definition}", IngestionPipelineDefinition), - libraries=_repeated_dict(d, "{libraries}", PipelineLibrary), - name=d.get("{name}", None), - notifications=_repeated_dict(d, "{notifications}", Notifications), - photon=d.get("{photon}", None), - pipeline_id=d.get("{pipeline_id}", None), - restart_window=_from_dict(d, "{restart_window}", RestartWindow), - run_as=_from_dict(d, "{run_as}", RunAs), - schema=d.get("{schema}", None), - serverless=d.get("{serverless}", None), - storage=d.get("{storage}", None), - target=d.get("{target}", None), - trigger=_from_dict(d, "{trigger}", PipelineTrigger), + allow_duplicate_names=d.get("allow_duplicate_names", None), + budget_policy_id=d.get("budget_policy_id", None), + catalog=d.get("catalog", None), + channel=d.get("channel", None), + clusters=_repeated_dict(d, "clusters", PipelineCluster), + configuration=d.get("configuration", None), + continuous=d.get("continuous", None), + deployment=_from_dict(d, "deployment", PipelineDeployment), + development=d.get("development", None), + edition=d.get("edition", None), + event_log=_from_dict(d, "event_log", EventLogSpec), + expected_last_modified=d.get("expected_last_modified", None), + filters=_from_dict(d, "filters", Filters), + gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), + id=d.get("id", None), + ingestion_definition=_from_dict(d, "ingestion_definition", IngestionPipelineDefinition), + libraries=_repeated_dict(d, "libraries", PipelineLibrary), + name=d.get("name", None), + notifications=_repeated_dict(d, "notifications", Notifications), + photon=d.get("photon", None), + pipeline_id=d.get("pipeline_id", None), + restart_window=_from_dict(d, "restart_window", RestartWindow), + run_as=_from_dict(d, "run_as", RunAs), + schema=d.get("schema", None), + serverless=d.get("serverless", None), + storage=d.get("storage", None), + target=d.get("target", None), + trigger=_from_dict(d, "trigger", PipelineTrigger), ) @@ -1032,15 +1031,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ErrorDetail into a shallow dictionary of its immediate attributes.""" body = {} if self.exceptions: - body["{exceptions}"] = self.exceptions + body["exceptions"] = self.exceptions if self.fatal is not None: - body["{fatal}"] = self.fatal + body["fatal"] = self.fatal return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ErrorDetail: """Deserializes the ErrorDetail from a dictionary.""" - return cls(exceptions=_repeated_dict(d, "{exceptions}", SerializedException), fatal=d.get("{fatal}", None)) + return cls(exceptions=_repeated_dict(d, "exceptions", SerializedException), fatal=d.get("fatal", None)) class EventLevel(Enum): @@ -1080,17 +1079,17 @@ def as_shallow_dict(self) -> dict: """Serializes the EventLogSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EventLogSpec: """Deserializes the EventLogSpec from a dictionary.""" - return cls(catalog=d.get("{catalog}", None), name=d.get("{name}", None), schema=d.get("{schema}", None)) + return cls(catalog=d.get("catalog", None), name=d.get("name", None), schema=d.get("schema", None)) @dataclass @@ -1109,13 +1108,13 @@ def as_shallow_dict(self) -> dict: """Serializes the FileLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FileLibrary: """Deserializes the FileLibrary from a dictionary.""" - return cls(path=d.get("{path}", None)) + return cls(path=d.get("path", None)) @dataclass @@ -1139,15 +1138,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Filters into a shallow dictionary of its immediate attributes.""" body = {} if self.exclude: - body["{exclude}"] = self.exclude + body["exclude"] = self.exclude if self.include: - body["{include}"] = self.include + body["include"] = self.include return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Filters: """Deserializes the Filters from a dictionary.""" - return cls(exclude=d.get("{exclude}", None), include=d.get("{include}", None)) + return cls(exclude=d.get("exclude", None), include=d.get("include", None)) @dataclass @@ -1206,29 +1205,29 @@ def as_shallow_dict(self) -> dict: """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.availability is not None: - body["{availability}"] = self.availability + body["availability"] = self.availability if self.boot_disk_size is not None: - body["{boot_disk_size}"] = self.boot_disk_size + body["boot_disk_size"] = self.boot_disk_size if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.local_ssd_count is not None: - body["{local_ssd_count}"] = self.local_ssd_count + body["local_ssd_count"] = self.local_ssd_count if self.use_preemptible_executors is not None: - body["{use_preemptible_executors}"] = self.use_preemptible_executors + body["use_preemptible_executors"] = self.use_preemptible_executors if self.zone_id is not None: - body["{zone_id}"] = self.zone_id + body["zone_id"] = self.zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: """Deserializes the GcpAttributes from a dictionary.""" return cls( - availability=_enum(d, "{availability}", GcpAvailability), - boot_disk_size=d.get("{boot_disk_size}", None), - google_service_account=d.get("{google_service_account}", None), - local_ssd_count=d.get("{local_ssd_count}", None), - use_preemptible_executors=d.get("{use_preemptible_executors}", None), - zone_id=d.get("{zone_id}", None), + availability=_enum(d, "availability", GcpAvailability), + boot_disk_size=d.get("boot_disk_size", None), + google_service_account=d.get("google_service_account", None), + local_ssd_count=d.get("local_ssd_count", None), + use_preemptible_executors=d.get("use_preemptible_executors", None), + zone_id=d.get("zone_id", None), ) @@ -1259,13 +1258,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: """Deserializes the GcsStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -1284,13 +1283,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPipelinePermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPipelinePermissionLevelsResponse: """Deserializes the GetPipelinePermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", PipelinePermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", PipelinePermissionsDescription)) @dataclass @@ -1364,47 +1363,47 @@ def as_shallow_dict(self) -> dict: """Serializes the GetPipelineResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause + body["cause"] = self.cause if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.effective_budget_policy_id is not None: - body["{effective_budget_policy_id}"] = self.effective_budget_policy_id + body["effective_budget_policy_id"] = self.effective_budget_policy_id if self.health is not None: - body["{health}"] = self.health + body["health"] = self.health if self.last_modified is not None: - body["{last_modified}"] = self.last_modified + body["last_modified"] = self.last_modified if self.latest_updates: - body["{latest_updates}"] = self.latest_updates + body["latest_updates"] = self.latest_updates if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.run_as_user_name is not None: - body["{run_as_user_name}"] = self.run_as_user_name + body["run_as_user_name"] = self.run_as_user_name if self.spec: - body["{spec}"] = self.spec + body["spec"] = self.spec if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetPipelineResponse: """Deserializes the GetPipelineResponse from a dictionary.""" return cls( - cause=d.get("{cause}", None), - cluster_id=d.get("{cluster_id}", None), - creator_user_name=d.get("{creator_user_name}", None), - effective_budget_policy_id=d.get("{effective_budget_policy_id}", None), - health=_enum(d, "{health}", GetPipelineResponseHealth), - last_modified=d.get("{last_modified}", None), - latest_updates=_repeated_dict(d, "{latest_updates}", UpdateStateInfo), - name=d.get("{name}", None), - pipeline_id=d.get("{pipeline_id}", None), - run_as_user_name=d.get("{run_as_user_name}", None), - spec=_from_dict(d, "{spec}", PipelineSpec), - state=_enum(d, "{state}", PipelineState), + cause=d.get("cause", None), + cluster_id=d.get("cluster_id", None), + creator_user_name=d.get("creator_user_name", None), + effective_budget_policy_id=d.get("effective_budget_policy_id", None), + health=_enum(d, "health", GetPipelineResponseHealth), + last_modified=d.get("last_modified", None), + latest_updates=_repeated_dict(d, "latest_updates", UpdateStateInfo), + name=d.get("name", None), + pipeline_id=d.get("pipeline_id", None), + run_as_user_name=d.get("run_as_user_name", None), + spec=_from_dict(d, "spec", PipelineSpec), + state=_enum(d, "state", PipelineState), ) @@ -1431,13 +1430,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetUpdateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.update: - body["{update}"] = self.update + body["update"] = self.update return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetUpdateResponse: """Deserializes the GetUpdateResponse from a dictionary.""" - return cls(update=_from_dict(d, "{update}", UpdateInfo)) + return cls(update=_from_dict(d, "update", UpdateInfo)) @dataclass @@ -1466,20 +1465,20 @@ def as_shallow_dict(self) -> dict: """Serializes the IngestionConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.report: - body["{report}"] = self.report + body["report"] = self.report if self.schema: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.table: - body["{table}"] = self.table + body["table"] = self.table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IngestionConfig: """Deserializes the IngestionConfig from a dictionary.""" return cls( - report=_from_dict(d, "{report}", ReportSpec), - schema=_from_dict(d, "{schema}", SchemaSpec), - table=_from_dict(d, "{table}", TableSpec), + report=_from_dict(d, "report", ReportSpec), + schema=_from_dict(d, "schema", SchemaSpec), + table=_from_dict(d, "table", TableSpec), ) @@ -1523,26 +1522,26 @@ def as_shallow_dict(self) -> dict: """Serializes the IngestionGatewayPipelineDefinition into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_id is not None: - body["{connection_id}"] = self.connection_id + body["connection_id"] = self.connection_id if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.gateway_storage_catalog is not None: - body["{gateway_storage_catalog}"] = self.gateway_storage_catalog + body["gateway_storage_catalog"] = self.gateway_storage_catalog if self.gateway_storage_name is not None: - body["{gateway_storage_name}"] = self.gateway_storage_name + body["gateway_storage_name"] = self.gateway_storage_name if self.gateway_storage_schema is not None: - body["{gateway_storage_schema}"] = self.gateway_storage_schema + body["gateway_storage_schema"] = self.gateway_storage_schema return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IngestionGatewayPipelineDefinition: """Deserializes the IngestionGatewayPipelineDefinition from a dictionary.""" return cls( - connection_id=d.get("{connection_id}", None), - connection_name=d.get("{connection_name}", None), - gateway_storage_catalog=d.get("{gateway_storage_catalog}", None), - gateway_storage_name=d.get("{gateway_storage_name}", None), - gateway_storage_schema=d.get("{gateway_storage_schema}", None), + connection_id=d.get("connection_id", None), + connection_name=d.get("connection_name", None), + gateway_storage_catalog=d.get("gateway_storage_catalog", None), + gateway_storage_name=d.get("gateway_storage_name", None), + gateway_storage_schema=d.get("gateway_storage_schema", None), ) @@ -1580,23 +1579,23 @@ def as_shallow_dict(self) -> dict: """Serializes the IngestionPipelineDefinition into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.ingestion_gateway_id is not None: - body["{ingestion_gateway_id}"] = self.ingestion_gateway_id + body["ingestion_gateway_id"] = self.ingestion_gateway_id if self.objects: - body["{objects}"] = self.objects + body["objects"] = self.objects if self.table_configuration: - body["{table_configuration}"] = self.table_configuration + body["table_configuration"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IngestionPipelineDefinition: """Deserializes the IngestionPipelineDefinition from a dictionary.""" return cls( - connection_name=d.get("{connection_name}", None), - ingestion_gateway_id=d.get("{ingestion_gateway_id}", None), - objects=_repeated_dict(d, "{objects}", IngestionConfig), - table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), + connection_name=d.get("connection_name", None), + ingestion_gateway_id=d.get("ingestion_gateway_id", None), + objects=_repeated_dict(d, "objects", IngestionConfig), + table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), ) @@ -1655,32 +1654,32 @@ def as_shallow_dict(self) -> dict: """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.abfss: - body["{abfss}"] = self.abfss + body["abfss"] = self.abfss if self.dbfs: - body["{dbfs}"] = self.dbfs + body["dbfs"] = self.dbfs if self.file: - body["{file}"] = self.file + body["file"] = self.file if self.gcs: - body["{gcs}"] = self.gcs + body["gcs"] = self.gcs if self.s3: - body["{s3}"] = self.s3 + body["s3"] = self.s3 if self.volumes: - body["{volumes}"] = self.volumes + body["volumes"] = self.volumes if self.workspace: - body["{workspace}"] = self.workspace + body["workspace"] = self.workspace return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: """Deserializes the InitScriptInfo from a dictionary.""" return cls( - abfss=_from_dict(d, "{abfss}", Adlsgen2Info), - dbfs=_from_dict(d, "{dbfs}", DbfsStorageInfo), - file=_from_dict(d, "{file}", LocalFileInfo), - gcs=_from_dict(d, "{gcs}", GcsStorageInfo), - s3=_from_dict(d, "{s3}", S3StorageInfo), - volumes=_from_dict(d, "{volumes}", VolumesStorageInfo), - workspace=_from_dict(d, "{workspace}", WorkspaceStorageInfo), + abfss=_from_dict(d, "abfss", Adlsgen2Info), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + file=_from_dict(d, "file", LocalFileInfo), + gcs=_from_dict(d, "gcs", GcsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), ) @@ -1710,20 +1709,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListPipelineEventsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.events: - body["{events}"] = self.events + body["events"] = self.events if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPipelineEventsResponse: """Deserializes the ListPipelineEventsResponse from a dictionary.""" return cls( - events=_repeated_dict(d, "{events}", PipelineEvent), - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), + events=_repeated_dict(d, "events", PipelineEvent), + next_page_token=d.get("next_page_token", None), + prev_page_token=d.get("prev_page_token", None), ) @@ -1748,17 +1747,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListPipelinesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.statuses: - body["{statuses}"] = self.statuses + body["statuses"] = self.statuses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPipelinesResponse: """Deserializes the ListPipelinesResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - statuses=_repeated_dict(d, "{statuses}", PipelineStateInfo), + next_page_token=d.get("next_page_token", None), statuses=_repeated_dict(d, "statuses", PipelineStateInfo) ) @@ -1788,20 +1786,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListUpdatesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.prev_page_token is not None: - body["{prev_page_token}"] = self.prev_page_token + body["prev_page_token"] = self.prev_page_token if self.updates: - body["{updates}"] = self.updates + body["updates"] = self.updates return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListUpdatesResponse: """Deserializes the ListUpdatesResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - prev_page_token=d.get("{prev_page_token}", None), - updates=_repeated_dict(d, "{updates}", UpdateInfo), + next_page_token=d.get("next_page_token", None), + prev_page_token=d.get("prev_page_token", None), + updates=_repeated_dict(d, "updates", UpdateInfo), ) @@ -1821,13 +1819,13 @@ def as_shallow_dict(self) -> dict: """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: """Deserializes the LocalFileInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -1849,17 +1847,17 @@ def as_shallow_dict(self) -> dict: """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.log_analytics_primary_key is not None: - body["{log_analytics_primary_key}"] = self.log_analytics_primary_key + body["log_analytics_primary_key"] = self.log_analytics_primary_key if self.log_analytics_workspace_id is not None: - body["{log_analytics_workspace_id}"] = self.log_analytics_workspace_id + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: """Deserializes the LogAnalyticsInfo from a dictionary.""" return cls( - log_analytics_primary_key=d.get("{log_analytics_primary_key}", None), - log_analytics_workspace_id=d.get("{log_analytics_workspace_id}", None), + log_analytics_primary_key=d.get("log_analytics_primary_key", None), + log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), ) @@ -1919,18 +1917,18 @@ def as_shallow_dict(self) -> dict: """Serializes the MavenLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.coordinates is not None: - body["{coordinates}"] = self.coordinates + body["coordinates"] = self.coordinates if self.exclusions: - body["{exclusions}"] = self.exclusions + body["exclusions"] = self.exclusions if self.repo is not None: - body["{repo}"] = self.repo + body["repo"] = self.repo return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MavenLibrary: """Deserializes the MavenLibrary from a dictionary.""" return cls( - coordinates=d.get("{coordinates}", None), exclusions=d.get("{exclusions}", None), repo=d.get("{repo}", None) + coordinates=d.get("coordinates", None), exclusions=d.get("exclusions", None), repo=d.get("repo", None) ) @@ -1950,13 +1948,13 @@ def as_shallow_dict(self) -> dict: """Serializes the NotebookLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookLibrary: """Deserializes the NotebookLibrary from a dictionary.""" - return cls(path=d.get("{path}", None)) + return cls(path=d.get("path", None)) @dataclass @@ -1985,15 +1983,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Notifications into a shallow dictionary of its immediate attributes.""" body = {} if self.alerts: - body["{alerts}"] = self.alerts + body["alerts"] = self.alerts if self.email_recipients: - body["{email_recipients}"] = self.email_recipients + body["email_recipients"] = self.email_recipients return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Notifications: """Deserializes the Notifications from a dictionary.""" - return cls(alerts=d.get("{alerts}", None), email_recipients=d.get("{email_recipients}", None)) + return cls(alerts=d.get("alerts", None), email_recipients=d.get("email_recipients", None)) @dataclass @@ -2093,62 +2091,62 @@ def as_shallow_dict(self) -> dict: """Serializes the Origin into a shallow dictionary of its immediate attributes.""" body = {} if self.batch_id is not None: - body["{batch_id}"] = self.batch_id + body["batch_id"] = self.batch_id if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.dataset_name is not None: - body["{dataset_name}"] = self.dataset_name + body["dataset_name"] = self.dataset_name if self.flow_id is not None: - body["{flow_id}"] = self.flow_id + body["flow_id"] = self.flow_id if self.flow_name is not None: - body["{flow_name}"] = self.flow_name + body["flow_name"] = self.flow_name if self.host is not None: - body["{host}"] = self.host + body["host"] = self.host if self.maintenance_id is not None: - body["{maintenance_id}"] = self.maintenance_id + body["maintenance_id"] = self.maintenance_id if self.materialization_name is not None: - body["{materialization_name}"] = self.materialization_name + body["materialization_name"] = self.materialization_name if self.org_id is not None: - body["{org_id}"] = self.org_id + body["org_id"] = self.org_id if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.pipeline_name is not None: - body["{pipeline_name}"] = self.pipeline_name + body["pipeline_name"] = self.pipeline_name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.request_id is not None: - body["{request_id}"] = self.request_id + body["request_id"] = self.request_id if self.table_id is not None: - body["{table_id}"] = self.table_id + body["table_id"] = self.table_id if self.uc_resource_id is not None: - body["{uc_resource_id}"] = self.uc_resource_id + body["uc_resource_id"] = self.uc_resource_id if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Origin: """Deserializes the Origin from a dictionary.""" return cls( - batch_id=d.get("{batch_id}", None), - cloud=d.get("{cloud}", None), - cluster_id=d.get("{cluster_id}", None), - dataset_name=d.get("{dataset_name}", None), - flow_id=d.get("{flow_id}", None), - flow_name=d.get("{flow_name}", None), - host=d.get("{host}", None), - maintenance_id=d.get("{maintenance_id}", None), - materialization_name=d.get("{materialization_name}", None), - org_id=d.get("{org_id}", None), - pipeline_id=d.get("{pipeline_id}", None), - pipeline_name=d.get("{pipeline_name}", None), - region=d.get("{region}", None), - request_id=d.get("{request_id}", None), - table_id=d.get("{table_id}", None), - uc_resource_id=d.get("{uc_resource_id}", None), - update_id=d.get("{update_id}", None), + batch_id=d.get("batch_id", None), + cloud=d.get("cloud", None), + cluster_id=d.get("cluster_id", None), + dataset_name=d.get("dataset_name", None), + flow_id=d.get("flow_id", None), + flow_name=d.get("flow_name", None), + host=d.get("host", None), + maintenance_id=d.get("maintenance_id", None), + materialization_name=d.get("materialization_name", None), + org_id=d.get("org_id", None), + pipeline_id=d.get("pipeline_id", None), + pipeline_name=d.get("pipeline_name", None), + region=d.get("region", None), + request_id=d.get("request_id", None), + table_id=d.get("table_id", None), + uc_resource_id=d.get("uc_resource_id", None), + update_id=d.get("update_id", None), ) @@ -2183,23 +2181,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineAccessControlRequest: """Deserializes the PipelineAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", PipelinePermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", PipelinePermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -2239,26 +2237,26 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineAccessControlResponse: """Deserializes the PipelineAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", PipelinePermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", PipelinePermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -2411,68 +2409,68 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineCluster into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_policy_default_values is not None: - body["{apply_policy_default_values}"] = self.apply_policy_default_values + body["apply_policy_default_values"] = self.apply_policy_default_values if self.autoscale: - body["{autoscale}"] = self.autoscale + body["autoscale"] = self.autoscale if self.aws_attributes: - body["{aws_attributes}"] = self.aws_attributes + body["aws_attributes"] = self.aws_attributes if self.azure_attributes: - body["{azure_attributes}"] = self.azure_attributes + body["azure_attributes"] = self.azure_attributes if self.cluster_log_conf: - body["{cluster_log_conf}"] = self.cluster_log_conf + body["cluster_log_conf"] = self.cluster_log_conf if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.driver_instance_pool_id is not None: - body["{driver_instance_pool_id}"] = self.driver_instance_pool_id + body["driver_instance_pool_id"] = self.driver_instance_pool_id if self.driver_node_type_id is not None: - body["{driver_node_type_id}"] = self.driver_node_type_id + body["driver_node_type_id"] = self.driver_node_type_id if self.enable_local_disk_encryption is not None: - body["{enable_local_disk_encryption}"] = self.enable_local_disk_encryption + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption if self.gcp_attributes: - body["{gcp_attributes}"] = self.gcp_attributes + body["gcp_attributes"] = self.gcp_attributes if self.init_scripts: - body["{init_scripts}"] = self.init_scripts + body["init_scripts"] = self.init_scripts if self.instance_pool_id is not None: - body["{instance_pool_id}"] = self.instance_pool_id + body["instance_pool_id"] = self.instance_pool_id if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.node_type_id is not None: - body["{node_type_id}"] = self.node_type_id + body["node_type_id"] = self.node_type_id if self.num_workers is not None: - body["{num_workers}"] = self.num_workers + body["num_workers"] = self.num_workers if self.policy_id is not None: - body["{policy_id}"] = self.policy_id + body["policy_id"] = self.policy_id if self.spark_conf: - body["{spark_conf}"] = self.spark_conf + body["spark_conf"] = self.spark_conf if self.spark_env_vars: - body["{spark_env_vars}"] = self.spark_env_vars + body["spark_env_vars"] = self.spark_env_vars if self.ssh_public_keys: - body["{ssh_public_keys}"] = self.ssh_public_keys + body["ssh_public_keys"] = self.ssh_public_keys return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineCluster: """Deserializes the PipelineCluster from a dictionary.""" return cls( - apply_policy_default_values=d.get("{apply_policy_default_values}", None), - autoscale=_from_dict(d, "{autoscale}", PipelineClusterAutoscale), - aws_attributes=_from_dict(d, "{aws_attributes}", AwsAttributes), - azure_attributes=_from_dict(d, "{azure_attributes}", AzureAttributes), - cluster_log_conf=_from_dict(d, "{cluster_log_conf}", ClusterLogConf), - custom_tags=d.get("{custom_tags}", None), - driver_instance_pool_id=d.get("{driver_instance_pool_id}", None), - driver_node_type_id=d.get("{driver_node_type_id}", None), - enable_local_disk_encryption=d.get("{enable_local_disk_encryption}", None), - gcp_attributes=_from_dict(d, "{gcp_attributes}", GcpAttributes), - init_scripts=_repeated_dict(d, "{init_scripts}", InitScriptInfo), - instance_pool_id=d.get("{instance_pool_id}", None), - label=d.get("{label}", None), - node_type_id=d.get("{node_type_id}", None), - num_workers=d.get("{num_workers}", None), - policy_id=d.get("{policy_id}", None), - spark_conf=d.get("{spark_conf}", None), - spark_env_vars=d.get("{spark_env_vars}", None), - ssh_public_keys=d.get("{ssh_public_keys}", None), + apply_policy_default_values=d.get("apply_policy_default_values", None), + autoscale=_from_dict(d, "autoscale", PipelineClusterAutoscale), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + custom_tags=d.get("custom_tags", None), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + label=d.get("label", None), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + ssh_public_keys=d.get("ssh_public_keys", None), ) @@ -2507,20 +2505,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineClusterAutoscale into a shallow dictionary of its immediate attributes.""" body = {} if self.max_workers is not None: - body["{max_workers}"] = self.max_workers + body["max_workers"] = self.max_workers if self.min_workers is not None: - body["{min_workers}"] = self.min_workers + body["min_workers"] = self.min_workers if self.mode is not None: - body["{mode}"] = self.mode + body["mode"] = self.mode return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineClusterAutoscale: """Deserializes the PipelineClusterAutoscale from a dictionary.""" return cls( - max_workers=d.get("{max_workers}", None), - min_workers=d.get("{min_workers}", None), - mode=_enum(d, "{mode}", PipelineClusterAutoscaleMode), + max_workers=d.get("max_workers", None), + min_workers=d.get("min_workers", None), + mode=_enum(d, "mode", PipelineClusterAutoscaleMode), ) @@ -2555,15 +2553,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineDeployment into a shallow dictionary of its immediate attributes.""" body = {} if self.kind is not None: - body["{kind}"] = self.kind + body["kind"] = self.kind if self.metadata_file_path is not None: - body["{metadata_file_path}"] = self.metadata_file_path + body["metadata_file_path"] = self.metadata_file_path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineDeployment: """Deserializes the PipelineDeployment from a dictionary.""" - return cls(kind=_enum(d, "{kind}", DeploymentKind), metadata_file_path=d.get("{metadata_file_path}", None)) + return cls(kind=_enum(d, "kind", DeploymentKind), metadata_file_path=d.get("metadata_file_path", None)) @dataclass @@ -2622,38 +2620,38 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineEvent into a shallow dictionary of its immediate attributes.""" body = {} if self.error: - body["{error}"] = self.error + body["error"] = self.error if self.event_type is not None: - body["{event_type}"] = self.event_type + body["event_type"] = self.event_type if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.level is not None: - body["{level}"] = self.level + body["level"] = self.level if self.maturity_level is not None: - body["{maturity_level}"] = self.maturity_level + body["maturity_level"] = self.maturity_level if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.origin: - body["{origin}"] = self.origin + body["origin"] = self.origin if self.sequence: - body["{sequence}"] = self.sequence + body["sequence"] = self.sequence if self.timestamp is not None: - body["{timestamp}"] = self.timestamp + body["timestamp"] = self.timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineEvent: """Deserializes the PipelineEvent from a dictionary.""" return cls( - error=_from_dict(d, "{error}", ErrorDetail), - event_type=d.get("{event_type}", None), - id=d.get("{id}", None), - level=_enum(d, "{level}", EventLevel), - maturity_level=_enum(d, "{maturity_level}", MaturityLevel), - message=d.get("{message}", None), - origin=_from_dict(d, "{origin}", Origin), - sequence=_from_dict(d, "{sequence}", Sequencing), - timestamp=d.get("{timestamp}", None), + error=_from_dict(d, "error", ErrorDetail), + event_type=d.get("event_type", None), + id=d.get("id", None), + level=_enum(d, "level", EventLevel), + maturity_level=_enum(d, "maturity_level", MaturityLevel), + message=d.get("message", None), + origin=_from_dict(d, "origin", Origin), + sequence=_from_dict(d, "sequence", Sequencing), + timestamp=d.get("timestamp", None), ) @@ -2693,26 +2691,26 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineLibrary into a shallow dictionary of its immediate attributes.""" body = {} if self.file: - body["{file}"] = self.file + body["file"] = self.file if self.jar is not None: - body["{jar}"] = self.jar + body["jar"] = self.jar if self.maven: - body["{maven}"] = self.maven + body["maven"] = self.maven if self.notebook: - body["{notebook}"] = self.notebook + body["notebook"] = self.notebook if self.whl is not None: - body["{whl}"] = self.whl + body["whl"] = self.whl return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineLibrary: """Deserializes the PipelineLibrary from a dictionary.""" return cls( - file=_from_dict(d, "{file}", FileLibrary), - jar=d.get("{jar}", None), - maven=_from_dict(d, "{maven}", MavenLibrary), - notebook=_from_dict(d, "{notebook}", NotebookLibrary), - whl=d.get("{whl}", None), + file=_from_dict(d, "file", FileLibrary), + jar=d.get("jar", None), + maven=_from_dict(d, "maven", MavenLibrary), + notebook=_from_dict(d, "notebook", NotebookLibrary), + whl=d.get("whl", None), ) @@ -2740,20 +2738,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelinePermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermission: """Deserializes the PipelinePermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", PipelinePermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", PipelinePermissionLevel), ) @@ -2789,20 +2787,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelinePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissions: """Deserializes the PipelinePermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", PipelineAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", PipelineAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -2826,17 +2824,17 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelinePermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissionsDescription: """Deserializes the PipelinePermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", PipelinePermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", PipelinePermissionLevel), ) @@ -2860,17 +2858,17 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelinePermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelinePermissionsRequest: """Deserializes the PipelinePermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", PipelineAccessControlRequest), - pipeline_id=d.get("{pipeline_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", PipelineAccessControlRequest), + pipeline_id=d.get("pipeline_id", None), ) @@ -3011,83 +3009,83 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.channel is not None: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.clusters: - body["{clusters}"] = self.clusters + body["clusters"] = self.clusters if self.configuration: - body["{configuration}"] = self.configuration + body["configuration"] = self.configuration if self.continuous is not None: - body["{continuous}"] = self.continuous + body["continuous"] = self.continuous if self.deployment: - body["{deployment}"] = self.deployment + body["deployment"] = self.deployment if self.development is not None: - body["{development}"] = self.development + body["development"] = self.development if self.edition is not None: - body["{edition}"] = self.edition + body["edition"] = self.edition if self.event_log: - body["{event_log}"] = self.event_log + body["event_log"] = self.event_log if self.filters: - body["{filters}"] = self.filters + body["filters"] = self.filters if self.gateway_definition: - body["{gateway_definition}"] = self.gateway_definition + body["gateway_definition"] = self.gateway_definition if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.ingestion_definition: - body["{ingestion_definition}"] = self.ingestion_definition + body["ingestion_definition"] = self.ingestion_definition if self.libraries: - body["{libraries}"] = self.libraries + body["libraries"] = self.libraries if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.notifications: - body["{notifications}"] = self.notifications + body["notifications"] = self.notifications if self.photon is not None: - body["{photon}"] = self.photon + body["photon"] = self.photon if self.restart_window: - body["{restart_window}"] = self.restart_window + body["restart_window"] = self.restart_window if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.serverless is not None: - body["{serverless}"] = self.serverless + body["serverless"] = self.serverless if self.storage is not None: - body["{storage}"] = self.storage + body["storage"] = self.storage if self.target is not None: - body["{target}"] = self.target + body["target"] = self.target if self.trigger: - body["{trigger}"] = self.trigger + body["trigger"] = self.trigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineSpec: """Deserializes the PipelineSpec from a dictionary.""" return cls( - budget_policy_id=d.get("{budget_policy_id}", None), - catalog=d.get("{catalog}", None), - channel=d.get("{channel}", None), - clusters=_repeated_dict(d, "{clusters}", PipelineCluster), - configuration=d.get("{configuration}", None), - continuous=d.get("{continuous}", None), - deployment=_from_dict(d, "{deployment}", PipelineDeployment), - development=d.get("{development}", None), - edition=d.get("{edition}", None), - event_log=_from_dict(d, "{event_log}", EventLogSpec), - filters=_from_dict(d, "{filters}", Filters), - gateway_definition=_from_dict(d, "{gateway_definition}", IngestionGatewayPipelineDefinition), - id=d.get("{id}", None), - ingestion_definition=_from_dict(d, "{ingestion_definition}", IngestionPipelineDefinition), - libraries=_repeated_dict(d, "{libraries}", PipelineLibrary), - name=d.get("{name}", None), - notifications=_repeated_dict(d, "{notifications}", Notifications), - photon=d.get("{photon}", None), - restart_window=_from_dict(d, "{restart_window}", RestartWindow), - schema=d.get("{schema}", None), - serverless=d.get("{serverless}", None), - storage=d.get("{storage}", None), - target=d.get("{target}", None), - trigger=_from_dict(d, "{trigger}", PipelineTrigger), + budget_policy_id=d.get("budget_policy_id", None), + catalog=d.get("catalog", None), + channel=d.get("channel", None), + clusters=_repeated_dict(d, "clusters", PipelineCluster), + configuration=d.get("configuration", None), + continuous=d.get("continuous", None), + deployment=_from_dict(d, "deployment", PipelineDeployment), + development=d.get("development", None), + edition=d.get("edition", None), + event_log=_from_dict(d, "event_log", EventLogSpec), + filters=_from_dict(d, "filters", Filters), + gateway_definition=_from_dict(d, "gateway_definition", IngestionGatewayPipelineDefinition), + id=d.get("id", None), + ingestion_definition=_from_dict(d, "ingestion_definition", IngestionPipelineDefinition), + libraries=_repeated_dict(d, "libraries", PipelineLibrary), + name=d.get("name", None), + notifications=_repeated_dict(d, "notifications", Notifications), + photon=d.get("photon", None), + restart_window=_from_dict(d, "restart_window", RestartWindow), + schema=d.get("schema", None), + serverless=d.get("serverless", None), + storage=d.get("storage", None), + target=d.get("target", None), + trigger=_from_dict(d, "trigger", PipelineTrigger), ) @@ -3157,35 +3155,35 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineStateInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.creator_user_name is not None: - body["{creator_user_name}"] = self.creator_user_name + body["creator_user_name"] = self.creator_user_name if self.health is not None: - body["{health}"] = self.health + body["health"] = self.health if self.latest_updates: - body["{latest_updates}"] = self.latest_updates + body["latest_updates"] = self.latest_updates if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.run_as_user_name is not None: - body["{run_as_user_name}"] = self.run_as_user_name + body["run_as_user_name"] = self.run_as_user_name if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineStateInfo: """Deserializes the PipelineStateInfo from a dictionary.""" return cls( - cluster_id=d.get("{cluster_id}", None), - creator_user_name=d.get("{creator_user_name}", None), - health=_enum(d, "{health}", PipelineStateInfoHealth), - latest_updates=_repeated_dict(d, "{latest_updates}", UpdateStateInfo), - name=d.get("{name}", None), - pipeline_id=d.get("{pipeline_id}", None), - run_as_user_name=d.get("{run_as_user_name}", None), - state=_enum(d, "{state}", PipelineState), + cluster_id=d.get("cluster_id", None), + creator_user_name=d.get("creator_user_name", None), + health=_enum(d, "health", PipelineStateInfoHealth), + latest_updates=_repeated_dict(d, "latest_updates", UpdateStateInfo), + name=d.get("name", None), + pipeline_id=d.get("pipeline_id", None), + run_as_user_name=d.get("run_as_user_name", None), + state=_enum(d, "state", PipelineState), ) @@ -3215,15 +3213,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PipelineTrigger into a shallow dictionary of its immediate attributes.""" body = {} if self.cron: - body["{cron}"] = self.cron + body["cron"] = self.cron if self.manual: - body["{manual}"] = self.manual + body["manual"] = self.manual return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PipelineTrigger: """Deserializes the PipelineTrigger from a dictionary.""" - return cls(cron=_from_dict(d, "{cron}", CronTrigger), manual=_from_dict(d, "{manual}", ManualTrigger)) + return cls(cron=_from_dict(d, "cron", CronTrigger), manual=_from_dict(d, "manual", ManualTrigger)) @dataclass @@ -3263,26 +3261,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ReportSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_catalog is not None: - body["{destination_catalog}"] = self.destination_catalog + body["destination_catalog"] = self.destination_catalog if self.destination_schema is not None: - body["{destination_schema}"] = self.destination_schema + body["destination_schema"] = self.destination_schema if self.destination_table is not None: - body["{destination_table}"] = self.destination_table + body["destination_table"] = self.destination_table if self.source_url is not None: - body["{source_url}"] = self.source_url + body["source_url"] = self.source_url if self.table_configuration: - body["{table_configuration}"] = self.table_configuration + body["table_configuration"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ReportSpec: """Deserializes the ReportSpec from a dictionary.""" return cls( - destination_catalog=d.get("{destination_catalog}", None), - destination_schema=d.get("{destination_schema}", None), - destination_table=d.get("{destination_table}", None), - source_url=d.get("{source_url}", None), - table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), + destination_catalog=d.get("destination_catalog", None), + destination_schema=d.get("destination_schema", None), + destination_table=d.get("destination_table", None), + source_url=d.get("source_url", None), + table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), ) @@ -3316,20 +3314,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RestartWindow into a shallow dictionary of its immediate attributes.""" body = {} if self.days_of_week: - body["{days_of_week}"] = self.days_of_week + body["days_of_week"] = self.days_of_week if self.start_hour is not None: - body["{start_hour}"] = self.start_hour + body["start_hour"] = self.start_hour if self.time_zone_id is not None: - body["{time_zone_id}"] = self.time_zone_id + body["time_zone_id"] = self.time_zone_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestartWindow: """Deserializes the RestartWindow from a dictionary.""" return cls( - days_of_week=_repeated_enum(d, "{days_of_week}", DayOfWeek), - start_hour=d.get("{start_hour}", None), - time_zone_id=d.get("{time_zone_id}", None), + days_of_week=_repeated_enum(d, "days_of_week", DayOfWeek), + start_hour=d.get("start_hour", None), + time_zone_id=d.get("time_zone_id", None), ) @@ -3362,15 +3360,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RunAs into a shallow dictionary of its immediate attributes.""" body = {} if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RunAs: """Deserializes the RunAs from a dictionary.""" - return cls(service_principal_name=d.get("{service_principal_name}", None), user_name=d.get("{user_name}", None)) + return cls(service_principal_name=d.get("service_principal_name", None), user_name=d.get("user_name", None)) @dataclass @@ -3433,32 +3431,32 @@ def as_shallow_dict(self) -> dict: """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.canned_acl is not None: - body["{canned_acl}"] = self.canned_acl + body["canned_acl"] = self.canned_acl if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination if self.enable_encryption is not None: - body["{enable_encryption}"] = self.enable_encryption + body["enable_encryption"] = self.enable_encryption if self.encryption_type is not None: - body["{encryption_type}"] = self.encryption_type + body["encryption_type"] = self.encryption_type if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.kms_key is not None: - body["{kms_key}"] = self.kms_key + body["kms_key"] = self.kms_key if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: """Deserializes the S3StorageInfo from a dictionary.""" return cls( - canned_acl=d.get("{canned_acl}", None), - destination=d.get("{destination}", None), - enable_encryption=d.get("{enable_encryption}", None), - encryption_type=d.get("{encryption_type}", None), - endpoint=d.get("{endpoint}", None), - kms_key=d.get("{kms_key}", None), - region=d.get("{region}", None), + canned_acl=d.get("canned_acl", None), + destination=d.get("destination", None), + enable_encryption=d.get("enable_encryption", None), + encryption_type=d.get("encryption_type", None), + endpoint=d.get("endpoint", None), + kms_key=d.get("kms_key", None), + region=d.get("region", None), ) @@ -3502,26 +3500,26 @@ def as_shallow_dict(self) -> dict: """Serializes the SchemaSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_catalog is not None: - body["{destination_catalog}"] = self.destination_catalog + body["destination_catalog"] = self.destination_catalog if self.destination_schema is not None: - body["{destination_schema}"] = self.destination_schema + body["destination_schema"] = self.destination_schema if self.source_catalog is not None: - body["{source_catalog}"] = self.source_catalog + body["source_catalog"] = self.source_catalog if self.source_schema is not None: - body["{source_schema}"] = self.source_schema + body["source_schema"] = self.source_schema if self.table_configuration: - body["{table_configuration}"] = self.table_configuration + body["table_configuration"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SchemaSpec: """Deserializes the SchemaSpec from a dictionary.""" return cls( - destination_catalog=d.get("{destination_catalog}", None), - destination_schema=d.get("{destination_schema}", None), - source_catalog=d.get("{source_catalog}", None), - source_schema=d.get("{source_schema}", None), - table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), + destination_catalog=d.get("destination_catalog", None), + destination_schema=d.get("destination_schema", None), + source_catalog=d.get("source_catalog", None), + source_schema=d.get("source_schema", None), + table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), ) @@ -3546,17 +3544,17 @@ def as_shallow_dict(self) -> dict: """Serializes the Sequencing into a shallow dictionary of its immediate attributes.""" body = {} if self.control_plane_seq_no is not None: - body["{control_plane_seq_no}"] = self.control_plane_seq_no + body["control_plane_seq_no"] = self.control_plane_seq_no if self.data_plane_id: - body["{data_plane_id}"] = self.data_plane_id + body["data_plane_id"] = self.data_plane_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Sequencing: """Deserializes the Sequencing from a dictionary.""" return cls( - control_plane_seq_no=d.get("{control_plane_seq_no}", None), - data_plane_id=_from_dict(d, "{data_plane_id}", DataPlaneId), + control_plane_seq_no=d.get("control_plane_seq_no", None), + data_plane_id=_from_dict(d, "data_plane_id", DataPlaneId), ) @@ -3586,20 +3584,20 @@ def as_shallow_dict(self) -> dict: """Serializes the SerializedException into a shallow dictionary of its immediate attributes.""" body = {} if self.class_name is not None: - body["{class_name}"] = self.class_name + body["class_name"] = self.class_name if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.stack: - body["{stack}"] = self.stack + body["stack"] = self.stack return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SerializedException: """Deserializes the SerializedException from a dictionary.""" return cls( - class_name=d.get("{class_name}", None), - message=d.get("{message}", None), - stack=_repeated_dict(d, "{stack}", StackFrame), + class_name=d.get("class_name", None), + message=d.get("message", None), + stack=_repeated_dict(d, "stack", StackFrame), ) @@ -3634,23 +3632,23 @@ def as_shallow_dict(self) -> dict: """Serializes the StackFrame into a shallow dictionary of its immediate attributes.""" body = {} if self.declaring_class is not None: - body["{declaring_class}"] = self.declaring_class + body["declaring_class"] = self.declaring_class if self.file_name is not None: - body["{file_name}"] = self.file_name + body["file_name"] = self.file_name if self.line_number is not None: - body["{line_number}"] = self.line_number + body["line_number"] = self.line_number if self.method_name is not None: - body["{method_name}"] = self.method_name + body["method_name"] = self.method_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StackFrame: """Deserializes the StackFrame from a dictionary.""" return cls( - declaring_class=d.get("{declaring_class}", None), - file_name=d.get("{file_name}", None), - line_number=d.get("{line_number}", None), - method_name=d.get("{method_name}", None), + declaring_class=d.get("declaring_class", None), + file_name=d.get("file_name", None), + line_number=d.get("line_number", None), + method_name=d.get("method_name", None), ) @@ -3698,29 +3696,29 @@ def as_shallow_dict(self) -> dict: """Serializes the StartUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause + body["cause"] = self.cause if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh if self.full_refresh_selection: - body["{full_refresh_selection}"] = self.full_refresh_selection + body["full_refresh_selection"] = self.full_refresh_selection if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.refresh_selection: - body["{refresh_selection}"] = self.refresh_selection + body["refresh_selection"] = self.refresh_selection if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StartUpdate: """Deserializes the StartUpdate from a dictionary.""" return cls( - cause=_enum(d, "{cause}", StartUpdateCause), - full_refresh=d.get("{full_refresh}", None), - full_refresh_selection=d.get("{full_refresh_selection}", None), - pipeline_id=d.get("{pipeline_id}", None), - refresh_selection=d.get("{refresh_selection}", None), - validate_only=d.get("{validate_only}", None), + cause=_enum(d, "cause", StartUpdateCause), + full_refresh=d.get("full_refresh", None), + full_refresh_selection=d.get("full_refresh_selection", None), + pipeline_id=d.get("pipeline_id", None), + refresh_selection=d.get("refresh_selection", None), + validate_only=d.get("validate_only", None), ) @@ -3749,13 +3747,13 @@ def as_shallow_dict(self) -> dict: """Serializes the StartUpdateResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StartUpdateResponse: """Deserializes the StartUpdateResponse from a dictionary.""" - return cls(update_id=d.get("{update_id}", None)) + return cls(update_id=d.get("update_id", None)) @dataclass @@ -3824,32 +3822,32 @@ def as_shallow_dict(self) -> dict: """Serializes the TableSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_catalog is not None: - body["{destination_catalog}"] = self.destination_catalog + body["destination_catalog"] = self.destination_catalog if self.destination_schema is not None: - body["{destination_schema}"] = self.destination_schema + body["destination_schema"] = self.destination_schema if self.destination_table is not None: - body["{destination_table}"] = self.destination_table + body["destination_table"] = self.destination_table if self.source_catalog is not None: - body["{source_catalog}"] = self.source_catalog + body["source_catalog"] = self.source_catalog if self.source_schema is not None: - body["{source_schema}"] = self.source_schema + body["source_schema"] = self.source_schema if self.source_table is not None: - body["{source_table}"] = self.source_table + body["source_table"] = self.source_table if self.table_configuration: - body["{table_configuration}"] = self.table_configuration + body["table_configuration"] = self.table_configuration return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableSpec: """Deserializes the TableSpec from a dictionary.""" return cls( - destination_catalog=d.get("{destination_catalog}", None), - destination_schema=d.get("{destination_schema}", None), - destination_table=d.get("{destination_table}", None), - source_catalog=d.get("{source_catalog}", None), - source_schema=d.get("{source_schema}", None), - source_table=d.get("{source_table}", None), - table_configuration=_from_dict(d, "{table_configuration}", TableSpecificConfig), + destination_catalog=d.get("destination_catalog", None), + destination_schema=d.get("destination_schema", None), + destination_table=d.get("destination_table", None), + source_catalog=d.get("source_catalog", None), + source_schema=d.get("source_schema", None), + source_table=d.get("source_table", None), + table_configuration=_from_dict(d, "table_configuration", TableSpecificConfig), ) @@ -3886,23 +3884,23 @@ def as_shallow_dict(self) -> dict: """Serializes the TableSpecificConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.primary_keys: - body["{primary_keys}"] = self.primary_keys + body["primary_keys"] = self.primary_keys if self.salesforce_include_formula_fields is not None: - body["{salesforce_include_formula_fields}"] = self.salesforce_include_formula_fields + body["salesforce_include_formula_fields"] = self.salesforce_include_formula_fields if self.scd_type is not None: - body["{scd_type}"] = self.scd_type + body["scd_type"] = self.scd_type if self.sequence_by: - body["{sequence_by}"] = self.sequence_by + body["sequence_by"] = self.sequence_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableSpecificConfig: """Deserializes the TableSpecificConfig from a dictionary.""" return cls( - primary_keys=d.get("{primary_keys}", None), - salesforce_include_formula_fields=d.get("{salesforce_include_formula_fields}", None), - scd_type=_enum(d, "{scd_type}", TableSpecificConfigScdType), - sequence_by=d.get("{sequence_by}", None), + primary_keys=d.get("primary_keys", None), + salesforce_include_formula_fields=d.get("salesforce_include_formula_fields", None), + scd_type=_enum(d, "scd_type", TableSpecificConfigScdType), + sequence_by=d.get("sequence_by", None), ) @@ -3985,44 +3983,44 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.cause is not None: - body["{cause}"] = self.cause + body["cause"] = self.cause if self.cluster_id is not None: - body["{cluster_id}"] = self.cluster_id + body["cluster_id"] = self.cluster_id if self.config: - body["{config}"] = self.config + body["config"] = self.config if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.full_refresh is not None: - body["{full_refresh}"] = self.full_refresh + body["full_refresh"] = self.full_refresh if self.full_refresh_selection: - body["{full_refresh_selection}"] = self.full_refresh_selection + body["full_refresh_selection"] = self.full_refresh_selection if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.refresh_selection: - body["{refresh_selection}"] = self.refresh_selection + body["refresh_selection"] = self.refresh_selection if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id if self.validate_only is not None: - body["{validate_only}"] = self.validate_only + body["validate_only"] = self.validate_only return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateInfo: """Deserializes the UpdateInfo from a dictionary.""" return cls( - cause=_enum(d, "{cause}", UpdateInfoCause), - cluster_id=d.get("{cluster_id}", None), - config=_from_dict(d, "{config}", PipelineSpec), - creation_time=d.get("{creation_time}", None), - full_refresh=d.get("{full_refresh}", None), - full_refresh_selection=d.get("{full_refresh_selection}", None), - pipeline_id=d.get("{pipeline_id}", None), - refresh_selection=d.get("{refresh_selection}", None), - state=_enum(d, "{state}", UpdateInfoState), - update_id=d.get("{update_id}", None), - validate_only=d.get("{validate_only}", None), + cause=_enum(d, "cause", UpdateInfoCause), + cluster_id=d.get("cluster_id", None), + config=_from_dict(d, "config", PipelineSpec), + creation_time=d.get("creation_time", None), + full_refresh=d.get("full_refresh", None), + full_refresh_selection=d.get("full_refresh_selection", None), + pipeline_id=d.get("pipeline_id", None), + refresh_selection=d.get("refresh_selection", None), + state=_enum(d, "state", UpdateInfoState), + update_id=d.get("update_id", None), + validate_only=d.get("validate_only", None), ) @@ -4076,20 +4074,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateStateInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.update_id is not None: - body["{update_id}"] = self.update_id + body["update_id"] = self.update_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateStateInfo: """Deserializes the UpdateStateInfo from a dictionary.""" return cls( - creation_time=d.get("{creation_time}", None), - state=_enum(d, "{state}", UpdateStateInfoState), - update_id=d.get("{update_id}", None), + creation_time=d.get("creation_time", None), + state=_enum(d, "state", UpdateStateInfoState), + update_id=d.get("update_id", None), ) @@ -4127,13 +4125,13 @@ def as_shallow_dict(self) -> dict: """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: """Deserializes the VolumesStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) @dataclass @@ -4154,13 +4152,13 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.destination is not None: - body["{destination}"] = self.destination + body["destination"] = self.destination return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: """Deserializes the WorkspaceStorageInfo from a dictionary.""" - return cls(destination=d.get("{destination}", None)) + return cls(destination=d.get("destination", None)) class PipelinesAPI: @@ -4281,59 +4279,59 @@ def create( """ body = {} if allow_duplicate_names is not None: - body["{allow_duplicate_names}"] = allow_duplicate_names + body["allow_duplicate_names"] = allow_duplicate_names if budget_policy_id is not None: - body["{budget_policy_id}"] = budget_policy_id + body["budget_policy_id"] = budget_policy_id if catalog is not None: - body["{catalog}"] = catalog + body["catalog"] = catalog if channel is not None: - body["{channel}"] = channel + body["channel"] = channel if clusters is not None: - body["{clusters}"] = [v.as_dict() for v in clusters] + body["clusters"] = [v.as_dict() for v in clusters] if configuration is not None: - body["{configuration}"] = configuration + body["configuration"] = configuration if continuous is not None: - body["{continuous}"] = continuous + body["continuous"] = continuous if deployment is not None: - body["{deployment}"] = deployment.as_dict() + body["deployment"] = deployment.as_dict() if development is not None: - body["{development}"] = development + body["development"] = development if dry_run is not None: - body["{dry_run}"] = dry_run + body["dry_run"] = dry_run if edition is not None: - body["{edition}"] = edition + body["edition"] = edition if event_log is not None: - body["{event_log}"] = event_log.as_dict() + body["event_log"] = event_log.as_dict() if filters is not None: - body["{filters}"] = filters.as_dict() + body["filters"] = filters.as_dict() if gateway_definition is not None: - body["{gateway_definition}"] = gateway_definition.as_dict() + body["gateway_definition"] = gateway_definition.as_dict() if id is not None: - body["{id}"] = id + body["id"] = id if ingestion_definition is not None: - body["{ingestion_definition}"] = ingestion_definition.as_dict() + body["ingestion_definition"] = ingestion_definition.as_dict() if libraries is not None: - body["{libraries}"] = [v.as_dict() for v in libraries] + body["libraries"] = [v.as_dict() for v in libraries] if name is not None: - body["{name}"] = name + body["name"] = name if notifications is not None: - body["{notifications}"] = [v.as_dict() for v in notifications] + body["notifications"] = [v.as_dict() for v in notifications] if photon is not None: - body["{photon}"] = photon + body["photon"] = photon if restart_window is not None: - body["{restart_window}"] = restart_window.as_dict() + body["restart_window"] = restart_window.as_dict() if run_as is not None: - body["{run_as}"] = run_as.as_dict() + body["run_as"] = run_as.as_dict() if schema is not None: - body["{schema}"] = schema + body["schema"] = schema if serverless is not None: - body["{serverless}"] = serverless + body["serverless"] = serverless if storage is not None: - body["{storage}"] = storage + body["storage"] = storage if target is not None: - body["{target}"] = target + body["target"] = target if trigger is not None: - body["{trigger}"] = trigger.as_dict() + body["trigger"] = trigger.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4467,25 +4465,25 @@ def list_pipeline_events( query = {} if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if order_by is not None: - query["{order_by}"] = [v for v in order_by] + query["order_by"] = [v for v in order_by] if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/events", query=query, headers=headers) - if "{events}" in json: - for v in json["{events}"]: + if "events" in json: + for v in json["events"]: yield PipelineEvent.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_pipelines( self, @@ -4523,25 +4521,25 @@ def list_pipelines( query = {} if filter is not None: - query["{filter}"] = filter + query["filter"] = filter if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if order_by is not None: - query["{order_by}"] = [v for v in order_by] + query["order_by"] = [v for v in order_by] if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/pipelines", query=query, headers=headers) - if "{statuses}" in json: - for v in json["{statuses}"]: + if "statuses" in json: + for v in json["statuses"]: yield PipelineStateInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_updates( self, @@ -4569,11 +4567,11 @@ def list_updates( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token if until_update_id is not None: - query["{until_update_id}"] = until_update_id + query["until_update_id"] = until_update_id headers = { "0": "{Accept application/json}", } @@ -4597,7 +4595,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4641,15 +4639,15 @@ def start_update( """ body = {} if cause is not None: - body["{cause}"] = cause.value + body["cause"] = cause.value if full_refresh is not None: - body["{full_refresh}"] = full_refresh + body["full_refresh"] = full_refresh if full_refresh_selection is not None: - body["{full_refresh_selection}"] = [v for v in full_refresh_selection] + body["full_refresh_selection"] = [v for v in full_refresh_selection] if refresh_selection is not None: - body["{refresh_selection}"] = [v for v in refresh_selection] + body["refresh_selection"] = [v for v in refresh_selection] if validate_only is not None: - body["{validate_only}"] = validate_only + body["validate_only"] = validate_only headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4790,59 +4788,59 @@ def update( """ body = {} if allow_duplicate_names is not None: - body["{allow_duplicate_names}"] = allow_duplicate_names + body["allow_duplicate_names"] = allow_duplicate_names if budget_policy_id is not None: - body["{budget_policy_id}"] = budget_policy_id + body["budget_policy_id"] = budget_policy_id if catalog is not None: - body["{catalog}"] = catalog + body["catalog"] = catalog if channel is not None: - body["{channel}"] = channel + body["channel"] = channel if clusters is not None: - body["{clusters}"] = [v.as_dict() for v in clusters] + body["clusters"] = [v.as_dict() for v in clusters] if configuration is not None: - body["{configuration}"] = configuration + body["configuration"] = configuration if continuous is not None: - body["{continuous}"] = continuous + body["continuous"] = continuous if deployment is not None: - body["{deployment}"] = deployment.as_dict() + body["deployment"] = deployment.as_dict() if development is not None: - body["{development}"] = development + body["development"] = development if edition is not None: - body["{edition}"] = edition + body["edition"] = edition if event_log is not None: - body["{event_log}"] = event_log.as_dict() + body["event_log"] = event_log.as_dict() if expected_last_modified is not None: - body["{expected_last_modified}"] = expected_last_modified + body["expected_last_modified"] = expected_last_modified if filters is not None: - body["{filters}"] = filters.as_dict() + body["filters"] = filters.as_dict() if gateway_definition is not None: - body["{gateway_definition}"] = gateway_definition.as_dict() + body["gateway_definition"] = gateway_definition.as_dict() if id is not None: - body["{id}"] = id + body["id"] = id if ingestion_definition is not None: - body["{ingestion_definition}"] = ingestion_definition.as_dict() + body["ingestion_definition"] = ingestion_definition.as_dict() if libraries is not None: - body["{libraries}"] = [v.as_dict() for v in libraries] + body["libraries"] = [v.as_dict() for v in libraries] if name is not None: - body["{name}"] = name + body["name"] = name if notifications is not None: - body["{notifications}"] = [v.as_dict() for v in notifications] + body["notifications"] = [v.as_dict() for v in notifications] if photon is not None: - body["{photon}"] = photon + body["photon"] = photon if restart_window is not None: - body["{restart_window}"] = restart_window.as_dict() + body["restart_window"] = restart_window.as_dict() if run_as is not None: - body["{run_as}"] = run_as.as_dict() + body["run_as"] = run_as.as_dict() if schema is not None: - body["{schema}"] = schema + body["schema"] = schema if serverless is not None: - body["{serverless}"] = serverless + body["serverless"] = serverless if storage is not None: - body["{storage}"] = storage + body["storage"] = storage if target is not None: - body["{target}"] = target + body["target"] = target if trigger is not None: - body["{trigger}"] = trigger.as_dict() + body["trigger"] = trigger.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4865,7 +4863,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/provisioning/v2/impl.py b/databricks/sdk/provisioning/v2/impl.py index 8f8c7dfdd..ec2ed3f51 100755 --- a/databricks/sdk/provisioning/v2/impl.py +++ b/databricks/sdk/provisioning/v2/impl.py @@ -31,13 +31,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.sts_role: - body["{sts_role}"] = self.sts_role + body["sts_role"] = self.sts_role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsCredentials: """Deserializes the AwsCredentials from a dictionary.""" - return cls(sts_role=_from_dict(d, "{sts_role}", StsRole)) + return cls(sts_role=_from_dict(d, "sts_role", StsRole)) @dataclass @@ -73,23 +73,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AwsKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.key_alias is not None: - body["{key_alias}"] = self.key_alias + body["key_alias"] = self.key_alias if self.key_arn is not None: - body["{key_arn}"] = self.key_arn + body["key_arn"] = self.key_arn if self.key_region is not None: - body["{key_region}"] = self.key_region + body["key_region"] = self.key_region if self.reuse_key_for_cluster_volumes is not None: - body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes + body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AwsKeyInfo: """Deserializes the AwsKeyInfo from a dictionary.""" return cls( - key_alias=d.get("{key_alias}", None), - key_arn=d.get("{key_arn}", None), - key_region=d.get("{key_region}", None), - reuse_key_for_cluster_volumes=d.get("{reuse_key_for_cluster_volumes}", None), + key_alias=d.get("key_alias", None), + key_arn=d.get("key_arn", None), + key_region=d.get("key_region", None), + reuse_key_for_cluster_volumes=d.get("reuse_key_for_cluster_volumes", None), ) @@ -114,15 +114,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureWorkspaceInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.resource_group is not None: - body["{resource_group}"] = self.resource_group + body["resource_group"] = self.resource_group if self.subscription_id is not None: - body["{subscription_id}"] = self.subscription_id + body["subscription_id"] = self.subscription_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureWorkspaceInfo: """Deserializes the AzureWorkspaceInfo from a dictionary.""" - return cls(resource_group=d.get("{resource_group}", None), subscription_id=d.get("{subscription_id}", None)) + return cls(resource_group=d.get("resource_group", None), subscription_id=d.get("subscription_id", None)) @dataclass @@ -143,13 +143,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CloudResourceContainer into a shallow dictionary of its immediate attributes.""" body = {} if self.gcp: - body["{gcp}"] = self.gcp + body["gcp"] = self.gcp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CloudResourceContainer: """Deserializes the CloudResourceContainer from a dictionary.""" - return cls(gcp=_from_dict(d, "{gcp}", CustomerFacingGcpCloudResourceContainer)) + return cls(gcp=_from_dict(d, "gcp", CustomerFacingGcpCloudResourceContainer)) @dataclass @@ -181,20 +181,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateAwsKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.key_alias is not None: - body["{key_alias}"] = self.key_alias + body["key_alias"] = self.key_alias if self.key_arn is not None: - body["{key_arn}"] = self.key_arn + body["key_arn"] = self.key_arn if self.reuse_key_for_cluster_volumes is not None: - body["{reuse_key_for_cluster_volumes}"] = self.reuse_key_for_cluster_volumes + body["reuse_key_for_cluster_volumes"] = self.reuse_key_for_cluster_volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAwsKeyInfo: """Deserializes the CreateAwsKeyInfo from a dictionary.""" return cls( - key_alias=d.get("{key_alias}", None), - key_arn=d.get("{key_arn}", None), - reuse_key_for_cluster_volumes=d.get("{reuse_key_for_cluster_volumes}", None), + key_alias=d.get("key_alias", None), + key_arn=d.get("key_arn", None), + reuse_key_for_cluster_volumes=d.get("reuse_key_for_cluster_volumes", None), ) @@ -213,13 +213,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialAwsCredentials into a shallow dictionary of its immediate attributes.""" body = {} if self.sts_role: - body["{sts_role}"] = self.sts_role + body["sts_role"] = self.sts_role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialAwsCredentials: """Deserializes the CreateCredentialAwsCredentials from a dictionary.""" - return cls(sts_role=_from_dict(d, "{sts_role}", CreateCredentialStsRole)) + return cls(sts_role=_from_dict(d, "sts_role", CreateCredentialStsRole)) @dataclass @@ -242,17 +242,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_credentials: - body["{aws_credentials}"] = self.aws_credentials + body["aws_credentials"] = self.aws_credentials if self.credentials_name is not None: - body["{credentials_name}"] = self.credentials_name + body["credentials_name"] = self.credentials_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialRequest: """Deserializes the CreateCredentialRequest from a dictionary.""" return cls( - aws_credentials=_from_dict(d, "{aws_credentials}", CreateCredentialAwsCredentials), - credentials_name=d.get("{credentials_name}", None), + aws_credentials=_from_dict(d, "aws_credentials", CreateCredentialAwsCredentials), + credentials_name=d.get("credentials_name", None), ) @@ -272,13 +272,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialStsRole into a shallow dictionary of its immediate attributes.""" body = {} if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialStsRole: """Deserializes the CreateCredentialStsRole from a dictionary.""" - return cls(role_arn=d.get("{role_arn}", None)) + return cls(role_arn=d.get("role_arn", None)) @dataclass @@ -305,20 +305,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCustomerManagedKeyRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_key_info: - body["{aws_key_info}"] = self.aws_key_info + body["aws_key_info"] = self.aws_key_info if self.gcp_key_info: - body["{gcp_key_info}"] = self.gcp_key_info + body["gcp_key_info"] = self.gcp_key_info if self.use_cases: - body["{use_cases}"] = self.use_cases + body["use_cases"] = self.use_cases return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCustomerManagedKeyRequest: """Deserializes the CreateCustomerManagedKeyRequest from a dictionary.""" return cls( - aws_key_info=_from_dict(d, "{aws_key_info}", CreateAwsKeyInfo), - gcp_key_info=_from_dict(d, "{gcp_key_info}", CreateGcpKeyInfo), - use_cases=_repeated_enum(d, "{use_cases}", KeyUseCase), + aws_key_info=_from_dict(d, "aws_key_info", CreateAwsKeyInfo), + gcp_key_info=_from_dict(d, "gcp_key_info", CreateGcpKeyInfo), + use_cases=_repeated_enum(d, "use_cases", KeyUseCase), ) @@ -338,13 +338,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateGcpKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.kms_key_id is not None: - body["{kms_key_id}"] = self.kms_key_id + body["kms_key_id"] = self.kms_key_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateGcpKeyInfo: """Deserializes the CreateGcpKeyInfo from a dictionary.""" - return cls(kms_key_id=d.get("{kms_key_id}", None)) + return cls(kms_key_id=d.get("kms_key_id", None)) @dataclass @@ -395,29 +395,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateNetworkRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.gcp_network_info: - body["{gcp_network_info}"] = self.gcp_network_info + body["gcp_network_info"] = self.gcp_network_info if self.network_name is not None: - body["{network_name}"] = self.network_name + body["network_name"] = self.network_name if self.security_group_ids: - body["{security_group_ids}"] = self.security_group_ids + body["security_group_ids"] = self.security_group_ids if self.subnet_ids: - body["{subnet_ids}"] = self.subnet_ids + body["subnet_ids"] = self.subnet_ids if self.vpc_endpoints: - body["{vpc_endpoints}"] = self.vpc_endpoints + body["vpc_endpoints"] = self.vpc_endpoints if self.vpc_id is not None: - body["{vpc_id}"] = self.vpc_id + body["vpc_id"] = self.vpc_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateNetworkRequest: """Deserializes the CreateNetworkRequest from a dictionary.""" return cls( - gcp_network_info=_from_dict(d, "{gcp_network_info}", GcpNetworkInfo), - network_name=d.get("{network_name}", None), - security_group_ids=d.get("{security_group_ids}", None), - subnet_ids=d.get("{subnet_ids}", None), - vpc_endpoints=_from_dict(d, "{vpc_endpoints}", NetworkVpcEndpoints), - vpc_id=d.get("{vpc_id}", None), + gcp_network_info=_from_dict(d, "gcp_network_info", GcpNetworkInfo), + network_name=d.get("network_name", None), + security_group_ids=d.get("security_group_ids", None), + subnet_ids=d.get("subnet_ids", None), + vpc_endpoints=_from_dict(d, "vpc_endpoints", NetworkVpcEndpoints), + vpc_id=d.get("vpc_id", None), ) @@ -442,17 +442,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateStorageConfigurationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.root_bucket_info: - body["{root_bucket_info}"] = self.root_bucket_info + body["root_bucket_info"] = self.root_bucket_info if self.storage_configuration_name is not None: - body["{storage_configuration_name}"] = self.storage_configuration_name + body["storage_configuration_name"] = self.storage_configuration_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateStorageConfigurationRequest: """Deserializes the CreateStorageConfigurationRequest from a dictionary.""" return cls( - root_bucket_info=_from_dict(d, "{root_bucket_info}", RootBucketInfo), - storage_configuration_name=d.get("{storage_configuration_name}", None), + root_bucket_info=_from_dict(d, "root_bucket_info", RootBucketInfo), + storage_configuration_name=d.get("storage_configuration_name", None), ) @@ -487,23 +487,23 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateVpcEndpointRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_vpc_endpoint_id is not None: - body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id + body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info + body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.vpc_endpoint_name is not None: - body["{vpc_endpoint_name}"] = self.vpc_endpoint_name + body["vpc_endpoint_name"] = self.vpc_endpoint_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVpcEndpointRequest: """Deserializes the CreateVpcEndpointRequest from a dictionary.""" return cls( - aws_vpc_endpoint_id=d.get("{aws_vpc_endpoint_id}", None), - gcp_vpc_endpoint_info=_from_dict(d, "{gcp_vpc_endpoint_info}", GcpVpcEndpointInfo), - region=d.get("{region}", None), - vpc_endpoint_name=d.get("{vpc_endpoint_name}", None), + aws_vpc_endpoint_id=d.get("aws_vpc_endpoint_id", None), + gcp_vpc_endpoint_info=_from_dict(d, "gcp_vpc_endpoint_info", GcpVpcEndpointInfo), + region=d.get("region", None), + vpc_endpoint_name=d.get("vpc_endpoint_name", None), ) @@ -659,62 +659,62 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateWorkspaceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.cloud_resource_container: - body["{cloud_resource_container}"] = self.cloud_resource_container + body["cloud_resource_container"] = self.cloud_resource_container if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.deployment_name is not None: - body["{deployment_name}"] = self.deployment_name + body["deployment_name"] = self.deployment_name if self.gcp_managed_network_config: - body["{gcp_managed_network_config}"] = self.gcp_managed_network_config + body["gcp_managed_network_config"] = self.gcp_managed_network_config if self.gke_config: - body["{gke_config}"] = self.gke_config + body["gke_config"] = self.gke_config if self.is_no_public_ip_enabled is not None: - body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled + body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled if self.location is not None: - body["{location}"] = self.location + body["location"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.pricing_tier is not None: - body["{pricing_tier}"] = self.pricing_tier + body["pricing_tier"] = self.pricing_tier if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id if self.workspace_name is not None: - body["{workspace_name}"] = self.workspace_name + body["workspace_name"] = self.workspace_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWorkspaceRequest: """Deserializes the CreateWorkspaceRequest from a dictionary.""" return cls( - aws_region=d.get("{aws_region}", None), - cloud=d.get("{cloud}", None), - cloud_resource_container=_from_dict(d, "{cloud_resource_container}", CloudResourceContainer), - credentials_id=d.get("{credentials_id}", None), - custom_tags=d.get("{custom_tags}", None), - deployment_name=d.get("{deployment_name}", None), - gcp_managed_network_config=_from_dict(d, "{gcp_managed_network_config}", GcpManagedNetworkConfig), - gke_config=_from_dict(d, "{gke_config}", GkeConfig), - is_no_public_ip_enabled=d.get("{is_no_public_ip_enabled}", None), - location=d.get("{location}", None), - managed_services_customer_managed_key_id=d.get("{managed_services_customer_managed_key_id}", None), - network_id=d.get("{network_id}", None), - pricing_tier=_enum(d, "{pricing_tier}", PricingTier), - private_access_settings_id=d.get("{private_access_settings_id}", None), - storage_configuration_id=d.get("{storage_configuration_id}", None), - storage_customer_managed_key_id=d.get("{storage_customer_managed_key_id}", None), - workspace_name=d.get("{workspace_name}", None), + aws_region=d.get("aws_region", None), + cloud=d.get("cloud", None), + cloud_resource_container=_from_dict(d, "cloud_resource_container", CloudResourceContainer), + credentials_id=d.get("credentials_id", None), + custom_tags=d.get("custom_tags", None), + deployment_name=d.get("deployment_name", None), + gcp_managed_network_config=_from_dict(d, "gcp_managed_network_config", GcpManagedNetworkConfig), + gke_config=_from_dict(d, "gke_config", GkeConfig), + is_no_public_ip_enabled=d.get("is_no_public_ip_enabled", None), + location=d.get("location", None), + managed_services_customer_managed_key_id=d.get("managed_services_customer_managed_key_id", None), + network_id=d.get("network_id", None), + pricing_tier=_enum(d, "pricing_tier", PricingTier), + private_access_settings_id=d.get("private_access_settings_id", None), + storage_configuration_id=d.get("storage_configuration_id", None), + storage_customer_managed_key_id=d.get("storage_customer_managed_key_id", None), + workspace_name=d.get("workspace_name", None), ) @@ -753,26 +753,26 @@ def as_shallow_dict(self) -> dict: """Serializes the Credential into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_credentials: - body["{aws_credentials}"] = self.aws_credentials + body["aws_credentials"] = self.aws_credentials if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.credentials_name is not None: - body["{credentials_name}"] = self.credentials_name + body["credentials_name"] = self.credentials_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Credential: """Deserializes the Credential from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - aws_credentials=_from_dict(d, "{aws_credentials}", AwsCredentials), - creation_time=d.get("{creation_time}", None), - credentials_id=d.get("{credentials_id}", None), - credentials_name=d.get("{credentials_name}", None), + account_id=d.get("account_id", None), + aws_credentials=_from_dict(d, "aws_credentials", AwsCredentials), + creation_time=d.get("creation_time", None), + credentials_id=d.get("credentials_id", None), + credentials_name=d.get("credentials_name", None), ) @@ -798,13 +798,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CustomerFacingGcpCloudResourceContainer into a shallow dictionary of its immediate attributes.""" body = {} if self.project_id is not None: - body["{project_id}"] = self.project_id + body["project_id"] = self.project_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomerFacingGcpCloudResourceContainer: """Deserializes the CustomerFacingGcpCloudResourceContainer from a dictionary.""" - return cls(project_id=d.get("{project_id}", None)) + return cls(project_id=d.get("project_id", None)) @dataclass @@ -846,29 +846,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CustomerManagedKey into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_key_info: - body["{aws_key_info}"] = self.aws_key_info + body["aws_key_info"] = self.aws_key_info if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.customer_managed_key_id is not None: - body["{customer_managed_key_id}"] = self.customer_managed_key_id + body["customer_managed_key_id"] = self.customer_managed_key_id if self.gcp_key_info: - body["{gcp_key_info}"] = self.gcp_key_info + body["gcp_key_info"] = self.gcp_key_info if self.use_cases: - body["{use_cases}"] = self.use_cases + body["use_cases"] = self.use_cases return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomerManagedKey: """Deserializes the CustomerManagedKey from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - aws_key_info=_from_dict(d, "{aws_key_info}", AwsKeyInfo), - creation_time=d.get("{creation_time}", None), - customer_managed_key_id=d.get("{customer_managed_key_id}", None), - gcp_key_info=_from_dict(d, "{gcp_key_info}", GcpKeyInfo), - use_cases=_repeated_enum(d, "{use_cases}", KeyUseCase), + account_id=d.get("account_id", None), + aws_key_info=_from_dict(d, "aws_key_info", AwsKeyInfo), + creation_time=d.get("creation_time", None), + customer_managed_key_id=d.get("customer_managed_key_id", None), + gcp_key_info=_from_dict(d, "gcp_key_info", GcpKeyInfo), + use_cases=_repeated_enum(d, "use_cases", KeyUseCase), ) @@ -937,20 +937,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalCustomerInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.authoritative_user_email is not None: - body["{authoritative_user_email}"] = self.authoritative_user_email + body["authoritative_user_email"] = self.authoritative_user_email if self.authoritative_user_full_name is not None: - body["{authoritative_user_full_name}"] = self.authoritative_user_full_name + body["authoritative_user_full_name"] = self.authoritative_user_full_name if self.customer_name is not None: - body["{customer_name}"] = self.customer_name + body["customer_name"] = self.customer_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalCustomerInfo: """Deserializes the ExternalCustomerInfo from a dictionary.""" return cls( - authoritative_user_email=d.get("{authoritative_user_email}", None), - authoritative_user_full_name=d.get("{authoritative_user_full_name}", None), - customer_name=d.get("{customer_name}", None), + authoritative_user_email=d.get("authoritative_user_email", None), + authoritative_user_full_name=d.get("authoritative_user_full_name", None), + customer_name=d.get("customer_name", None), ) @@ -970,13 +970,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GcpKeyInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.kms_key_id is not None: - body["{kms_key_id}"] = self.kms_key_id + body["kms_key_id"] = self.kms_key_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpKeyInfo: """Deserializes the GcpKeyInfo from a dictionary.""" - return cls(kms_key_id=d.get("{kms_key_id}", None)) + return cls(kms_key_id=d.get("kms_key_id", None)) @dataclass @@ -1028,20 +1028,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GcpManagedNetworkConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.gke_cluster_pod_ip_range is not None: - body["{gke_cluster_pod_ip_range}"] = self.gke_cluster_pod_ip_range + body["gke_cluster_pod_ip_range"] = self.gke_cluster_pod_ip_range if self.gke_cluster_service_ip_range is not None: - body["{gke_cluster_service_ip_range}"] = self.gke_cluster_service_ip_range + body["gke_cluster_service_ip_range"] = self.gke_cluster_service_ip_range if self.subnet_cidr is not None: - body["{subnet_cidr}"] = self.subnet_cidr + body["subnet_cidr"] = self.subnet_cidr return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpManagedNetworkConfig: """Deserializes the GcpManagedNetworkConfig from a dictionary.""" return cls( - gke_cluster_pod_ip_range=d.get("{gke_cluster_pod_ip_range}", None), - gke_cluster_service_ip_range=d.get("{gke_cluster_service_ip_range}", None), - subnet_cidr=d.get("{subnet_cidr}", None), + gke_cluster_pod_ip_range=d.get("gke_cluster_pod_ip_range", None), + gke_cluster_service_ip_range=d.get("gke_cluster_service_ip_range", None), + subnet_cidr=d.get("subnet_cidr", None), ) @@ -1092,29 +1092,29 @@ def as_shallow_dict(self) -> dict: """Serializes the GcpNetworkInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.network_project_id is not None: - body["{network_project_id}"] = self.network_project_id + body["network_project_id"] = self.network_project_id if self.pod_ip_range_name is not None: - body["{pod_ip_range_name}"] = self.pod_ip_range_name + body["pod_ip_range_name"] = self.pod_ip_range_name if self.service_ip_range_name is not None: - body["{service_ip_range_name}"] = self.service_ip_range_name + body["service_ip_range_name"] = self.service_ip_range_name if self.subnet_id is not None: - body["{subnet_id}"] = self.subnet_id + body["subnet_id"] = self.subnet_id if self.subnet_region is not None: - body["{subnet_region}"] = self.subnet_region + body["subnet_region"] = self.subnet_region if self.vpc_id is not None: - body["{vpc_id}"] = self.vpc_id + body["vpc_id"] = self.vpc_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpNetworkInfo: """Deserializes the GcpNetworkInfo from a dictionary.""" return cls( - network_project_id=d.get("{network_project_id}", None), - pod_ip_range_name=d.get("{pod_ip_range_name}", None), - service_ip_range_name=d.get("{service_ip_range_name}", None), - subnet_id=d.get("{subnet_id}", None), - subnet_region=d.get("{subnet_region}", None), - vpc_id=d.get("{vpc_id}", None), + network_project_id=d.get("network_project_id", None), + pod_ip_range_name=d.get("pod_ip_range_name", None), + service_ip_range_name=d.get("service_ip_range_name", None), + subnet_id=d.get("subnet_id", None), + subnet_region=d.get("subnet_region", None), + vpc_id=d.get("vpc_id", None), ) @@ -1156,26 +1156,26 @@ def as_shallow_dict(self) -> dict: """Serializes the GcpVpcEndpointInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_region is not None: - body["{endpoint_region}"] = self.endpoint_region + body["endpoint_region"] = self.endpoint_region if self.project_id is not None: - body["{project_id}"] = self.project_id + body["project_id"] = self.project_id if self.psc_connection_id is not None: - body["{psc_connection_id}"] = self.psc_connection_id + body["psc_connection_id"] = self.psc_connection_id if self.psc_endpoint_name is not None: - body["{psc_endpoint_name}"] = self.psc_endpoint_name + body["psc_endpoint_name"] = self.psc_endpoint_name if self.service_attachment_id is not None: - body["{service_attachment_id}"] = self.service_attachment_id + body["service_attachment_id"] = self.service_attachment_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GcpVpcEndpointInfo: """Deserializes the GcpVpcEndpointInfo from a dictionary.""" return cls( - endpoint_region=d.get("{endpoint_region}", None), - project_id=d.get("{project_id}", None), - psc_connection_id=d.get("{psc_connection_id}", None), - psc_endpoint_name=d.get("{psc_endpoint_name}", None), - service_attachment_id=d.get("{service_attachment_id}", None), + endpoint_region=d.get("endpoint_region", None), + project_id=d.get("project_id", None), + psc_connection_id=d.get("psc_connection_id", None), + psc_endpoint_name=d.get("psc_endpoint_name", None), + service_attachment_id=d.get("service_attachment_id", None), ) @@ -1211,17 +1211,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GkeConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.connectivity_type is not None: - body["{connectivity_type}"] = self.connectivity_type + body["connectivity_type"] = self.connectivity_type if self.master_ip_range is not None: - body["{master_ip_range}"] = self.master_ip_range + body["master_ip_range"] = self.master_ip_range return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GkeConfig: """Deserializes the GkeConfig from a dictionary.""" return cls( - connectivity_type=_enum(d, "{connectivity_type}", GkeConfigConnectivityType), - master_ip_range=d.get("{master_ip_range}", None), + connectivity_type=_enum(d, "connectivity_type", GkeConfigConnectivityType), + master_ip_range=d.get("master_ip_range", None), ) @@ -1327,50 +1327,50 @@ def as_shallow_dict(self) -> dict: """Serializes the Network into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.error_messages: - body["{error_messages}"] = self.error_messages + body["error_messages"] = self.error_messages if self.gcp_network_info: - body["{gcp_network_info}"] = self.gcp_network_info + body["gcp_network_info"] = self.gcp_network_info if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.network_name is not None: - body["{network_name}"] = self.network_name + body["network_name"] = self.network_name if self.security_group_ids: - body["{security_group_ids}"] = self.security_group_ids + body["security_group_ids"] = self.security_group_ids if self.subnet_ids: - body["{subnet_ids}"] = self.subnet_ids + body["subnet_ids"] = self.subnet_ids if self.vpc_endpoints: - body["{vpc_endpoints}"] = self.vpc_endpoints + body["vpc_endpoints"] = self.vpc_endpoints if self.vpc_id is not None: - body["{vpc_id}"] = self.vpc_id + body["vpc_id"] = self.vpc_id if self.vpc_status is not None: - body["{vpc_status}"] = self.vpc_status + body["vpc_status"] = self.vpc_status if self.warning_messages: - body["{warning_messages}"] = self.warning_messages + body["warning_messages"] = self.warning_messages if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Network: """Deserializes the Network from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - creation_time=d.get("{creation_time}", None), - error_messages=_repeated_dict(d, "{error_messages}", NetworkHealth), - gcp_network_info=_from_dict(d, "{gcp_network_info}", GcpNetworkInfo), - network_id=d.get("{network_id}", None), - network_name=d.get("{network_name}", None), - security_group_ids=d.get("{security_group_ids}", None), - subnet_ids=d.get("{subnet_ids}", None), - vpc_endpoints=_from_dict(d, "{vpc_endpoints}", NetworkVpcEndpoints), - vpc_id=d.get("{vpc_id}", None), - vpc_status=_enum(d, "{vpc_status}", VpcStatus), - warning_messages=_repeated_dict(d, "{warning_messages}", NetworkWarning), - workspace_id=d.get("{workspace_id}", None), + account_id=d.get("account_id", None), + creation_time=d.get("creation_time", None), + error_messages=_repeated_dict(d, "error_messages", NetworkHealth), + gcp_network_info=_from_dict(d, "gcp_network_info", GcpNetworkInfo), + network_id=d.get("network_id", None), + network_name=d.get("network_name", None), + security_group_ids=d.get("security_group_ids", None), + subnet_ids=d.get("subnet_ids", None), + vpc_endpoints=_from_dict(d, "vpc_endpoints", NetworkVpcEndpoints), + vpc_id=d.get("vpc_id", None), + vpc_status=_enum(d, "vpc_status", VpcStatus), + warning_messages=_repeated_dict(d, "warning_messages", NetworkWarning), + workspace_id=d.get("workspace_id", None), ) @@ -1396,15 +1396,15 @@ def as_shallow_dict(self) -> dict: """Serializes the NetworkHealth into a shallow dictionary of its immediate attributes.""" body = {} if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.error_type is not None: - body["{error_type}"] = self.error_type + body["error_type"] = self.error_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkHealth: """Deserializes the NetworkHealth from a dictionary.""" - return cls(error_message=d.get("{error_message}", None), error_type=_enum(d, "{error_type}", ErrorType)) + return cls(error_message=d.get("error_message", None), error_type=_enum(d, "error_type", ErrorType)) @dataclass @@ -1434,15 +1434,15 @@ def as_shallow_dict(self) -> dict: """Serializes the NetworkVpcEndpoints into a shallow dictionary of its immediate attributes.""" body = {} if self.dataplane_relay: - body["{dataplane_relay}"] = self.dataplane_relay + body["dataplane_relay"] = self.dataplane_relay if self.rest_api: - body["{rest_api}"] = self.rest_api + body["rest_api"] = self.rest_api return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkVpcEndpoints: """Deserializes the NetworkVpcEndpoints from a dictionary.""" - return cls(dataplane_relay=d.get("{dataplane_relay}", None), rest_api=d.get("{rest_api}", None)) + return cls(dataplane_relay=d.get("dataplane_relay", None), rest_api=d.get("rest_api", None)) @dataclass @@ -1466,17 +1466,15 @@ def as_shallow_dict(self) -> dict: """Serializes the NetworkWarning into a shallow dictionary of its immediate attributes.""" body = {} if self.warning_message is not None: - body["{warning_message}"] = self.warning_message + body["warning_message"] = self.warning_message if self.warning_type is not None: - body["{warning_type}"] = self.warning_type + body["warning_type"] = self.warning_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkWarning: """Deserializes the NetworkWarning from a dictionary.""" - return cls( - warning_message=d.get("{warning_message}", None), warning_type=_enum(d, "{warning_type}", WarningType) - ) + return cls(warning_message=d.get("warning_message", None), warning_type=_enum(d, "warning_type", WarningType)) class PricingTier(Enum): @@ -1556,32 +1554,32 @@ def as_shallow_dict(self) -> dict: """Serializes the PrivateAccessSettings into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.allowed_vpc_endpoint_ids: - body["{allowed_vpc_endpoint_ids}"] = self.allowed_vpc_endpoint_ids + body["allowed_vpc_endpoint_ids"] = self.allowed_vpc_endpoint_ids if self.private_access_level is not None: - body["{private_access_level}"] = self.private_access_level + body["private_access_level"] = self.private_access_level if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["{private_access_settings_name}"] = self.private_access_settings_name + body["private_access_settings_name"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["{public_access_enabled}"] = self.public_access_enabled + body["public_access_enabled"] = self.public_access_enabled if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrivateAccessSettings: """Deserializes the PrivateAccessSettings from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - allowed_vpc_endpoint_ids=d.get("{allowed_vpc_endpoint_ids}", None), - private_access_level=_enum(d, "{private_access_level}", PrivateAccessLevel), - private_access_settings_id=d.get("{private_access_settings_id}", None), - private_access_settings_name=d.get("{private_access_settings_name}", None), - public_access_enabled=d.get("{public_access_enabled}", None), - region=d.get("{region}", None), + account_id=d.get("account_id", None), + allowed_vpc_endpoint_ids=d.get("allowed_vpc_endpoint_ids", None), + private_access_level=_enum(d, "private_access_level", PrivateAccessLevel), + private_access_settings_id=d.get("private_access_settings_id", None), + private_access_settings_name=d.get("private_access_settings_name", None), + public_access_enabled=d.get("public_access_enabled", None), + region=d.get("region", None), ) @@ -1621,13 +1619,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RootBucketInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.bucket_name is not None: - body["{bucket_name}"] = self.bucket_name + body["bucket_name"] = self.bucket_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RootBucketInfo: """Deserializes the RootBucketInfo from a dictionary.""" - return cls(bucket_name=d.get("{bucket_name}", None)) + return cls(bucket_name=d.get("bucket_name", None)) @dataclass @@ -1666,26 +1664,26 @@ def as_shallow_dict(self) -> dict: """Serializes the StorageConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.root_bucket_info: - body["{root_bucket_info}"] = self.root_bucket_info + body["root_bucket_info"] = self.root_bucket_info if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_configuration_name is not None: - body["{storage_configuration_name}"] = self.storage_configuration_name + body["storage_configuration_name"] = self.storage_configuration_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StorageConfiguration: """Deserializes the StorageConfiguration from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - creation_time=d.get("{creation_time}", None), - root_bucket_info=_from_dict(d, "{root_bucket_info}", RootBucketInfo), - storage_configuration_id=d.get("{storage_configuration_id}", None), - storage_configuration_name=d.get("{storage_configuration_name}", None), + account_id=d.get("account_id", None), + creation_time=d.get("creation_time", None), + root_bucket_info=_from_dict(d, "root_bucket_info", RootBucketInfo), + storage_configuration_id=d.get("storage_configuration_id", None), + storage_configuration_name=d.get("storage_configuration_name", None), ) @@ -1711,15 +1709,15 @@ def as_shallow_dict(self) -> dict: """Serializes the StsRole into a shallow dictionary of its immediate attributes.""" body = {} if self.external_id is not None: - body["{external_id}"] = self.external_id + body["external_id"] = self.external_id if self.role_arn is not None: - body["{role_arn}"] = self.role_arn + body["role_arn"] = self.role_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StsRole: """Deserializes the StsRole from a dictionary.""" - return cls(external_id=d.get("{external_id}", None), role_arn=d.get("{role_arn}", None)) + return cls(external_id=d.get("external_id", None), role_arn=d.get("role_arn", None)) @dataclass @@ -1810,41 +1808,41 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateWorkspaceRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateWorkspaceRequest: """Deserializes the UpdateWorkspaceRequest from a dictionary.""" return cls( - aws_region=d.get("{aws_region}", None), - credentials_id=d.get("{credentials_id}", None), - custom_tags=d.get("{custom_tags}", None), - managed_services_customer_managed_key_id=d.get("{managed_services_customer_managed_key_id}", None), - network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), - network_id=d.get("{network_id}", None), - private_access_settings_id=d.get("{private_access_settings_id}", None), - storage_configuration_id=d.get("{storage_configuration_id}", None), - storage_customer_managed_key_id=d.get("{storage_customer_managed_key_id}", None), - workspace_id=d.get("{workspace_id}", None), + aws_region=d.get("aws_region", None), + credentials_id=d.get("credentials_id", None), + custom_tags=d.get("custom_tags", None), + managed_services_customer_managed_key_id=d.get("managed_services_customer_managed_key_id", None), + network_connectivity_config_id=d.get("network_connectivity_config_id", None), + network_id=d.get("network_id", None), + private_access_settings_id=d.get("private_access_settings_id", None), + storage_configuration_id=d.get("storage_configuration_id", None), + storage_customer_managed_key_id=d.get("storage_customer_managed_key_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -1907,29 +1905,29 @@ def as_shallow_dict(self) -> dict: """Serializes the UpsertPrivateAccessSettingsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_vpc_endpoint_ids: - body["{allowed_vpc_endpoint_ids}"] = self.allowed_vpc_endpoint_ids + body["allowed_vpc_endpoint_ids"] = self.allowed_vpc_endpoint_ids if self.private_access_level is not None: - body["{private_access_level}"] = self.private_access_level + body["private_access_level"] = self.private_access_level if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.private_access_settings_name is not None: - body["{private_access_settings_name}"] = self.private_access_settings_name + body["private_access_settings_name"] = self.private_access_settings_name if self.public_access_enabled is not None: - body["{public_access_enabled}"] = self.public_access_enabled + body["public_access_enabled"] = self.public_access_enabled if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertPrivateAccessSettingsRequest: """Deserializes the UpsertPrivateAccessSettingsRequest from a dictionary.""" return cls( - allowed_vpc_endpoint_ids=d.get("{allowed_vpc_endpoint_ids}", None), - private_access_level=_enum(d, "{private_access_level}", PrivateAccessLevel), - private_access_settings_id=d.get("{private_access_settings_id}", None), - private_access_settings_name=d.get("{private_access_settings_name}", None), - public_access_enabled=d.get("{public_access_enabled}", None), - region=d.get("{region}", None), + allowed_vpc_endpoint_ids=d.get("allowed_vpc_endpoint_ids", None), + private_access_level=_enum(d, "private_access_level", PrivateAccessLevel), + private_access_settings_id=d.get("private_access_settings_id", None), + private_access_settings_name=d.get("private_access_settings_name", None), + public_access_enabled=d.get("public_access_enabled", None), + region=d.get("region", None), ) @@ -2006,41 +2004,41 @@ def as_shallow_dict(self) -> dict: """Serializes the VpcEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_account_id is not None: - body["{aws_account_id}"] = self.aws_account_id + body["aws_account_id"] = self.aws_account_id if self.aws_endpoint_service_id is not None: - body["{aws_endpoint_service_id}"] = self.aws_endpoint_service_id + body["aws_endpoint_service_id"] = self.aws_endpoint_service_id if self.aws_vpc_endpoint_id is not None: - body["{aws_vpc_endpoint_id}"] = self.aws_vpc_endpoint_id + body["aws_vpc_endpoint_id"] = self.aws_vpc_endpoint_id if self.gcp_vpc_endpoint_info: - body["{gcp_vpc_endpoint_info}"] = self.gcp_vpc_endpoint_info + body["gcp_vpc_endpoint_info"] = self.gcp_vpc_endpoint_info if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.use_case is not None: - body["{use_case}"] = self.use_case + body["use_case"] = self.use_case if self.vpc_endpoint_id is not None: - body["{vpc_endpoint_id}"] = self.vpc_endpoint_id + body["vpc_endpoint_id"] = self.vpc_endpoint_id if self.vpc_endpoint_name is not None: - body["{vpc_endpoint_name}"] = self.vpc_endpoint_name + body["vpc_endpoint_name"] = self.vpc_endpoint_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VpcEndpoint: """Deserializes the VpcEndpoint from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - aws_account_id=d.get("{aws_account_id}", None), - aws_endpoint_service_id=d.get("{aws_endpoint_service_id}", None), - aws_vpc_endpoint_id=d.get("{aws_vpc_endpoint_id}", None), - gcp_vpc_endpoint_info=_from_dict(d, "{gcp_vpc_endpoint_info}", GcpVpcEndpointInfo), - region=d.get("{region}", None), - state=d.get("{state}", None), - use_case=_enum(d, "{use_case}", EndpointUseCase), - vpc_endpoint_id=d.get("{vpc_endpoint_id}", None), - vpc_endpoint_name=d.get("{vpc_endpoint_name}", None), + account_id=d.get("account_id", None), + aws_account_id=d.get("aws_account_id", None), + aws_endpoint_service_id=d.get("aws_endpoint_service_id", None), + aws_vpc_endpoint_id=d.get("aws_vpc_endpoint_id", None), + gcp_vpc_endpoint_info=_from_dict(d, "gcp_vpc_endpoint_info", GcpVpcEndpointInfo), + region=d.get("region", None), + state=d.get("state", None), + use_case=_enum(d, "use_case", EndpointUseCase), + vpc_endpoint_id=d.get("vpc_endpoint_id", None), + vpc_endpoint_name=d.get("vpc_endpoint_name", None), ) @@ -2226,83 +2224,83 @@ def as_shallow_dict(self) -> dict: """Serializes the Workspace into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.azure_workspace_info: - body["{azure_workspace_info}"] = self.azure_workspace_info + body["azure_workspace_info"] = self.azure_workspace_info if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.cloud_resource_container: - body["{cloud_resource_container}"] = self.cloud_resource_container + body["cloud_resource_container"] = self.cloud_resource_container if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.credentials_id is not None: - body["{credentials_id}"] = self.credentials_id + body["credentials_id"] = self.credentials_id if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags if self.deployment_name is not None: - body["{deployment_name}"] = self.deployment_name + body["deployment_name"] = self.deployment_name if self.external_customer_info: - body["{external_customer_info}"] = self.external_customer_info + body["external_customer_info"] = self.external_customer_info if self.gcp_managed_network_config: - body["{gcp_managed_network_config}"] = self.gcp_managed_network_config + body["gcp_managed_network_config"] = self.gcp_managed_network_config if self.gke_config: - body["{gke_config}"] = self.gke_config + body["gke_config"] = self.gke_config if self.is_no_public_ip_enabled is not None: - body["{is_no_public_ip_enabled}"] = self.is_no_public_ip_enabled + body["is_no_public_ip_enabled"] = self.is_no_public_ip_enabled if self.location is not None: - body["{location}"] = self.location + body["location"] = self.location if self.managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = self.managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = self.managed_services_customer_managed_key_id if self.network_id is not None: - body["{network_id}"] = self.network_id + body["network_id"] = self.network_id if self.pricing_tier is not None: - body["{pricing_tier}"] = self.pricing_tier + body["pricing_tier"] = self.pricing_tier if self.private_access_settings_id is not None: - body["{private_access_settings_id}"] = self.private_access_settings_id + body["private_access_settings_id"] = self.private_access_settings_id if self.storage_configuration_id is not None: - body["{storage_configuration_id}"] = self.storage_configuration_id + body["storage_configuration_id"] = self.storage_configuration_id if self.storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = self.storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = self.storage_customer_managed_key_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id if self.workspace_name is not None: - body["{workspace_name}"] = self.workspace_name + body["workspace_name"] = self.workspace_name if self.workspace_status is not None: - body["{workspace_status}"] = self.workspace_status + body["workspace_status"] = self.workspace_status if self.workspace_status_message is not None: - body["{workspace_status_message}"] = self.workspace_status_message + body["workspace_status_message"] = self.workspace_status_message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Workspace: """Deserializes the Workspace from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - aws_region=d.get("{aws_region}", None), - azure_workspace_info=_from_dict(d, "{azure_workspace_info}", AzureWorkspaceInfo), - cloud=d.get("{cloud}", None), - cloud_resource_container=_from_dict(d, "{cloud_resource_container}", CloudResourceContainer), - creation_time=d.get("{creation_time}", None), - credentials_id=d.get("{credentials_id}", None), - custom_tags=d.get("{custom_tags}", None), - deployment_name=d.get("{deployment_name}", None), - external_customer_info=_from_dict(d, "{external_customer_info}", ExternalCustomerInfo), - gcp_managed_network_config=_from_dict(d, "{gcp_managed_network_config}", GcpManagedNetworkConfig), - gke_config=_from_dict(d, "{gke_config}", GkeConfig), - is_no_public_ip_enabled=d.get("{is_no_public_ip_enabled}", None), - location=d.get("{location}", None), - managed_services_customer_managed_key_id=d.get("{managed_services_customer_managed_key_id}", None), - network_id=d.get("{network_id}", None), - pricing_tier=_enum(d, "{pricing_tier}", PricingTier), - private_access_settings_id=d.get("{private_access_settings_id}", None), - storage_configuration_id=d.get("{storage_configuration_id}", None), - storage_customer_managed_key_id=d.get("{storage_customer_managed_key_id}", None), - workspace_id=d.get("{workspace_id}", None), - workspace_name=d.get("{workspace_name}", None), - workspace_status=_enum(d, "{workspace_status}", WorkspaceStatus), - workspace_status_message=d.get("{workspace_status_message}", None), + account_id=d.get("account_id", None), + aws_region=d.get("aws_region", None), + azure_workspace_info=_from_dict(d, "azure_workspace_info", AzureWorkspaceInfo), + cloud=d.get("cloud", None), + cloud_resource_container=_from_dict(d, "cloud_resource_container", CloudResourceContainer), + creation_time=d.get("creation_time", None), + credentials_id=d.get("credentials_id", None), + custom_tags=d.get("custom_tags", None), + deployment_name=d.get("deployment_name", None), + external_customer_info=_from_dict(d, "external_customer_info", ExternalCustomerInfo), + gcp_managed_network_config=_from_dict(d, "gcp_managed_network_config", GcpManagedNetworkConfig), + gke_config=_from_dict(d, "gke_config", GkeConfig), + is_no_public_ip_enabled=d.get("is_no_public_ip_enabled", None), + location=d.get("location", None), + managed_services_customer_managed_key_id=d.get("managed_services_customer_managed_key_id", None), + network_id=d.get("network_id", None), + pricing_tier=_enum(d, "pricing_tier", PricingTier), + private_access_settings_id=d.get("private_access_settings_id", None), + storage_configuration_id=d.get("storage_configuration_id", None), + storage_customer_managed_key_id=d.get("storage_customer_managed_key_id", None), + workspace_id=d.get("workspace_id", None), + workspace_name=d.get("workspace_name", None), + workspace_status=_enum(d, "workspace_status", WorkspaceStatus), + workspace_status_message=d.get("workspace_status_message", None), ) @@ -2351,9 +2349,9 @@ def create(self, credentials_name: str, aws_credentials: CreateCredentialAwsCred """ body = {} if aws_credentials is not None: - body["{aws_credentials}"] = aws_credentials.as_dict() + body["aws_credentials"] = aws_credentials.as_dict() if credentials_name is not None: - body["{credentials_name}"] = credentials_name + body["credentials_name"] = credentials_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2468,11 +2466,11 @@ def create( """ body = {} if aws_key_info is not None: - body["{aws_key_info}"] = aws_key_info.as_dict() + body["aws_key_info"] = aws_key_info.as_dict() if gcp_key_info is not None: - body["{gcp_key_info}"] = gcp_key_info.as_dict() + body["gcp_key_info"] = gcp_key_info.as_dict() if use_cases is not None: - body["{use_cases}"] = [v.value for v in use_cases] + body["use_cases"] = [v.value for v in use_cases] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2609,17 +2607,17 @@ def create( """ body = {} if gcp_network_info is not None: - body["{gcp_network_info}"] = gcp_network_info.as_dict() + body["gcp_network_info"] = gcp_network_info.as_dict() if network_name is not None: - body["{network_name}"] = network_name + body["network_name"] = network_name if security_group_ids is not None: - body["{security_group_ids}"] = [v for v in security_group_ids] + body["security_group_ids"] = [v for v in security_group_ids] if subnet_ids is not None: - body["{subnet_ids}"] = [v for v in subnet_ids] + body["subnet_ids"] = [v for v in subnet_ids] if vpc_endpoints is not None: - body["{vpc_endpoints}"] = vpc_endpoints.as_dict() + body["vpc_endpoints"] = vpc_endpoints.as_dict() if vpc_id is not None: - body["{vpc_id}"] = vpc_id + body["vpc_id"] = vpc_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2746,15 +2744,15 @@ def create( """ body = {} if allowed_vpc_endpoint_ids is not None: - body["{allowed_vpc_endpoint_ids}"] = [v for v in allowed_vpc_endpoint_ids] + body["allowed_vpc_endpoint_ids"] = [v for v in allowed_vpc_endpoint_ids] if private_access_level is not None: - body["{private_access_level}"] = private_access_level.value + body["private_access_level"] = private_access_level.value if private_access_settings_name is not None: - body["{private_access_settings_name}"] = private_access_settings_name + body["private_access_settings_name"] = private_access_settings_name if public_access_enabled is not None: - body["{public_access_enabled}"] = public_access_enabled + body["public_access_enabled"] = public_access_enabled if region is not None: - body["{region}"] = region + body["region"] = region headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2899,15 +2897,15 @@ def replace( """ body = {} if allowed_vpc_endpoint_ids is not None: - body["{allowed_vpc_endpoint_ids}"] = [v for v in allowed_vpc_endpoint_ids] + body["allowed_vpc_endpoint_ids"] = [v for v in allowed_vpc_endpoint_ids] if private_access_level is not None: - body["{private_access_level}"] = private_access_level.value + body["private_access_level"] = private_access_level.value if private_access_settings_name is not None: - body["{private_access_settings_name}"] = private_access_settings_name + body["private_access_settings_name"] = private_access_settings_name if public_access_enabled is not None: - body["{public_access_enabled}"] = public_access_enabled + body["public_access_enabled"] = public_access_enabled if region is not None: - body["{region}"] = region + body["region"] = region headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2952,9 +2950,9 @@ def create(self, storage_configuration_name: str, root_bucket_info: RootBucketIn """ body = {} if root_bucket_info is not None: - body["{root_bucket_info}"] = root_bucket_info.as_dict() + body["root_bucket_info"] = root_bucket_info.as_dict() if storage_configuration_name is not None: - body["{storage_configuration_name}"] = storage_configuration_name + body["storage_configuration_name"] = storage_configuration_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3067,13 +3065,13 @@ def create( """ body = {} if aws_vpc_endpoint_id is not None: - body["{aws_vpc_endpoint_id}"] = aws_vpc_endpoint_id + body["aws_vpc_endpoint_id"] = aws_vpc_endpoint_id if gcp_vpc_endpoint_info is not None: - body["{gcp_vpc_endpoint_info}"] = gcp_vpc_endpoint_info.as_dict() + body["gcp_vpc_endpoint_info"] = gcp_vpc_endpoint_info.as_dict() if region is not None: - body["{region}"] = region + body["region"] = region if vpc_endpoint_name is not None: - body["{vpc_endpoint_name}"] = vpc_endpoint_name + body["vpc_endpoint_name"] = vpc_endpoint_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3292,39 +3290,39 @@ def create( """ body = {} if aws_region is not None: - body["{aws_region}"] = aws_region + body["aws_region"] = aws_region if cloud is not None: - body["{cloud}"] = cloud + body["cloud"] = cloud if cloud_resource_container is not None: - body["{cloud_resource_container}"] = cloud_resource_container.as_dict() + body["cloud_resource_container"] = cloud_resource_container.as_dict() if credentials_id is not None: - body["{credentials_id}"] = credentials_id + body["credentials_id"] = credentials_id if custom_tags is not None: - body["{custom_tags}"] = custom_tags + body["custom_tags"] = custom_tags if deployment_name is not None: - body["{deployment_name}"] = deployment_name + body["deployment_name"] = deployment_name if gcp_managed_network_config is not None: - body["{gcp_managed_network_config}"] = gcp_managed_network_config.as_dict() + body["gcp_managed_network_config"] = gcp_managed_network_config.as_dict() if gke_config is not None: - body["{gke_config}"] = gke_config.as_dict() + body["gke_config"] = gke_config.as_dict() if is_no_public_ip_enabled is not None: - body["{is_no_public_ip_enabled}"] = is_no_public_ip_enabled + body["is_no_public_ip_enabled"] = is_no_public_ip_enabled if location is not None: - body["{location}"] = location + body["location"] = location if managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = managed_services_customer_managed_key_id if network_id is not None: - body["{network_id}"] = network_id + body["network_id"] = network_id if pricing_tier is not None: - body["{pricing_tier}"] = pricing_tier.value + body["pricing_tier"] = pricing_tier.value if private_access_settings_id is not None: - body["{private_access_settings_id}"] = private_access_settings_id + body["private_access_settings_id"] = private_access_settings_id if storage_configuration_id is not None: - body["{storage_configuration_id}"] = storage_configuration_id + body["storage_configuration_id"] = storage_configuration_id if storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = storage_customer_managed_key_id if workspace_name is not None: - body["{workspace_name}"] = workspace_name + body["workspace_name"] = workspace_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3336,7 +3334,7 @@ def create( return Wait( self.WaitGetWorkspaceRunning, response=Workspace.from_dict(op_response), - workspace_id=op_response["{workspace_id}"], + workspace_id=op_response["workspace_id"], ) def create_and_wait( @@ -3598,23 +3596,23 @@ def update( """ body = {} if aws_region is not None: - body["{aws_region}"] = aws_region + body["aws_region"] = aws_region if credentials_id is not None: - body["{credentials_id}"] = credentials_id + body["credentials_id"] = credentials_id if custom_tags is not None: - body["{custom_tags}"] = custom_tags + body["custom_tags"] = custom_tags if managed_services_customer_managed_key_id is not None: - body["{managed_services_customer_managed_key_id}"] = managed_services_customer_managed_key_id + body["managed_services_customer_managed_key_id"] = managed_services_customer_managed_key_id if network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = network_connectivity_config_id + body["network_connectivity_config_id"] = network_connectivity_config_id if network_id is not None: - body["{network_id}"] = network_id + body["network_id"] = network_id if private_access_settings_id is not None: - body["{private_access_settings_id}"] = private_access_settings_id + body["private_access_settings_id"] = private_access_settings_id if storage_configuration_id is not None: - body["{storage_configuration_id}"] = storage_configuration_id + body["storage_configuration_id"] = storage_configuration_id if storage_customer_managed_key_id is not None: - body["{storage_customer_managed_key_id}"] = storage_customer_managed_key_id + body["storage_customer_managed_key_id"] = storage_customer_managed_key_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/serving/v2/impl.py b/databricks/sdk/serving/v2/impl.py index c4303f52c..191e7b6ec 100755 --- a/databricks/sdk/serving/v2/impl.py +++ b/databricks/sdk/serving/v2/impl.py @@ -40,17 +40,17 @@ def as_shallow_dict(self) -> dict: """Serializes the Ai21LabsConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.ai21labs_api_key is not None: - body["{ai21labs_api_key}"] = self.ai21labs_api_key + body["ai21labs_api_key"] = self.ai21labs_api_key if self.ai21labs_api_key_plaintext is not None: - body["{ai21labs_api_key_plaintext}"] = self.ai21labs_api_key_plaintext + body["ai21labs_api_key_plaintext"] = self.ai21labs_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Ai21LabsConfig: """Deserializes the Ai21LabsConfig from a dictionary.""" return cls( - ai21labs_api_key=d.get("{ai21labs_api_key}", None), - ai21labs_api_key_plaintext=d.get("{ai21labs_api_key_plaintext}", None), + ai21labs_api_key=d.get("ai21labs_api_key", None), + ai21labs_api_key_plaintext=d.get("ai21labs_api_key_plaintext", None), ) @@ -94,26 +94,26 @@ def as_shallow_dict(self) -> dict: """Serializes the AiGatewayConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.fallback_config: - body["{fallback_config}"] = self.fallback_config + body["fallback_config"] = self.fallback_config if self.guardrails: - body["{guardrails}"] = self.guardrails + body["guardrails"] = self.guardrails if self.inference_table_config: - body["{inference_table_config}"] = self.inference_table_config + body["inference_table_config"] = self.inference_table_config if self.rate_limits: - body["{rate_limits}"] = self.rate_limits + body["rate_limits"] = self.rate_limits if self.usage_tracking_config: - body["{usage_tracking_config}"] = self.usage_tracking_config + body["usage_tracking_config"] = self.usage_tracking_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayConfig: """Deserializes the AiGatewayConfig from a dictionary.""" return cls( - fallback_config=_from_dict(d, "{fallback_config}", FallbackConfig), - guardrails=_from_dict(d, "{guardrails}", AiGatewayGuardrails), - inference_table_config=_from_dict(d, "{inference_table_config}", AiGatewayInferenceTableConfig), - rate_limits=_repeated_dict(d, "{rate_limits}", AiGatewayRateLimit), - usage_tracking_config=_from_dict(d, "{usage_tracking_config}", AiGatewayUsageTrackingConfig), + fallback_config=_from_dict(d, "fallback_config", FallbackConfig), + guardrails=_from_dict(d, "guardrails", AiGatewayGuardrails), + inference_table_config=_from_dict(d, "inference_table_config", AiGatewayInferenceTableConfig), + rate_limits=_repeated_dict(d, "rate_limits", AiGatewayRateLimit), + usage_tracking_config=_from_dict(d, "usage_tracking_config", AiGatewayUsageTrackingConfig), ) @@ -150,23 +150,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AiGatewayGuardrailParameters into a shallow dictionary of its immediate attributes.""" body = {} if self.invalid_keywords: - body["{invalid_keywords}"] = self.invalid_keywords + body["invalid_keywords"] = self.invalid_keywords if self.pii: - body["{pii}"] = self.pii + body["pii"] = self.pii if self.safety is not None: - body["{safety}"] = self.safety + body["safety"] = self.safety if self.valid_topics: - body["{valid_topics}"] = self.valid_topics + body["valid_topics"] = self.valid_topics return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayGuardrailParameters: """Deserializes the AiGatewayGuardrailParameters from a dictionary.""" return cls( - invalid_keywords=d.get("{invalid_keywords}", None), - pii=_from_dict(d, "{pii}", AiGatewayGuardrailPiiBehavior), - safety=d.get("{safety}", None), - valid_topics=d.get("{valid_topics}", None), + invalid_keywords=d.get("invalid_keywords", None), + pii=_from_dict(d, "pii", AiGatewayGuardrailPiiBehavior), + safety=d.get("safety", None), + valid_topics=d.get("valid_topics", None), ) @@ -186,13 +186,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AiGatewayGuardrailPiiBehavior into a shallow dictionary of its immediate attributes.""" body = {} if self.behavior is not None: - body["{behavior}"] = self.behavior + body["behavior"] = self.behavior return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayGuardrailPiiBehavior: """Deserializes the AiGatewayGuardrailPiiBehavior from a dictionary.""" - return cls(behavior=_enum(d, "{behavior}", AiGatewayGuardrailPiiBehaviorBehavior)) + return cls(behavior=_enum(d, "behavior", AiGatewayGuardrailPiiBehaviorBehavior)) class AiGatewayGuardrailPiiBehaviorBehavior(Enum): @@ -222,17 +222,17 @@ def as_shallow_dict(self) -> dict: """Serializes the AiGatewayGuardrails into a shallow dictionary of its immediate attributes.""" body = {} if self.input: - body["{input}"] = self.input + body["input"] = self.input if self.output: - body["{output}"] = self.output + body["output"] = self.output return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayGuardrails: """Deserializes the AiGatewayGuardrails from a dictionary.""" return cls( - input=_from_dict(d, "{input}", AiGatewayGuardrailParameters), - output=_from_dict(d, "{output}", AiGatewayGuardrailParameters), + input=_from_dict(d, "input", AiGatewayGuardrailParameters), + output=_from_dict(d, "output", AiGatewayGuardrailParameters), ) @@ -270,23 +270,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AiGatewayInferenceTableConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.table_name_prefix is not None: - body["{table_name_prefix}"] = self.table_name_prefix + body["table_name_prefix"] = self.table_name_prefix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayInferenceTableConfig: """Deserializes the AiGatewayInferenceTableConfig from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - enabled=d.get("{enabled}", None), - schema_name=d.get("{schema_name}", None), - table_name_prefix=d.get("{table_name_prefix}", None), + catalog_name=d.get("catalog_name", None), + enabled=d.get("enabled", None), + schema_name=d.get("schema_name", None), + table_name_prefix=d.get("table_name_prefix", None), ) @@ -317,20 +317,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AiGatewayRateLimit into a shallow dictionary of its immediate attributes.""" body = {} if self.calls is not None: - body["{calls}"] = self.calls + body["calls"] = self.calls if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.renewal_period is not None: - body["{renewal_period}"] = self.renewal_period + body["renewal_period"] = self.renewal_period return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayRateLimit: """Deserializes the AiGatewayRateLimit from a dictionary.""" return cls( - calls=d.get("{calls}", None), - key=_enum(d, "{key}", AiGatewayRateLimitKey), - renewal_period=_enum(d, "{renewal_period}", AiGatewayRateLimitRenewalPeriod), + calls=d.get("calls", None), + key=_enum(d, "key", AiGatewayRateLimitKey), + renewal_period=_enum(d, "renewal_period", AiGatewayRateLimitRenewalPeriod), ) @@ -361,13 +361,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AiGatewayUsageTrackingConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AiGatewayUsageTrackingConfig: """Deserializes the AiGatewayUsageTrackingConfig from a dictionary.""" - return cls(enabled=d.get("{enabled}", None)) + return cls(enabled=d.get("enabled", None)) @dataclass @@ -432,32 +432,32 @@ def as_shallow_dict(self) -> dict: """Serializes the AmazonBedrockConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_access_key_id is not None: - body["{aws_access_key_id}"] = self.aws_access_key_id + body["aws_access_key_id"] = self.aws_access_key_id if self.aws_access_key_id_plaintext is not None: - body["{aws_access_key_id_plaintext}"] = self.aws_access_key_id_plaintext + body["aws_access_key_id_plaintext"] = self.aws_access_key_id_plaintext if self.aws_region is not None: - body["{aws_region}"] = self.aws_region + body["aws_region"] = self.aws_region if self.aws_secret_access_key is not None: - body["{aws_secret_access_key}"] = self.aws_secret_access_key + body["aws_secret_access_key"] = self.aws_secret_access_key if self.aws_secret_access_key_plaintext is not None: - body["{aws_secret_access_key_plaintext}"] = self.aws_secret_access_key_plaintext + body["aws_secret_access_key_plaintext"] = self.aws_secret_access_key_plaintext if self.bedrock_provider is not None: - body["{bedrock_provider}"] = self.bedrock_provider + body["bedrock_provider"] = self.bedrock_provider if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AmazonBedrockConfig: """Deserializes the AmazonBedrockConfig from a dictionary.""" return cls( - aws_access_key_id=d.get("{aws_access_key_id}", None), - aws_access_key_id_plaintext=d.get("{aws_access_key_id_plaintext}", None), - aws_region=d.get("{aws_region}", None), - aws_secret_access_key=d.get("{aws_secret_access_key}", None), - aws_secret_access_key_plaintext=d.get("{aws_secret_access_key_plaintext}", None), - bedrock_provider=_enum(d, "{bedrock_provider}", AmazonBedrockConfigBedrockProvider), - instance_profile_arn=d.get("{instance_profile_arn}", None), + aws_access_key_id=d.get("aws_access_key_id", None), + aws_access_key_id_plaintext=d.get("aws_access_key_id_plaintext", None), + aws_region=d.get("aws_region", None), + aws_secret_access_key=d.get("aws_secret_access_key", None), + aws_secret_access_key_plaintext=d.get("aws_secret_access_key_plaintext", None), + bedrock_provider=_enum(d, "bedrock_provider", AmazonBedrockConfigBedrockProvider), + instance_profile_arn=d.get("instance_profile_arn", None), ) @@ -494,17 +494,17 @@ def as_shallow_dict(self) -> dict: """Serializes the AnthropicConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.anthropic_api_key is not None: - body["{anthropic_api_key}"] = self.anthropic_api_key + body["anthropic_api_key"] = self.anthropic_api_key if self.anthropic_api_key_plaintext is not None: - body["{anthropic_api_key_plaintext}"] = self.anthropic_api_key_plaintext + body["anthropic_api_key_plaintext"] = self.anthropic_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AnthropicConfig: """Deserializes the AnthropicConfig from a dictionary.""" return cls( - anthropic_api_key=d.get("{anthropic_api_key}", None), - anthropic_api_key_plaintext=d.get("{anthropic_api_key_plaintext}", None), + anthropic_api_key=d.get("anthropic_api_key", None), + anthropic_api_key_plaintext=d.get("anthropic_api_key_plaintext", None), ) @@ -536,19 +536,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ApiKeyAuth into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value if self.value_plaintext is not None: - body["{value_plaintext}"] = self.value_plaintext + body["value_plaintext"] = self.value_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ApiKeyAuth: """Deserializes the ApiKeyAuth from a dictionary.""" - return cls( - key=d.get("{key}", None), value=d.get("{value}", None), value_plaintext=d.get("{value_plaintext}", None) - ) + return cls(key=d.get("key", None), value=d.get("value", None), value_plaintext=d.get("value_plaintext", None)) @dataclass @@ -585,23 +583,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AutoCaptureConfigInput into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.table_name_prefix is not None: - body["{table_name_prefix}"] = self.table_name_prefix + body["table_name_prefix"] = self.table_name_prefix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoCaptureConfigInput: """Deserializes the AutoCaptureConfigInput from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - enabled=d.get("{enabled}", None), - schema_name=d.get("{schema_name}", None), - table_name_prefix=d.get("{table_name_prefix}", None), + catalog_name=d.get("catalog_name", None), + enabled=d.get("enabled", None), + schema_name=d.get("schema_name", None), + table_name_prefix=d.get("table_name_prefix", None), ) @@ -643,26 +641,26 @@ def as_shallow_dict(self) -> dict: """Serializes the AutoCaptureConfigOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog_name is not None: - body["{catalog_name}"] = self.catalog_name + body["catalog_name"] = self.catalog_name if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.table_name_prefix is not None: - body["{table_name_prefix}"] = self.table_name_prefix + body["table_name_prefix"] = self.table_name_prefix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoCaptureConfigOutput: """Deserializes the AutoCaptureConfigOutput from a dictionary.""" return cls( - catalog_name=d.get("{catalog_name}", None), - enabled=d.get("{enabled}", None), - schema_name=d.get("{schema_name}", None), - state=_from_dict(d, "{state}", AutoCaptureState), - table_name_prefix=d.get("{table_name_prefix}", None), + catalog_name=d.get("catalog_name", None), + enabled=d.get("enabled", None), + schema_name=d.get("schema_name", None), + state=_from_dict(d, "state", AutoCaptureState), + table_name_prefix=d.get("table_name_prefix", None), ) @@ -681,13 +679,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AutoCaptureState into a shallow dictionary of its immediate attributes.""" body = {} if self.payload_table: - body["{payload_table}"] = self.payload_table + body["payload_table"] = self.payload_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AutoCaptureState: """Deserializes the AutoCaptureState from a dictionary.""" - return cls(payload_table=_from_dict(d, "{payload_table}", PayloadTable)) + return cls(payload_table=_from_dict(d, "payload_table", PayloadTable)) @dataclass @@ -713,15 +711,15 @@ def as_shallow_dict(self) -> dict: """Serializes the BearerTokenAuth into a shallow dictionary of its immediate attributes.""" body = {} if self.token is not None: - body["{token}"] = self.token + body["token"] = self.token if self.token_plaintext is not None: - body["{token_plaintext}"] = self.token_plaintext + body["token_plaintext"] = self.token_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BearerTokenAuth: """Deserializes the BearerTokenAuth from a dictionary.""" - return cls(token=d.get("{token}", None), token_plaintext=d.get("{token_plaintext}", None)) + return cls(token=d.get("token", None), token_plaintext=d.get("token_plaintext", None)) @dataclass @@ -740,13 +738,13 @@ def as_shallow_dict(self) -> dict: """Serializes the BuildLogsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.logs is not None: - body["{logs}"] = self.logs + body["logs"] = self.logs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BuildLogsResponse: """Deserializes the BuildLogsResponse from a dictionary.""" - return cls(logs=d.get("{logs}", None)) + return cls(logs=d.get("logs", None)) @dataclass @@ -770,15 +768,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ChatMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.role is not None: - body["{role}"] = self.role + body["role"] = self.role return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ChatMessage: """Deserializes the ChatMessage from a dictionary.""" - return cls(content=d.get("{content}", None), role=_enum(d, "{role}", ChatMessageRole)) + return cls(content=d.get("content", None), role=_enum(d, "role", ChatMessageRole)) class ChatMessageRole(Enum): @@ -820,20 +818,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CohereConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.cohere_api_base is not None: - body["{cohere_api_base}"] = self.cohere_api_base + body["cohere_api_base"] = self.cohere_api_base if self.cohere_api_key is not None: - body["{cohere_api_key}"] = self.cohere_api_key + body["cohere_api_key"] = self.cohere_api_key if self.cohere_api_key_plaintext is not None: - body["{cohere_api_key_plaintext}"] = self.cohere_api_key_plaintext + body["cohere_api_key_plaintext"] = self.cohere_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CohereConfig: """Deserializes the CohereConfig from a dictionary.""" return cls( - cohere_api_base=d.get("{cohere_api_base}", None), - cohere_api_key=d.get("{cohere_api_key}", None), - cohere_api_key_plaintext=d.get("{cohere_api_key_plaintext}", None), + cohere_api_base=d.get("cohere_api_base", None), + cohere_api_key=d.get("cohere_api_key", None), + cohere_api_key_plaintext=d.get("cohere_api_key_plaintext", None), ) @@ -886,32 +884,32 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateServingEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.ai_gateway: - body["{ai_gateway}"] = self.ai_gateway + body["ai_gateway"] = self.ai_gateway if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.config: - body["{config}"] = self.config + body["config"] = self.config if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rate_limits: - body["{rate_limits}"] = self.rate_limits + body["rate_limits"] = self.rate_limits if self.route_optimized is not None: - body["{route_optimized}"] = self.route_optimized + body["route_optimized"] = self.route_optimized if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateServingEndpoint: """Deserializes the CreateServingEndpoint from a dictionary.""" return cls( - ai_gateway=_from_dict(d, "{ai_gateway}", AiGatewayConfig), - budget_policy_id=d.get("{budget_policy_id}", None), - config=_from_dict(d, "{config}", EndpointCoreConfigInput), - name=d.get("{name}", None), - rate_limits=_repeated_dict(d, "{rate_limits}", RateLimit), - route_optimized=d.get("{route_optimized}", None), - tags=_repeated_dict(d, "{tags}", EndpointTag), + ai_gateway=_from_dict(d, "ai_gateway", AiGatewayConfig), + budget_policy_id=d.get("budget_policy_id", None), + config=_from_dict(d, "config", EndpointCoreConfigInput), + name=d.get("name", None), + rate_limits=_repeated_dict(d, "rate_limits", RateLimit), + route_optimized=d.get("route_optimized", None), + tags=_repeated_dict(d, "tags", EndpointTag), ) @@ -945,20 +943,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CustomProviderConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.api_key_auth: - body["{api_key_auth}"] = self.api_key_auth + body["api_key_auth"] = self.api_key_auth if self.bearer_token_auth: - body["{bearer_token_auth}"] = self.bearer_token_auth + body["bearer_token_auth"] = self.bearer_token_auth if self.custom_provider_url is not None: - body["{custom_provider_url}"] = self.custom_provider_url + body["custom_provider_url"] = self.custom_provider_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CustomProviderConfig: """Deserializes the CustomProviderConfig from a dictionary.""" return cls( - api_key_auth=_from_dict(d, "{api_key_auth}", ApiKeyAuth), - bearer_token_auth=_from_dict(d, "{bearer_token_auth}", BearerTokenAuth), - custom_provider_url=d.get("{custom_provider_url}", None), + api_key_auth=_from_dict(d, "api_key_auth", ApiKeyAuth), + bearer_token_auth=_from_dict(d, "bearer_token_auth", BearerTokenAuth), + custom_provider_url=d.get("custom_provider_url", None), ) @@ -985,17 +983,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DataPlaneInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.authorization_details is not None: - body["{authorization_details}"] = self.authorization_details + body["authorization_details"] = self.authorization_details if self.endpoint_url is not None: - body["{endpoint_url}"] = self.endpoint_url + body["endpoint_url"] = self.endpoint_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataPlaneInfo: """Deserializes the DataPlaneInfo from a dictionary.""" - return cls( - authorization_details=d.get("{authorization_details}", None), endpoint_url=d.get("{endpoint_url}", None) - ) + return cls(authorization_details=d.get("authorization_details", None), endpoint_url=d.get("endpoint_url", None)) @dataclass @@ -1033,20 +1029,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DatabricksModelServingConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.databricks_api_token is not None: - body["{databricks_api_token}"] = self.databricks_api_token + body["databricks_api_token"] = self.databricks_api_token if self.databricks_api_token_plaintext is not None: - body["{databricks_api_token_plaintext}"] = self.databricks_api_token_plaintext + body["databricks_api_token_plaintext"] = self.databricks_api_token_plaintext if self.databricks_workspace_url is not None: - body["{databricks_workspace_url}"] = self.databricks_workspace_url + body["databricks_workspace_url"] = self.databricks_workspace_url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DatabricksModelServingConfig: """Deserializes the DatabricksModelServingConfig from a dictionary.""" return cls( - databricks_api_token=d.get("{databricks_api_token}", None), - databricks_api_token_plaintext=d.get("{databricks_api_token_plaintext}", None), - databricks_workspace_url=d.get("{databricks_workspace_url}", None), + databricks_api_token=d.get("databricks_api_token", None), + databricks_api_token_plaintext=d.get("databricks_api_token_plaintext", None), + databricks_workspace_url=d.get("databricks_workspace_url", None), ) @@ -1073,17 +1069,17 @@ def as_shallow_dict(self) -> dict: """Serializes the DataframeSplitInput into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns if self.data: - body["{data}"] = self.data + body["data"] = self.data if self.index: - body["{index}"] = self.index + body["index"] = self.index return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataframeSplitInput: """Deserializes the DataframeSplitInput from a dictionary.""" - return cls(columns=d.get("{columns}", None), data=d.get("{data}", None), index=d.get("{index}", None)) + return cls(columns=d.get("columns", None), data=d.get("data", None), index=d.get("index", None)) @dataclass @@ -1129,20 +1125,20 @@ def as_shallow_dict(self) -> dict: """Serializes the EmbeddingsV1ResponseEmbeddingElement into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding: - body["{embedding}"] = self.embedding + body["embedding"] = self.embedding if self.index is not None: - body["{index}"] = self.index + body["index"] = self.index if self.object is not None: - body["{object}"] = self.object + body["object"] = self.object return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmbeddingsV1ResponseEmbeddingElement: """Deserializes the EmbeddingsV1ResponseEmbeddingElement from a dictionary.""" return cls( - embedding=d.get("{embedding}", None), - index=d.get("{index}", None), - object=_enum(d, "{object}", EmbeddingsV1ResponseEmbeddingElementObject), + embedding=d.get("embedding", None), + index=d.get("index", None), + object=_enum(d, "object", EmbeddingsV1ResponseEmbeddingElementObject), ) @@ -1192,26 +1188,26 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointCoreConfigInput into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_capture_config: - body["{auto_capture_config}"] = self.auto_capture_config + body["auto_capture_config"] = self.auto_capture_config if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.served_entities: - body["{served_entities}"] = self.served_entities + body["served_entities"] = self.served_entities if self.served_models: - body["{served_models}"] = self.served_models + body["served_models"] = self.served_models if self.traffic_config: - body["{traffic_config}"] = self.traffic_config + body["traffic_config"] = self.traffic_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointCoreConfigInput: """Deserializes the EndpointCoreConfigInput from a dictionary.""" return cls( - auto_capture_config=_from_dict(d, "{auto_capture_config}", AutoCaptureConfigInput), - name=d.get("{name}", None), - served_entities=_repeated_dict(d, "{served_entities}", ServedEntityInput), - served_models=_repeated_dict(d, "{served_models}", ServedModelInput), - traffic_config=_from_dict(d, "{traffic_config}", TrafficConfig), + auto_capture_config=_from_dict(d, "auto_capture_config", AutoCaptureConfigInput), + name=d.get("name", None), + served_entities=_repeated_dict(d, "served_entities", ServedEntityInput), + served_models=_repeated_dict(d, "served_models", ServedModelInput), + traffic_config=_from_dict(d, "traffic_config", TrafficConfig), ) @@ -1255,26 +1251,26 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointCoreConfigOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_capture_config: - body["{auto_capture_config}"] = self.auto_capture_config + body["auto_capture_config"] = self.auto_capture_config if self.config_version is not None: - body["{config_version}"] = self.config_version + body["config_version"] = self.config_version if self.served_entities: - body["{served_entities}"] = self.served_entities + body["served_entities"] = self.served_entities if self.served_models: - body["{served_models}"] = self.served_models + body["served_models"] = self.served_models if self.traffic_config: - body["{traffic_config}"] = self.traffic_config + body["traffic_config"] = self.traffic_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointCoreConfigOutput: """Deserializes the EndpointCoreConfigOutput from a dictionary.""" return cls( - auto_capture_config=_from_dict(d, "{auto_capture_config}", AutoCaptureConfigOutput), - config_version=d.get("{config_version}", None), - served_entities=_repeated_dict(d, "{served_entities}", ServedEntityOutput), - served_models=_repeated_dict(d, "{served_models}", ServedModelOutput), - traffic_config=_from_dict(d, "{traffic_config}", TrafficConfig), + auto_capture_config=_from_dict(d, "auto_capture_config", AutoCaptureConfigOutput), + config_version=d.get("config_version", None), + served_entities=_repeated_dict(d, "served_entities", ServedEntityOutput), + served_models=_repeated_dict(d, "served_models", ServedModelOutput), + traffic_config=_from_dict(d, "traffic_config", TrafficConfig), ) @@ -1300,17 +1296,17 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointCoreConfigSummary into a shallow dictionary of its immediate attributes.""" body = {} if self.served_entities: - body["{served_entities}"] = self.served_entities + body["served_entities"] = self.served_entities if self.served_models: - body["{served_models}"] = self.served_models + body["served_models"] = self.served_models return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointCoreConfigSummary: """Deserializes the EndpointCoreConfigSummary from a dictionary.""" return cls( - served_entities=_repeated_dict(d, "{served_entities}", ServedEntitySpec), - served_models=_repeated_dict(d, "{served_models}", ServedModelSpec), + served_entities=_repeated_dict(d, "served_entities", ServedEntitySpec), + served_models=_repeated_dict(d, "served_models", ServedModelSpec), ) @@ -1359,29 +1355,29 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointPendingConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_capture_config: - body["{auto_capture_config}"] = self.auto_capture_config + body["auto_capture_config"] = self.auto_capture_config if self.config_version is not None: - body["{config_version}"] = self.config_version + body["config_version"] = self.config_version if self.served_entities: - body["{served_entities}"] = self.served_entities + body["served_entities"] = self.served_entities if self.served_models: - body["{served_models}"] = self.served_models + body["served_models"] = self.served_models if self.start_time is not None: - body["{start_time}"] = self.start_time + body["start_time"] = self.start_time if self.traffic_config: - body["{traffic_config}"] = self.traffic_config + body["traffic_config"] = self.traffic_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointPendingConfig: """Deserializes the EndpointPendingConfig from a dictionary.""" return cls( - auto_capture_config=_from_dict(d, "{auto_capture_config}", AutoCaptureConfigOutput), - config_version=d.get("{config_version}", None), - served_entities=_repeated_dict(d, "{served_entities}", ServedEntityOutput), - served_models=_repeated_dict(d, "{served_models}", ServedModelOutput), - start_time=d.get("{start_time}", None), - traffic_config=_from_dict(d, "{traffic_config}", TrafficConfig), + auto_capture_config=_from_dict(d, "auto_capture_config", AutoCaptureConfigOutput), + config_version=d.get("config_version", None), + served_entities=_repeated_dict(d, "served_entities", ServedEntityOutput), + served_models=_repeated_dict(d, "served_models", ServedModelOutput), + start_time=d.get("start_time", None), + traffic_config=_from_dict(d, "traffic_config", TrafficConfig), ) @@ -1411,17 +1407,17 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointState into a shallow dictionary of its immediate attributes.""" body = {} if self.config_update is not None: - body["{config_update}"] = self.config_update + body["config_update"] = self.config_update if self.ready is not None: - body["{ready}"] = self.ready + body["ready"] = self.ready return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointState: """Deserializes the EndpointState from a dictionary.""" return cls( - config_update=_enum(d, "{config_update}", EndpointStateConfigUpdate), - ready=_enum(d, "{ready}", EndpointStateReady), + config_update=_enum(d, "config_update", EndpointStateConfigUpdate), + ready=_enum(d, "ready", EndpointStateReady), ) @@ -1460,15 +1456,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointTag into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTag: """Deserializes the EndpointTag from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -1486,13 +1482,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointTags into a shallow dictionary of its immediate attributes.""" body = {} if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTags: """Deserializes the EndpointTags from a dictionary.""" - return cls(tags=_repeated_dict(d, "{tags}", EndpointTag)) + return cls(tags=_repeated_dict(d, "tags", EndpointTag)) @dataclass @@ -1510,13 +1506,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ExportMetricsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExportMetricsResponse: """Deserializes the ExportMetricsResponse from a dictionary.""" - return cls(contents=d.get("{contents}", None)) + return cls(contents=d.get("contents", None)) @dataclass @@ -1563,29 +1559,29 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalFunctionRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_name is not None: - body["{connection_name}"] = self.connection_name + body["connection_name"] = self.connection_name if self.headers is not None: - body["{headers}"] = self.headers + body["headers"] = self.headers if self.json is not None: - body["{json}"] = self.json + body["json"] = self.json if self.method is not None: - body["{method}"] = self.method + body["method"] = self.method if self.params is not None: - body["{params}"] = self.params + body["params"] = self.params if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalFunctionRequest: """Deserializes the ExternalFunctionRequest from a dictionary.""" return cls( - connection_name=d.get("{connection_name}", None), - headers=d.get("{headers}", None), - json=d.get("{json}", None), - method=_enum(d, "{method}", ExternalFunctionRequestHttpMethod), - params=d.get("{params}", None), - path=d.get("{path}", None), + connection_name=d.get("connection_name", None), + headers=d.get("headers", None), + json=d.get("json", None), + method=_enum(d, "method", ExternalFunctionRequestHttpMethod), + params=d.get("params", None), + path=d.get("path", None), ) @@ -1671,49 +1667,49 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalModel into a shallow dictionary of its immediate attributes.""" body = {} if self.ai21labs_config: - body["{ai21labs_config}"] = self.ai21labs_config + body["ai21labs_config"] = self.ai21labs_config if self.amazon_bedrock_config: - body["{amazon_bedrock_config}"] = self.amazon_bedrock_config + body["amazon_bedrock_config"] = self.amazon_bedrock_config if self.anthropic_config: - body["{anthropic_config}"] = self.anthropic_config + body["anthropic_config"] = self.anthropic_config if self.cohere_config: - body["{cohere_config}"] = self.cohere_config + body["cohere_config"] = self.cohere_config if self.custom_provider_config: - body["{custom_provider_config}"] = self.custom_provider_config + body["custom_provider_config"] = self.custom_provider_config if self.databricks_model_serving_config: - body["{databricks_model_serving_config}"] = self.databricks_model_serving_config + body["databricks_model_serving_config"] = self.databricks_model_serving_config if self.google_cloud_vertex_ai_config: - body["{google_cloud_vertex_ai_config}"] = self.google_cloud_vertex_ai_config + body["google_cloud_vertex_ai_config"] = self.google_cloud_vertex_ai_config if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.openai_config: - body["{openai_config}"] = self.openai_config + body["openai_config"] = self.openai_config if self.palm_config: - body["{palm_config}"] = self.palm_config + body["palm_config"] = self.palm_config if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.task is not None: - body["{task}"] = self.task + body["task"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalModel: """Deserializes the ExternalModel from a dictionary.""" return cls( - ai21labs_config=_from_dict(d, "{ai21labs_config}", Ai21LabsConfig), - amazon_bedrock_config=_from_dict(d, "{amazon_bedrock_config}", AmazonBedrockConfig), - anthropic_config=_from_dict(d, "{anthropic_config}", AnthropicConfig), - cohere_config=_from_dict(d, "{cohere_config}", CohereConfig), - custom_provider_config=_from_dict(d, "{custom_provider_config}", CustomProviderConfig), + ai21labs_config=_from_dict(d, "ai21labs_config", Ai21LabsConfig), + amazon_bedrock_config=_from_dict(d, "amazon_bedrock_config", AmazonBedrockConfig), + anthropic_config=_from_dict(d, "anthropic_config", AnthropicConfig), + cohere_config=_from_dict(d, "cohere_config", CohereConfig), + custom_provider_config=_from_dict(d, "custom_provider_config", CustomProviderConfig), databricks_model_serving_config=_from_dict( - d, "{databricks_model_serving_config}", DatabricksModelServingConfig + d, "databricks_model_serving_config", DatabricksModelServingConfig ), - google_cloud_vertex_ai_config=_from_dict(d, "{google_cloud_vertex_ai_config}", GoogleCloudVertexAiConfig), - name=d.get("{name}", None), - openai_config=_from_dict(d, "{openai_config}", OpenAiConfig), - palm_config=_from_dict(d, "{palm_config}", PaLmConfig), - provider=_enum(d, "{provider}", ExternalModelProvider), - task=d.get("{task}", None), + google_cloud_vertex_ai_config=_from_dict(d, "google_cloud_vertex_ai_config", GoogleCloudVertexAiConfig), + name=d.get("name", None), + openai_config=_from_dict(d, "openai_config", OpenAiConfig), + palm_config=_from_dict(d, "palm_config", PaLmConfig), + provider=_enum(d, "provider", ExternalModelProvider), + task=d.get("task", None), ) @@ -1756,20 +1752,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalModelUsageElement into a shallow dictionary of its immediate attributes.""" body = {} if self.completion_tokens is not None: - body["{completion_tokens}"] = self.completion_tokens + body["completion_tokens"] = self.completion_tokens if self.prompt_tokens is not None: - body["{prompt_tokens}"] = self.prompt_tokens + body["prompt_tokens"] = self.prompt_tokens if self.total_tokens is not None: - body["{total_tokens}"] = self.total_tokens + body["total_tokens"] = self.total_tokens return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalModelUsageElement: """Deserializes the ExternalModelUsageElement from a dictionary.""" return cls( - completion_tokens=d.get("{completion_tokens}", None), - prompt_tokens=d.get("{prompt_tokens}", None), - total_tokens=d.get("{total_tokens}", None), + completion_tokens=d.get("completion_tokens", None), + prompt_tokens=d.get("prompt_tokens", None), + total_tokens=d.get("total_tokens", None), ) @@ -1793,13 +1789,13 @@ def as_shallow_dict(self) -> dict: """Serializes the FallbackConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FallbackConfig: """Deserializes the FallbackConfig from a dictionary.""" - return cls(enabled=d.get("{enabled}", None)) + return cls(enabled=d.get("enabled", None)) @dataclass @@ -1832,23 +1828,23 @@ def as_shallow_dict(self) -> dict: """Serializes the FoundationModel into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.docs is not None: - body["{docs}"] = self.docs + body["docs"] = self.docs if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FoundationModel: """Deserializes the FoundationModel from a dictionary.""" return cls( - description=d.get("{description}", None), - display_name=d.get("{display_name}", None), - docs=d.get("{docs}", None), - name=d.get("{name}", None), + description=d.get("description", None), + display_name=d.get("display_name", None), + docs=d.get("docs", None), + name=d.get("name", None), ) @@ -1867,13 +1863,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetOpenApiResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetOpenApiResponse: """Deserializes the GetOpenApiResponse from a dictionary.""" - return cls(contents=d.get("{contents}", None)) + return cls(contents=d.get("contents", None)) @dataclass @@ -1892,13 +1888,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetServingEndpointPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetServingEndpointPermissionLevelsResponse: """Deserializes the GetServingEndpointPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", ServingEndpointPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", ServingEndpointPermissionsDescription)) @dataclass @@ -1947,23 +1943,23 @@ def as_shallow_dict(self) -> dict: """Serializes the GoogleCloudVertexAiConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.private_key is not None: - body["{private_key}"] = self.private_key + body["private_key"] = self.private_key if self.private_key_plaintext is not None: - body["{private_key_plaintext}"] = self.private_key_plaintext + body["private_key_plaintext"] = self.private_key_plaintext if self.project_id is not None: - body["{project_id}"] = self.project_id + body["project_id"] = self.project_id if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GoogleCloudVertexAiConfig: """Deserializes the GoogleCloudVertexAiConfig from a dictionary.""" return cls( - private_key=d.get("{private_key}", None), - private_key_plaintext=d.get("{private_key_plaintext}", None), - project_id=d.get("{project_id}", None), - region=d.get("{region}", None), + private_key=d.get("private_key", None), + private_key_plaintext=d.get("private_key_plaintext", None), + project_id=d.get("project_id", None), + region=d.get("region", None), ) @@ -1982,13 +1978,13 @@ def as_shallow_dict(self) -> dict: """Serializes the HttpRequestResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.contents: - body["{contents}"] = self.contents + body["contents"] = self.contents return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> HttpRequestResponse: """Deserializes the HttpRequestResponse from a dictionary.""" - return cls(contents=d.get("{contents}", None)) + return cls(contents=d.get("contents", None)) @dataclass @@ -2007,13 +2003,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListEndpointsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoints: - body["{endpoints}"] = self.endpoints + body["endpoints"] = self.endpoints return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListEndpointsResponse: """Deserializes the ListEndpointsResponse from a dictionary.""" - return cls(endpoints=_repeated_dict(d, "{endpoints}", ServingEndpoint)) + return cls(endpoints=_repeated_dict(d, "endpoints", ServingEndpoint)) @dataclass @@ -2035,13 +2031,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ModelDataPlaneInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.query_info: - body["{query_info}"] = self.query_info + body["query_info"] = self.query_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ModelDataPlaneInfo: """Deserializes the ModelDataPlaneInfo from a dictionary.""" - return cls(query_info=_from_dict(d, "{query_info}", DataPlaneInfo)) + return cls(query_info=_from_dict(d, "query_info", DataPlaneInfo)) @dataclass @@ -2130,44 +2126,44 @@ def as_shallow_dict(self) -> dict: """Serializes the OpenAiConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.microsoft_entra_client_id is not None: - body["{microsoft_entra_client_id}"] = self.microsoft_entra_client_id + body["microsoft_entra_client_id"] = self.microsoft_entra_client_id if self.microsoft_entra_client_secret is not None: - body["{microsoft_entra_client_secret}"] = self.microsoft_entra_client_secret + body["microsoft_entra_client_secret"] = self.microsoft_entra_client_secret if self.microsoft_entra_client_secret_plaintext is not None: - body["{microsoft_entra_client_secret_plaintext}"] = self.microsoft_entra_client_secret_plaintext + body["microsoft_entra_client_secret_plaintext"] = self.microsoft_entra_client_secret_plaintext if self.microsoft_entra_tenant_id is not None: - body["{microsoft_entra_tenant_id}"] = self.microsoft_entra_tenant_id + body["microsoft_entra_tenant_id"] = self.microsoft_entra_tenant_id if self.openai_api_base is not None: - body["{openai_api_base}"] = self.openai_api_base + body["openai_api_base"] = self.openai_api_base if self.openai_api_key is not None: - body["{openai_api_key}"] = self.openai_api_key + body["openai_api_key"] = self.openai_api_key if self.openai_api_key_plaintext is not None: - body["{openai_api_key_plaintext}"] = self.openai_api_key_plaintext + body["openai_api_key_plaintext"] = self.openai_api_key_plaintext if self.openai_api_type is not None: - body["{openai_api_type}"] = self.openai_api_type + body["openai_api_type"] = self.openai_api_type if self.openai_api_version is not None: - body["{openai_api_version}"] = self.openai_api_version + body["openai_api_version"] = self.openai_api_version if self.openai_deployment_name is not None: - body["{openai_deployment_name}"] = self.openai_deployment_name + body["openai_deployment_name"] = self.openai_deployment_name if self.openai_organization is not None: - body["{openai_organization}"] = self.openai_organization + body["openai_organization"] = self.openai_organization return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OpenAiConfig: """Deserializes the OpenAiConfig from a dictionary.""" return cls( - microsoft_entra_client_id=d.get("{microsoft_entra_client_id}", None), - microsoft_entra_client_secret=d.get("{microsoft_entra_client_secret}", None), - microsoft_entra_client_secret_plaintext=d.get("{microsoft_entra_client_secret_plaintext}", None), - microsoft_entra_tenant_id=d.get("{microsoft_entra_tenant_id}", None), - openai_api_base=d.get("{openai_api_base}", None), - openai_api_key=d.get("{openai_api_key}", None), - openai_api_key_plaintext=d.get("{openai_api_key_plaintext}", None), - openai_api_type=d.get("{openai_api_type}", None), - openai_api_version=d.get("{openai_api_version}", None), - openai_deployment_name=d.get("{openai_deployment_name}", None), - openai_organization=d.get("{openai_organization}", None), + microsoft_entra_client_id=d.get("microsoft_entra_client_id", None), + microsoft_entra_client_secret=d.get("microsoft_entra_client_secret", None), + microsoft_entra_client_secret_plaintext=d.get("microsoft_entra_client_secret_plaintext", None), + microsoft_entra_tenant_id=d.get("microsoft_entra_tenant_id", None), + openai_api_base=d.get("openai_api_base", None), + openai_api_key=d.get("openai_api_key", None), + openai_api_key_plaintext=d.get("openai_api_key_plaintext", None), + openai_api_type=d.get("openai_api_type", None), + openai_api_version=d.get("openai_api_version", None), + openai_deployment_name=d.get("openai_deployment_name", None), + openai_organization=d.get("openai_organization", None), ) @@ -2196,16 +2192,16 @@ def as_shallow_dict(self) -> dict: """Serializes the PaLmConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.palm_api_key is not None: - body["{palm_api_key}"] = self.palm_api_key + body["palm_api_key"] = self.palm_api_key if self.palm_api_key_plaintext is not None: - body["{palm_api_key_plaintext}"] = self.palm_api_key_plaintext + body["palm_api_key_plaintext"] = self.palm_api_key_plaintext return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PaLmConfig: """Deserializes the PaLmConfig from a dictionary.""" return cls( - palm_api_key=d.get("{palm_api_key}", None), palm_api_key_plaintext=d.get("{palm_api_key_plaintext}", None) + palm_api_key=d.get("palm_api_key", None), palm_api_key_plaintext=d.get("palm_api_key_plaintext", None) ) @@ -2235,20 +2231,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PatchServingEndpointTags into a shallow dictionary of its immediate attributes.""" body = {} if self.add_tags: - body["{add_tags}"] = self.add_tags + body["add_tags"] = self.add_tags if self.delete_tags: - body["{delete_tags}"] = self.delete_tags + body["delete_tags"] = self.delete_tags if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PatchServingEndpointTags: """Deserializes the PatchServingEndpointTags from a dictionary.""" return cls( - add_tags=_repeated_dict(d, "{add_tags}", EndpointTag), - delete_tags=d.get("{delete_tags}", None), - name=d.get("{name}", None), + add_tags=_repeated_dict(d, "add_tags", EndpointTag), + delete_tags=d.get("delete_tags", None), + name=d.get("name", None), ) @@ -2275,19 +2271,17 @@ def as_shallow_dict(self) -> dict: """Serializes the PayloadTable into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.status_message is not None: - body["{status_message}"] = self.status_message + body["status_message"] = self.status_message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PayloadTable: """Deserializes the PayloadTable from a dictionary.""" - return cls( - name=d.get("{name}", None), status=d.get("{status}", None), status_message=d.get("{status_message}", None) - ) + return cls(name=d.get("name", None), status=d.get("status", None), status_message=d.get("status_message", None)) @dataclass @@ -2335,29 +2329,29 @@ def as_shallow_dict(self) -> dict: """Serializes the PutAiGatewayRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.fallback_config: - body["{fallback_config}"] = self.fallback_config + body["fallback_config"] = self.fallback_config if self.guardrails: - body["{guardrails}"] = self.guardrails + body["guardrails"] = self.guardrails if self.inference_table_config: - body["{inference_table_config}"] = self.inference_table_config + body["inference_table_config"] = self.inference_table_config if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rate_limits: - body["{rate_limits}"] = self.rate_limits + body["rate_limits"] = self.rate_limits if self.usage_tracking_config: - body["{usage_tracking_config}"] = self.usage_tracking_config + body["usage_tracking_config"] = self.usage_tracking_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutAiGatewayRequest: """Deserializes the PutAiGatewayRequest from a dictionary.""" return cls( - fallback_config=_from_dict(d, "{fallback_config}", FallbackConfig), - guardrails=_from_dict(d, "{guardrails}", AiGatewayGuardrails), - inference_table_config=_from_dict(d, "{inference_table_config}", AiGatewayInferenceTableConfig), - name=d.get("{name}", None), - rate_limits=_repeated_dict(d, "{rate_limits}", AiGatewayRateLimit), - usage_tracking_config=_from_dict(d, "{usage_tracking_config}", AiGatewayUsageTrackingConfig), + fallback_config=_from_dict(d, "fallback_config", FallbackConfig), + guardrails=_from_dict(d, "guardrails", AiGatewayGuardrails), + inference_table_config=_from_dict(d, "inference_table_config", AiGatewayInferenceTableConfig), + name=d.get("name", None), + rate_limits=_repeated_dict(d, "rate_limits", AiGatewayRateLimit), + usage_tracking_config=_from_dict(d, "usage_tracking_config", AiGatewayUsageTrackingConfig), ) @@ -2401,26 +2395,26 @@ def as_shallow_dict(self) -> dict: """Serializes the PutAiGatewayResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.fallback_config: - body["{fallback_config}"] = self.fallback_config + body["fallback_config"] = self.fallback_config if self.guardrails: - body["{guardrails}"] = self.guardrails + body["guardrails"] = self.guardrails if self.inference_table_config: - body["{inference_table_config}"] = self.inference_table_config + body["inference_table_config"] = self.inference_table_config if self.rate_limits: - body["{rate_limits}"] = self.rate_limits + body["rate_limits"] = self.rate_limits if self.usage_tracking_config: - body["{usage_tracking_config}"] = self.usage_tracking_config + body["usage_tracking_config"] = self.usage_tracking_config return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutAiGatewayResponse: """Deserializes the PutAiGatewayResponse from a dictionary.""" return cls( - fallback_config=_from_dict(d, "{fallback_config}", FallbackConfig), - guardrails=_from_dict(d, "{guardrails}", AiGatewayGuardrails), - inference_table_config=_from_dict(d, "{inference_table_config}", AiGatewayInferenceTableConfig), - rate_limits=_repeated_dict(d, "{rate_limits}", AiGatewayRateLimit), - usage_tracking_config=_from_dict(d, "{usage_tracking_config}", AiGatewayUsageTrackingConfig), + fallback_config=_from_dict(d, "fallback_config", FallbackConfig), + guardrails=_from_dict(d, "guardrails", AiGatewayGuardrails), + inference_table_config=_from_dict(d, "inference_table_config", AiGatewayInferenceTableConfig), + rate_limits=_repeated_dict(d, "rate_limits", AiGatewayRateLimit), + usage_tracking_config=_from_dict(d, "usage_tracking_config", AiGatewayUsageTrackingConfig), ) @@ -2445,15 +2439,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PutRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.rate_limits: - body["{rate_limits}"] = self.rate_limits + body["rate_limits"] = self.rate_limits return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutRequest: """Deserializes the PutRequest from a dictionary.""" - return cls(name=d.get("{name}", None), rate_limits=_repeated_dict(d, "{rate_limits}", RateLimit)) + return cls(name=d.get("name", None), rate_limits=_repeated_dict(d, "rate_limits", RateLimit)) @dataclass @@ -2472,13 +2466,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PutResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.rate_limits: - body["{rate_limits}"] = self.rate_limits + body["rate_limits"] = self.rate_limits return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutResponse: """Deserializes the PutResponse from a dictionary.""" - return cls(rate_limits=_repeated_dict(d, "{rate_limits}", RateLimit)) + return cls(rate_limits=_repeated_dict(d, "rate_limits", RateLimit)) @dataclass @@ -2578,53 +2572,53 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryEndpointInput into a shallow dictionary of its immediate attributes.""" body = {} if self.dataframe_records: - body["{dataframe_records}"] = self.dataframe_records + body["dataframe_records"] = self.dataframe_records if self.dataframe_split: - body["{dataframe_split}"] = self.dataframe_split + body["dataframe_split"] = self.dataframe_split if self.extra_params: - body["{extra_params}"] = self.extra_params + body["extra_params"] = self.extra_params if self.input: - body["{input}"] = self.input + body["input"] = self.input if self.inputs: - body["{inputs}"] = self.inputs + body["inputs"] = self.inputs if self.instances: - body["{instances}"] = self.instances + body["instances"] = self.instances if self.max_tokens is not None: - body["{max_tokens}"] = self.max_tokens + body["max_tokens"] = self.max_tokens if self.messages: - body["{messages}"] = self.messages + body["messages"] = self.messages if self.n is not None: - body["{n}"] = self.n + body["n"] = self.n if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.prompt: - body["{prompt}"] = self.prompt + body["prompt"] = self.prompt if self.stop: - body["{stop}"] = self.stop + body["stop"] = self.stop if self.stream is not None: - body["{stream}"] = self.stream + body["stream"] = self.stream if self.temperature is not None: - body["{temperature}"] = self.temperature + body["temperature"] = self.temperature return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryEndpointInput: """Deserializes the QueryEndpointInput from a dictionary.""" return cls( - dataframe_records=d.get("{dataframe_records}", None), - dataframe_split=_from_dict(d, "{dataframe_split}", DataframeSplitInput), - extra_params=d.get("{extra_params}", None), - input=d.get("{input}", None), - inputs=d.get("{inputs}", None), - instances=d.get("{instances}", None), - max_tokens=d.get("{max_tokens}", None), - messages=_repeated_dict(d, "{messages}", ChatMessage), - n=d.get("{n}", None), - name=d.get("{name}", None), - prompt=d.get("{prompt}", None), - stop=d.get("{stop}", None), - stream=d.get("{stream}", None), - temperature=d.get("{temperature}", None), + dataframe_records=d.get("dataframe_records", None), + dataframe_split=_from_dict(d, "dataframe_split", DataframeSplitInput), + extra_params=d.get("extra_params", None), + input=d.get("input", None), + inputs=d.get("inputs", None), + instances=d.get("instances", None), + max_tokens=d.get("max_tokens", None), + messages=_repeated_dict(d, "messages", ChatMessage), + n=d.get("n", None), + name=d.get("name", None), + prompt=d.get("prompt", None), + stop=d.get("stop", None), + stream=d.get("stream", None), + temperature=d.get("temperature", None), ) @@ -2692,38 +2686,38 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryEndpointResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.choices: - body["{choices}"] = self.choices + body["choices"] = self.choices if self.created is not None: - body["{created}"] = self.created + body["created"] = self.created if self.data: - body["{data}"] = self.data + body["data"] = self.data if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.model is not None: - body["{model}"] = self.model + body["model"] = self.model if self.object is not None: - body["{object}"] = self.object + body["object"] = self.object if self.predictions: - body["{predictions}"] = self.predictions + body["predictions"] = self.predictions if self.served_model_name is not None: - body["{served_model_name}"] = self.served_model_name + body["served-model-name"] = self.served_model_name if self.usage: - body["{usage}"] = self.usage + body["usage"] = self.usage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryEndpointResponse: """Deserializes the QueryEndpointResponse from a dictionary.""" return cls( - choices=_repeated_dict(d, "{choices}", V1ResponseChoiceElement), - created=d.get("{created}", None), - data=_repeated_dict(d, "{data}", EmbeddingsV1ResponseEmbeddingElement), - id=d.get("{id}", None), - model=d.get("{model}", None), - object=_enum(d, "{object}", QueryEndpointResponseObject), - predictions=d.get("{predictions}", None), - served_model_name=d.get("{served_model_name}", None), - usage=_from_dict(d, "{usage}", ExternalModelUsageElement), + choices=_repeated_dict(d, "choices", V1ResponseChoiceElement), + created=d.get("created", None), + data=_repeated_dict(d, "data", EmbeddingsV1ResponseEmbeddingElement), + id=d.get("id", None), + model=d.get("model", None), + object=_enum(d, "object", QueryEndpointResponseObject), + predictions=d.get("predictions", None), + served_model_name=d.get("served-model-name", None), + usage=_from_dict(d, "usage", ExternalModelUsageElement), ) @@ -2763,20 +2757,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RateLimit into a shallow dictionary of its immediate attributes.""" body = {} if self.calls is not None: - body["{calls}"] = self.calls + body["calls"] = self.calls if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.renewal_period is not None: - body["{renewal_period}"] = self.renewal_period + body["renewal_period"] = self.renewal_period return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RateLimit: """Deserializes the RateLimit from a dictionary.""" return cls( - calls=d.get("{calls}", None), - key=_enum(d, "{key}", RateLimitKey), - renewal_period=_enum(d, "{renewal_period}", RateLimitRenewalPeriod), + calls=d.get("calls", None), + key=_enum(d, "key", RateLimitKey), + renewal_period=_enum(d, "renewal_period", RateLimitRenewalPeriod), ) @@ -2813,16 +2807,16 @@ def as_shallow_dict(self) -> dict: """Serializes the Route into a shallow dictionary of its immediate attributes.""" body = {} if self.served_model_name is not None: - body["{served_model_name}"] = self.served_model_name + body["served_model_name"] = self.served_model_name if self.traffic_percentage is not None: - body["{traffic_percentage}"] = self.traffic_percentage + body["traffic_percentage"] = self.traffic_percentage return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Route: """Deserializes the Route from a dictionary.""" return cls( - served_model_name=d.get("{served_model_name}", None), traffic_percentage=d.get("{traffic_percentage}", None) + served_model_name=d.get("served_model_name", None), traffic_percentage=d.get("traffic_percentage", None) ) @@ -2915,44 +2909,44 @@ def as_shallow_dict(self) -> dict: """Serializes the ServedEntityInput into a shallow dictionary of its immediate attributes.""" body = {} if self.entity_name is not None: - body["{entity_name}"] = self.entity_name + body["entity_name"] = self.entity_name if self.entity_version is not None: - body["{entity_version}"] = self.entity_version + body["entity_version"] = self.entity_version if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.external_model: - body["{external_model}"] = self.external_model + body["external_model"] = self.external_model if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["{max_provisioned_throughput}"] = self.max_provisioned_throughput + body["max_provisioned_throughput"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["{min_provisioned_throughput}"] = self.min_provisioned_throughput + body["min_provisioned_throughput"] = self.min_provisioned_throughput if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["{workload_size}"] = self.workload_size + body["workload_size"] = self.workload_size if self.workload_type is not None: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedEntityInput: """Deserializes the ServedEntityInput from a dictionary.""" return cls( - entity_name=d.get("{entity_name}", None), - entity_version=d.get("{entity_version}", None), - environment_vars=d.get("{environment_vars}", None), - external_model=_from_dict(d, "{external_model}", ExternalModel), - instance_profile_arn=d.get("{instance_profile_arn}", None), - max_provisioned_throughput=d.get("{max_provisioned_throughput}", None), - min_provisioned_throughput=d.get("{min_provisioned_throughput}", None), - name=d.get("{name}", None), - scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), - workload_size=d.get("{workload_size}", None), - workload_type=_enum(d, "{workload_type}", ServingModelWorkloadType), + entity_name=d.get("entity_name", None), + entity_version=d.get("entity_version", None), + environment_vars=d.get("environment_vars", None), + external_model=_from_dict(d, "external_model", ExternalModel), + instance_profile_arn=d.get("instance_profile_arn", None), + max_provisioned_throughput=d.get("max_provisioned_throughput", None), + min_provisioned_throughput=d.get("min_provisioned_throughput", None), + name=d.get("name", None), + scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), + workload_size=d.get("workload_size", None), + workload_type=_enum(d, "workload_type", ServingModelWorkloadType), ) @@ -3063,56 +3057,56 @@ def as_shallow_dict(self) -> dict: """Serializes the ServedEntityOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.entity_name is not None: - body["{entity_name}"] = self.entity_name + body["entity_name"] = self.entity_name if self.entity_version is not None: - body["{entity_version}"] = self.entity_version + body["entity_version"] = self.entity_version if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.external_model: - body["{external_model}"] = self.external_model + body["external_model"] = self.external_model if self.foundation_model: - body["{foundation_model}"] = self.foundation_model + body["foundation_model"] = self.foundation_model if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["{max_provisioned_throughput}"] = self.max_provisioned_throughput + body["max_provisioned_throughput"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["{min_provisioned_throughput}"] = self.min_provisioned_throughput + body["min_provisioned_throughput"] = self.min_provisioned_throughput if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.workload_size is not None: - body["{workload_size}"] = self.workload_size + body["workload_size"] = self.workload_size if self.workload_type is not None: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedEntityOutput: """Deserializes the ServedEntityOutput from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - creator=d.get("{creator}", None), - entity_name=d.get("{entity_name}", None), - entity_version=d.get("{entity_version}", None), - environment_vars=d.get("{environment_vars}", None), - external_model=_from_dict(d, "{external_model}", ExternalModel), - foundation_model=_from_dict(d, "{foundation_model}", FoundationModel), - instance_profile_arn=d.get("{instance_profile_arn}", None), - max_provisioned_throughput=d.get("{max_provisioned_throughput}", None), - min_provisioned_throughput=d.get("{min_provisioned_throughput}", None), - name=d.get("{name}", None), - scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), - state=_from_dict(d, "{state}", ServedModelState), - workload_size=d.get("{workload_size}", None), - workload_type=_enum(d, "{workload_type}", ServingModelWorkloadType), + creation_timestamp=d.get("creation_timestamp", None), + creator=d.get("creator", None), + entity_name=d.get("entity_name", None), + entity_version=d.get("entity_version", None), + environment_vars=d.get("environment_vars", None), + external_model=_from_dict(d, "external_model", ExternalModel), + foundation_model=_from_dict(d, "foundation_model", FoundationModel), + instance_profile_arn=d.get("instance_profile_arn", None), + max_provisioned_throughput=d.get("max_provisioned_throughput", None), + min_provisioned_throughput=d.get("min_provisioned_throughput", None), + name=d.get("name", None), + scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), + state=_from_dict(d, "state", ServedModelState), + workload_size=d.get("workload_size", None), + workload_type=_enum(d, "workload_type", ServingModelWorkloadType), ) @@ -3149,26 +3143,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ServedEntitySpec into a shallow dictionary of its immediate attributes.""" body = {} if self.entity_name is not None: - body["{entity_name}"] = self.entity_name + body["entity_name"] = self.entity_name if self.entity_version is not None: - body["{entity_version}"] = self.entity_version + body["entity_version"] = self.entity_version if self.external_model: - body["{external_model}"] = self.external_model + body["external_model"] = self.external_model if self.foundation_model: - body["{foundation_model}"] = self.foundation_model + body["foundation_model"] = self.foundation_model if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedEntitySpec: """Deserializes the ServedEntitySpec from a dictionary.""" return cls( - entity_name=d.get("{entity_name}", None), - entity_version=d.get("{entity_version}", None), - external_model=_from_dict(d, "{external_model}", ExternalModel), - foundation_model=_from_dict(d, "{foundation_model}", FoundationModel), - name=d.get("{name}", None), + entity_name=d.get("entity_name", None), + entity_version=d.get("entity_version", None), + external_model=_from_dict(d, "external_model", ExternalModel), + foundation_model=_from_dict(d, "foundation_model", FoundationModel), + name=d.get("name", None), ) @@ -3247,41 +3241,41 @@ def as_shallow_dict(self) -> dict: """Serializes the ServedModelInput into a shallow dictionary of its immediate attributes.""" body = {} if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_provisioned_throughput is not None: - body["{max_provisioned_throughput}"] = self.max_provisioned_throughput + body["max_provisioned_throughput"] = self.max_provisioned_throughput if self.min_provisioned_throughput is not None: - body["{min_provisioned_throughput}"] = self.min_provisioned_throughput + body["min_provisioned_throughput"] = self.min_provisioned_throughput if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version is not None: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.workload_size is not None: - body["{workload_size}"] = self.workload_size + body["workload_size"] = self.workload_size if self.workload_type is not None: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelInput: """Deserializes the ServedModelInput from a dictionary.""" return cls( - environment_vars=d.get("{environment_vars}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - max_provisioned_throughput=d.get("{max_provisioned_throughput}", None), - min_provisioned_throughput=d.get("{min_provisioned_throughput}", None), - model_name=d.get("{model_name}", None), - model_version=d.get("{model_version}", None), - name=d.get("{name}", None), - scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), - workload_size=_enum(d, "{workload_size}", ServedModelInputWorkloadSize), - workload_type=_enum(d, "{workload_type}", ServedModelInputWorkloadType), + environment_vars=d.get("environment_vars", None), + instance_profile_arn=d.get("instance_profile_arn", None), + max_provisioned_throughput=d.get("max_provisioned_throughput", None), + min_provisioned_throughput=d.get("min_provisioned_throughput", None), + model_name=d.get("model_name", None), + model_version=d.get("model_version", None), + name=d.get("name", None), + scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), + workload_size=_enum(d, "workload_size", ServedModelInputWorkloadSize), + workload_type=_enum(d, "workload_type", ServedModelInputWorkloadType), ) @@ -3379,44 +3373,44 @@ def as_shallow_dict(self) -> dict: """Serializes the ServedModelOutput into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.environment_vars: - body["{environment_vars}"] = self.environment_vars + body["environment_vars"] = self.environment_vars if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version is not None: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.scale_to_zero_enabled is not None: - body["{scale_to_zero_enabled}"] = self.scale_to_zero_enabled + body["scale_to_zero_enabled"] = self.scale_to_zero_enabled if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.workload_size is not None: - body["{workload_size}"] = self.workload_size + body["workload_size"] = self.workload_size if self.workload_type is not None: - body["{workload_type}"] = self.workload_type + body["workload_type"] = self.workload_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelOutput: """Deserializes the ServedModelOutput from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - creator=d.get("{creator}", None), - environment_vars=d.get("{environment_vars}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - model_name=d.get("{model_name}", None), - model_version=d.get("{model_version}", None), - name=d.get("{name}", None), - scale_to_zero_enabled=d.get("{scale_to_zero_enabled}", None), - state=_from_dict(d, "{state}", ServedModelState), - workload_size=d.get("{workload_size}", None), - workload_type=_enum(d, "{workload_type}", ServingModelWorkloadType), + creation_timestamp=d.get("creation_timestamp", None), + creator=d.get("creator", None), + environment_vars=d.get("environment_vars", None), + instance_profile_arn=d.get("instance_profile_arn", None), + model_name=d.get("model_name", None), + model_version=d.get("model_version", None), + name=d.get("name", None), + scale_to_zero_enabled=d.get("scale_to_zero_enabled", None), + state=_from_dict(d, "state", ServedModelState), + workload_size=d.get("workload_size", None), + workload_type=_enum(d, "workload_type", ServingModelWorkloadType), ) @@ -3445,20 +3439,18 @@ def as_shallow_dict(self) -> dict: """Serializes the ServedModelSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.model_name is not None: - body["{model_name}"] = self.model_name + body["model_name"] = self.model_name if self.model_version is not None: - body["{model_version}"] = self.model_version + body["model_version"] = self.model_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelSpec: """Deserializes the ServedModelSpec from a dictionary.""" return cls( - model_name=d.get("{model_name}", None), - model_version=d.get("{model_version}", None), - name=d.get("{name}", None), + model_name=d.get("model_name", None), model_version=d.get("model_version", None), name=d.get("name", None) ) @@ -3481,17 +3473,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ServedModelState into a shallow dictionary of its immediate attributes.""" body = {} if self.deployment is not None: - body["{deployment}"] = self.deployment + body["deployment"] = self.deployment if self.deployment_state_message is not None: - body["{deployment_state_message}"] = self.deployment_state_message + body["deployment_state_message"] = self.deployment_state_message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServedModelState: """Deserializes the ServedModelState from a dictionary.""" return cls( - deployment=_enum(d, "{deployment}", ServedModelStateDeployment), - deployment_state_message=d.get("{deployment_state_message}", None), + deployment=_enum(d, "deployment", ServedModelStateDeployment), + deployment_state_message=d.get("deployment_state_message", None), ) @@ -3520,13 +3512,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ServerLogsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.logs is not None: - body["{logs}"] = self.logs + body["logs"] = self.logs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServerLogsResponse: """Deserializes the ServerLogsResponse from a dictionary.""" - return cls(logs=d.get("{logs}", None)) + return cls(logs=d.get("logs", None)) @dataclass @@ -3596,44 +3588,44 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.ai_gateway: - body["{ai_gateway}"] = self.ai_gateway + body["ai_gateway"] = self.ai_gateway if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.config: - body["{config}"] = self.config + body["config"] = self.config if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.task is not None: - body["{task}"] = self.task + body["task"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpoint: """Deserializes the ServingEndpoint from a dictionary.""" return cls( - ai_gateway=_from_dict(d, "{ai_gateway}", AiGatewayConfig), - budget_policy_id=d.get("{budget_policy_id}", None), - config=_from_dict(d, "{config}", EndpointCoreConfigSummary), - creation_timestamp=d.get("{creation_timestamp}", None), - creator=d.get("{creator}", None), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - name=d.get("{name}", None), - state=_from_dict(d, "{state}", EndpointState), - tags=_repeated_dict(d, "{tags}", EndpointTag), - task=d.get("{task}", None), + ai_gateway=_from_dict(d, "ai_gateway", AiGatewayConfig), + budget_policy_id=d.get("budget_policy_id", None), + config=_from_dict(d, "config", EndpointCoreConfigSummary), + creation_timestamp=d.get("creation_timestamp", None), + creator=d.get("creator", None), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + name=d.get("name", None), + state=_from_dict(d, "state", EndpointState), + tags=_repeated_dict(d, "tags", EndpointTag), + task=d.get("task", None), ) @@ -3668,23 +3660,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointAccessControlRequest: """Deserializes the ServingEndpointAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", ServingEndpointPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -3724,26 +3716,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointAccessControlResponse: """Deserializes the ServingEndpointAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", ServingEndpointPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", ServingEndpointPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -3840,59 +3832,59 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointDetailed into a shallow dictionary of its immediate attributes.""" body = {} if self.ai_gateway: - body["{ai_gateway}"] = self.ai_gateway + body["ai_gateway"] = self.ai_gateway if self.budget_policy_id is not None: - body["{budget_policy_id}"] = self.budget_policy_id + body["budget_policy_id"] = self.budget_policy_id if self.config: - body["{config}"] = self.config + body["config"] = self.config if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.data_plane_info: - body["{data_plane_info}"] = self.data_plane_info + body["data_plane_info"] = self.data_plane_info if self.endpoint_url is not None: - body["{endpoint_url}"] = self.endpoint_url + body["endpoint_url"] = self.endpoint_url if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pending_config: - body["{pending_config}"] = self.pending_config + body["pending_config"] = self.pending_config if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.route_optimized is not None: - body["{route_optimized}"] = self.route_optimized + body["route_optimized"] = self.route_optimized if self.state: - body["{state}"] = self.state + body["state"] = self.state if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.task is not None: - body["{task}"] = self.task + body["task"] = self.task return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointDetailed: """Deserializes the ServingEndpointDetailed from a dictionary.""" return cls( - ai_gateway=_from_dict(d, "{ai_gateway}", AiGatewayConfig), - budget_policy_id=d.get("{budget_policy_id}", None), - config=_from_dict(d, "{config}", EndpointCoreConfigOutput), - creation_timestamp=d.get("{creation_timestamp}", None), - creator=d.get("{creator}", None), - data_plane_info=_from_dict(d, "{data_plane_info}", ModelDataPlaneInfo), - endpoint_url=d.get("{endpoint_url}", None), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - name=d.get("{name}", None), - pending_config=_from_dict(d, "{pending_config}", EndpointPendingConfig), - permission_level=_enum(d, "{permission_level}", ServingEndpointDetailedPermissionLevel), - route_optimized=d.get("{route_optimized}", None), - state=_from_dict(d, "{state}", EndpointState), - tags=_repeated_dict(d, "{tags}", EndpointTag), - task=d.get("{task}", None), + ai_gateway=_from_dict(d, "ai_gateway", AiGatewayConfig), + budget_policy_id=d.get("budget_policy_id", None), + config=_from_dict(d, "config", EndpointCoreConfigOutput), + creation_timestamp=d.get("creation_timestamp", None), + creator=d.get("creator", None), + data_plane_info=_from_dict(d, "data_plane_info", ModelDataPlaneInfo), + endpoint_url=d.get("endpoint_url", None), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + name=d.get("name", None), + pending_config=_from_dict(d, "pending_config", EndpointPendingConfig), + permission_level=_enum(d, "permission_level", ServingEndpointDetailedPermissionLevel), + route_optimized=d.get("route_optimized", None), + state=_from_dict(d, "state", EndpointState), + tags=_repeated_dict(d, "tags", EndpointTag), + task=d.get("task", None), ) @@ -3927,20 +3919,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermission: """Deserializes the ServingEndpointPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", ServingEndpointPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), ) @@ -3975,20 +3967,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissions: """Deserializes the ServingEndpointPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ServingEndpointAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", ServingEndpointAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -4012,17 +4004,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissionsDescription: """Deserializes the ServingEndpointPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", ServingEndpointPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", ServingEndpointPermissionLevel), ) @@ -4046,17 +4038,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ServingEndpointPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.serving_endpoint_id is not None: - body["{serving_endpoint_id}"] = self.serving_endpoint_id + body["serving_endpoint_id"] = self.serving_endpoint_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointPermissionsRequest: """Deserializes the ServingEndpointPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", ServingEndpointAccessControlRequest), - serving_endpoint_id=d.get("{serving_endpoint_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", ServingEndpointAccessControlRequest), + serving_endpoint_id=d.get("serving_endpoint_id", None), ) @@ -4086,13 +4078,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TrafficConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.routes: - body["{routes}"] = self.routes + body["routes"] = self.routes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TrafficConfig: """Deserializes the TrafficConfig from a dictionary.""" - return cls(routes=_repeated_dict(d, "{routes}", Route)) + return cls(routes=_repeated_dict(d, "routes", Route)) @dataclass @@ -4131,26 +4123,26 @@ def as_shallow_dict(self) -> dict: """Serializes the V1ResponseChoiceElement into a shallow dictionary of its immediate attributes.""" body = {} if self.finish_reason is not None: - body["{finish_reason}"] = self.finish_reason + body["finishReason"] = self.finish_reason if self.index is not None: - body["{index}"] = self.index + body["index"] = self.index if self.logprobs is not None: - body["{logprobs}"] = self.logprobs + body["logprobs"] = self.logprobs if self.message: - body["{message}"] = self.message + body["message"] = self.message if self.text is not None: - body["{text}"] = self.text + body["text"] = self.text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> V1ResponseChoiceElement: """Deserializes the V1ResponseChoiceElement from a dictionary.""" return cls( - finish_reason=d.get("{finish_reason}", None), - index=d.get("{index}", None), - logprobs=d.get("{logprobs}", None), - message=_from_dict(d, "{message}", ChatMessage), - text=d.get("{text}", None), + finish_reason=d.get("finishReason", None), + index=d.get("index", None), + logprobs=d.get("logprobs", None), + message=_from_dict(d, "message", ChatMessage), + text=d.get("text", None), ) @@ -4228,19 +4220,19 @@ def create( """ body = {} if ai_gateway is not None: - body["{ai_gateway}"] = ai_gateway.as_dict() + body["ai_gateway"] = ai_gateway.as_dict() if budget_policy_id is not None: - body["{budget_policy_id}"] = budget_policy_id + body["budget_policy_id"] = budget_policy_id if config is not None: - body["{config}"] = config.as_dict() + body["config"] = config.as_dict() if name is not None: - body["{name}"] = name + body["name"] = name if rate_limits is not None: - body["{rate_limits}"] = [v.as_dict() for v in rate_limits] + body["rate_limits"] = [v.as_dict() for v in rate_limits] if route_optimized is not None: - body["{route_optimized}"] = route_optimized + body["route_optimized"] = route_optimized if tags is not None: - body["{tags}"] = [v.as_dict() for v in tags] + body["tags"] = [v.as_dict() for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4250,7 +4242,7 @@ def create( return Wait( self.WaitGetServingEndpointNotUpdating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["{name}"], + name=op_response["name"], ) def create_and_wait( @@ -4412,17 +4404,17 @@ def http_request( """ body = {} if connection_name is not None: - body["{connection_name}"] = connection_name + body["connection_name"] = connection_name if headers is not None: - body["{headers}"] = headers + body["headers"] = headers if json is not None: - body["{json}"] = json + body["json"] = json if method is not None: - body["{method}"] = method.value + body["method"] = method.value if params is not None: - body["{params}"] = params + body["params"] = params if path is not None: - body["{path}"] = path + body["path"] = path headers = { "0": "{Accept text/plain}", "1": "{Content-Type application/json}", @@ -4485,9 +4477,9 @@ def patch( """ body = {} if add_tags is not None: - body["{add_tags}"] = [v.as_dict() for v in add_tags] + body["add_tags"] = [v.as_dict() for v in add_tags] if delete_tags is not None: - body["{delete_tags}"] = [v for v in delete_tags] + body["delete_tags"] = [v for v in delete_tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4511,7 +4503,7 @@ def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> Pu """ body = {} if rate_limits is not None: - body["{rate_limits}"] = [v.as_dict() for v in rate_limits] + body["rate_limits"] = [v.as_dict() for v in rate_limits] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4555,15 +4547,15 @@ def put_ai_gateway( """ body = {} if fallback_config is not None: - body["{fallback_config}"] = fallback_config.as_dict() + body["fallback_config"] = fallback_config.as_dict() if guardrails is not None: - body["{guardrails}"] = guardrails.as_dict() + body["guardrails"] = guardrails.as_dict() if inference_table_config is not None: - body["{inference_table_config}"] = inference_table_config.as_dict() + body["inference_table_config"] = inference_table_config.as_dict() if rate_limits is not None: - body["{rate_limits}"] = [v.as_dict() for v in rate_limits] + body["rate_limits"] = [v.as_dict() for v in rate_limits] if usage_tracking_config is not None: - body["{usage_tracking_config}"] = usage_tracking_config.as_dict() + body["usage_tracking_config"] = usage_tracking_config.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4640,31 +4632,31 @@ def query( """ body = {} if dataframe_records is not None: - body["{dataframe_records}"] = [v for v in dataframe_records] + body["dataframe_records"] = [v for v in dataframe_records] if dataframe_split is not None: - body["{dataframe_split}"] = dataframe_split.as_dict() + body["dataframe_split"] = dataframe_split.as_dict() if extra_params is not None: - body["{extra_params}"] = extra_params + body["extra_params"] = extra_params if input is not None: - body["{input}"] = input + body["input"] = input if inputs is not None: - body["{inputs}"] = inputs + body["inputs"] = inputs if instances is not None: - body["{instances}"] = [v for v in instances] + body["instances"] = [v for v in instances] if max_tokens is not None: - body["{max_tokens}"] = max_tokens + body["max_tokens"] = max_tokens if messages is not None: - body["{messages}"] = [v.as_dict() for v in messages] + body["messages"] = [v.as_dict() for v in messages] if n is not None: - body["{n}"] = n + body["n"] = n if prompt is not None: - body["{prompt}"] = prompt + body["prompt"] = prompt if stop is not None: - body["{stop}"] = [v for v in stop] + body["stop"] = [v for v in stop] if stream is not None: - body["{stream}"] = stream + body["stream"] = stream if temperature is not None: - body["{temperature}"] = temperature + body["temperature"] = temperature headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4700,7 +4692,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4747,13 +4739,13 @@ def update_config( """ body = {} if auto_capture_config is not None: - body["{auto_capture_config}"] = auto_capture_config.as_dict() + body["auto_capture_config"] = auto_capture_config.as_dict() if served_entities is not None: - body["{served_entities}"] = [v.as_dict() for v in served_entities] + body["served_entities"] = [v.as_dict() for v in served_entities] if served_models is not None: - body["{served_models}"] = [v.as_dict() for v in served_models] + body["served_models"] = [v.as_dict() for v in served_models] if traffic_config is not None: - body["{traffic_config}"] = traffic_config.as_dict() + body["traffic_config"] = traffic_config.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4763,7 +4755,7 @@ def update_config( return Wait( self.WaitGetServingEndpointNotUpdating, response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["{name}"], + name=op_response["name"], ) def update_config_and_wait( @@ -4803,7 +4795,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4890,31 +4882,31 @@ def query( """ body = {} if dataframe_records is not None: - body["{dataframe_records}"] = [v for v in dataframe_records] + body["dataframe_records"] = [v for v in dataframe_records] if dataframe_split is not None: - body["{dataframe_split}"] = dataframe_split.as_dict() + body["dataframe_split"] = dataframe_split.as_dict() if extra_params is not None: - body["{extra_params}"] = extra_params + body["extra_params"] = extra_params if input is not None: - body["{input}"] = input + body["input"] = input if inputs is not None: - body["{inputs}"] = inputs + body["inputs"] = inputs if instances is not None: - body["{instances}"] = [v for v in instances] + body["instances"] = [v for v in instances] if max_tokens is not None: - body["{max_tokens}"] = max_tokens + body["max_tokens"] = max_tokens if messages is not None: - body["{messages}"] = [v.as_dict() for v in messages] + body["messages"] = [v.as_dict() for v in messages] if n is not None: - body["{n}"] = n + body["n"] = n if prompt is not None: - body["{prompt}"] = prompt + body["prompt"] = prompt if stop is not None: - body["{stop}"] = [v for v in stop] + body["stop"] = [v for v in stop] if stream is not None: - body["{stream}"] = stream + body["stream"] = stream if temperature is not None: - body["{temperature}"] = temperature + body["temperature"] = temperature headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/settings/v2/impl.py b/databricks/sdk/settings/v2/impl.py index fb47a847b..1310b85a4 100755 --- a/databricks/sdk/settings/v2/impl.py +++ b/databricks/sdk/settings/v2/impl.py @@ -48,20 +48,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AccountIpAccessEnable into a shallow dictionary of its immediate attributes.""" body = {} if self.acct_ip_acl_enable: - body["{acct_ip_acl_enable}"] = self.acct_ip_acl_enable + body["acct_ip_acl_enable"] = self.acct_ip_acl_enable if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccountIpAccessEnable: """Deserializes the AccountIpAccessEnable from a dictionary.""" return cls( - acct_ip_acl_enable=_from_dict(d, "{acct_ip_acl_enable}", BooleanMessage), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + acct_ip_acl_enable=_from_dict(d, "acct_ip_acl_enable", BooleanMessage), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -80,14 +80,14 @@ def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicy into a shallow dictionary of its immediate attributes.""" body = {} if self.access_policy_type is not None: - body["{access_policy_type}"] = self.access_policy_type + body["access_policy_type"] = self.access_policy_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingAccessPolicy: """Deserializes the AibiDashboardEmbeddingAccessPolicy from a dictionary.""" return cls( - access_policy_type=_enum(d, "{access_policy_type}", AibiDashboardEmbeddingAccessPolicyAccessPolicyType) + access_policy_type=_enum(d, "access_policy_type", AibiDashboardEmbeddingAccessPolicyAccessPolicyType) ) @@ -131,11 +131,11 @@ def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingAccessPolicySetting into a shallow dictionary of its immediate attributes.""" body = {} if self.aibi_dashboard_embedding_access_policy: - body["{aibi_dashboard_embedding_access_policy}"] = self.aibi_dashboard_embedding_access_policy + body["aibi_dashboard_embedding_access_policy"] = self.aibi_dashboard_embedding_access_policy if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod @@ -143,10 +143,10 @@ def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingAccessPolicySetti """Deserializes the AibiDashboardEmbeddingAccessPolicySetting from a dictionary.""" return cls( aibi_dashboard_embedding_access_policy=_from_dict( - d, "{aibi_dashboard_embedding_access_policy}", AibiDashboardEmbeddingAccessPolicy + d, "aibi_dashboard_embedding_access_policy", AibiDashboardEmbeddingAccessPolicy ), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -165,13 +165,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomains into a shallow dictionary of its immediate attributes.""" body = {} if self.approved_domains: - body["{approved_domains}"] = self.approved_domains + body["approved_domains"] = self.approved_domains return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingApprovedDomains: """Deserializes the AibiDashboardEmbeddingApprovedDomains from a dictionary.""" - return cls(approved_domains=d.get("{approved_domains}", None)) + return cls(approved_domains=d.get("approved_domains", None)) @dataclass @@ -207,11 +207,11 @@ def as_shallow_dict(self) -> dict: """Serializes the AibiDashboardEmbeddingApprovedDomainsSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.aibi_dashboard_embedding_approved_domains: - body["{aibi_dashboard_embedding_approved_domains}"] = self.aibi_dashboard_embedding_approved_domains + body["aibi_dashboard_embedding_approved_domains"] = self.aibi_dashboard_embedding_approved_domains if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod @@ -219,10 +219,10 @@ def from_dict(cls, d: Dict[str, Any]) -> AibiDashboardEmbeddingApprovedDomainsSe """Deserializes the AibiDashboardEmbeddingApprovedDomainsSetting from a dictionary.""" return cls( aibi_dashboard_embedding_approved_domains=_from_dict( - d, "{aibi_dashboard_embedding_approved_domains}", AibiDashboardEmbeddingApprovedDomains + d, "aibi_dashboard_embedding_approved_domains", AibiDashboardEmbeddingApprovedDomains ), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -259,11 +259,11 @@ def as_shallow_dict(self) -> dict: """Serializes the AutomaticClusterUpdateSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.automatic_cluster_update_workspace: - body["{automatic_cluster_update_workspace}"] = self.automatic_cluster_update_workspace + body["automatic_cluster_update_workspace"] = self.automatic_cluster_update_workspace if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod @@ -271,10 +271,10 @@ def from_dict(cls, d: Dict[str, Any]) -> AutomaticClusterUpdateSetting: """Deserializes the AutomaticClusterUpdateSetting from a dictionary.""" return cls( automatic_cluster_update_workspace=_from_dict( - d, "{automatic_cluster_update_workspace}", ClusterAutoRestartMessage + d, "automatic_cluster_update_workspace", ClusterAutoRestartMessage ), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -293,13 +293,13 @@ def as_shallow_dict(self) -> dict: """Serializes the BooleanMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BooleanMessage: """Deserializes the BooleanMessage from a dictionary.""" - return cls(value=d.get("{value}", None)) + return cls(value=d.get("value", None)) @dataclass @@ -338,26 +338,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.can_toggle is not None: - body["{can_toggle}"] = self.can_toggle + body["can_toggle"] = self.can_toggle if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.enablement_details: - body["{enablement_details}"] = self.enablement_details + body["enablement_details"] = self.enablement_details if self.maintenance_window: - body["{maintenance_window}"] = self.maintenance_window + body["maintenance_window"] = self.maintenance_window if self.restart_even_if_no_updates_available is not None: - body["{restart_even_if_no_updates_available}"] = self.restart_even_if_no_updates_available + body["restart_even_if_no_updates_available"] = self.restart_even_if_no_updates_available return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessage: """Deserializes the ClusterAutoRestartMessage from a dictionary.""" return cls( - can_toggle=d.get("{can_toggle}", None), - enabled=d.get("{enabled}", None), - enablement_details=_from_dict(d, "{enablement_details}", ClusterAutoRestartMessageEnablementDetails), - maintenance_window=_from_dict(d, "{maintenance_window}", ClusterAutoRestartMessageMaintenanceWindow), - restart_even_if_no_updates_available=d.get("{restart_even_if_no_updates_available}", None), + can_toggle=d.get("can_toggle", None), + enabled=d.get("enabled", None), + enablement_details=_from_dict(d, "enablement_details", ClusterAutoRestartMessageEnablementDetails), + maintenance_window=_from_dict(d, "maintenance_window", ClusterAutoRestartMessageMaintenanceWindow), + restart_even_if_no_updates_available=d.get("restart_even_if_no_updates_available", None), ) @@ -394,20 +394,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageEnablementDetails into a shallow dictionary of its immediate attributes.""" body = {} if self.forced_for_compliance_mode is not None: - body["{forced_for_compliance_mode}"] = self.forced_for_compliance_mode + body["forced_for_compliance_mode"] = self.forced_for_compliance_mode if self.unavailable_for_disabled_entitlement is not None: - body["{unavailable_for_disabled_entitlement}"] = self.unavailable_for_disabled_entitlement + body["unavailable_for_disabled_entitlement"] = self.unavailable_for_disabled_entitlement if self.unavailable_for_non_enterprise_tier is not None: - body["{unavailable_for_non_enterprise_tier}"] = self.unavailable_for_non_enterprise_tier + body["unavailable_for_non_enterprise_tier"] = self.unavailable_for_non_enterprise_tier return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageEnablementDetails: """Deserializes the ClusterAutoRestartMessageEnablementDetails from a dictionary.""" return cls( - forced_for_compliance_mode=d.get("{forced_for_compliance_mode}", None), - unavailable_for_disabled_entitlement=d.get("{unavailable_for_disabled_entitlement}", None), - unavailable_for_non_enterprise_tier=d.get("{unavailable_for_non_enterprise_tier}", None), + forced_for_compliance_mode=d.get("forced_for_compliance_mode", None), + unavailable_for_disabled_entitlement=d.get("unavailable_for_disabled_entitlement", None), + unavailable_for_non_enterprise_tier=d.get("unavailable_for_non_enterprise_tier", None), ) @@ -426,7 +426,7 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindow into a shallow dictionary of its immediate attributes.""" body = {} if self.week_day_based_schedule: - body["{week_day_based_schedule}"] = self.week_day_based_schedule + body["week_day_based_schedule"] = self.week_day_based_schedule return body @classmethod @@ -434,7 +434,7 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageMaintenanceWin """Deserializes the ClusterAutoRestartMessageMaintenanceWindow from a dictionary.""" return cls( week_day_based_schedule=_from_dict( - d, "{week_day_based_schedule}", ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule + d, "week_day_based_schedule", ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule ) ) @@ -473,21 +473,21 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule into a shallow dictionary of its immediate attributes.""" body = {} if self.day_of_week is not None: - body["{day_of_week}"] = self.day_of_week + body["day_of_week"] = self.day_of_week if self.frequency is not None: - body["{frequency}"] = self.frequency + body["frequency"] = self.frequency if self.window_start_time: - body["{window_start_time}"] = self.window_start_time + body["window_start_time"] = self.window_start_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule: """Deserializes the ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule from a dictionary.""" return cls( - day_of_week=_enum(d, "{day_of_week}", ClusterAutoRestartMessageMaintenanceWindowDayOfWeek), - frequency=_enum(d, "{frequency}", ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency), + day_of_week=_enum(d, "day_of_week", ClusterAutoRestartMessageMaintenanceWindowDayOfWeek), + frequency=_enum(d, "frequency", ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency), window_start_time=_from_dict( - d, "{window_start_time}", ClusterAutoRestartMessageMaintenanceWindowWindowStartTime + d, "window_start_time", ClusterAutoRestartMessageMaintenanceWindowWindowStartTime ), ) @@ -522,15 +522,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime into a shallow dictionary of its immediate attributes.""" body = {} if self.hours is not None: - body["{hours}"] = self.hours + body["hours"] = self.hours if self.minutes is not None: - body["{minutes}"] = self.minutes + body["minutes"] = self.minutes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClusterAutoRestartMessageMaintenanceWindowWindowStartTime: """Deserializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime from a dictionary.""" - return cls(hours=d.get("{hours}", None), minutes=d.get("{minutes}", None)) + return cls(hours=d.get("hours", None), minutes=d.get("minutes", None)) @dataclass @@ -555,17 +555,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ComplianceSecurityProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_standards: - body["{compliance_standards}"] = self.compliance_standards + body["compliance_standards"] = self.compliance_standards if self.is_enabled is not None: - body["{is_enabled}"] = self.is_enabled + body["is_enabled"] = self.is_enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ComplianceSecurityProfile: """Deserializes the ComplianceSecurityProfile from a dictionary.""" return cls( - compliance_standards=_repeated_enum(d, "{compliance_standards}", ComplianceStandard), - is_enabled=d.get("{is_enabled}", None), + compliance_standards=_repeated_enum(d, "compliance_standards", ComplianceStandard), + is_enabled=d.get("is_enabled", None), ) @@ -603,11 +603,11 @@ def as_shallow_dict(self) -> dict: """Serializes the ComplianceSecurityProfileSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_security_profile_workspace: - body["{compliance_security_profile_workspace}"] = self.compliance_security_profile_workspace + body["compliance_security_profile_workspace"] = self.compliance_security_profile_workspace if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod @@ -615,10 +615,10 @@ def from_dict(cls, d: Dict[str, Any]) -> ComplianceSecurityProfileSetting: """Deserializes the ComplianceSecurityProfileSetting from a dictionary.""" return cls( compliance_security_profile_workspace=_from_dict( - d, "{compliance_security_profile_workspace}", ComplianceSecurityProfile + d, "compliance_security_profile_workspace", ComplianceSecurityProfile ), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -670,26 +670,26 @@ def as_shallow_dict(self) -> dict: """Serializes the Config into a shallow dictionary of its immediate attributes.""" body = {} if self.email: - body["{email}"] = self.email + body["email"] = self.email if self.generic_webhook: - body["{generic_webhook}"] = self.generic_webhook + body["generic_webhook"] = self.generic_webhook if self.microsoft_teams: - body["{microsoft_teams}"] = self.microsoft_teams + body["microsoft_teams"] = self.microsoft_teams if self.pagerduty: - body["{pagerduty}"] = self.pagerduty + body["pagerduty"] = self.pagerduty if self.slack: - body["{slack}"] = self.slack + body["slack"] = self.slack return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Config: """Deserializes the Config from a dictionary.""" return cls( - email=_from_dict(d, "{email}", EmailConfig), - generic_webhook=_from_dict(d, "{generic_webhook}", GenericWebhookConfig), - microsoft_teams=_from_dict(d, "{microsoft_teams}", MicrosoftTeamsConfig), - pagerduty=_from_dict(d, "{pagerduty}", PagerdutyConfig), - slack=_from_dict(d, "{slack}", SlackConfig), + email=_from_dict(d, "email", EmailConfig), + generic_webhook=_from_dict(d, "generic_webhook", GenericWebhookConfig), + microsoft_teams=_from_dict(d, "microsoft_teams", MicrosoftTeamsConfig), + pagerduty=_from_dict(d, "pagerduty", PagerdutyConfig), + slack=_from_dict(d, "slack", SlackConfig), ) @@ -723,20 +723,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateIpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_addresses: - body["{ip_addresses}"] = self.ip_addresses + body["ip_addresses"] = self.ip_addresses if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_type is not None: - body["{list_type}"] = self.list_type + body["list_type"] = self.list_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateIpAccessList: """Deserializes the CreateIpAccessList from a dictionary.""" return cls( - ip_addresses=d.get("{ip_addresses}", None), - label=d.get("{label}", None), - list_type=_enum(d, "{list_type}", ListType), + ip_addresses=d.get("ip_addresses", None), + label=d.get("label", None), + list_type=_enum(d, "list_type", ListType), ) @@ -758,13 +758,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list + body["ip_access_list"] = self.ip_access_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateIpAccessListResponse: """Deserializes the CreateIpAccessListResponse from a dictionary.""" - return cls(ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessListInfo)) + return cls(ip_access_list=_from_dict(d, "ip_access_list", IpAccessListInfo)) @dataclass @@ -791,15 +791,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateNetworkConnectivityConfigRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateNetworkConnectivityConfigRequest: """Deserializes the CreateNetworkConnectivityConfigRequest from a dictionary.""" - return cls(name=d.get("{name}", None), region=d.get("{region}", None)) + return cls(name=d.get("name", None), region=d.get("region", None)) @dataclass @@ -823,15 +823,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateNotificationDestinationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.config: - body["{config}"] = self.config + body["config"] = self.config if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateNotificationDestinationRequest: """Deserializes the CreateNotificationDestinationRequest from a dictionary.""" - return cls(config=_from_dict(d, "{config}", Config), display_name=d.get("{display_name}", None)) + return cls(config=_from_dict(d, "config", Config), display_name=d.get("display_name", None)) @dataclass @@ -862,20 +862,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateOboTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.application_id is not None: - body["{application_id}"] = self.application_id + body["application_id"] = self.application_id if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.lifetime_seconds is not None: - body["{lifetime_seconds}"] = self.lifetime_seconds + body["lifetime_seconds"] = self.lifetime_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateOboTokenRequest: """Deserializes the CreateOboTokenRequest from a dictionary.""" return cls( - application_id=d.get("{application_id}", None), - comment=d.get("{comment}", None), - lifetime_seconds=d.get("{lifetime_seconds}", None), + application_id=d.get("application_id", None), + comment=d.get("comment", None), + lifetime_seconds=d.get("lifetime_seconds", None), ) @@ -901,15 +901,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateOboTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_info: - body["{token_info}"] = self.token_info + body["token_info"] = self.token_info if self.token_value is not None: - body["{token_value}"] = self.token_value + body["token_value"] = self.token_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateOboTokenResponse: """Deserializes the CreateOboTokenResponse from a dictionary.""" - return cls(token_info=_from_dict(d, "{token_info}", TokenInfo), token_value=d.get("{token_value}", None)) + return cls(token_info=_from_dict(d, "token_info", TokenInfo), token_value=d.get("token_value", None)) @dataclass @@ -939,20 +939,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreatePrivateEndpointRuleRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_id is not None: - body["{group_id}"] = self.group_id + body["group_id"] = self.group_id if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreatePrivateEndpointRuleRequest: """Deserializes the CreatePrivateEndpointRuleRequest from a dictionary.""" return cls( - group_id=_enum(d, "{group_id}", CreatePrivateEndpointRuleRequestGroupId), - network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), - resource_id=d.get("{resource_id}", None), + group_id=_enum(d, "group_id", CreatePrivateEndpointRuleRequestGroupId), + network_connectivity_config_id=d.get("network_connectivity_config_id", None), + resource_id=d.get("resource_id", None), ) @@ -989,15 +989,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.lifetime_seconds is not None: - body["{lifetime_seconds}"] = self.lifetime_seconds + body["lifetime_seconds"] = self.lifetime_seconds return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTokenRequest: """Deserializes the CreateTokenRequest from a dictionary.""" - return cls(comment=d.get("{comment}", None), lifetime_seconds=d.get("{lifetime_seconds}", None)) + return cls(comment=d.get("comment", None), lifetime_seconds=d.get("lifetime_seconds", None)) @dataclass @@ -1021,15 +1021,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_info: - body["{token_info}"] = self.token_info + body["token_info"] = self.token_info if self.token_value is not None: - body["{token_value}"] = self.token_value + body["token_value"] = self.token_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateTokenResponse: """Deserializes the CreateTokenResponse from a dictionary.""" - return cls(token_info=_from_dict(d, "{token_info}", PublicTokenInfo), token_value=d.get("{token_value}", None)) + return cls(token_info=_from_dict(d, "token_info", PublicTokenInfo), token_value=d.get("token_value", None)) @dataclass @@ -1056,17 +1056,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CspEnablementAccount into a shallow dictionary of its immediate attributes.""" body = {} if self.compliance_standards: - body["{compliance_standards}"] = self.compliance_standards + body["compliance_standards"] = self.compliance_standards if self.is_enforced is not None: - body["{is_enforced}"] = self.is_enforced + body["is_enforced"] = self.is_enforced return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CspEnablementAccount: """Deserializes the CspEnablementAccount from a dictionary.""" return cls( - compliance_standards=_repeated_enum(d, "{compliance_standards}", ComplianceStandard), - is_enforced=d.get("{is_enforced}", None), + compliance_standards=_repeated_enum(d, "compliance_standards", ComplianceStandard), + is_enforced=d.get("is_enforced", None), ) @@ -1104,20 +1104,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CspEnablementAccountSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.csp_enablement_account: - body["{csp_enablement_account}"] = self.csp_enablement_account + body["csp_enablement_account"] = self.csp_enablement_account if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CspEnablementAccountSetting: """Deserializes the CspEnablementAccountSetting from a dictionary.""" return cls( - csp_enablement_account=_from_dict(d, "{csp_enablement_account}", CspEnablementAccount), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + csp_enablement_account=_from_dict(d, "csp_enablement_account", CspEnablementAccount), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -1162,20 +1162,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DefaultNamespaceSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.namespace: - body["{namespace}"] = self.namespace + body["namespace"] = self.namespace if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DefaultNamespaceSetting: """Deserializes the DefaultNamespaceSetting from a dictionary.""" return cls( - etag=d.get("{etag}", None), - namespace=_from_dict(d, "{namespace}", StringMessage), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + namespace=_from_dict(d, "namespace", StringMessage), + setting_name=d.get("setting_name", None), ) @@ -1202,13 +1202,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteAccountIpAccessEnableResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAccountIpAccessEnableResponse: """Deserializes the DeleteAccountIpAccessEnableResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1234,13 +1234,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingAccessPolicySettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAibiDashboardEmbeddingAccessPolicySettingResponse: """Deserializes the DeleteAibiDashboardEmbeddingAccessPolicySettingResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1266,13 +1266,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse: """Deserializes the DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1298,13 +1298,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteDefaultNamespaceSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDefaultNamespaceSettingResponse: """Deserializes the DeleteDefaultNamespaceSettingResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1330,13 +1330,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteDisableLegacyAccessResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDisableLegacyAccessResponse: """Deserializes the DeleteDisableLegacyAccessResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1362,13 +1362,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteDisableLegacyDbfsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDisableLegacyDbfsResponse: """Deserializes the DeleteDisableLegacyDbfsResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1394,13 +1394,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteDisableLegacyFeaturesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDisableLegacyFeaturesResponse: """Deserializes the DeleteDisableLegacyFeaturesResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1444,13 +1444,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeletePersonalComputeSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeletePersonalComputeSettingResponse: """Deserializes the DeletePersonalComputeSettingResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) @dataclass @@ -1494,13 +1494,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteRestrictWorkspaceAdminsSettingResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteRestrictWorkspaceAdminsSettingResponse: """Deserializes the DeleteRestrictWorkspaceAdminsSettingResponse from a dictionary.""" - return cls(etag=d.get("{etag}", None)) + return cls(etag=d.get("etag", None)) class DestinationType(Enum): @@ -1545,20 +1545,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DisableLegacyAccess into a shallow dictionary of its immediate attributes.""" body = {} if self.disable_legacy_access: - body["{disable_legacy_access}"] = self.disable_legacy_access + body["disable_legacy_access"] = self.disable_legacy_access if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DisableLegacyAccess: """Deserializes the DisableLegacyAccess from a dictionary.""" return cls( - disable_legacy_access=_from_dict(d, "{disable_legacy_access}", BooleanMessage), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + disable_legacy_access=_from_dict(d, "disable_legacy_access", BooleanMessage), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -1595,20 +1595,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DisableLegacyDbfs into a shallow dictionary of its immediate attributes.""" body = {} if self.disable_legacy_dbfs: - body["{disable_legacy_dbfs}"] = self.disable_legacy_dbfs + body["disable_legacy_dbfs"] = self.disable_legacy_dbfs if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DisableLegacyDbfs: """Deserializes the DisableLegacyDbfs from a dictionary.""" return cls( - disable_legacy_dbfs=_from_dict(d, "{disable_legacy_dbfs}", BooleanMessage), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + disable_legacy_dbfs=_from_dict(d, "disable_legacy_dbfs", BooleanMessage), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -1645,20 +1645,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DisableLegacyFeatures into a shallow dictionary of its immediate attributes.""" body = {} if self.disable_legacy_features: - body["{disable_legacy_features}"] = self.disable_legacy_features + body["disable_legacy_features"] = self.disable_legacy_features if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DisableLegacyFeatures: """Deserializes the DisableLegacyFeatures from a dictionary.""" return cls( - disable_legacy_features=_from_dict(d, "{disable_legacy_features}", BooleanMessage), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + disable_legacy_features=_from_dict(d, "disable_legacy_features", BooleanMessage), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -1678,13 +1678,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EmailConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.addresses: - body["{addresses}"] = self.addresses + body["addresses"] = self.addresses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmailConfig: """Deserializes the EmailConfig from a dictionary.""" - return cls(addresses=d.get("{addresses}", None)) + return cls(addresses=d.get("addresses", None)) @dataclass @@ -1722,13 +1722,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoring into a shallow dictionary of its immediate attributes.""" body = {} if self.is_enabled is not None: - body["{is_enabled}"] = self.is_enabled + body["is_enabled"] = self.is_enabled return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnhancedSecurityMonitoring: """Deserializes the EnhancedSecurityMonitoring from a dictionary.""" - return cls(is_enabled=d.get("{is_enabled}", None)) + return cls(is_enabled=d.get("is_enabled", None)) @dataclass @@ -1765,11 +1765,11 @@ def as_shallow_dict(self) -> dict: """Serializes the EnhancedSecurityMonitoringSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.enhanced_security_monitoring_workspace: - body["{enhanced_security_monitoring_workspace}"] = self.enhanced_security_monitoring_workspace + body["enhanced_security_monitoring_workspace"] = self.enhanced_security_monitoring_workspace if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod @@ -1777,10 +1777,10 @@ def from_dict(cls, d: Dict[str, Any]) -> EnhancedSecurityMonitoringSetting: """Deserializes the EnhancedSecurityMonitoringSetting from a dictionary.""" return cls( enhanced_security_monitoring_workspace=_from_dict( - d, "{enhanced_security_monitoring_workspace}", EnhancedSecurityMonitoring + d, "enhanced_security_monitoring_workspace", EnhancedSecurityMonitoring ), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -1801,13 +1801,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EsmEnablementAccount into a shallow dictionary of its immediate attributes.""" body = {} if self.is_enforced is not None: - body["{is_enforced}"] = self.is_enforced + body["is_enforced"] = self.is_enforced return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EsmEnablementAccount: """Deserializes the EsmEnablementAccount from a dictionary.""" - return cls(is_enforced=d.get("{is_enforced}", None)) + return cls(is_enforced=d.get("is_enforced", None)) @dataclass @@ -1844,20 +1844,20 @@ def as_shallow_dict(self) -> dict: """Serializes the EsmEnablementAccountSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.esm_enablement_account: - body["{esm_enablement_account}"] = self.esm_enablement_account + body["esm_enablement_account"] = self.esm_enablement_account if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EsmEnablementAccountSetting: """Deserializes the EsmEnablementAccountSetting from a dictionary.""" return cls( - esm_enablement_account=_from_dict(d, "{esm_enablement_account}", EsmEnablementAccount), - etag=d.get("{etag}", None), - setting_name=d.get("{setting_name}", None), + esm_enablement_account=_from_dict(d, "esm_enablement_account", EsmEnablementAccount), + etag=d.get("etag", None), + setting_name=d.get("setting_name", None), ) @@ -1899,26 +1899,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ExchangeToken into a shallow dictionary of its immediate attributes.""" body = {} if self.credential is not None: - body["{credential}"] = self.credential + body["credential"] = self.credential if self.credential_eol_time is not None: - body["{credential_eol_time}"] = self.credential_eol_time + body["credentialEolTime"] = self.credential_eol_time if self.owner_id is not None: - body["{owner_id}"] = self.owner_id + body["ownerId"] = self.owner_id if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes if self.token_type is not None: - body["{token_type}"] = self.token_type + body["tokenType"] = self.token_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeToken: """Deserializes the ExchangeToken from a dictionary.""" return cls( - credential=d.get("{credential}", None), - credential_eol_time=d.get("{credential_eol_time}", None), - owner_id=d.get("{owner_id}", None), - scopes=d.get("{scopes}", None), - token_type=_enum(d, "{token_type}", TokenType), + credential=d.get("credential", None), + credential_eol_time=d.get("credentialEolTime", None), + owner_id=d.get("ownerId", None), + scopes=d.get("scopes", None), + token_type=_enum(d, "tokenType", TokenType), ) @@ -1950,20 +1950,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ExchangeTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.partition_id: - body["{partition_id}"] = self.partition_id + body["partitionId"] = self.partition_id if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes if self.token_type: - body["{token_type}"] = self.token_type + body["tokenType"] = self.token_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeTokenRequest: """Deserializes the ExchangeTokenRequest from a dictionary.""" return cls( - partition_id=_from_dict(d, "{partition_id}", PartitionId), - scopes=d.get("{scopes}", None), - token_type=_repeated_enum(d, "{token_type}", TokenType), + partition_id=_from_dict(d, "partitionId", PartitionId), + scopes=d.get("scopes", None), + token_type=_repeated_enum(d, "tokenType", TokenType), ) @@ -1984,13 +1984,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ExchangeTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExchangeTokenResponse: """Deserializes the ExchangeTokenResponse from a dictionary.""" - return cls(values=_repeated_dict(d, "{values}", ExchangeToken)) + return cls(values=_repeated_dict(d, "values", ExchangeToken)) @dataclass @@ -2011,13 +2011,13 @@ def as_shallow_dict(self) -> dict: """Serializes the FetchIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list + body["ip_access_list"] = self.ip_access_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FetchIpAccessListResponse: """Deserializes the FetchIpAccessListResponse from a dictionary.""" - return cls(ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessListInfo)) + return cls(ip_access_list=_from_dict(d, "ip_access_list", IpAccessListInfo)) @dataclass @@ -2061,29 +2061,29 @@ def as_shallow_dict(self) -> dict: """Serializes the GenericWebhookConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.password is not None: - body["{password}"] = self.password + body["password"] = self.password if self.password_set is not None: - body["{password_set}"] = self.password_set + body["password_set"] = self.password_set if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.url_set is not None: - body["{url_set}"] = self.url_set + body["url_set"] = self.url_set if self.username is not None: - body["{username}"] = self.username + body["username"] = self.username if self.username_set is not None: - body["{username_set}"] = self.username_set + body["username_set"] = self.username_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GenericWebhookConfig: """Deserializes the GenericWebhookConfig from a dictionary.""" return cls( - password=d.get("{password}", None), - password_set=d.get("{password_set}", None), - url=d.get("{url}", None), - url_set=d.get("{url_set}", None), - username=d.get("{username}", None), - username_set=d.get("{username_set}", None), + password=d.get("password", None), + password_set=d.get("password_set", None), + url=d.get("url", None), + url_set=d.get("url_set", None), + username=d.get("username", None), + username_set=d.get("username_set", None), ) @@ -2103,13 +2103,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list + body["ip_access_list"] = self.ip_access_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetIpAccessListResponse: """Deserializes the GetIpAccessListResponse from a dictionary.""" - return cls(ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessListInfo)) + return cls(ip_access_list=_from_dict(d, "ip_access_list", IpAccessListInfo)) @dataclass @@ -2129,13 +2129,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetIpAccessListsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_lists: - body["{ip_access_lists}"] = self.ip_access_lists + body["ip_access_lists"] = self.ip_access_lists return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetIpAccessListsResponse: """Deserializes the GetIpAccessListsResponse from a dictionary.""" - return cls(ip_access_lists=_repeated_dict(d, "{ip_access_lists}", IpAccessListInfo)) + return cls(ip_access_lists=_repeated_dict(d, "ip_access_lists", IpAccessListInfo)) @dataclass @@ -2154,13 +2154,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetTokenPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetTokenPermissionLevelsResponse: """Deserializes the GetTokenPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", TokenPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", TokenPermissionsDescription)) @dataclass @@ -2180,13 +2180,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_info: - body["{token_info}"] = self.token_info + body["token_info"] = self.token_info return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetTokenResponse: """Deserializes the GetTokenResponse from a dictionary.""" - return cls(token_info=_from_dict(d, "{token_info}", TokenInfo)) + return cls(token_info=_from_dict(d, "token_info", TokenInfo)) @dataclass @@ -2254,41 +2254,41 @@ def as_shallow_dict(self) -> dict: """Serializes the IpAccessListInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.address_count is not None: - body["{address_count}"] = self.address_count + body["address_count"] = self.address_count if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.ip_addresses: - body["{ip_addresses}"] = self.ip_addresses + body["ip_addresses"] = self.ip_addresses if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_id is not None: - body["{list_id}"] = self.list_id + body["list_id"] = self.list_id if self.list_type is not None: - body["{list_type}"] = self.list_type + body["list_type"] = self.list_type if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IpAccessListInfo: """Deserializes the IpAccessListInfo from a dictionary.""" return cls( - address_count=d.get("{address_count}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - enabled=d.get("{enabled}", None), - ip_addresses=d.get("{ip_addresses}", None), - label=d.get("{label}", None), - list_id=d.get("{list_id}", None), - list_type=_enum(d, "{list_type}", ListType), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + address_count=d.get("address_count", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + enabled=d.get("enabled", None), + ip_addresses=d.get("ip_addresses", None), + label=d.get("label", None), + list_id=d.get("list_id", None), + list_type=_enum(d, "list_type", ListType), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -2309,13 +2309,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListIpAccessListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.ip_access_lists: - body["{ip_access_lists}"] = self.ip_access_lists + body["ip_access_lists"] = self.ip_access_lists return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListIpAccessListResponse: """Deserializes the ListIpAccessListResponse from a dictionary.""" - return cls(ip_access_lists=_repeated_dict(d, "{ip_access_lists}", IpAccessListInfo)) + return cls(ip_access_lists=_repeated_dict(d, "ip_access_lists", IpAccessListInfo)) @dataclass @@ -2339,17 +2339,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListNccAzurePrivateEndpointRulesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items: - body["{items}"] = self.items + body["items"] = self.items if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNccAzurePrivateEndpointRulesResponse: """Deserializes the ListNccAzurePrivateEndpointRulesResponse from a dictionary.""" return cls( - items=_repeated_dict(d, "{items}", NccAzurePrivateEndpointRule), - next_page_token=d.get("{next_page_token}", None), + items=_repeated_dict(d, "items", NccAzurePrivateEndpointRule), + next_page_token=d.get("next_page_token", None), ) @@ -2374,17 +2374,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListNetworkConnectivityConfigurationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items: - body["{items}"] = self.items + body["items"] = self.items if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNetworkConnectivityConfigurationsResponse: """Deserializes the ListNetworkConnectivityConfigurationsResponse from a dictionary.""" return cls( - items=_repeated_dict(d, "{items}", NetworkConnectivityConfiguration), - next_page_token=d.get("{next_page_token}", None), + items=_repeated_dict(d, "items", NetworkConnectivityConfiguration), + next_page_token=d.get("next_page_token", None), ) @@ -2408,17 +2408,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListNotificationDestinationsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNotificationDestinationsResponse: """Deserializes the ListNotificationDestinationsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - results=_repeated_dict(d, "{results}", ListNotificationDestinationsResult), + next_page_token=d.get("next_page_token", None), + results=_repeated_dict(d, "results", ListNotificationDestinationsResult), ) @@ -2448,20 +2448,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListNotificationDestinationsResult into a shallow dictionary of its immediate attributes.""" body = {} if self.destination_type is not None: - body["{destination_type}"] = self.destination_type + body["destination_type"] = self.destination_type if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListNotificationDestinationsResult: """Deserializes the ListNotificationDestinationsResult from a dictionary.""" return cls( - destination_type=_enum(d, "{destination_type}", DestinationType), - display_name=d.get("{display_name}", None), - id=d.get("{id}", None), + destination_type=_enum(d, "destination_type", DestinationType), + display_name=d.get("display_name", None), + id=d.get("id", None), ) @@ -2481,13 +2481,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListPublicTokensResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_infos: - body["{token_infos}"] = self.token_infos + body["token_infos"] = self.token_infos return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListPublicTokensResponse: """Deserializes the ListPublicTokensResponse from a dictionary.""" - return cls(token_infos=_repeated_dict(d, "{token_infos}", PublicTokenInfo)) + return cls(token_infos=_repeated_dict(d, "token_infos", PublicTokenInfo)) @dataclass @@ -2508,13 +2508,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListTokensResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.token_infos: - body["{token_infos}"] = self.token_infos + body["token_infos"] = self.token_infos return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListTokensResponse: """Deserializes the ListTokensResponse from a dictionary.""" - return cls(token_infos=_repeated_dict(d, "{token_infos}", TokenInfo)) + return cls(token_infos=_repeated_dict(d, "token_infos", TokenInfo)) class ListType(Enum): @@ -2548,15 +2548,15 @@ def as_shallow_dict(self) -> dict: """Serializes the MicrosoftTeamsConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.url_set is not None: - body["{url_set}"] = self.url_set + body["url_set"] = self.url_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MicrosoftTeamsConfig: """Deserializes the MicrosoftTeamsConfig from a dictionary.""" - return cls(url=d.get("{url}", None), url_set=d.get("{url_set}", None)) + return cls(url=d.get("url", None), url_set=d.get("url_set", None)) @dataclass @@ -2579,13 +2579,13 @@ def as_shallow_dict(self) -> dict: """Serializes the NccAwsStableIpRule into a shallow dictionary of its immediate attributes.""" body = {} if self.cidr_blocks: - body["{cidr_blocks}"] = self.cidr_blocks + body["cidr_blocks"] = self.cidr_blocks return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccAwsStableIpRule: """Deserializes the NccAwsStableIpRule from a dictionary.""" - return cls(cidr_blocks=d.get("{cidr_blocks}", None)) + return cls(cidr_blocks=d.get("cidr_blocks", None)) @dataclass @@ -2660,41 +2660,41 @@ def as_shallow_dict(self) -> dict: """Serializes the NccAzurePrivateEndpointRule into a shallow dictionary of its immediate attributes.""" body = {} if self.connection_state is not None: - body["{connection_state}"] = self.connection_state + body["connection_state"] = self.connection_state if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.deactivated is not None: - body["{deactivated}"] = self.deactivated + body["deactivated"] = self.deactivated if self.deactivated_at is not None: - body["{deactivated_at}"] = self.deactivated_at + body["deactivated_at"] = self.deactivated_at if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.group_id is not None: - body["{group_id}"] = self.group_id + body["group_id"] = self.group_id if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id if self.rule_id is not None: - body["{rule_id}"] = self.rule_id + body["rule_id"] = self.rule_id if self.updated_time is not None: - body["{updated_time}"] = self.updated_time + body["updated_time"] = self.updated_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccAzurePrivateEndpointRule: """Deserializes the NccAzurePrivateEndpointRule from a dictionary.""" return cls( - connection_state=_enum(d, "{connection_state}", NccAzurePrivateEndpointRuleConnectionState), - creation_time=d.get("{creation_time}", None), - deactivated=d.get("{deactivated}", None), - deactivated_at=d.get("{deactivated_at}", None), - endpoint_name=d.get("{endpoint_name}", None), - group_id=_enum(d, "{group_id}", NccAzurePrivateEndpointRuleGroupId), - network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), - resource_id=d.get("{resource_id}", None), - rule_id=d.get("{rule_id}", None), - updated_time=d.get("{updated_time}", None), + connection_state=_enum(d, "connection_state", NccAzurePrivateEndpointRuleConnectionState), + creation_time=d.get("creation_time", None), + deactivated=d.get("deactivated", None), + deactivated_at=d.get("deactivated_at", None), + endpoint_name=d.get("endpoint_name", None), + group_id=_enum(d, "group_id", NccAzurePrivateEndpointRuleGroupId), + network_connectivity_config_id=d.get("network_connectivity_config_id", None), + resource_id=d.get("resource_id", None), + rule_id=d.get("rule_id", None), + updated_time=d.get("updated_time", None), ) @@ -2757,20 +2757,20 @@ def as_shallow_dict(self) -> dict: """Serializes the NccAzureServiceEndpointRule into a shallow dictionary of its immediate attributes.""" body = {} if self.subnets: - body["{subnets}"] = self.subnets + body["subnets"] = self.subnets if self.target_region is not None: - body["{target_region}"] = self.target_region + body["target_region"] = self.target_region if self.target_services: - body["{target_services}"] = self.target_services + body["target_services"] = self.target_services return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccAzureServiceEndpointRule: """Deserializes the NccAzureServiceEndpointRule from a dictionary.""" return cls( - subnets=d.get("{subnets}", None), - target_region=d.get("{target_region}", None), - target_services=d.get("{target_services}", None), + subnets=d.get("subnets", None), + target_region=d.get("target_region", None), + target_services=d.get("target_services", None), ) @@ -2801,17 +2801,17 @@ def as_shallow_dict(self) -> dict: """Serializes the NccEgressConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.default_rules: - body["{default_rules}"] = self.default_rules + body["default_rules"] = self.default_rules if self.target_rules: - body["{target_rules}"] = self.target_rules + body["target_rules"] = self.target_rules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccEgressConfig: """Deserializes the NccEgressConfig from a dictionary.""" return cls( - default_rules=_from_dict(d, "{default_rules}", NccEgressDefaultRules), - target_rules=_from_dict(d, "{target_rules}", NccEgressTargetRules), + default_rules=_from_dict(d, "default_rules", NccEgressDefaultRules), + target_rules=_from_dict(d, "target_rules", NccEgressTargetRules), ) @@ -2842,17 +2842,17 @@ def as_shallow_dict(self) -> dict: """Serializes the NccEgressDefaultRules into a shallow dictionary of its immediate attributes.""" body = {} if self.aws_stable_ip_rule: - body["{aws_stable_ip_rule}"] = self.aws_stable_ip_rule + body["aws_stable_ip_rule"] = self.aws_stable_ip_rule if self.azure_service_endpoint_rule: - body["{azure_service_endpoint_rule}"] = self.azure_service_endpoint_rule + body["azure_service_endpoint_rule"] = self.azure_service_endpoint_rule return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccEgressDefaultRules: """Deserializes the NccEgressDefaultRules from a dictionary.""" return cls( - aws_stable_ip_rule=_from_dict(d, "{aws_stable_ip_rule}", NccAwsStableIpRule), - azure_service_endpoint_rule=_from_dict(d, "{azure_service_endpoint_rule}", NccAzureServiceEndpointRule), + aws_stable_ip_rule=_from_dict(d, "aws_stable_ip_rule", NccAwsStableIpRule), + azure_service_endpoint_rule=_from_dict(d, "azure_service_endpoint_rule", NccAzureServiceEndpointRule), ) @@ -2874,16 +2874,14 @@ def as_shallow_dict(self) -> dict: """Serializes the NccEgressTargetRules into a shallow dictionary of its immediate attributes.""" body = {} if self.azure_private_endpoint_rules: - body["{azure_private_endpoint_rules}"] = self.azure_private_endpoint_rules + body["azure_private_endpoint_rules"] = self.azure_private_endpoint_rules return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NccEgressTargetRules: """Deserializes the NccEgressTargetRules from a dictionary.""" return cls( - azure_private_endpoint_rules=_repeated_dict( - d, "{azure_private_endpoint_rules}", NccAzurePrivateEndpointRule - ) + azure_private_endpoint_rules=_repeated_dict(d, "azure_private_endpoint_rules", NccAzurePrivateEndpointRule) ) @@ -2937,32 +2935,32 @@ def as_shallow_dict(self) -> dict: """Serializes the NetworkConnectivityConfiguration into a shallow dictionary of its immediate attributes.""" body = {} if self.account_id is not None: - body["{account_id}"] = self.account_id + body["account_id"] = self.account_id if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.egress_config: - body["{egress_config}"] = self.egress_config + body["egress_config"] = self.egress_config if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.network_connectivity_config_id is not None: - body["{network_connectivity_config_id}"] = self.network_connectivity_config_id + body["network_connectivity_config_id"] = self.network_connectivity_config_id if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.updated_time is not None: - body["{updated_time}"] = self.updated_time + body["updated_time"] = self.updated_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NetworkConnectivityConfiguration: """Deserializes the NetworkConnectivityConfiguration from a dictionary.""" return cls( - account_id=d.get("{account_id}", None), - creation_time=d.get("{creation_time}", None), - egress_config=_from_dict(d, "{egress_config}", NccEgressConfig), - name=d.get("{name}", None), - network_connectivity_config_id=d.get("{network_connectivity_config_id}", None), - region=d.get("{region}", None), - updated_time=d.get("{updated_time}", None), + account_id=d.get("account_id", None), + creation_time=d.get("creation_time", None), + egress_config=_from_dict(d, "egress_config", NccEgressConfig), + name=d.get("name", None), + network_connectivity_config_id=d.get("network_connectivity_config_id", None), + region=d.get("region", None), + updated_time=d.get("updated_time", None), ) @@ -2998,23 +2996,23 @@ def as_shallow_dict(self) -> dict: """Serializes the NotificationDestination into a shallow dictionary of its immediate attributes.""" body = {} if self.config: - body["{config}"] = self.config + body["config"] = self.config if self.destination_type is not None: - body["{destination_type}"] = self.destination_type + body["destination_type"] = self.destination_type if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotificationDestination: """Deserializes the NotificationDestination from a dictionary.""" return cls( - config=_from_dict(d, "{config}", Config), - destination_type=_enum(d, "{destination_type}", DestinationType), - display_name=d.get("{display_name}", None), - id=d.get("{id}", None), + config=_from_dict(d, "config", Config), + destination_type=_enum(d, "destination_type", DestinationType), + display_name=d.get("display_name", None), + id=d.get("id", None), ) @@ -3039,16 +3037,16 @@ def as_shallow_dict(self) -> dict: """Serializes the PagerdutyConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.integration_key is not None: - body["{integration_key}"] = self.integration_key + body["integration_key"] = self.integration_key if self.integration_key_set is not None: - body["{integration_key_set}"] = self.integration_key_set + body["integration_key_set"] = self.integration_key_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PagerdutyConfig: """Deserializes the PagerdutyConfig from a dictionary.""" return cls( - integration_key=d.get("{integration_key}", None), integration_key_set=d.get("{integration_key_set}", None) + integration_key=d.get("integration_key", None), integration_key_set=d.get("integration_key_set", None) ) @@ -3070,13 +3068,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PartitionId into a shallow dictionary of its immediate attributes.""" body = {} if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspaceId"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartitionId: """Deserializes the PartitionId from a dictionary.""" - return cls(workspace_id=d.get("{workspace_id}", None)) + return cls(workspace_id=d.get("workspaceId", None)) @dataclass @@ -3099,13 +3097,13 @@ def as_shallow_dict(self) -> dict: """Serializes the PersonalComputeMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PersonalComputeMessage: """Deserializes the PersonalComputeMessage from a dictionary.""" - return cls(value=_enum(d, "{value}", PersonalComputeMessageEnum)) + return cls(value=_enum(d, "value", PersonalComputeMessageEnum)) class PersonalComputeMessageEnum(Enum): @@ -3152,20 +3150,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PersonalComputeSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.personal_compute: - body["{personal_compute}"] = self.personal_compute + body["personal_compute"] = self.personal_compute if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PersonalComputeSetting: """Deserializes the PersonalComputeSetting from a dictionary.""" return cls( - etag=d.get("{etag}", None), - personal_compute=_from_dict(d, "{personal_compute}", PersonalComputeMessage), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + personal_compute=_from_dict(d, "personal_compute", PersonalComputeMessage), + setting_name=d.get("setting_name", None), ) @@ -3200,23 +3198,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PublicTokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.expiry_time is not None: - body["{expiry_time}"] = self.expiry_time + body["expiry_time"] = self.expiry_time if self.token_id is not None: - body["{token_id}"] = self.token_id + body["token_id"] = self.token_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PublicTokenInfo: """Deserializes the PublicTokenInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - creation_time=d.get("{creation_time}", None), - expiry_time=d.get("{expiry_time}", None), - token_id=d.get("{token_id}", None), + comment=d.get("comment", None), + creation_time=d.get("creation_time", None), + expiry_time=d.get("expiry_time", None), + token_id=d.get("token_id", None), ) @@ -3260,26 +3258,26 @@ def as_shallow_dict(self) -> dict: """Serializes the ReplaceIpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.ip_access_list_id is not None: - body["{ip_access_list_id}"] = self.ip_access_list_id + body["ip_access_list_id"] = self.ip_access_list_id if self.ip_addresses: - body["{ip_addresses}"] = self.ip_addresses + body["ip_addresses"] = self.ip_addresses if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_type is not None: - body["{list_type}"] = self.list_type + body["list_type"] = self.list_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ReplaceIpAccessList: """Deserializes the ReplaceIpAccessList from a dictionary.""" return cls( - enabled=d.get("{enabled}", None), - ip_access_list_id=d.get("{ip_access_list_id}", None), - ip_addresses=d.get("{ip_addresses}", None), - label=d.get("{label}", None), - list_type=_enum(d, "{list_type}", ListType), + enabled=d.get("enabled", None), + ip_access_list_id=d.get("ip_access_list_id", None), + ip_addresses=d.get("ip_addresses", None), + label=d.get("label", None), + list_type=_enum(d, "list_type", ListType), ) @@ -3316,13 +3314,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestrictWorkspaceAdminsMessage: """Deserializes the RestrictWorkspaceAdminsMessage from a dictionary.""" - return cls(status=_enum(d, "{status}", RestrictWorkspaceAdminsMessageStatus)) + return cls(status=_enum(d, "status", RestrictWorkspaceAdminsMessageStatus)) class RestrictWorkspaceAdminsMessageStatus(Enum): @@ -3364,20 +3362,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RestrictWorkspaceAdminsSetting into a shallow dictionary of its immediate attributes.""" body = {} if self.etag is not None: - body["{etag}"] = self.etag + body["etag"] = self.etag if self.restrict_workspace_admins: - body["{restrict_workspace_admins}"] = self.restrict_workspace_admins + body["restrict_workspace_admins"] = self.restrict_workspace_admins if self.setting_name is not None: - body["{setting_name}"] = self.setting_name + body["setting_name"] = self.setting_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RestrictWorkspaceAdminsSetting: """Deserializes the RestrictWorkspaceAdminsSetting from a dictionary.""" return cls( - etag=d.get("{etag}", None), - restrict_workspace_admins=_from_dict(d, "{restrict_workspace_admins}", RestrictWorkspaceAdminsMessage), - setting_name=d.get("{setting_name}", None), + etag=d.get("etag", None), + restrict_workspace_admins=_from_dict(d, "restrict_workspace_admins", RestrictWorkspaceAdminsMessage), + setting_name=d.get("setting_name", None), ) @@ -3397,13 +3395,13 @@ def as_shallow_dict(self) -> dict: """Serializes the RevokeTokenRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.token_id is not None: - body["{token_id}"] = self.token_id + body["token_id"] = self.token_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RevokeTokenRequest: """Deserializes the RevokeTokenRequest from a dictionary.""" - return cls(token_id=d.get("{token_id}", None)) + return cls(token_id=d.get("token_id", None)) @dataclass @@ -3463,15 +3461,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SlackConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url if self.url_set is not None: - body["{url_set}"] = self.url_set + body["url_set"] = self.url_set return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SlackConfig: """Deserializes the SlackConfig from a dictionary.""" - return cls(url=d.get("{url}", None), url_set=d.get("{url_set}", None)) + return cls(url=d.get("url", None), url_set=d.get("url_set", None)) @dataclass @@ -3490,13 +3488,13 @@ def as_shallow_dict(self) -> dict: """Serializes the StringMessage into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StringMessage: """Deserializes the StringMessage from a dictionary.""" - return cls(value=d.get("{value}", None)) + return cls(value=d.get("value", None)) @dataclass @@ -3530,23 +3528,23 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenAccessControlRequest: """Deserializes the TokenAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", TokenPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", TokenPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -3586,26 +3584,26 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenAccessControlResponse: """Deserializes the TokenAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", TokenPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", TokenPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -3665,38 +3663,38 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_by_id is not None: - body["{created_by_id}"] = self.created_by_id + body["created_by_id"] = self.created_by_id if self.created_by_username is not None: - body["{created_by_username}"] = self.created_by_username + body["created_by_username"] = self.created_by_username if self.creation_time is not None: - body["{creation_time}"] = self.creation_time + body["creation_time"] = self.creation_time if self.expiry_time is not None: - body["{expiry_time}"] = self.expiry_time + body["expiry_time"] = self.expiry_time if self.last_used_day is not None: - body["{last_used_day}"] = self.last_used_day + body["last_used_day"] = self.last_used_day if self.owner_id is not None: - body["{owner_id}"] = self.owner_id + body["owner_id"] = self.owner_id if self.token_id is not None: - body["{token_id}"] = self.token_id + body["token_id"] = self.token_id if self.workspace_id is not None: - body["{workspace_id}"] = self.workspace_id + body["workspace_id"] = self.workspace_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenInfo: """Deserializes the TokenInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - created_by_id=d.get("{created_by_id}", None), - created_by_username=d.get("{created_by_username}", None), - creation_time=d.get("{creation_time}", None), - expiry_time=d.get("{expiry_time}", None), - last_used_day=d.get("{last_used_day}", None), - owner_id=d.get("{owner_id}", None), - token_id=d.get("{token_id}", None), - workspace_id=d.get("{workspace_id}", None), + comment=d.get("comment", None), + created_by_id=d.get("created_by_id", None), + created_by_username=d.get("created_by_username", None), + creation_time=d.get("creation_time", None), + expiry_time=d.get("expiry_time", None), + last_used_day=d.get("last_used_day", None), + owner_id=d.get("owner_id", None), + token_id=d.get("token_id", None), + workspace_id=d.get("workspace_id", None), ) @@ -3724,20 +3722,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermission: """Deserializes the TokenPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", TokenPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", TokenPermissionLevel), ) @@ -3770,20 +3768,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermissions: """Deserializes the TokenPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", TokenAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", TokenAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -3807,17 +3805,16 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermissionsDescription: """Deserializes the TokenPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", TokenPermissionLevel), + description=d.get("description", None), permission_level=_enum(d, "permission_level", TokenPermissionLevel) ) @@ -3836,13 +3833,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TokenPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TokenPermissionsRequest: """Deserializes the TokenPermissionsRequest from a dictionary.""" - return cls(access_control_list=_repeated_dict(d, "{access_control_list}", TokenAccessControlRequest)) + return cls(access_control_list=_repeated_dict(d, "access_control_list", TokenAccessControlRequest)) class TokenType(Enum): @@ -3892,20 +3889,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateAccountIpAccessEnableRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAccountIpAccessEnableRequest: """Deserializes the UpdateAccountIpAccessEnableRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", AccountIpAccessEnable), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", AccountIpAccessEnable), ) @@ -3944,20 +3941,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAibiDashboardEmbeddingAccessPolicySettingRequest: """Deserializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", AibiDashboardEmbeddingAccessPolicySetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", AibiDashboardEmbeddingAccessPolicySetting), ) @@ -3996,20 +3993,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest: """Deserializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", AibiDashboardEmbeddingApprovedDomainsSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", AibiDashboardEmbeddingApprovedDomainsSetting), ) @@ -4048,20 +4045,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateAutomaticClusterUpdateSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAutomaticClusterUpdateSettingRequest: """Deserializes the UpdateAutomaticClusterUpdateSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", AutomaticClusterUpdateSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", AutomaticClusterUpdateSetting), ) @@ -4100,20 +4097,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateComplianceSecurityProfileSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateComplianceSecurityProfileSettingRequest: """Deserializes the UpdateComplianceSecurityProfileSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", ComplianceSecurityProfileSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", ComplianceSecurityProfileSetting), ) @@ -4152,20 +4149,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCspEnablementAccountSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCspEnablementAccountSettingRequest: """Deserializes the UpdateCspEnablementAccountSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", CspEnablementAccountSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", CspEnablementAccountSetting), ) @@ -4211,20 +4208,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateDefaultNamespaceSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDefaultNamespaceSettingRequest: """Deserializes the UpdateDefaultNamespaceSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", DefaultNamespaceSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", DefaultNamespaceSetting), ) @@ -4263,20 +4260,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateDisableLegacyAccessRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDisableLegacyAccessRequest: """Deserializes the UpdateDisableLegacyAccessRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", DisableLegacyAccess), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", DisableLegacyAccess), ) @@ -4315,20 +4312,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateDisableLegacyDbfsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDisableLegacyDbfsRequest: """Deserializes the UpdateDisableLegacyDbfsRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", DisableLegacyDbfs), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", DisableLegacyDbfs), ) @@ -4367,20 +4364,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateDisableLegacyFeaturesRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateDisableLegacyFeaturesRequest: """Deserializes the UpdateDisableLegacyFeaturesRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", DisableLegacyFeatures), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", DisableLegacyFeatures), ) @@ -4419,20 +4416,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateEnhancedSecurityMonitoringSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateEnhancedSecurityMonitoringSettingRequest: """Deserializes the UpdateEnhancedSecurityMonitoringSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", EnhancedSecurityMonitoringSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", EnhancedSecurityMonitoringSetting), ) @@ -4471,20 +4468,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateEsmEnablementAccountSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateEsmEnablementAccountSettingRequest: """Deserializes the UpdateEsmEnablementAccountSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", EsmEnablementAccountSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", EsmEnablementAccountSetting), ) @@ -4528,26 +4525,26 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateIpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.ip_access_list_id is not None: - body["{ip_access_list_id}"] = self.ip_access_list_id + body["ip_access_list_id"] = self.ip_access_list_id if self.ip_addresses: - body["{ip_addresses}"] = self.ip_addresses + body["ip_addresses"] = self.ip_addresses if self.label is not None: - body["{label}"] = self.label + body["label"] = self.label if self.list_type is not None: - body["{list_type}"] = self.list_type + body["list_type"] = self.list_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateIpAccessList: """Deserializes the UpdateIpAccessList from a dictionary.""" return cls( - enabled=d.get("{enabled}", None), - ip_access_list_id=d.get("{ip_access_list_id}", None), - ip_addresses=d.get("{ip_addresses}", None), - label=d.get("{label}", None), - list_type=_enum(d, "{list_type}", ListType), + enabled=d.get("enabled", None), + ip_access_list_id=d.get("ip_access_list_id", None), + ip_addresses=d.get("ip_addresses", None), + label=d.get("label", None), + list_type=_enum(d, "list_type", ListType), ) @@ -4577,18 +4574,18 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateNotificationDestinationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.config: - body["{config}"] = self.config + body["config"] = self.config if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateNotificationDestinationRequest: """Deserializes the UpdateNotificationDestinationRequest from a dictionary.""" return cls( - config=_from_dict(d, "{config}", Config), display_name=d.get("{display_name}", None), id=d.get("{id}", None) + config=_from_dict(d, "config", Config), display_name=d.get("display_name", None), id=d.get("id", None) ) @@ -4627,20 +4624,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdatePersonalComputeSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdatePersonalComputeSettingRequest: """Deserializes the UpdatePersonalComputeSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", PersonalComputeSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", PersonalComputeSetting), ) @@ -4697,20 +4694,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRestrictWorkspaceAdminsSettingRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_missing is not None: - body["{allow_missing}"] = self.allow_missing + body["allow_missing"] = self.allow_missing if self.field_mask is not None: - body["{field_mask}"] = self.field_mask + body["field_mask"] = self.field_mask if self.setting: - body["{setting}"] = self.setting + body["setting"] = self.setting return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRestrictWorkspaceAdminsSettingRequest: """Deserializes the UpdateRestrictWorkspaceAdminsSettingRequest from a dictionary.""" return cls( - allow_missing=d.get("{allow_missing}", None), - field_mask=d.get("{field_mask}", None), - setting=_from_dict(d, "{setting}", RestrictWorkspaceAdminsSetting), + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", RestrictWorkspaceAdminsSetting), ) @@ -4772,11 +4769,11 @@ def create( """ body = {} if ip_addresses is not None: - body["{ip_addresses}"] = [v for v in ip_addresses] + body["ip_addresses"] = [v for v in ip_addresses] if label is not None: - body["{label}"] = label + body["label"] = label if list_type is not None: - body["{list_type}"] = list_type.value + body["list_type"] = list_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -4878,13 +4875,13 @@ def replace( """ body = {} if enabled is not None: - body["{enabled}"] = enabled + body["enabled"] = enabled if ip_addresses is not None: - body["{ip_addresses}"] = [v for v in ip_addresses] + body["ip_addresses"] = [v for v in ip_addresses] if label is not None: - body["{label}"] = label + body["label"] = label if list_type is not None: - body["{list_type}"] = list_type.value + body["list_type"] = list_type.value headers = { "0": "{Content-Type application/json}", } @@ -4938,13 +4935,13 @@ def update( """ body = {} if enabled is not None: - body["{enabled}"] = enabled + body["enabled"] = enabled if ip_addresses is not None: - body["{ip_addresses}"] = [v for v in ip_addresses] + body["ip_addresses"] = [v for v in ip_addresses] if label is not None: - body["{label}"] = label + body["label"] = label if list_type is not None: - body["{list_type}"] = list_type.value + body["list_type"] = list_type.value headers = { "0": "{Content-Type application/json}", } @@ -4988,7 +4985,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5019,7 +5016,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingAccessPoli query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5054,11 +5051,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5095,7 +5092,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5125,7 +5122,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingApprovedDo query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5164,11 +5161,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5207,7 +5204,7 @@ def get(self, *, etag: Optional[str] = None) -> AutomaticClusterUpdateSetting: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5245,11 +5242,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5287,7 +5284,7 @@ def get(self, *, etag: Optional[str] = None) -> ComplianceSecurityProfileSetting query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5325,11 +5322,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5367,11 +5364,11 @@ def exchange_token( """ body = {} if partition_id is not None: - body["{partition_id}"] = partition_id.as_dict() + body["partitionId"] = partition_id.as_dict() if scopes is not None: - body["{scopes}"] = [v for v in scopes] + body["scopes"] = [v for v in scopes] if token_type is not None: - body["{token_type}"] = [v.value for v in token_type] + body["tokenType"] = [v.value for v in token_type] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5409,7 +5406,7 @@ def get(self, *, etag: Optional[str] = None) -> CspEnablementAccountSetting: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5447,11 +5444,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5501,7 +5498,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultNamespaceSetting query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5528,7 +5525,7 @@ def get(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5573,11 +5570,11 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5617,7 +5614,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyAccessResp query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5644,7 +5641,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyAccess: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5677,11 +5674,11 @@ def update(self, allow_missing: bool, setting: DisableLegacyAccess, field_mask: """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5717,7 +5714,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyDbfsRespon query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5744,7 +5741,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyDbfs: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5777,11 +5774,11 @@ def update(self, allow_missing: bool, setting: DisableLegacyDbfs, field_mask: st """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5820,7 +5817,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyFeaturesRe query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5850,7 +5847,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyFeatures: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5886,11 +5883,11 @@ def update(self, allow_missing: bool, setting: DisableLegacyFeatures, field_mask """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -5929,7 +5926,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAccountIpAccessEnableRe query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5959,7 +5956,7 @@ def get(self, *, etag: Optional[str] = None) -> AccountIpAccessEnable: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -5995,11 +5992,11 @@ def update(self, allow_missing: bool, setting: AccountIpAccessEnable, field_mask """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6042,7 +6039,7 @@ def get(self, *, etag: Optional[str] = None) -> EnhancedSecurityMonitoringSettin query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -6080,11 +6077,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6121,7 +6118,7 @@ def get(self, *, etag: Optional[str] = None) -> EsmEnablementAccountSetting: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -6159,11 +6156,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6233,11 +6230,11 @@ def create( """ body = {} if ip_addresses is not None: - body["{ip_addresses}"] = [v for v in ip_addresses] + body["ip_addresses"] = [v for v in ip_addresses] if label is not None: - body["{label}"] = label + body["label"] = label if list_type is not None: - body["{list_type}"] = list_type.value + body["list_type"] = list_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6334,13 +6331,13 @@ def replace( """ body = {} if enabled is not None: - body["{enabled}"] = enabled + body["enabled"] = enabled if ip_addresses is not None: - body["{ip_addresses}"] = [v for v in ip_addresses] + body["ip_addresses"] = [v for v in ip_addresses] if label is not None: - body["{label}"] = label + body["label"] = label if list_type is not None: - body["{list_type}"] = list_type.value + body["list_type"] = list_type.value headers = { "0": "{Content-Type application/json}", } @@ -6390,13 +6387,13 @@ def update( """ body = {} if enabled is not None: - body["{enabled}"] = enabled + body["enabled"] = enabled if ip_addresses is not None: - body["{ip_addresses}"] = [v for v in ip_addresses] + body["ip_addresses"] = [v for v in ip_addresses] if label is not None: - body["{label}"] = label + body["label"] = label if list_type is not None: - body["{list_type}"] = list_type.value + body["list_type"] = list_type.value headers = { "0": "{Content-Type application/json}", } @@ -6426,9 +6423,9 @@ def create_network_connectivity_configuration(self, name: str, region: str) -> N """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if region is not None: - body["{region}"] = region + body["region"] = region headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6466,9 +6463,9 @@ def create_private_endpoint_rule( """ body = {} if group_id is not None: - body["{group_id}"] = group_id.value + body["group_id"] = group_id.value if resource_id is not None: - body["{resource_id}"] = resource_id + body["resource_id"] = resource_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6597,7 +6594,7 @@ def list_network_connectivity_configurations( query = {} if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -6609,12 +6606,12 @@ def list_network_connectivity_configurations( query=query, headers=headers, ) - if "{items}" in json: - for v in json["{items}"]: + if "items" in json: + for v in json["items"]: yield NetworkConnectivityConfiguration.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_private_endpoint_rules( self, network_connectivity_config_id: str, *, page_token: Optional[str] = None @@ -6633,7 +6630,7 @@ def list_private_endpoint_rules( query = {} if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -6645,12 +6642,12 @@ def list_private_endpoint_rules( query=query, headers=headers, ) - if "{items}" in json: - for v in json["{items}"]: + if "items" in json: + for v in json["items"]: yield NccAzurePrivateEndpointRule.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class NotificationDestinationsAPI: @@ -6676,9 +6673,9 @@ def create(self, *, config: Optional[Config] = None, display_name: Optional[str] """ body = {} if config is not None: - body["{config}"] = config.as_dict() + body["config"] = config.as_dict() if display_name is not None: - body["{display_name}"] = display_name + body["display_name"] = display_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6735,21 +6732,21 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/notification-destinations", query=query, headers=headers) - if "{results}" in json: - for v in json["{results}"]: + if "results" in json: + for v in json["results"]: yield ListNotificationDestinationsResult.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, id: str, *, config: Optional[Config] = None, display_name: Optional[str] = None @@ -6770,9 +6767,9 @@ def update( """ body = {} if config is not None: - body["{config}"] = config.as_dict() + body["config"] = config.as_dict() if display_name is not None: - body["{display_name}"] = display_name + body["display_name"] = display_name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6811,7 +6808,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeletePersonalComputeSettingR query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -6841,7 +6838,7 @@ def get(self, *, etag: Optional[str] = None) -> PersonalComputeSetting: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -6877,11 +6874,11 @@ def update(self, allow_missing: bool, setting: PersonalComputeSetting, field_mas """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -6930,7 +6927,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteRestrictWorkspaceAdmins query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -6957,7 +6954,7 @@ def get(self, *, etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting: query = {} if etag is not None: - query["{etag}"] = etag + query["etag"] = etag headers = { "0": "{Accept application/json}", } @@ -6995,11 +6992,11 @@ def update( """ body = {} if allow_missing is not None: - body["{allow_missing}"] = allow_missing + body["allow_missing"] = allow_missing if field_mask is not None: - body["{field_mask}"] = field_mask + body["field_mask"] = field_mask if setting is not None: - body["{setting}"] = setting.as_dict() + body["setting"] = setting.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7043,11 +7040,11 @@ def create_obo_token( """ body = {} if application_id is not None: - body["{application_id}"] = application_id + body["application_id"] = application_id if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if lifetime_seconds is not None: - body["{lifetime_seconds}"] = lifetime_seconds + body["lifetime_seconds"] = lifetime_seconds headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7136,9 +7133,9 @@ def list( query = {} if created_by_id is not None: - query["{created_by_id}"] = created_by_id + query["created_by_id"] = created_by_id if created_by_username is not None: - query["{created_by_username}"] = created_by_username + query["created_by_username"] = created_by_username headers = { "0": "{Accept application/json}", } @@ -7161,7 +7158,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7183,7 +7180,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7218,9 +7215,9 @@ def create(self, *, comment: Optional[str] = None, lifetime_seconds: Optional[in """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if lifetime_seconds is not None: - body["{lifetime_seconds}"] = lifetime_seconds + body["lifetime_seconds"] = lifetime_seconds headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7243,7 +7240,7 @@ def delete(self, token_id: str): """ body = {} if token_id is not None: - body["{token_id}"] = token_id + body["token_id"] = token_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7286,7 +7283,7 @@ def get_status(self, keys: str) -> WorkspaceConf: query = {} if keys is not None: - query["{keys}"] = keys + query["keys"] = keys headers = { "0": "{Accept application/json}", } diff --git a/databricks/sdk/sharing/v2/impl.py b/databricks/sdk/sharing/v2/impl.py index badeb0722..7ceed0b30 100755 --- a/databricks/sdk/sharing/v2/impl.py +++ b/databricks/sdk/sharing/v2/impl.py @@ -84,23 +84,23 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateProvider into a shallow dictionary of its immediate attributes.""" body = {} if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type + body["authentication_type"] = self.authentication_type if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.recipient_profile_str is not None: - body["{recipient_profile_str}"] = self.recipient_profile_str + body["recipient_profile_str"] = self.recipient_profile_str return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateProvider: """Deserializes the CreateProvider from a dictionary.""" return cls( - authentication_type=_enum(d, "{authentication_type}", AuthenticationType), - comment=d.get("{comment}", None), - name=d.get("{name}", None), - recipient_profile_str=d.get("{recipient_profile_str}", None), + authentication_type=_enum(d, "authentication_type", AuthenticationType), + comment=d.get("comment", None), + name=d.get("name", None), + recipient_profile_str=d.get("recipient_profile_str", None), ) @@ -165,38 +165,38 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateRecipient into a shallow dictionary of its immediate attributes.""" body = {} if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type + body["authentication_type"] = self.authentication_type if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.data_recipient_global_metastore_id is not None: - body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id + body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list + body["ip_access_list"] = self.ip_access_list if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties_kvpairs: - body["{properties_kvpairs}"] = self.properties_kvpairs + body["properties_kvpairs"] = self.properties_kvpairs if self.sharing_code is not None: - body["{sharing_code}"] = self.sharing_code + body["sharing_code"] = self.sharing_code return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRecipient: """Deserializes the CreateRecipient from a dictionary.""" return cls( - authentication_type=_enum(d, "{authentication_type}", AuthenticationType), - comment=d.get("{comment}", None), - data_recipient_global_metastore_id=d.get("{data_recipient_global_metastore_id}", None), - expiration_time=d.get("{expiration_time}", None), - ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessList), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - properties_kvpairs=_from_dict(d, "{properties_kvpairs}", SecurablePropertiesKvPairs), - sharing_code=d.get("{sharing_code}", None), + authentication_type=_enum(d, "authentication_type", AuthenticationType), + comment=d.get("comment", None), + data_recipient_global_metastore_id=d.get("data_recipient_global_metastore_id", None), + expiration_time=d.get("expiration_time", None), + ip_access_list=_from_dict(d, "ip_access_list", IpAccessList), + name=d.get("name", None), + owner=d.get("owner", None), + properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs), + sharing_code=d.get("sharing_code", None), ) @@ -226,19 +226,17 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateShare into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateShare: """Deserializes the CreateShare from a dictionary.""" - return cls( - comment=d.get("{comment}", None), name=d.get("{name}", None), storage_root=d.get("{storage_root}", None) - ) + return cls(comment=d.get("comment", None), name=d.get("name", None), storage_root=d.get("storage_root", None)) @dataclass @@ -282,17 +280,17 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function: - body["{function}"] = self.function + body["function"] = self.function if self.table: - body["{table}"] = self.table + body["table"] = self.table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingDependency: """Deserializes the DeltaSharingDependency from a dictionary.""" return cls( - function=_from_dict(d, "{function}", DeltaSharingFunctionDependency), - table=_from_dict(d, "{table}", DeltaSharingTableDependency), + function=_from_dict(d, "function", DeltaSharingFunctionDependency), + table=_from_dict(d, "table", DeltaSharingTableDependency), ) @@ -314,13 +312,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingDependencyList into a shallow dictionary of its immediate attributes.""" body = {} if self.dependencies: - body["{dependencies}"] = self.dependencies + body["dependencies"] = self.dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingDependencyList: """Deserializes the DeltaSharingDependencyList from a dictionary.""" - return cls(dependencies=_repeated_dict(d, "{dependencies}", DeltaSharingDependency)) + return cls(dependencies=_repeated_dict(d, "dependencies", DeltaSharingDependency)) @dataclass @@ -414,59 +412,59 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingFunction into a shallow dictionary of its immediate attributes.""" body = {} if self.aliases: - body["{aliases}"] = self.aliases + body["aliases"] = self.aliases if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.data_type is not None: - body["{data_type}"] = self.data_type + body["data_type"] = self.data_type if self.dependency_list: - body["{dependency_list}"] = self.dependency_list + body["dependency_list"] = self.dependency_list if self.full_data_type is not None: - body["{full_data_type}"] = self.full_data_type + body["full_data_type"] = self.full_data_type if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.input_params: - body["{input_params}"] = self.input_params + body["input_params"] = self.input_params if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.properties is not None: - body["{properties}"] = self.properties + body["properties"] = self.properties if self.routine_definition is not None: - body["{routine_definition}"] = self.routine_definition + body["routine_definition"] = self.routine_definition if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.securable_kind is not None: - body["{securable_kind}"] = self.securable_kind + body["securable_kind"] = self.securable_kind if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingFunction: """Deserializes the DeltaSharingFunction from a dictionary.""" return cls( - aliases=_repeated_dict(d, "{aliases}", RegisteredModelAlias), - comment=d.get("{comment}", None), - data_type=_enum(d, "{data_type}", ColumnTypeName), - dependency_list=_from_dict(d, "{dependency_list}", DeltaSharingDependencyList), - full_data_type=d.get("{full_data_type}", None), - id=d.get("{id}", None), - input_params=_from_dict(d, "{input_params}", FunctionParameterInfos), - name=d.get("{name}", None), - properties=d.get("{properties}", None), - routine_definition=d.get("{routine_definition}", None), - schema=d.get("{schema}", None), - securable_kind=_enum(d, "{securable_kind}", SharedSecurableKind), - share=d.get("{share}", None), - share_id=d.get("{share_id}", None), - storage_location=d.get("{storage_location}", None), - tags=_repeated_dict(d, "{tags}", TagKeyValue), + aliases=_repeated_dict(d, "aliases", RegisteredModelAlias), + comment=d.get("comment", None), + data_type=_enum(d, "data_type", ColumnTypeName), + dependency_list=_from_dict(d, "dependency_list", DeltaSharingDependencyList), + full_data_type=d.get("full_data_type", None), + id=d.get("id", None), + input_params=_from_dict(d, "input_params", FunctionParameterInfos), + name=d.get("name", None), + properties=d.get("properties", None), + routine_definition=d.get("routine_definition", None), + schema=d.get("schema", None), + securable_kind=_enum(d, "securable_kind", SharedSecurableKind), + share=d.get("share", None), + share_id=d.get("share_id", None), + storage_location=d.get("storage_location", None), + tags=_repeated_dict(d, "tags", TagKeyValue), ) @@ -491,15 +489,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingFunctionDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.function_name is not None: - body["{function_name}"] = self.function_name + body["function_name"] = self.function_name if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingFunctionDependency: """Deserializes the DeltaSharingFunctionDependency from a dictionary.""" - return cls(function_name=d.get("{function_name}", None), schema_name=d.get("{schema_name}", None)) + return cls(function_name=d.get("function_name", None), schema_name=d.get("schema_name", None)) @dataclass @@ -523,15 +521,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaSharingTableDependency into a shallow dictionary of its immediate attributes.""" body = {} if self.schema_name is not None: - body["{schema_name}"] = self.schema_name + body["schema_name"] = self.schema_name if self.table_name is not None: - body["{table_name}"] = self.table_name + body["table_name"] = self.table_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingTableDependency: """Deserializes the DeltaSharingTableDependency from a dictionary.""" - return cls(schema_name=d.get("{schema_name}", None), table_name=d.get("{table_name}", None)) + return cls(schema_name=d.get("schema_name", None), table_name=d.get("table_name", None)) @dataclass @@ -608,47 +606,47 @@ def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parameter_default is not None: - body["{parameter_default}"] = self.parameter_default + body["parameter_default"] = self.parameter_default if self.parameter_mode is not None: - body["{parameter_mode}"] = self.parameter_mode + body["parameter_mode"] = self.parameter_mode if self.parameter_type is not None: - body["{parameter_type}"] = self.parameter_type + body["parameter_type"] = self.parameter_type if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_json is not None: - body["{type_json}"] = self.type_json + body["type_json"] = self.type_json if self.type_name is not None: - body["{type_name}"] = self.type_name + body["type_name"] = self.type_name if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfo: """Deserializes the FunctionParameterInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - name=d.get("{name}", None), - parameter_default=d.get("{parameter_default}", None), - parameter_mode=_enum(d, "{parameter_mode}", FunctionParameterMode), - parameter_type=_enum(d, "{parameter_type}", FunctionParameterType), - position=d.get("{position}", None), - type_interval_type=d.get("{type_interval_type}", None), - type_json=d.get("{type_json}", None), - type_name=_enum(d, "{type_name}", ColumnTypeName), - type_precision=d.get("{type_precision}", None), - type_scale=d.get("{type_scale}", None), - type_text=d.get("{type_text}", None), + comment=d.get("comment", None), + name=d.get("name", None), + parameter_default=d.get("parameter_default", None), + parameter_mode=_enum(d, "parameter_mode", FunctionParameterMode), + parameter_type=_enum(d, "parameter_type", FunctionParameterType), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_json=d.get("type_json", None), + type_name=_enum(d, "type_name", ColumnTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), ) @@ -668,13 +666,13 @@ def as_shallow_dict(self) -> dict: """Serializes the FunctionParameterInfos into a shallow dictionary of its immediate attributes.""" body = {} if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfos: """Deserializes the FunctionParameterInfos from a dictionary.""" - return cls(parameters=_repeated_dict(d, "{parameters}", FunctionParameterInfo)) + return cls(parameters=_repeated_dict(d, "parameters", FunctionParameterInfo)) class FunctionParameterMode(Enum): @@ -730,17 +728,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GetRecipientSharePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.permissions_out: - body["{permissions_out}"] = self.permissions_out + body["permissions_out"] = self.permissions_out return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRecipientSharePermissionsResponse: """Deserializes the GetRecipientSharePermissionsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - permissions_out=_repeated_dict(d, "{permissions_out}", ShareToPrivilegeAssignment), + next_page_token=d.get("next_page_token", None), + permissions_out=_repeated_dict(d, "permissions_out", ShareToPrivilegeAssignment), ) @@ -766,17 +764,17 @@ def as_shallow_dict(self) -> dict: """Serializes the GetSharePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.privilege_assignments: - body["{privilege_assignments}"] = self.privilege_assignments + body["privilege_assignments"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetSharePermissionsResponse: """Deserializes the GetSharePermissionsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment), + next_page_token=d.get("next_page_token", None), + privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment), ) @@ -796,13 +794,13 @@ def as_shallow_dict(self) -> dict: """Serializes the IpAccessList into a shallow dictionary of its immediate attributes.""" body = {} if self.allowed_ip_addresses: - body["{allowed_ip_addresses}"] = self.allowed_ip_addresses + body["allowed_ip_addresses"] = self.allowed_ip_addresses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> IpAccessList: """Deserializes the IpAccessList from a dictionary.""" - return cls(allowed_ip_addresses=d.get("{allowed_ip_addresses}", None)) + return cls(allowed_ip_addresses=d.get("allowed_ip_addresses", None)) @dataclass @@ -838,23 +836,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ListProviderShareAssetsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.functions: - body["{functions}"] = self.functions + body["functions"] = self.functions if self.notebooks: - body["{notebooks}"] = self.notebooks + body["notebooks"] = self.notebooks if self.tables: - body["{tables}"] = self.tables + body["tables"] = self.tables if self.volumes: - body["{volumes}"] = self.volumes + body["volumes"] = self.volumes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProviderShareAssetsResponse: """Deserializes the ListProviderShareAssetsResponse from a dictionary.""" return cls( - functions=_repeated_dict(d, "{functions}", DeltaSharingFunction), - notebooks=_repeated_dict(d, "{notebooks}", NotebookFile), - tables=_repeated_dict(d, "{tables}", Table), - volumes=_repeated_dict(d, "{volumes}", Volume), + functions=_repeated_dict(d, "functions", DeltaSharingFunction), + notebooks=_repeated_dict(d, "notebooks", NotebookFile), + tables=_repeated_dict(d, "tables", Table), + volumes=_repeated_dict(d, "volumes", Volume), ) @@ -880,17 +878,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListProviderSharesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.shares: - body["{shares}"] = self.shares + body["shares"] = self.shares return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProviderSharesResponse: """Deserializes the ListProviderSharesResponse from a dictionary.""" - return cls( - next_page_token=d.get("{next_page_token}", None), shares=_repeated_dict(d, "{shares}", ProviderShare) - ) + return cls(next_page_token=d.get("next_page_token", None), shares=_repeated_dict(d, "shares", ProviderShare)) @dataclass @@ -915,16 +911,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListProvidersResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.providers: - body["{providers}"] = self.providers + body["providers"] = self.providers return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListProvidersResponse: """Deserializes the ListProvidersResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), providers=_repeated_dict(d, "{providers}", ProviderInfo) + next_page_token=d.get("next_page_token", None), providers=_repeated_dict(d, "providers", ProviderInfo) ) @@ -950,17 +946,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListRecipientsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.recipients: - body["{recipients}"] = self.recipients + body["recipients"] = self.recipients return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListRecipientsResponse: """Deserializes the ListRecipientsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - recipients=_repeated_dict(d, "{recipients}", RecipientInfo), + next_page_token=d.get("next_page_token", None), recipients=_repeated_dict(d, "recipients", RecipientInfo) ) @@ -986,15 +981,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListSharesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.shares: - body["{shares}"] = self.shares + body["shares"] = self.shares return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSharesResponse: """Deserializes the ListSharesResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), shares=_repeated_dict(d, "{shares}", ShareInfo)) + return cls(next_page_token=d.get("next_page_token", None), shares=_repeated_dict(d, "shares", ShareInfo)) @dataclass @@ -1038,29 +1033,29 @@ def as_shallow_dict(self) -> dict: """Serializes the NotebookFile into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NotebookFile: """Deserializes the NotebookFile from a dictionary.""" return cls( - comment=d.get("{comment}", None), - id=d.get("{id}", None), - name=d.get("{name}", None), - share=d.get("{share}", None), - share_id=d.get("{share_id}", None), - tags=_repeated_dict(d, "{tags}", TagKeyValue), + comment=d.get("comment", None), + id=d.get("id", None), + name=d.get("name", None), + share=d.get("share", None), + share_id=d.get("share_id", None), + tags=_repeated_dict(d, "tags", TagKeyValue), ) @@ -1080,13 +1075,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Partition into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Partition: """Deserializes the Partition from a dictionary.""" - return cls(values=_repeated_dict(d, "{values}", PartitionValue)) + return cls(values=_repeated_dict(d, "values", PartitionValue)) @dataclass @@ -1122,23 +1117,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PartitionValue into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.recipient_property_key is not None: - body["{recipient_property_key}"] = self.recipient_property_key + body["recipient_property_key"] = self.recipient_property_key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PartitionValue: """Deserializes the PartitionValue from a dictionary.""" return cls( - name=d.get("{name}", None), - op=_enum(d, "{op}", PartitionValueOp), - recipient_property_key=d.get("{recipient_property_key}", None), - value=d.get("{value}", None), + name=d.get("name", None), + op=_enum(d, "op", PartitionValueOp), + recipient_property_key=d.get("recipient_property_key", None), + value=d.get("value", None), ) @@ -1174,17 +1169,17 @@ def as_shallow_dict(self) -> dict: """Serializes the PermissionsChange into a shallow dictionary of its immediate attributes.""" body = {} if self.add: - body["{add}"] = self.add + body["add"] = self.add if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.remove: - body["{remove}"] = self.remove + body["remove"] = self.remove return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PermissionsChange: """Deserializes the PermissionsChange from a dictionary.""" - return cls(add=d.get("{add}", None), principal=d.get("{principal}", None), remove=d.get("{remove}", None)) + return cls(add=d.get("add", None), principal=d.get("principal", None), remove=d.get("remove", None)) class Privilege(Enum): @@ -1257,15 +1252,15 @@ def as_shallow_dict(self) -> dict: """Serializes the PrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.privileges: - body["{privileges}"] = self.privileges + body["privileges"] = self.privileges return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PrivilegeAssignment: """Deserializes the PrivilegeAssignment from a dictionary.""" - return cls(principal=d.get("{principal}", None), privileges=_repeated_enum(d, "{privileges}", Privilege)) + return cls(principal=d.get("principal", None), privileges=_repeated_enum(d, "privileges", Privilege)) @dataclass @@ -1356,53 +1351,53 @@ def as_shallow_dict(self) -> dict: """Serializes the ProviderInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type + body["authentication_type"] = self.authentication_type if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_provider_global_metastore_id is not None: - body["{data_provider_global_metastore_id}"] = self.data_provider_global_metastore_id + body["data_provider_global_metastore_id"] = self.data_provider_global_metastore_id if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.recipient_profile: - body["{recipient_profile}"] = self.recipient_profile + body["recipient_profile"] = self.recipient_profile if self.recipient_profile_str is not None: - body["{recipient_profile_str}"] = self.recipient_profile_str + body["recipient_profile_str"] = self.recipient_profile_str if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderInfo: """Deserializes the ProviderInfo from a dictionary.""" return cls( - authentication_type=_enum(d, "{authentication_type}", AuthenticationType), - cloud=d.get("{cloud}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - data_provider_global_metastore_id=d.get("{data_provider_global_metastore_id}", None), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - recipient_profile=_from_dict(d, "{recipient_profile}", RecipientProfile), - recipient_profile_str=d.get("{recipient_profile_str}", None), - region=d.get("{region}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + authentication_type=_enum(d, "authentication_type", AuthenticationType), + cloud=d.get("cloud", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + data_provider_global_metastore_id=d.get("data_provider_global_metastore_id", None), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + recipient_profile=_from_dict(d, "recipient_profile", RecipientProfile), + recipient_profile_str=d.get("recipient_profile_str", None), + region=d.get("region", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -1422,13 +1417,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ProviderShare into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ProviderShare: """Deserializes the ProviderShare from a dictionary.""" - return cls(name=d.get("{name}", None)) + return cls(name=d.get("name", None)) @dataclass @@ -1546,68 +1541,68 @@ def as_shallow_dict(self) -> dict: """Serializes the RecipientInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.activated is not None: - body["{activated}"] = self.activated + body["activated"] = self.activated if self.activation_url is not None: - body["{activation_url}"] = self.activation_url + body["activation_url"] = self.activation_url if self.authentication_type is not None: - body["{authentication_type}"] = self.authentication_type + body["authentication_type"] = self.authentication_type if self.cloud is not None: - body["{cloud}"] = self.cloud + body["cloud"] = self.cloud if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.data_recipient_global_metastore_id is not None: - body["{data_recipient_global_metastore_id}"] = self.data_recipient_global_metastore_id + body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list + body["ip_access_list"] = self.ip_access_list if self.metastore_id is not None: - body["{metastore_id}"] = self.metastore_id + body["metastore_id"] = self.metastore_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties_kvpairs: - body["{properties_kvpairs}"] = self.properties_kvpairs + body["properties_kvpairs"] = self.properties_kvpairs if self.region is not None: - body["{region}"] = self.region + body["region"] = self.region if self.sharing_code is not None: - body["{sharing_code}"] = self.sharing_code + body["sharing_code"] = self.sharing_code if self.tokens: - body["{tokens}"] = self.tokens + body["tokens"] = self.tokens if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RecipientInfo: """Deserializes the RecipientInfo from a dictionary.""" return cls( - activated=d.get("{activated}", None), - activation_url=d.get("{activation_url}", None), - authentication_type=_enum(d, "{authentication_type}", AuthenticationType), - cloud=d.get("{cloud}", None), - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - data_recipient_global_metastore_id=d.get("{data_recipient_global_metastore_id}", None), - expiration_time=d.get("{expiration_time}", None), - ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessList), - metastore_id=d.get("{metastore_id}", None), - name=d.get("{name}", None), - owner=d.get("{owner}", None), - properties_kvpairs=_from_dict(d, "{properties_kvpairs}", SecurablePropertiesKvPairs), - region=d.get("{region}", None), - sharing_code=d.get("{sharing_code}", None), - tokens=_repeated_dict(d, "{tokens}", RecipientTokenInfo), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + activated=d.get("activated", None), + activation_url=d.get("activation_url", None), + authentication_type=_enum(d, "authentication_type", AuthenticationType), + cloud=d.get("cloud", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + data_recipient_global_metastore_id=d.get("data_recipient_global_metastore_id", None), + expiration_time=d.get("expiration_time", None), + ip_access_list=_from_dict(d, "ip_access_list", IpAccessList), + metastore_id=d.get("metastore_id", None), + name=d.get("name", None), + owner=d.get("owner", None), + properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs), + region=d.get("region", None), + sharing_code=d.get("sharing_code", None), + tokens=_repeated_dict(d, "tokens", RecipientTokenInfo), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -1637,20 +1632,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RecipientProfile into a shallow dictionary of its immediate attributes.""" body = {} if self.bearer_token is not None: - body["{bearer_token}"] = self.bearer_token + body["bearer_token"] = self.bearer_token if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.share_credentials_version is not None: - body["{share_credentials_version}"] = self.share_credentials_version + body["share_credentials_version"] = self.share_credentials_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RecipientProfile: """Deserializes the RecipientProfile from a dictionary.""" return cls( - bearer_token=d.get("{bearer_token}", None), - endpoint=d.get("{endpoint}", None), - share_credentials_version=d.get("{share_credentials_version}", None), + bearer_token=d.get("bearer_token", None), + endpoint=d.get("endpoint", None), + share_credentials_version=d.get("share_credentials_version", None), ) @@ -1701,32 +1696,32 @@ def as_shallow_dict(self) -> dict: """Serializes the RecipientTokenInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.activation_url is not None: - body["{activation_url}"] = self.activation_url + body["activation_url"] = self.activation_url if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RecipientTokenInfo: """Deserializes the RecipientTokenInfo from a dictionary.""" return cls( - activation_url=d.get("{activation_url}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - expiration_time=d.get("{expiration_time}", None), - id=d.get("{id}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + activation_url=d.get("activation_url", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + expiration_time=d.get("expiration_time", None), + id=d.get("id", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -1751,15 +1746,15 @@ def as_shallow_dict(self) -> dict: """Serializes the RegisteredModelAlias into a shallow dictionary of its immediate attributes.""" body = {} if self.alias_name is not None: - body["{alias_name}"] = self.alias_name + body["alias_name"] = self.alias_name if self.version_num is not None: - body["{version_num}"] = self.version_num + body["version_num"] = self.version_num return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAlias: """Deserializes the RegisteredModelAlias from a dictionary.""" - return cls(alias_name=d.get("{alias_name}", None), version_num=d.get("{version_num}", None)) + return cls(alias_name=d.get("alias_name", None), version_num=d.get("version_num", None)) @dataclass @@ -1793,23 +1788,23 @@ def as_shallow_dict(self) -> dict: """Serializes the RetrieveTokenResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.bearer_token is not None: - body["{bearer_token}"] = self.bearer_token + body["bearerToken"] = self.bearer_token if self.endpoint is not None: - body["{endpoint}"] = self.endpoint + body["endpoint"] = self.endpoint if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expirationTime"] = self.expiration_time if self.share_credentials_version is not None: - body["{share_credentials_version}"] = self.share_credentials_version + body["shareCredentialsVersion"] = self.share_credentials_version return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RetrieveTokenResponse: """Deserializes the RetrieveTokenResponse from a dictionary.""" return cls( - bearer_token=d.get("{bearer_token}", None), - endpoint=d.get("{endpoint}", None), - expiration_time=d.get("{expiration_time}", None), - share_credentials_version=d.get("{share_credentials_version}", None), + bearer_token=d.get("bearerToken", None), + endpoint=d.get("endpoint", None), + expiration_time=d.get("expirationTime", None), + share_credentials_version=d.get("shareCredentialsVersion", None), ) @@ -1836,17 +1831,16 @@ def as_shallow_dict(self) -> dict: """Serializes the RotateRecipientToken into a shallow dictionary of its immediate attributes.""" body = {} if self.existing_token_expire_in_seconds is not None: - body["{existing_token_expire_in_seconds}"] = self.existing_token_expire_in_seconds + body["existing_token_expire_in_seconds"] = self.existing_token_expire_in_seconds if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RotateRecipientToken: """Deserializes the RotateRecipientToken from a dictionary.""" return cls( - existing_token_expire_in_seconds=d.get("{existing_token_expire_in_seconds}", None), - name=d.get("{name}", None), + existing_token_expire_in_seconds=d.get("existing_token_expire_in_seconds", None), name=d.get("name", None) ) @@ -1868,13 +1862,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SecurablePropertiesKvPairs into a shallow dictionary of its immediate attributes.""" body = {} if self.properties: - body["{properties}"] = self.properties + body["properties"] = self.properties return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecurablePropertiesKvPairs: """Deserializes the SecurablePropertiesKvPairs from a dictionary.""" - return cls(properties=d.get("{properties}", None)) + return cls(properties=d.get("properties", None)) @dataclass @@ -1938,41 +1932,41 @@ def as_shallow_dict(self) -> dict: """Serializes the ShareInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.created_by is not None: - body["{created_by}"] = self.created_by + body["created_by"] = self.created_by if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.objects: - body["{objects}"] = self.objects + body["objects"] = self.objects if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.updated_by is not None: - body["{updated_by}"] = self.updated_by + body["updated_by"] = self.updated_by return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ShareInfo: """Deserializes the ShareInfo from a dictionary.""" return cls( - comment=d.get("{comment}", None), - created_at=d.get("{created_at}", None), - created_by=d.get("{created_by}", None), - name=d.get("{name}", None), - objects=_repeated_dict(d, "{objects}", SharedDataObject), - owner=d.get("{owner}", None), - storage_location=d.get("{storage_location}", None), - storage_root=d.get("{storage_root}", None), - updated_at=d.get("{updated_at}", None), - updated_by=d.get("{updated_by}", None), + comment=d.get("comment", None), + created_at=d.get("created_at", None), + created_by=d.get("created_by", None), + name=d.get("name", None), + objects=_repeated_dict(d, "objects", SharedDataObject), + owner=d.get("owner", None), + storage_location=d.get("storage_location", None), + storage_root=d.get("storage_root", None), + updated_at=d.get("updated_at", None), + updated_by=d.get("updated_by", None), ) @@ -1997,17 +1991,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ShareToPrivilegeAssignment into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = self.privilege_assignments + body["privilege_assignments"] = self.privilege_assignments if self.share_name is not None: - body["{share_name}"] = self.share_name + body["share_name"] = self.share_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ShareToPrivilegeAssignment: """Deserializes the ShareToPrivilegeAssignment from a dictionary.""" return cls( - privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment), - share_name=d.get("{share_name}", None), + privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment), + share_name=d.get("share_name", None), ) @@ -2101,52 +2095,52 @@ def as_shallow_dict(self) -> dict: """Serializes the SharedDataObject into a shallow dictionary of its immediate attributes.""" body = {} if self.added_at is not None: - body["{added_at}"] = self.added_at + body["added_at"] = self.added_at if self.added_by is not None: - body["{added_by}"] = self.added_by + body["added_by"] = self.added_by if self.cdf_enabled is not None: - body["{cdf_enabled}"] = self.cdf_enabled + body["cdf_enabled"] = self.cdf_enabled if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.data_object_type is not None: - body["{data_object_type}"] = self.data_object_type + body["data_object_type"] = self.data_object_type if self.history_data_sharing_status is not None: - body["{history_data_sharing_status}"] = self.history_data_sharing_status + body["history_data_sharing_status"] = self.history_data_sharing_status if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.partitions: - body["{partitions}"] = self.partitions + body["partitions"] = self.partitions if self.shared_as is not None: - body["{shared_as}"] = self.shared_as + body["shared_as"] = self.shared_as if self.start_version is not None: - body["{start_version}"] = self.start_version + body["start_version"] = self.start_version if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.string_shared_as is not None: - body["{string_shared_as}"] = self.string_shared_as + body["string_shared_as"] = self.string_shared_as return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SharedDataObject: """Deserializes the SharedDataObject from a dictionary.""" return cls( - added_at=d.get("{added_at}", None), - added_by=d.get("{added_by}", None), - cdf_enabled=d.get("{cdf_enabled}", None), - comment=d.get("{comment}", None), - content=d.get("{content}", None), - data_object_type=_enum(d, "{data_object_type}", SharedDataObjectDataObjectType), + added_at=d.get("added_at", None), + added_by=d.get("added_by", None), + cdf_enabled=d.get("cdf_enabled", None), + comment=d.get("comment", None), + content=d.get("content", None), + data_object_type=_enum(d, "data_object_type", SharedDataObjectDataObjectType), history_data_sharing_status=_enum( - d, "{history_data_sharing_status}", SharedDataObjectHistoryDataSharingStatus + d, "history_data_sharing_status", SharedDataObjectHistoryDataSharingStatus ), - name=d.get("{name}", None), - partitions=_repeated_dict(d, "{partitions}", Partition), - shared_as=d.get("{shared_as}", None), - start_version=d.get("{start_version}", None), - status=_enum(d, "{status}", SharedDataObjectStatus), - string_shared_as=d.get("{string_shared_as}", None), + name=d.get("name", None), + partitions=_repeated_dict(d, "partitions", Partition), + shared_as=d.get("shared_as", None), + start_version=d.get("start_version", None), + status=_enum(d, "status", SharedDataObjectStatus), + string_shared_as=d.get("string_shared_as", None), ) @@ -2196,17 +2190,17 @@ def as_shallow_dict(self) -> dict: """Serializes the SharedDataObjectUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.action is not None: - body["{action}"] = self.action + body["action"] = self.action if self.data_object: - body["{data_object}"] = self.data_object + body["data_object"] = self.data_object return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SharedDataObjectUpdate: """Deserializes the SharedDataObjectUpdate from a dictionary.""" return cls( - action=_enum(d, "{action}", SharedDataObjectUpdateAction), - data_object=_from_dict(d, "{data_object}", SharedDataObject), + action=_enum(d, "action", SharedDataObjectUpdateAction), + data_object=_from_dict(d, "data_object", SharedDataObject), ) @@ -2281,38 +2275,38 @@ def as_shallow_dict(self) -> dict: """Serializes the Table into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.internal_attributes: - body["{internal_attributes}"] = self.internal_attributes + body["internal_attributes"] = self.internal_attributes if self.materialized_table_name is not None: - body["{materialized_table_name}"] = self.materialized_table_name + body["materialized_table_name"] = self.materialized_table_name if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Table: """Deserializes the Table from a dictionary.""" return cls( - comment=d.get("{comment}", None), - id=d.get("{id}", None), - internal_attributes=_from_dict(d, "{internal_attributes}", TableInternalAttributes), - materialized_table_name=d.get("{materialized_table_name}", None), - name=d.get("{name}", None), - schema=d.get("{schema}", None), - share=d.get("{share}", None), - share_id=d.get("{share_id}", None), - tags=_repeated_dict(d, "{tags}", TagKeyValue), + comment=d.get("comment", None), + id=d.get("id", None), + internal_attributes=_from_dict(d, "internal_attributes", TableInternalAttributes), + materialized_table_name=d.get("materialized_table_name", None), + name=d.get("name", None), + schema=d.get("schema", None), + share=d.get("share", None), + share_id=d.get("share_id", None), + tags=_repeated_dict(d, "tags", TagKeyValue), ) @@ -2354,23 +2348,23 @@ def as_shallow_dict(self) -> dict: """Serializes the TableInternalAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.parent_storage_location is not None: - body["{parent_storage_location}"] = self.parent_storage_location + body["parent_storage_location"] = self.parent_storage_location if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.view_definition is not None: - body["{view_definition}"] = self.view_definition + body["view_definition"] = self.view_definition return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TableInternalAttributes: """Deserializes the TableInternalAttributes from a dictionary.""" return cls( - parent_storage_location=d.get("{parent_storage_location}", None), - storage_location=d.get("{storage_location}", None), - type=_enum(d, "{type}", TableInternalAttributesSharedTableType), - view_definition=d.get("{view_definition}", None), + parent_storage_location=d.get("parent_storage_location", None), + storage_location=d.get("storage_location", None), + type=_enum(d, "type", TableInternalAttributesSharedTableType), + view_definition=d.get("view_definition", None), ) @@ -2405,15 +2399,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TagKeyValue into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TagKeyValue: """Deserializes the TagKeyValue from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -2453,26 +2447,26 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateProvider into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.recipient_profile_str is not None: - body["{recipient_profile_str}"] = self.recipient_profile_str + body["recipient_profile_str"] = self.recipient_profile_str return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateProvider: """Deserializes the UpdateProvider from a dictionary.""" return cls( - comment=d.get("{comment}", None), - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - recipient_profile_str=d.get("{recipient_profile_str}", None), + comment=d.get("comment", None), + name=d.get("name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + recipient_profile_str=d.get("recipient_profile_str", None), ) @@ -2524,32 +2518,32 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRecipient into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.expiration_time is not None: - body["{expiration_time}"] = self.expiration_time + body["expiration_time"] = self.expiration_time if self.ip_access_list: - body["{ip_access_list}"] = self.ip_access_list + body["ip_access_list"] = self.ip_access_list if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.properties_kvpairs: - body["{properties_kvpairs}"] = self.properties_kvpairs + body["properties_kvpairs"] = self.properties_kvpairs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRecipient: """Deserializes the UpdateRecipient from a dictionary.""" return cls( - comment=d.get("{comment}", None), - expiration_time=d.get("{expiration_time}", None), - ip_access_list=_from_dict(d, "{ip_access_list}", IpAccessList), - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - properties_kvpairs=_from_dict(d, "{properties_kvpairs}", SecurablePropertiesKvPairs), + comment=d.get("comment", None), + expiration_time=d.get("expiration_time", None), + ip_access_list=_from_dict(d, "ip_access_list", IpAccessList), + name=d.get("name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs), ) @@ -2594,29 +2588,29 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateShare into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.new_name is not None: - body["{new_name}"] = self.new_name + body["new_name"] = self.new_name if self.owner is not None: - body["{owner}"] = self.owner + body["owner"] = self.owner if self.storage_root is not None: - body["{storage_root}"] = self.storage_root + body["storage_root"] = self.storage_root if self.updates: - body["{updates}"] = self.updates + body["updates"] = self.updates return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateShare: """Deserializes the UpdateShare from a dictionary.""" return cls( - comment=d.get("{comment}", None), - name=d.get("{name}", None), - new_name=d.get("{new_name}", None), - owner=d.get("{owner}", None), - storage_root=d.get("{storage_root}", None), - updates=_repeated_dict(d, "{updates}", SharedDataObjectUpdate), + comment=d.get("comment", None), + name=d.get("name", None), + new_name=d.get("new_name", None), + owner=d.get("owner", None), + storage_root=d.get("storage_root", None), + updates=_repeated_dict(d, "updates", SharedDataObjectUpdate), ) @@ -2641,15 +2635,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateSharePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.changes: - body["{changes}"] = self.changes + body["changes"] = self.changes if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateSharePermissions: """Deserializes the UpdateSharePermissions from a dictionary.""" - return cls(changes=_repeated_dict(d, "{changes}", PermissionsChange), name=d.get("{name}", None)) + return cls(changes=_repeated_dict(d, "changes", PermissionsChange), name=d.get("name", None)) @dataclass @@ -2668,13 +2662,13 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateSharePermissionsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.privilege_assignments: - body["{privilege_assignments}"] = self.privilege_assignments + body["privilege_assignments"] = self.privilege_assignments return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateSharePermissionsResponse: """Deserializes the UpdateSharePermissionsResponse from a dictionary.""" - return cls(privilege_assignments=_repeated_dict(d, "{privilege_assignments}", PrivilegeAssignment)) + return cls(privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment)) @dataclass @@ -2729,35 +2723,35 @@ def as_shallow_dict(self) -> dict: """Serializes the Volume into a shallow dictionary of its immediate attributes.""" body = {} if self.comment is not None: - body["{comment}"] = self.comment + body["comment"] = self.comment if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.internal_attributes: - body["{internal_attributes}"] = self.internal_attributes + body["internal_attributes"] = self.internal_attributes if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.share is not None: - body["{share}"] = self.share + body["share"] = self.share if self.share_id is not None: - body["{share_id}"] = self.share_id + body["share_id"] = self.share_id if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Volume: """Deserializes the Volume from a dictionary.""" return cls( - comment=d.get("{comment}", None), - id=d.get("{id}", None), - internal_attributes=_from_dict(d, "{internal_attributes}", VolumeInternalAttributes), - name=d.get("{name}", None), - schema=d.get("{schema}", None), - share=d.get("{share}", None), - share_id=d.get("{share_id}", None), - tags=_repeated_dict(d, "{tags}", TagKeyValue), + comment=d.get("comment", None), + id=d.get("id", None), + internal_attributes=_from_dict(d, "internal_attributes", VolumeInternalAttributes), + name=d.get("name", None), + schema=d.get("schema", None), + share=d.get("share", None), + share_id=d.get("share_id", None), + tags=_repeated_dict(d, "tags", TagKeyValue), ) @@ -2784,15 +2778,15 @@ def as_shallow_dict(self) -> dict: """Serializes the VolumeInternalAttributes into a shallow dictionary of its immediate attributes.""" body = {} if self.storage_location is not None: - body["{storage_location}"] = self.storage_location + body["storage_location"] = self.storage_location if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VolumeInternalAttributes: """Deserializes the VolumeInternalAttributes from a dictionary.""" - return cls(storage_location=d.get("{storage_location}", None), type=d.get("{type}", None)) + return cls(storage_location=d.get("storage_location", None), type=d.get("type", None)) class ProvidersAPI: @@ -2829,13 +2823,13 @@ def create( """ body = {} if authentication_type is not None: - body["{authentication_type}"] = authentication_type.value + body["authentication_type"] = authentication_type.value if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if recipient_profile_str is not None: - body["{recipient_profile_str}"] = recipient_profile_str + body["recipient_profile_str"] = recipient_profile_str headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2911,25 +2905,25 @@ def list( query = {} if data_provider_global_metastore_id is not None: - query["{data_provider_global_metastore_id}"] = data_provider_global_metastore_id + query["data_provider_global_metastore_id"] = data_provider_global_metastore_id if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/providers", query=query, headers=headers) - if "{providers}" in json: - for v in json["{providers}"]: + if "providers" in json: + for v in json["providers"]: yield ProviderInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_provider_share_assets( self, @@ -2964,13 +2958,13 @@ def list_provider_share_assets( query = {} if function_max_results is not None: - query["{function_max_results}"] = function_max_results + query["function_max_results"] = function_max_results if notebook_max_results is not None: - query["{notebook_max_results}"] = notebook_max_results + query["notebook_max_results"] = notebook_max_results if table_max_results is not None: - query["{table_max_results}"] = table_max_results + query["table_max_results"] = table_max_results if volume_max_results is not None: - query["{volume_max_results}"] = volume_max_results + query["volume_max_results"] = volume_max_results headers = { "0": "{Accept application/json}", } @@ -3007,23 +3001,23 @@ def list_shares( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", f"/api/2.1/unity-catalog/providers/{name}/shares", query=query, headers=headers) - if "{shares}" in json: - for v in json["{shares}"]: + if "shares" in json: + for v in json["shares"]: yield ProviderShare.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update( self, @@ -3056,13 +3050,13 @@ def update( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if recipient_profile_str is not None: - body["{recipient_profile_str}"] = recipient_profile_str + body["recipient_profile_str"] = recipient_profile_str headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3188,23 +3182,23 @@ def create( """ body = {} if authentication_type is not None: - body["{authentication_type}"] = authentication_type.value + body["authentication_type"] = authentication_type.value if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if data_recipient_global_metastore_id is not None: - body["{data_recipient_global_metastore_id}"] = data_recipient_global_metastore_id + body["data_recipient_global_metastore_id"] = data_recipient_global_metastore_id if expiration_time is not None: - body["{expiration_time}"] = expiration_time + body["expiration_time"] = expiration_time if ip_access_list is not None: - body["{ip_access_list}"] = ip_access_list.as_dict() + body["ip_access_list"] = ip_access_list.as_dict() if name is not None: - body["{name}"] = name + body["name"] = name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if properties_kvpairs is not None: - body["{properties_kvpairs}"] = properties_kvpairs.as_dict() + body["properties_kvpairs"] = properties_kvpairs.as_dict() if sharing_code is not None: - body["{sharing_code}"] = sharing_code + body["sharing_code"] = sharing_code headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3281,25 +3275,25 @@ def list( query = {} if data_recipient_global_metastore_id is not None: - query["{data_recipient_global_metastore_id}"] = data_recipient_global_metastore_id + query["data_recipient_global_metastore_id"] = data_recipient_global_metastore_id if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/recipients", query=query, headers=headers) - if "{recipients}" in json: - for v in json["{recipients}"]: + if "recipients" in json: + for v in json["recipients"]: yield RecipientInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> RecipientInfo: """Rotate a token. @@ -3318,7 +3312,7 @@ def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> Reci """ body = {} if existing_token_expire_in_seconds is not None: - body["{existing_token_expire_in_seconds}"] = existing_token_expire_in_seconds + body["existing_token_expire_in_seconds"] = existing_token_expire_in_seconds headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3353,9 +3347,9 @@ def share_permissions( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -3403,17 +3397,17 @@ def update( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if expiration_time is not None: - body["{expiration_time}"] = expiration_time + body["expiration_time"] = expiration_time if ip_access_list is not None: - body["{ip_access_list}"] = ip_access_list.as_dict() + body["ip_access_list"] = ip_access_list.as_dict() if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if properties_kvpairs is not None: - body["{properties_kvpairs}"] = properties_kvpairs.as_dict() + body["properties_kvpairs"] = properties_kvpairs.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3449,11 +3443,11 @@ def create(self, name: str, *, comment: Optional[str] = None, storage_root: Opti """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if name is not None: - body["{name}"] = name + body["name"] = name if storage_root is not None: - body["{storage_root}"] = storage_root + body["storage_root"] = storage_root headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3493,7 +3487,7 @@ def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> Share query = {} if include_shared_data is not None: - query["{include_shared_data}"] = include_shared_data + query["include_shared_data"] = include_shared_data headers = { "0": "{Accept application/json}", } @@ -3523,23 +3517,23 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } - if "{max_results}" not in query: - query["{max_results}"] = 0 + if "max_results" not in query: + query["max_results"] = 0 while True: json = self._api.do("GET", "/api/2.1/unity-catalog/shares", query=query, headers=headers) - if "{shares}" in json: - for v in json["{shares}"]: + if "shares" in json: + for v in json["shares"]: yield ShareInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def share_permissions( self, name: str, *, max_results: Optional[int] = None, page_token: Optional[str] = None @@ -3567,9 +3561,9 @@ def share_permissions( query = {} if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -3622,15 +3616,15 @@ def update( """ body = {} if comment is not None: - body["{comment}"] = comment + body["comment"] = comment if new_name is not None: - body["{new_name}"] = new_name + body["new_name"] = new_name if owner is not None: - body["{owner}"] = owner + body["owner"] = owner if storage_root is not None: - body["{storage_root}"] = storage_root + body["storage_root"] = storage_root if updates is not None: - body["{updates}"] = [v.as_dict() for v in updates] + body["updates"] = [v.as_dict() for v in updates] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3659,7 +3653,7 @@ def update_permissions( """ body = {} if changes is not None: - body["{changes}"] = [v.as_dict() for v in changes] + body["changes"] = [v.as_dict() for v in changes] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/sql/v2/impl.py b/databricks/sdk/sql/v2/impl.py index 099b8e5b3..fb857324d 100755 --- a/databricks/sdk/sql/v2/impl.py +++ b/databricks/sdk/sql/v2/impl.py @@ -41,20 +41,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AccessControl into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AccessControl: """Deserializes the AccessControl from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", PermissionLevel), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", PermissionLevel), + user_name=d.get("user_name", None), ) @@ -151,56 +151,56 @@ def as_shallow_dict(self) -> dict: """Serializes the Alert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["{condition}"] = self.condition + body["condition"] = self.condition if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state + body["lifecycle_state"] = self.lifecycle_state if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.trigger_time is not None: - body["{trigger_time}"] = self.trigger_time + body["trigger_time"] = self.trigger_time if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Alert: """Deserializes the Alert from a dictionary.""" return cls( - condition=_from_dict(d, "{condition}", AlertCondition), - create_time=d.get("{create_time}", None), - custom_body=d.get("{custom_body}", None), - custom_subject=d.get("{custom_subject}", None), - display_name=d.get("{display_name}", None), - id=d.get("{id}", None), - lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), - notify_on_ok=d.get("{notify_on_ok}", None), - owner_user_name=d.get("{owner_user_name}", None), - parent_path=d.get("{parent_path}", None), - query_id=d.get("{query_id}", None), - seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), - state=_enum(d, "{state}", AlertState), - trigger_time=d.get("{trigger_time}", None), - update_time=d.get("{update_time}", None), + condition=_from_dict(d, "condition", AlertCondition), + create_time=d.get("create_time", None), + custom_body=d.get("custom_body", None), + custom_subject=d.get("custom_subject", None), + display_name=d.get("display_name", None), + id=d.get("id", None), + lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), + notify_on_ok=d.get("notify_on_ok", None), + owner_user_name=d.get("owner_user_name", None), + parent_path=d.get("parent_path", None), + query_id=d.get("query_id", None), + seconds_to_retrigger=d.get("seconds_to_retrigger", None), + state=_enum(d, "state", AlertState), + trigger_time=d.get("trigger_time", None), + update_time=d.get("update_time", None), ) @@ -235,23 +235,23 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertCondition into a shallow dictionary of its immediate attributes.""" body = {} if self.empty_result_state is not None: - body["{empty_result_state}"] = self.empty_result_state + body["empty_result_state"] = self.empty_result_state if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.operand: - body["{operand}"] = self.operand + body["operand"] = self.operand if self.threshold: - body["{threshold}"] = self.threshold + body["threshold"] = self.threshold return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertCondition: """Deserializes the AlertCondition from a dictionary.""" return cls( - empty_result_state=_enum(d, "{empty_result_state}", AlertState), - op=_enum(d, "{op}", AlertOperator), - operand=_from_dict(d, "{operand}", AlertConditionOperand), - threshold=_from_dict(d, "{threshold}", AlertConditionThreshold), + empty_result_state=_enum(d, "empty_result_state", AlertState), + op=_enum(d, "op", AlertOperator), + operand=_from_dict(d, "operand", AlertConditionOperand), + threshold=_from_dict(d, "threshold", AlertConditionThreshold), ) @@ -270,13 +270,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertConditionOperand into a shallow dictionary of its immediate attributes.""" body = {} if self.column: - body["{column}"] = self.column + body["column"] = self.column return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertConditionOperand: """Deserializes the AlertConditionOperand from a dictionary.""" - return cls(column=_from_dict(d, "{column}", AlertOperandColumn)) + return cls(column=_from_dict(d, "column", AlertOperandColumn)) @dataclass @@ -294,13 +294,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertConditionThreshold into a shallow dictionary of its immediate attributes.""" body = {} if self.value: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertConditionThreshold: """Deserializes the AlertConditionThreshold from a dictionary.""" - return cls(value=_from_dict(d, "{value}", AlertOperandValue)) + return cls(value=_from_dict(d, "value", AlertOperandValue)) @dataclass @@ -318,13 +318,13 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertOperandColumn into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertOperandColumn: """Deserializes the AlertOperandColumn from a dictionary.""" - return cls(name=d.get("{name}", None)) + return cls(name=d.get("name", None)) @dataclass @@ -350,20 +350,20 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertOperandValue into a shallow dictionary of its immediate attributes.""" body = {} if self.bool_value is not None: - body["{bool_value}"] = self.bool_value + body["bool_value"] = self.bool_value if self.double_value is not None: - body["{double_value}"] = self.double_value + body["double_value"] = self.double_value if self.string_value is not None: - body["{string_value}"] = self.string_value + body["string_value"] = self.string_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertOperandValue: """Deserializes the AlertOperandValue from a dictionary.""" return cls( - bool_value=d.get("{bool_value}", None), - double_value=d.get("{double_value}", None), - string_value=d.get("{string_value}", None), + bool_value=d.get("bool_value", None), + double_value=d.get("double_value", None), + string_value=d.get("string_value", None), ) @@ -433,32 +433,32 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.column is not None: - body["{column}"] = self.column + body["column"] = self.column if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.empty_result_state is not None: - body["{empty_result_state}"] = self.empty_result_state + body["empty_result_state"] = self.empty_result_state if self.muted is not None: - body["{muted}"] = self.muted + body["muted"] = self.muted if self.op is not None: - body["{op}"] = self.op + body["op"] = self.op if self.value: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertOptions: """Deserializes the AlertOptions from a dictionary.""" return cls( - column=d.get("{column}", None), - custom_body=d.get("{custom_body}", None), - custom_subject=d.get("{custom_subject}", None), - empty_result_state=_enum(d, "{empty_result_state}", AlertOptionsEmptyResultState), - muted=d.get("{muted}", None), - op=d.get("{op}", None), - value=d.get("{value}", None), + column=d.get("column", None), + custom_body=d.get("custom_body", None), + custom_subject=d.get("custom_subject", None), + empty_result_state=_enum(d, "empty_result_state", AlertOptionsEmptyResultState), + muted=d.get("muted", None), + op=d.get("op", None), + value=d.get("value", None), ) @@ -552,50 +552,50 @@ def as_shallow_dict(self) -> dict: """Serializes the AlertQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_archived is not None: - body["{is_archived}"] = self.is_archived + body["is_archived"] = self.is_archived if self.is_draft is not None: - body["{is_draft}"] = self.is_draft + body["is_draft"] = self.is_draft if self.is_safe is not None: - body["{is_safe}"] = self.is_safe + body["is_safe"] = self.is_safe if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AlertQuery: """Deserializes the AlertQuery from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - data_source_id=d.get("{data_source_id}", None), - description=d.get("{description}", None), - id=d.get("{id}", None), - is_archived=d.get("{is_archived}", None), - is_draft=d.get("{is_draft}", None), - is_safe=d.get("{is_safe}", None), - name=d.get("{name}", None), - options=_from_dict(d, "{options}", QueryOptions), - query=d.get("{query}", None), - tags=d.get("{tags}", None), - updated_at=d.get("{updated_at}", None), - user_id=d.get("{user_id}", None), + created_at=d.get("created_at", None), + data_source_id=d.get("data_source_id", None), + description=d.get("description", None), + id=d.get("id", None), + is_archived=d.get("is_archived", None), + is_draft=d.get("is_draft", None), + is_safe=d.get("is_safe", None), + name=d.get("name", None), + options=_from_dict(d, "options", QueryOptions), + query=d.get("query", None), + tags=d.get("tags", None), + updated_at=d.get("updated_at", None), + user_id=d.get("user_id", None), ) @@ -641,23 +641,23 @@ def as_shallow_dict(self) -> dict: """Serializes the BaseChunkInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> BaseChunkInfo: """Deserializes the BaseChunkInfo from a dictionary.""" return cls( - byte_count=d.get("{byte_count}", None), - chunk_index=d.get("{chunk_index}", None), - row_count=d.get("{row_count}", None), - row_offset=d.get("{row_offset}", None), + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), ) @@ -701,15 +701,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Channel into a shallow dictionary of its immediate attributes.""" body = {} if self.dbsql_version is not None: - body["{dbsql_version}"] = self.dbsql_version + body["dbsql_version"] = self.dbsql_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Channel: """Deserializes the Channel from a dictionary.""" - return cls(dbsql_version=d.get("{dbsql_version}", None), name=_enum(d, "{name}", ChannelName)) + return cls(dbsql_version=d.get("dbsql_version", None), name=_enum(d, "name", ChannelName)) @dataclass @@ -735,15 +735,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ChannelInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.dbsql_version is not None: - body["{dbsql_version}"] = self.dbsql_version + body["dbsql_version"] = self.dbsql_version if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ChannelInfo: """Deserializes the ChannelInfo from a dictionary.""" - return cls(dbsql_version=d.get("{dbsql_version}", None), name=_enum(d, "{name}", ChannelName)) + return cls(dbsql_version=d.get("dbsql_version", None), name=_enum(d, "name", ChannelName)) class ChannelName(Enum): @@ -805,41 +805,41 @@ def as_shallow_dict(self) -> dict: """Serializes the ClientConfig into a shallow dictionary of its immediate attributes.""" body = {} if self.allow_custom_js_visualizations is not None: - body["{allow_custom_js_visualizations}"] = self.allow_custom_js_visualizations + body["allow_custom_js_visualizations"] = self.allow_custom_js_visualizations if self.allow_downloads is not None: - body["{allow_downloads}"] = self.allow_downloads + body["allow_downloads"] = self.allow_downloads if self.allow_external_shares is not None: - body["{allow_external_shares}"] = self.allow_external_shares + body["allow_external_shares"] = self.allow_external_shares if self.allow_subscriptions is not None: - body["{allow_subscriptions}"] = self.allow_subscriptions + body["allow_subscriptions"] = self.allow_subscriptions if self.date_format is not None: - body["{date_format}"] = self.date_format + body["date_format"] = self.date_format if self.date_time_format is not None: - body["{date_time_format}"] = self.date_time_format + body["date_time_format"] = self.date_time_format if self.disable_publish is not None: - body["{disable_publish}"] = self.disable_publish + body["disable_publish"] = self.disable_publish if self.enable_legacy_autodetect_types is not None: - body["{enable_legacy_autodetect_types}"] = self.enable_legacy_autodetect_types + body["enable_legacy_autodetect_types"] = self.enable_legacy_autodetect_types if self.feature_show_permissions_control is not None: - body["{feature_show_permissions_control}"] = self.feature_show_permissions_control + body["feature_show_permissions_control"] = self.feature_show_permissions_control if self.hide_plotly_mode_bar is not None: - body["{hide_plotly_mode_bar}"] = self.hide_plotly_mode_bar + body["hide_plotly_mode_bar"] = self.hide_plotly_mode_bar return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ClientConfig: """Deserializes the ClientConfig from a dictionary.""" return cls( - allow_custom_js_visualizations=d.get("{allow_custom_js_visualizations}", None), - allow_downloads=d.get("{allow_downloads}", None), - allow_external_shares=d.get("{allow_external_shares}", None), - allow_subscriptions=d.get("{allow_subscriptions}", None), - date_format=d.get("{date_format}", None), - date_time_format=d.get("{date_time_format}", None), - disable_publish=d.get("{disable_publish}", None), - enable_legacy_autodetect_types=d.get("{enable_legacy_autodetect_types}", None), - feature_show_permissions_control=d.get("{feature_show_permissions_control}", None), - hide_plotly_mode_bar=d.get("{hide_plotly_mode_bar}", None), + allow_custom_js_visualizations=d.get("allow_custom_js_visualizations", None), + allow_downloads=d.get("allow_downloads", None), + allow_external_shares=d.get("allow_external_shares", None), + allow_subscriptions=d.get("allow_subscriptions", None), + date_format=d.get("date_format", None), + date_time_format=d.get("date_time_format", None), + disable_publish=d.get("disable_publish", None), + enable_legacy_autodetect_types=d.get("enable_legacy_autodetect_types", None), + feature_show_permissions_control=d.get("feature_show_permissions_control", None), + hide_plotly_mode_bar=d.get("hide_plotly_mode_bar", None), ) @@ -891,32 +891,32 @@ def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.position is not None: - body["{position}"] = self.position + body["position"] = self.position if self.type_interval_type is not None: - body["{type_interval_type}"] = self.type_interval_type + body["type_interval_type"] = self.type_interval_type if self.type_name is not None: - body["{type_name}"] = self.type_name + body["type_name"] = self.type_name if self.type_precision is not None: - body["{type_precision}"] = self.type_precision + body["type_precision"] = self.type_precision if self.type_scale is not None: - body["{type_scale}"] = self.type_scale + body["type_scale"] = self.type_scale if self.type_text is not None: - body["{type_text}"] = self.type_text + body["type_text"] = self.type_text return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" return cls( - name=d.get("{name}", None), - position=d.get("{position}", None), - type_interval_type=d.get("{type_interval_type}", None), - type_name=_enum(d, "{type_name}", ColumnInfoTypeName), - type_precision=d.get("{type_precision}", None), - type_scale=d.get("{type_scale}", None), - type_text=d.get("{type_text}", None), + name=d.get("name", None), + position=d.get("position", None), + type_interval_type=d.get("type_interval_type", None), + type_name=_enum(d, "type_name", ColumnInfoTypeName), + type_precision=d.get("type_precision", None), + type_scale=d.get("type_scale", None), + type_text=d.get("type_text", None), ) @@ -982,26 +982,26 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.rearm is not None: - body["{rearm}"] = self.rearm + body["rearm"] = self.rearm return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAlert: """Deserializes the CreateAlert from a dictionary.""" return cls( - name=d.get("{name}", None), - options=_from_dict(d, "{options}", AlertOptions), - parent=d.get("{parent}", None), - query_id=d.get("{query_id}", None), - rearm=d.get("{rearm}", None), + name=d.get("name", None), + options=_from_dict(d, "options", AlertOptions), + parent=d.get("parent", None), + query_id=d.get("query_id", None), + rearm=d.get("rearm", None), ) @@ -1020,13 +1020,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateAlertRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.alert: - body["{alert}"] = self.alert + body["alert"] = self.alert return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAlertRequest: """Deserializes the CreateAlertRequest from a dictionary.""" - return cls(alert=_from_dict(d, "{alert}", CreateAlertRequestAlert)) + return cls(alert=_from_dict(d, "alert", CreateAlertRequestAlert)) @dataclass @@ -1086,35 +1086,35 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateAlertRequestAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["{condition}"] = self.condition + body["condition"] = self.condition if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateAlertRequestAlert: """Deserializes the CreateAlertRequestAlert from a dictionary.""" return cls( - condition=_from_dict(d, "{condition}", AlertCondition), - custom_body=d.get("{custom_body}", None), - custom_subject=d.get("{custom_subject}", None), - display_name=d.get("{display_name}", None), - notify_on_ok=d.get("{notify_on_ok}", None), - parent_path=d.get("{parent_path}", None), - query_id=d.get("{query_id}", None), - seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), + condition=_from_dict(d, "condition", AlertCondition), + custom_body=d.get("custom_body", None), + custom_subject=d.get("custom_subject", None), + display_name=d.get("display_name", None), + notify_on_ok=d.get("notify_on_ok", None), + parent_path=d.get("parent_path", None), + query_id=d.get("query_id", None), + seconds_to_retrigger=d.get("seconds_to_retrigger", None), ) @@ -1133,13 +1133,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateQueryRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.query: - body["{query}"] = self.query + body["query"] = self.query return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateQueryRequest: """Deserializes the CreateQueryRequest from a dictionary.""" - return cls(query=_from_dict(d, "{query}", CreateQueryRequestQuery)) + return cls(query=_from_dict(d, "query", CreateQueryRequestQuery)) @dataclass @@ -1207,44 +1207,44 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateQueryRequestQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode + body["run_as_mode"] = self.run_as_mode if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateQueryRequestQuery: """Deserializes the CreateQueryRequestQuery from a dictionary.""" return cls( - apply_auto_limit=d.get("{apply_auto_limit}", None), - catalog=d.get("{catalog}", None), - description=d.get("{description}", None), - display_name=d.get("{display_name}", None), - parameters=_repeated_dict(d, "{parameters}", QueryParameter), - parent_path=d.get("{parent_path}", None), - query_text=d.get("{query_text}", None), - run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), - schema=d.get("{schema}", None), - tags=d.get("{tags}", None), - warehouse_id=d.get("{warehouse_id}", None), + apply_auto_limit=d.get("apply_auto_limit", None), + catalog=d.get("catalog", None), + description=d.get("description", None), + display_name=d.get("display_name", None), + parameters=_repeated_dict(d, "parameters", QueryParameter), + parent_path=d.get("parent_path", None), + query_text=d.get("query_text", None), + run_as_mode=_enum(d, "run_as_mode", RunAsMode), + schema=d.get("schema", None), + tags=d.get("tags", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -1263,13 +1263,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateVisualizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.visualization: - body["{visualization}"] = self.visualization + body["visualization"] = self.visualization return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVisualizationRequest: """Deserializes the CreateVisualizationRequest from a dictionary.""" - return cls(visualization=_from_dict(d, "{visualization}", CreateVisualizationRequestVisualization)) + return cls(visualization=_from_dict(d, "visualization", CreateVisualizationRequestVisualization)) @dataclass @@ -1310,26 +1310,26 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateVisualizationRequestVisualization into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.serialized_options is not None: - body["{serialized_options}"] = self.serialized_options + body["serialized_options"] = self.serialized_options if self.serialized_query_plan is not None: - body["{serialized_query_plan}"] = self.serialized_query_plan + body["serialized_query_plan"] = self.serialized_query_plan if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVisualizationRequestVisualization: """Deserializes the CreateVisualizationRequestVisualization from a dictionary.""" return cls( - display_name=d.get("{display_name}", None), - query_id=d.get("{query_id}", None), - serialized_options=d.get("{serialized_options}", None), - serialized_query_plan=d.get("{serialized_query_plan}", None), - type=d.get("{type}", None), + display_name=d.get("display_name", None), + query_id=d.get("query_id", None), + serialized_options=d.get("serialized_options", None), + serialized_query_plan=d.get("serialized_query_plan", None), + type=d.get("type", None), ) @@ -1439,50 +1439,50 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateWarehouseRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy + body["spot_instance_policy"] = self.spot_instance_policy if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type + body["warehouse_type"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseRequest: """Deserializes the CreateWarehouseRequest from a dictionary.""" return cls( - auto_stop_mins=d.get("{auto_stop_mins}", None), - channel=_from_dict(d, "{channel}", Channel), - cluster_size=d.get("{cluster_size}", None), - creator_name=d.get("{creator_name}", None), - enable_photon=d.get("{enable_photon}", None), - enable_serverless_compute=d.get("{enable_serverless_compute}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - max_num_clusters=d.get("{max_num_clusters}", None), - min_num_clusters=d.get("{min_num_clusters}", None), - name=d.get("{name}", None), - spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), - tags=_from_dict(d, "{tags}", EndpointTags), - warehouse_type=_enum(d, "{warehouse_type}", CreateWarehouseRequestWarehouseType), + auto_stop_mins=d.get("auto_stop_mins", None), + channel=_from_dict(d, "channel", Channel), + cluster_size=d.get("cluster_size", None), + creator_name=d.get("creator_name", None), + enable_photon=d.get("enable_photon", None), + enable_serverless_compute=d.get("enable_serverless_compute", None), + instance_profile_arn=d.get("instance_profile_arn", None), + max_num_clusters=d.get("max_num_clusters", None), + min_num_clusters=d.get("min_num_clusters", None), + name=d.get("name", None), + spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), + tags=_from_dict(d, "tags", EndpointTags), + warehouse_type=_enum(d, "warehouse_type", CreateWarehouseRequestWarehouseType), ) @@ -1511,13 +1511,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateWarehouseResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseResponse: """Deserializes the CreateWarehouseResponse from a dictionary.""" - return cls(id=d.get("{id}", None)) + return cls(id=d.get("id", None)) @dataclass @@ -1561,29 +1561,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateWidget into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.text is not None: - body["{text}"] = self.text + body["text"] = self.text if self.visualization_id is not None: - body["{visualization_id}"] = self.visualization_id + body["visualization_id"] = self.visualization_id if self.width is not None: - body["{width}"] = self.width + body["width"] = self.width return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateWidget: """Deserializes the CreateWidget from a dictionary.""" return cls( - dashboard_id=d.get("{dashboard_id}", None), - id=d.get("{id}", None), - options=_from_dict(d, "{options}", WidgetOptions), - text=d.get("{text}", None), - visualization_id=d.get("{visualization_id}", None), - width=d.get("{width}", None), + dashboard_id=d.get("dashboard_id", None), + id=d.get("id", None), + options=_from_dict(d, "options", WidgetOptions), + text=d.get("text", None), + visualization_id=d.get("visualization_id", None), + width=d.get("width", None), ) @@ -1687,62 +1687,62 @@ def as_shallow_dict(self) -> dict: """Serializes the Dashboard into a shallow dictionary of its immediate attributes.""" body = {} if self.can_edit is not None: - body["{can_edit}"] = self.can_edit + body["can_edit"] = self.can_edit if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.dashboard_filters_enabled is not None: - body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled + body["dashboard_filters_enabled"] = self.dashboard_filters_enabled if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_archived is not None: - body["{is_archived}"] = self.is_archived + body["is_archived"] = self.is_archived if self.is_draft is not None: - body["{is_draft}"] = self.is_draft + body["is_draft"] = self.is_draft if self.is_favorite is not None: - body["{is_favorite}"] = self.is_favorite + body["is_favorite"] = self.is_favorite if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.permission_tier is not None: - body["{permission_tier}"] = self.permission_tier + body["permission_tier"] = self.permission_tier if self.slug is not None: - body["{slug}"] = self.slug + body["slug"] = self.slug if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user: - body["{user}"] = self.user + body["user"] = self.user if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.widgets: - body["{widgets}"] = self.widgets + body["widgets"] = self.widgets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Dashboard: """Deserializes the Dashboard from a dictionary.""" return cls( - can_edit=d.get("{can_edit}", None), - created_at=d.get("{created_at}", None), - dashboard_filters_enabled=d.get("{dashboard_filters_enabled}", None), - id=d.get("{id}", None), - is_archived=d.get("{is_archived}", None), - is_draft=d.get("{is_draft}", None), - is_favorite=d.get("{is_favorite}", None), - name=d.get("{name}", None), - options=_from_dict(d, "{options}", DashboardOptions), - parent=d.get("{parent}", None), - permission_tier=_enum(d, "{permission_tier}", PermissionLevel), - slug=d.get("{slug}", None), - tags=d.get("{tags}", None), - updated_at=d.get("{updated_at}", None), - user=_from_dict(d, "{user}", User), - user_id=d.get("{user_id}", None), - widgets=_repeated_dict(d, "{widgets}", Widget), + can_edit=d.get("can_edit", None), + created_at=d.get("created_at", None), + dashboard_filters_enabled=d.get("dashboard_filters_enabled", None), + id=d.get("id", None), + is_archived=d.get("is_archived", None), + is_draft=d.get("is_draft", None), + is_favorite=d.get("is_favorite", None), + name=d.get("name", None), + options=_from_dict(d, "options", DashboardOptions), + parent=d.get("parent", None), + permission_tier=_enum(d, "permission_tier", PermissionLevel), + slug=d.get("slug", None), + tags=d.get("tags", None), + updated_at=d.get("updated_at", None), + user=_from_dict(d, "user", User), + user_id=d.get("user_id", None), + widgets=_repeated_dict(d, "widgets", Widget), ) @@ -1776,23 +1776,23 @@ def as_shallow_dict(self) -> dict: """Serializes the DashboardEditContent into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role + body["run_as_role"] = self.run_as_role if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DashboardEditContent: """Deserializes the DashboardEditContent from a dictionary.""" return cls( - dashboard_id=d.get("{dashboard_id}", None), - name=d.get("{name}", None), - run_as_role=_enum(d, "{run_as_role}", RunAsRole), - tags=d.get("{tags}", None), + dashboard_id=d.get("dashboard_id", None), + name=d.get("name", None), + run_as_role=_enum(d, "run_as_role", RunAsRole), + tags=d.get("tags", None), ) @@ -1813,13 +1813,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DashboardOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.moved_to_trash_at is not None: - body["{moved_to_trash_at}"] = self.moved_to_trash_at + body["moved_to_trash_at"] = self.moved_to_trash_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DashboardOptions: """Deserializes the DashboardOptions from a dictionary.""" - return cls(moved_to_trash_at=d.get("{moved_to_trash_at}", None)) + return cls(moved_to_trash_at=d.get("moved_to_trash_at", None)) @dataclass @@ -1863,29 +1863,29 @@ def as_shallow_dict(self) -> dict: """Serializes the DashboardPostContent into a shallow dictionary of its immediate attributes.""" body = {} if self.dashboard_filters_enabled is not None: - body["{dashboard_filters_enabled}"] = self.dashboard_filters_enabled + body["dashboard_filters_enabled"] = self.dashboard_filters_enabled if self.is_favorite is not None: - body["{is_favorite}"] = self.is_favorite + body["is_favorite"] = self.is_favorite if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role + body["run_as_role"] = self.run_as_role if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DashboardPostContent: """Deserializes the DashboardPostContent from a dictionary.""" return cls( - dashboard_filters_enabled=d.get("{dashboard_filters_enabled}", None), - is_favorite=d.get("{is_favorite}", None), - name=d.get("{name}", None), - parent=d.get("{parent}", None), - run_as_role=_enum(d, "{run_as_role}", RunAsRole), - tags=d.get("{tags}", None), + dashboard_filters_enabled=d.get("dashboard_filters_enabled", None), + is_favorite=d.get("is_favorite", None), + name=d.get("name", None), + parent=d.get("parent", None), + run_as_role=_enum(d, "run_as_role", RunAsRole), + tags=d.get("tags", None), ) @@ -1951,38 +1951,38 @@ def as_shallow_dict(self) -> dict: """Serializes the DataSource into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.pause_reason is not None: - body["{pause_reason}"] = self.pause_reason + body["pause_reason"] = self.pause_reason if self.paused is not None: - body["{paused}"] = self.paused + body["paused"] = self.paused if self.supports_auto_limit is not None: - body["{supports_auto_limit}"] = self.supports_auto_limit + body["supports_auto_limit"] = self.supports_auto_limit if self.syntax is not None: - body["{syntax}"] = self.syntax + body["syntax"] = self.syntax if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.view_only is not None: - body["{view_only}"] = self.view_only + body["view_only"] = self.view_only if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DataSource: """Deserializes the DataSource from a dictionary.""" return cls( - id=d.get("{id}", None), - name=d.get("{name}", None), - pause_reason=d.get("{pause_reason}", None), - paused=d.get("{paused}", None), - supports_auto_limit=d.get("{supports_auto_limit}", None), - syntax=d.get("{syntax}", None), - type=d.get("{type}", None), - view_only=d.get("{view_only}", None), - warehouse_id=d.get("{warehouse_id}", None), + id=d.get("id", None), + name=d.get("name", None), + pause_reason=d.get("pause_reason", None), + paused=d.get("paused", None), + supports_auto_limit=d.get("supports_auto_limit", None), + syntax=d.get("syntax", None), + type=d.get("type", None), + view_only=d.get("view_only", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -2012,15 +2012,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DateRange into a shallow dictionary of its immediate attributes.""" body = {} if self.end is not None: - body["{end}"] = self.end + body["end"] = self.end if self.start is not None: - body["{start}"] = self.start + body["start"] = self.start return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DateRange: """Deserializes the DateRange from a dictionary.""" - return cls(end=d.get("{end}", None), start=d.get("{start}", None)) + return cls(end=d.get("end", None), start=d.get("start", None)) @dataclass @@ -2054,23 +2054,23 @@ def as_shallow_dict(self) -> dict: """Serializes the DateRangeValue into a shallow dictionary of its immediate attributes.""" body = {} if self.date_range_value: - body["{date_range_value}"] = self.date_range_value + body["date_range_value"] = self.date_range_value if self.dynamic_date_range_value is not None: - body["{dynamic_date_range_value}"] = self.dynamic_date_range_value + body["dynamic_date_range_value"] = self.dynamic_date_range_value if self.precision is not None: - body["{precision}"] = self.precision + body["precision"] = self.precision if self.start_day_of_week is not None: - body["{start_day_of_week}"] = self.start_day_of_week + body["start_day_of_week"] = self.start_day_of_week return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DateRangeValue: """Deserializes the DateRangeValue from a dictionary.""" return cls( - date_range_value=_from_dict(d, "{date_range_value}", DateRange), - dynamic_date_range_value=_enum(d, "{dynamic_date_range_value}", DateRangeValueDynamicDateRange), - precision=_enum(d, "{precision}", DatePrecision), - start_day_of_week=d.get("{start_day_of_week}", None), + date_range_value=_from_dict(d, "date_range_value", DateRange), + dynamic_date_range_value=_enum(d, "dynamic_date_range_value", DateRangeValueDynamicDateRange), + precision=_enum(d, "precision", DatePrecision), + start_day_of_week=d.get("start_day_of_week", None), ) @@ -2122,20 +2122,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DateValue into a shallow dictionary of its immediate attributes.""" body = {} if self.date_value is not None: - body["{date_value}"] = self.date_value + body["date_value"] = self.date_value if self.dynamic_date_value is not None: - body["{dynamic_date_value}"] = self.dynamic_date_value + body["dynamic_date_value"] = self.dynamic_date_value if self.precision is not None: - body["{precision}"] = self.precision + body["precision"] = self.precision return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DateValue: """Deserializes the DateValue from a dictionary.""" return cls( - date_value=d.get("{date_value}", None), - dynamic_date_value=_enum(d, "{dynamic_date_value}", DateValueDynamicDate), - precision=_enum(d, "{precision}", DatePrecision), + date_value=d.get("date_value", None), + dynamic_date_value=_enum(d, "dynamic_date_value", DateValueDynamicDate), + precision=_enum(d, "precision", DatePrecision), ) @@ -2223,26 +2223,26 @@ def as_shallow_dict(self) -> dict: """Serializes the EditAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_id is not None: - body["{alert_id}"] = self.alert_id + body["alert_id"] = self.alert_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.rearm is not None: - body["{rearm}"] = self.rearm + body["rearm"] = self.rearm return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditAlert: """Deserializes the EditAlert from a dictionary.""" return cls( - alert_id=d.get("{alert_id}", None), - name=d.get("{name}", None), - options=_from_dict(d, "{options}", AlertOptions), - query_id=d.get("{query_id}", None), - rearm=d.get("{rearm}", None), + alert_id=d.get("alert_id", None), + name=d.get("name", None), + options=_from_dict(d, "options", AlertOptions), + query_id=d.get("query_id", None), + rearm=d.get("rearm", None), ) @@ -2356,53 +2356,53 @@ def as_shallow_dict(self) -> dict: """Serializes the EditWarehouseRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy + body["spot_instance_policy"] = self.spot_instance_policy if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type + body["warehouse_type"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EditWarehouseRequest: """Deserializes the EditWarehouseRequest from a dictionary.""" return cls( - auto_stop_mins=d.get("{auto_stop_mins}", None), - channel=_from_dict(d, "{channel}", Channel), - cluster_size=d.get("{cluster_size}", None), - creator_name=d.get("{creator_name}", None), - enable_photon=d.get("{enable_photon}", None), - enable_serverless_compute=d.get("{enable_serverless_compute}", None), - id=d.get("{id}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - max_num_clusters=d.get("{max_num_clusters}", None), - min_num_clusters=d.get("{min_num_clusters}", None), - name=d.get("{name}", None), - spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), - tags=_from_dict(d, "{tags}", EndpointTags), - warehouse_type=_enum(d, "{warehouse_type}", EditWarehouseRequestWarehouseType), + auto_stop_mins=d.get("auto_stop_mins", None), + channel=_from_dict(d, "channel", Channel), + cluster_size=d.get("cluster_size", None), + creator_name=d.get("creator_name", None), + enable_photon=d.get("enable_photon", None), + enable_serverless_compute=d.get("enable_serverless_compute", None), + id=d.get("id", None), + instance_profile_arn=d.get("instance_profile_arn", None), + max_num_clusters=d.get("max_num_clusters", None), + min_num_clusters=d.get("min_num_clusters", None), + name=d.get("name", None), + spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), + tags=_from_dict(d, "tags", EndpointTags), + warehouse_type=_enum(d, "warehouse_type", EditWarehouseRequestWarehouseType), ) @@ -2473,15 +2473,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointConfPair into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointConfPair: """Deserializes the EndpointConfPair from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -2521,26 +2521,26 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointHealth into a shallow dictionary of its immediate attributes.""" body = {} if self.details is not None: - body["{details}"] = self.details + body["details"] = self.details if self.failure_reason: - body["{failure_reason}"] = self.failure_reason + body["failure_reason"] = self.failure_reason if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.summary is not None: - body["{summary}"] = self.summary + body["summary"] = self.summary return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointHealth: """Deserializes the EndpointHealth from a dictionary.""" return cls( - details=d.get("{details}", None), - failure_reason=_from_dict(d, "{failure_reason}", TerminationReason), - message=d.get("{message}", None), - status=_enum(d, "{status}", Status), - summary=d.get("{summary}", None), + details=d.get("details", None), + failure_reason=_from_dict(d, "failure_reason", TerminationReason), + message=d.get("message", None), + status=_enum(d, "status", Status), + summary=d.get("summary", None), ) @@ -2684,71 +2684,71 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.health: - body["{health}"] = self.health + body["health"] = self.health if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.jdbc_url is not None: - body["{jdbc_url}"] = self.jdbc_url + body["jdbc_url"] = self.jdbc_url if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.num_active_sessions is not None: - body["{num_active_sessions}"] = self.num_active_sessions + body["num_active_sessions"] = self.num_active_sessions if self.num_clusters is not None: - body["{num_clusters}"] = self.num_clusters + body["num_clusters"] = self.num_clusters if self.odbc_params: - body["{odbc_params}"] = self.odbc_params + body["odbc_params"] = self.odbc_params if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy + body["spot_instance_policy"] = self.spot_instance_policy if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type + body["warehouse_type"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointInfo: """Deserializes the EndpointInfo from a dictionary.""" return cls( - auto_stop_mins=d.get("{auto_stop_mins}", None), - channel=_from_dict(d, "{channel}", Channel), - cluster_size=d.get("{cluster_size}", None), - creator_name=d.get("{creator_name}", None), - enable_photon=d.get("{enable_photon}", None), - enable_serverless_compute=d.get("{enable_serverless_compute}", None), - health=_from_dict(d, "{health}", EndpointHealth), - id=d.get("{id}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - jdbc_url=d.get("{jdbc_url}", None), - max_num_clusters=d.get("{max_num_clusters}", None), - min_num_clusters=d.get("{min_num_clusters}", None), - name=d.get("{name}", None), - num_active_sessions=d.get("{num_active_sessions}", None), - num_clusters=d.get("{num_clusters}", None), - odbc_params=_from_dict(d, "{odbc_params}", OdbcParams), - spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), - state=_enum(d, "{state}", State), - tags=_from_dict(d, "{tags}", EndpointTags), - warehouse_type=_enum(d, "{warehouse_type}", EndpointInfoWarehouseType), + auto_stop_mins=d.get("auto_stop_mins", None), + channel=_from_dict(d, "channel", Channel), + cluster_size=d.get("cluster_size", None), + creator_name=d.get("creator_name", None), + enable_photon=d.get("enable_photon", None), + enable_serverless_compute=d.get("enable_serverless_compute", None), + health=_from_dict(d, "health", EndpointHealth), + id=d.get("id", None), + instance_profile_arn=d.get("instance_profile_arn", None), + jdbc_url=d.get("jdbc_url", None), + max_num_clusters=d.get("max_num_clusters", None), + min_num_clusters=d.get("min_num_clusters", None), + name=d.get("name", None), + num_active_sessions=d.get("num_active_sessions", None), + num_clusters=d.get("num_clusters", None), + odbc_params=_from_dict(d, "odbc_params", OdbcParams), + spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), + state=_enum(d, "state", State), + tags=_from_dict(d, "tags", EndpointTags), + warehouse_type=_enum(d, "warehouse_type", EndpointInfoWarehouseType), ) @@ -2780,15 +2780,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointTagPair into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTagPair: """Deserializes the EndpointTagPair from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -2806,13 +2806,13 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointTags into a shallow dictionary of its immediate attributes.""" body = {} if self.custom_tags: - body["{custom_tags}"] = self.custom_tags + body["custom_tags"] = self.custom_tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointTags: """Deserializes the EndpointTags from a dictionary.""" - return cls(custom_tags=_repeated_dict(d, "{custom_tags}", EndpointTagPair)) + return cls(custom_tags=_repeated_dict(d, "custom_tags", EndpointTagPair)) @dataclass @@ -2841,20 +2841,20 @@ def as_shallow_dict(self) -> dict: """Serializes the EnumValue into a shallow dictionary of its immediate attributes.""" body = {} if self.enum_options is not None: - body["{enum_options}"] = self.enum_options + body["enum_options"] = self.enum_options if self.multi_values_options: - body["{multi_values_options}"] = self.multi_values_options + body["multi_values_options"] = self.multi_values_options if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EnumValue: """Deserializes the EnumValue from a dictionary.""" return cls( - enum_options=d.get("{enum_options}", None), - multi_values_options=_from_dict(d, "{multi_values_options}", MultiValuesOptions), - values=d.get("{values}", None), + enum_options=d.get("enum_options", None), + multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions), + values=d.get("values", None), ) @@ -3006,44 +3006,44 @@ def as_shallow_dict(self) -> dict: """Serializes the ExecuteStatementRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_limit is not None: - body["{byte_limit}"] = self.byte_limit + body["byte_limit"] = self.byte_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.disposition is not None: - body["{disposition}"] = self.disposition + body["disposition"] = self.disposition if self.format is not None: - body["{format}"] = self.format + body["format"] = self.format if self.on_wait_timeout is not None: - body["{on_wait_timeout}"] = self.on_wait_timeout + body["on_wait_timeout"] = self.on_wait_timeout if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.row_limit is not None: - body["{row_limit}"] = self.row_limit + body["row_limit"] = self.row_limit if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.statement is not None: - body["{statement}"] = self.statement + body["statement"] = self.statement if self.wait_timeout is not None: - body["{wait_timeout}"] = self.wait_timeout + body["wait_timeout"] = self.wait_timeout if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExecuteStatementRequest: """Deserializes the ExecuteStatementRequest from a dictionary.""" return cls( - byte_limit=d.get("{byte_limit}", None), - catalog=d.get("{catalog}", None), - disposition=_enum(d, "{disposition}", Disposition), - format=_enum(d, "{format}", Format), - on_wait_timeout=_enum(d, "{on_wait_timeout}", ExecuteStatementRequestOnWaitTimeout), - parameters=_repeated_dict(d, "{parameters}", StatementParameterListItem), - row_limit=d.get("{row_limit}", None), - schema=d.get("{schema}", None), - statement=d.get("{statement}", None), - wait_timeout=d.get("{wait_timeout}", None), - warehouse_id=d.get("{warehouse_id}", None), + byte_limit=d.get("byte_limit", None), + catalog=d.get("catalog", None), + disposition=_enum(d, "disposition", Disposition), + format=_enum(d, "format", Format), + on_wait_timeout=_enum(d, "on_wait_timeout", ExecuteStatementRequestOnWaitTimeout), + parameters=_repeated_dict(d, "parameters", StatementParameterListItem), + row_limit=d.get("row_limit", None), + schema=d.get("schema", None), + statement=d.get("statement", None), + wait_timeout=d.get("wait_timeout", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -3123,38 +3123,38 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalLink into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.expiration is not None: - body["{expiration}"] = self.expiration + body["expiration"] = self.expiration if self.external_link is not None: - body["{external_link}"] = self.external_link + body["external_link"] = self.external_link if self.http_headers: - body["{http_headers}"] = self.http_headers + body["http_headers"] = self.http_headers if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalLink: """Deserializes the ExternalLink from a dictionary.""" return cls( - byte_count=d.get("{byte_count}", None), - chunk_index=d.get("{chunk_index}", None), - expiration=d.get("{expiration}", None), - external_link=d.get("{external_link}", None), - http_headers=d.get("{http_headers}", None), - next_chunk_index=d.get("{next_chunk_index}", None), - next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), - row_count=d.get("{row_count}", None), - row_offset=d.get("{row_offset}", None), + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + expiration=d.get("expiration", None), + external_link=d.get("external_link", None), + http_headers=d.get("http_headers", None), + next_chunk_index=d.get("next_chunk_index", None), + next_chunk_internal_link=d.get("next_chunk_internal_link", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), ) @@ -3203,32 +3203,32 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalQuerySource into a shallow dictionary of its immediate attributes.""" body = {} if self.alert_id is not None: - body["{alert_id}"] = self.alert_id + body["alert_id"] = self.alert_id if self.dashboard_id is not None: - body["{dashboard_id}"] = self.dashboard_id + body["dashboard_id"] = self.dashboard_id if self.genie_space_id is not None: - body["{genie_space_id}"] = self.genie_space_id + body["genie_space_id"] = self.genie_space_id if self.job_info: - body["{job_info}"] = self.job_info + body["job_info"] = self.job_info if self.legacy_dashboard_id is not None: - body["{legacy_dashboard_id}"] = self.legacy_dashboard_id + body["legacy_dashboard_id"] = self.legacy_dashboard_id if self.notebook_id is not None: - body["{notebook_id}"] = self.notebook_id + body["notebook_id"] = self.notebook_id if self.sql_query_id is not None: - body["{sql_query_id}"] = self.sql_query_id + body["sql_query_id"] = self.sql_query_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalQuerySource: """Deserializes the ExternalQuerySource from a dictionary.""" return cls( - alert_id=d.get("{alert_id}", None), - dashboard_id=d.get("{dashboard_id}", None), - genie_space_id=d.get("{genie_space_id}", None), - job_info=_from_dict(d, "{job_info}", ExternalQuerySourceJobInfo), - legacy_dashboard_id=d.get("{legacy_dashboard_id}", None), - notebook_id=d.get("{notebook_id}", None), - sql_query_id=d.get("{sql_query_id}", None), + alert_id=d.get("alert_id", None), + dashboard_id=d.get("dashboard_id", None), + genie_space_id=d.get("genie_space_id", None), + job_info=_from_dict(d, "job_info", ExternalQuerySourceJobInfo), + legacy_dashboard_id=d.get("legacy_dashboard_id", None), + notebook_id=d.get("notebook_id", None), + sql_query_id=d.get("sql_query_id", None), ) @@ -3258,20 +3258,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ExternalQuerySourceJobInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.job_id is not None: - body["{job_id}"] = self.job_id + body["job_id"] = self.job_id if self.job_run_id is not None: - body["{job_run_id}"] = self.job_run_id + body["job_run_id"] = self.job_run_id if self.job_task_run_id is not None: - body["{job_task_run_id}"] = self.job_task_run_id + body["job_task_run_id"] = self.job_task_run_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExternalQuerySourceJobInfo: """Deserializes the ExternalQuerySourceJobInfo from a dictionary.""" return cls( - job_id=d.get("{job_id}", None), - job_run_id=d.get("{job_run_id}", None), - job_task_run_id=d.get("{job_task_run_id}", None), + job_id=d.get("job_id", None), + job_run_id=d.get("job_run_id", None), + job_task_run_id=d.get("job_task_run_id", None), ) @@ -3307,20 +3307,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GetResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetResponse: """Deserializes the GetResponse from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", AccessControl), - object_id=d.get("{object_id}", None), - object_type=_enum(d, "{object_type}", ObjectType), + access_control_list=_repeated_dict(d, "access_control_list", AccessControl), + object_id=d.get("object_id", None), + object_type=_enum(d, "object_type", ObjectType), ) @@ -3340,13 +3340,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetWarehousePermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWarehousePermissionLevelsResponse: """Deserializes the GetWarehousePermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", WarehousePermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", WarehousePermissionsDescription)) @dataclass @@ -3489,71 +3489,71 @@ def as_shallow_dict(self) -> dict: """Serializes the GetWarehouseResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_stop_mins is not None: - body["{auto_stop_mins}"] = self.auto_stop_mins + body["auto_stop_mins"] = self.auto_stop_mins if self.channel: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.cluster_size is not None: - body["{cluster_size}"] = self.cluster_size + body["cluster_size"] = self.cluster_size if self.creator_name is not None: - body["{creator_name}"] = self.creator_name + body["creator_name"] = self.creator_name if self.enable_photon is not None: - body["{enable_photon}"] = self.enable_photon + body["enable_photon"] = self.enable_photon if self.enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = self.enable_serverless_compute + body["enable_serverless_compute"] = self.enable_serverless_compute if self.health: - body["{health}"] = self.health + body["health"] = self.health if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.jdbc_url is not None: - body["{jdbc_url}"] = self.jdbc_url + body["jdbc_url"] = self.jdbc_url if self.max_num_clusters is not None: - body["{max_num_clusters}"] = self.max_num_clusters + body["max_num_clusters"] = self.max_num_clusters if self.min_num_clusters is not None: - body["{min_num_clusters}"] = self.min_num_clusters + body["min_num_clusters"] = self.min_num_clusters if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.num_active_sessions is not None: - body["{num_active_sessions}"] = self.num_active_sessions + body["num_active_sessions"] = self.num_active_sessions if self.num_clusters is not None: - body["{num_clusters}"] = self.num_clusters + body["num_clusters"] = self.num_clusters if self.odbc_params: - body["{odbc_params}"] = self.odbc_params + body["odbc_params"] = self.odbc_params if self.spot_instance_policy is not None: - body["{spot_instance_policy}"] = self.spot_instance_policy + body["spot_instance_policy"] = self.spot_instance_policy if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type + body["warehouse_type"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWarehouseResponse: """Deserializes the GetWarehouseResponse from a dictionary.""" return cls( - auto_stop_mins=d.get("{auto_stop_mins}", None), - channel=_from_dict(d, "{channel}", Channel), - cluster_size=d.get("{cluster_size}", None), - creator_name=d.get("{creator_name}", None), - enable_photon=d.get("{enable_photon}", None), - enable_serverless_compute=d.get("{enable_serverless_compute}", None), - health=_from_dict(d, "{health}", EndpointHealth), - id=d.get("{id}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - jdbc_url=d.get("{jdbc_url}", None), - max_num_clusters=d.get("{max_num_clusters}", None), - min_num_clusters=d.get("{min_num_clusters}", None), - name=d.get("{name}", None), - num_active_sessions=d.get("{num_active_sessions}", None), - num_clusters=d.get("{num_clusters}", None), - odbc_params=_from_dict(d, "{odbc_params}", OdbcParams), - spot_instance_policy=_enum(d, "{spot_instance_policy}", SpotInstancePolicy), - state=_enum(d, "{state}", State), - tags=_from_dict(d, "{tags}", EndpointTags), - warehouse_type=_enum(d, "{warehouse_type}", GetWarehouseResponseWarehouseType), + auto_stop_mins=d.get("auto_stop_mins", None), + channel=_from_dict(d, "channel", Channel), + cluster_size=d.get("cluster_size", None), + creator_name=d.get("creator_name", None), + enable_photon=d.get("enable_photon", None), + enable_serverless_compute=d.get("enable_serverless_compute", None), + health=_from_dict(d, "health", EndpointHealth), + id=d.get("id", None), + instance_profile_arn=d.get("instance_profile_arn", None), + jdbc_url=d.get("jdbc_url", None), + max_num_clusters=d.get("max_num_clusters", None), + min_num_clusters=d.get("min_num_clusters", None), + name=d.get("name", None), + num_active_sessions=d.get("num_active_sessions", None), + num_clusters=d.get("num_clusters", None), + odbc_params=_from_dict(d, "odbc_params", OdbcParams), + spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy), + state=_enum(d, "state", State), + tags=_from_dict(d, "tags", EndpointTags), + warehouse_type=_enum(d, "warehouse_type", GetWarehouseResponseWarehouseType), ) @@ -3627,38 +3627,38 @@ def as_shallow_dict(self) -> dict: """Serializes the GetWorkspaceWarehouseConfigResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.channel: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.config_param: - body["{config_param}"] = self.config_param + body["config_param"] = self.config_param if self.data_access_config: - body["{data_access_config}"] = self.data_access_config + body["data_access_config"] = self.data_access_config if self.enabled_warehouse_types: - body["{enabled_warehouse_types}"] = self.enabled_warehouse_types + body["enabled_warehouse_types"] = self.enabled_warehouse_types if self.global_param: - body["{global_param}"] = self.global_param + body["global_param"] = self.global_param if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.security_policy is not None: - body["{security_policy}"] = self.security_policy + body["security_policy"] = self.security_policy if self.sql_configuration_parameters: - body["{sql_configuration_parameters}"] = self.sql_configuration_parameters + body["sql_configuration_parameters"] = self.sql_configuration_parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWorkspaceWarehouseConfigResponse: """Deserializes the GetWorkspaceWarehouseConfigResponse from a dictionary.""" return cls( - channel=_from_dict(d, "{channel}", Channel), - config_param=_from_dict(d, "{config_param}", RepeatedEndpointConfPairs), - data_access_config=_repeated_dict(d, "{data_access_config}", EndpointConfPair), - enabled_warehouse_types=_repeated_dict(d, "{enabled_warehouse_types}", WarehouseTypePair), - global_param=_from_dict(d, "{global_param}", RepeatedEndpointConfPairs), - google_service_account=d.get("{google_service_account}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - security_policy=_enum(d, "{security_policy}", GetWorkspaceWarehouseConfigResponseSecurityPolicy), - sql_configuration_parameters=_from_dict(d, "{sql_configuration_parameters}", RepeatedEndpointConfPairs), + channel=_from_dict(d, "channel", Channel), + config_param=_from_dict(d, "config_param", RepeatedEndpointConfPairs), + data_access_config=_repeated_dict(d, "data_access_config", EndpointConfPair), + enabled_warehouse_types=_repeated_dict(d, "enabled_warehouse_types", WarehouseTypePair), + global_param=_from_dict(d, "global_param", RepeatedEndpointConfPairs), + google_service_account=d.get("google_service_account", None), + instance_profile_arn=d.get("instance_profile_arn", None), + security_policy=_enum(d, "security_policy", GetWorkspaceWarehouseConfigResponseSecurityPolicy), + sql_configuration_parameters=_from_dict(d, "sql_configuration_parameters", RepeatedEndpointConfPairs), ) @@ -3736,44 +3736,44 @@ def as_shallow_dict(self) -> dict: """Serializes the LegacyAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_triggered_at is not None: - body["{last_triggered_at}"] = self.last_triggered_at + body["last_triggered_at"] = self.last_triggered_at if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.query: - body["{query}"] = self.query + body["query"] = self.query if self.rearm is not None: - body["{rearm}"] = self.rearm + body["rearm"] = self.rearm if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user: - body["{user}"] = self.user + body["user"] = self.user return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LegacyAlert: """Deserializes the LegacyAlert from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - id=d.get("{id}", None), - last_triggered_at=d.get("{last_triggered_at}", None), - name=d.get("{name}", None), - options=_from_dict(d, "{options}", AlertOptions), - parent=d.get("{parent}", None), - query=_from_dict(d, "{query}", AlertQuery), - rearm=d.get("{rearm}", None), - state=_enum(d, "{state}", LegacyAlertState), - updated_at=d.get("{updated_at}", None), - user=_from_dict(d, "{user}", User), + created_at=d.get("created_at", None), + id=d.get("id", None), + last_triggered_at=d.get("last_triggered_at", None), + name=d.get("name", None), + options=_from_dict(d, "options", AlertOptions), + parent=d.get("parent", None), + query=_from_dict(d, "query", AlertQuery), + rearm=d.get("rearm", None), + state=_enum(d, "state", LegacyAlertState), + updated_at=d.get("updated_at", None), + user=_from_dict(d, "user", User), ) @@ -3924,83 +3924,83 @@ def as_shallow_dict(self) -> dict: """Serializes the LegacyQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.can_edit is not None: - body["{can_edit}"] = self.can_edit + body["can_edit"] = self.can_edit if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.is_archived is not None: - body["{is_archived}"] = self.is_archived + body["is_archived"] = self.is_archived if self.is_draft is not None: - body["{is_draft}"] = self.is_draft + body["is_draft"] = self.is_draft if self.is_favorite is not None: - body["{is_favorite}"] = self.is_favorite + body["is_favorite"] = self.is_favorite if self.is_safe is not None: - body["{is_safe}"] = self.is_safe + body["is_safe"] = self.is_safe if self.last_modified_by: - body["{last_modified_by}"] = self.last_modified_by + body["last_modified_by"] = self.last_modified_by if self.last_modified_by_id is not None: - body["{last_modified_by_id}"] = self.last_modified_by_id + body["last_modified_by_id"] = self.last_modified_by_id if self.latest_query_data_id is not None: - body["{latest_query_data_id}"] = self.latest_query_data_id + body["latest_query_data_id"] = self.latest_query_data_id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.permission_tier is not None: - body["{permission_tier}"] = self.permission_tier + body["permission_tier"] = self.permission_tier if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.query_hash is not None: - body["{query_hash}"] = self.query_hash + body["query_hash"] = self.query_hash if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role + body["run_as_role"] = self.run_as_role if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at if self.user: - body["{user}"] = self.user + body["user"] = self.user if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.visualizations: - body["{visualizations}"] = self.visualizations + body["visualizations"] = self.visualizations return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LegacyQuery: """Deserializes the LegacyQuery from a dictionary.""" return cls( - can_edit=d.get("{can_edit}", None), - created_at=d.get("{created_at}", None), - data_source_id=d.get("{data_source_id}", None), - description=d.get("{description}", None), - id=d.get("{id}", None), - is_archived=d.get("{is_archived}", None), - is_draft=d.get("{is_draft}", None), - is_favorite=d.get("{is_favorite}", None), - is_safe=d.get("{is_safe}", None), - last_modified_by=_from_dict(d, "{last_modified_by}", User), - last_modified_by_id=d.get("{last_modified_by_id}", None), - latest_query_data_id=d.get("{latest_query_data_id}", None), - name=d.get("{name}", None), - options=_from_dict(d, "{options}", QueryOptions), - parent=d.get("{parent}", None), - permission_tier=_enum(d, "{permission_tier}", PermissionLevel), - query=d.get("{query}", None), - query_hash=d.get("{query_hash}", None), - run_as_role=_enum(d, "{run_as_role}", RunAsRole), - tags=d.get("{tags}", None), - updated_at=d.get("{updated_at}", None), - user=_from_dict(d, "{user}", User), - user_id=d.get("{user_id}", None), - visualizations=_repeated_dict(d, "{visualizations}", LegacyVisualization), + can_edit=d.get("can_edit", None), + created_at=d.get("created_at", None), + data_source_id=d.get("data_source_id", None), + description=d.get("description", None), + id=d.get("id", None), + is_archived=d.get("is_archived", None), + is_draft=d.get("is_draft", None), + is_favorite=d.get("is_favorite", None), + is_safe=d.get("is_safe", None), + last_modified_by=_from_dict(d, "last_modified_by", User), + last_modified_by_id=d.get("last_modified_by_id", None), + latest_query_data_id=d.get("latest_query_data_id", None), + name=d.get("name", None), + options=_from_dict(d, "options", QueryOptions), + parent=d.get("parent", None), + permission_tier=_enum(d, "permission_tier", PermissionLevel), + query=d.get("query", None), + query_hash=d.get("query_hash", None), + run_as_role=_enum(d, "run_as_role", RunAsRole), + tags=d.get("tags", None), + updated_at=d.get("updated_at", None), + user=_from_dict(d, "user", User), + user_id=d.get("user_id", None), + visualizations=_repeated_dict(d, "visualizations", LegacyVisualization), ) @@ -4058,35 +4058,35 @@ def as_shallow_dict(self) -> dict: """Serializes the LegacyVisualization into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.query: - body["{query}"] = self.query + body["query"] = self.query if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> LegacyVisualization: """Deserializes the LegacyVisualization from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - description=d.get("{description}", None), - id=d.get("{id}", None), - name=d.get("{name}", None), - options=d.get("{options}", None), - query=_from_dict(d, "{query}", LegacyQuery), - type=d.get("{type}", None), - updated_at=d.get("{updated_at}", None), + created_at=d.get("created_at", None), + description=d.get("description", None), + id=d.get("id", None), + name=d.get("name", None), + options=d.get("options", None), + query=_from_dict(d, "query", LegacyQuery), + type=d.get("type", None), + updated_at=d.get("updated_at", None), ) @@ -4115,17 +4115,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAlertsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAlertsResponse: """Deserializes the ListAlertsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - results=_repeated_dict(d, "{results}", ListAlertsResponseAlert), + next_page_token=d.get("next_page_token", None), + results=_repeated_dict(d, "results", ListAlertsResponseAlert), ) @@ -4217,53 +4217,53 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAlertsResponseAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["{condition}"] = self.condition + body["condition"] = self.condition if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state + body["lifecycle_state"] = self.lifecycle_state if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state if self.trigger_time is not None: - body["{trigger_time}"] = self.trigger_time + body["trigger_time"] = self.trigger_time if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAlertsResponseAlert: """Deserializes the ListAlertsResponseAlert from a dictionary.""" return cls( - condition=_from_dict(d, "{condition}", AlertCondition), - create_time=d.get("{create_time}", None), - custom_body=d.get("{custom_body}", None), - custom_subject=d.get("{custom_subject}", None), - display_name=d.get("{display_name}", None), - id=d.get("{id}", None), - lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), - notify_on_ok=d.get("{notify_on_ok}", None), - owner_user_name=d.get("{owner_user_name}", None), - query_id=d.get("{query_id}", None), - seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), - state=_enum(d, "{state}", AlertState), - trigger_time=d.get("{trigger_time}", None), - update_time=d.get("{update_time}", None), + condition=_from_dict(d, "condition", AlertCondition), + create_time=d.get("create_time", None), + custom_body=d.get("custom_body", None), + custom_subject=d.get("custom_subject", None), + display_name=d.get("display_name", None), + id=d.get("id", None), + lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), + notify_on_ok=d.get("notify_on_ok", None), + owner_user_name=d.get("owner_user_name", None), + query_id=d.get("query_id", None), + seconds_to_retrigger=d.get("seconds_to_retrigger", None), + state=_enum(d, "state", AlertState), + trigger_time=d.get("trigger_time", None), + update_time=d.get("update_time", None), ) @@ -4298,20 +4298,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ListQueriesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.has_next_page is not None: - body["{has_next_page}"] = self.has_next_page + body["has_next_page"] = self.has_next_page if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.res: - body["{res}"] = self.res + body["res"] = self.res return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQueriesResponse: """Deserializes the ListQueriesResponse from a dictionary.""" return cls( - has_next_page=d.get("{has_next_page}", None), - next_page_token=d.get("{next_page_token}", None), - res=_repeated_dict(d, "{res}", QueryInfo), + has_next_page=d.get("has_next_page", None), + next_page_token=d.get("next_page_token", None), + res=_repeated_dict(d, "res", QueryInfo), ) @@ -4334,17 +4334,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListQueryObjectsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQueryObjectsResponse: """Deserializes the ListQueryObjectsResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - results=_repeated_dict(d, "{results}", ListQueryObjectsResponseQuery), + next_page_token=d.get("next_page_token", None), + results=_repeated_dict(d, "results", ListQueryObjectsResponseQuery), ) @@ -4438,59 +4438,59 @@ def as_shallow_dict(self) -> dict: """Serializes the ListQueryObjectsResponseQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_modifier_user_name is not None: - body["{last_modifier_user_name}"] = self.last_modifier_user_name + body["last_modifier_user_name"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state + body["lifecycle_state"] = self.lifecycle_state if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode + body["run_as_mode"] = self.run_as_mode if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListQueryObjectsResponseQuery: """Deserializes the ListQueryObjectsResponseQuery from a dictionary.""" return cls( - apply_auto_limit=d.get("{apply_auto_limit}", None), - catalog=d.get("{catalog}", None), - create_time=d.get("{create_time}", None), - description=d.get("{description}", None), - display_name=d.get("{display_name}", None), - id=d.get("{id}", None), - last_modifier_user_name=d.get("{last_modifier_user_name}", None), - lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), - owner_user_name=d.get("{owner_user_name}", None), - parameters=_repeated_dict(d, "{parameters}", QueryParameter), - query_text=d.get("{query_text}", None), - run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), - schema=d.get("{schema}", None), - tags=d.get("{tags}", None), - update_time=d.get("{update_time}", None), - warehouse_id=d.get("{warehouse_id}", None), + apply_auto_limit=d.get("apply_auto_limit", None), + catalog=d.get("catalog", None), + create_time=d.get("create_time", None), + description=d.get("description", None), + display_name=d.get("display_name", None), + id=d.get("id", None), + last_modifier_user_name=d.get("last_modifier_user_name", None), + lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), + owner_user_name=d.get("owner_user_name", None), + parameters=_repeated_dict(d, "parameters", QueryParameter), + query_text=d.get("query_text", None), + run_as_mode=_enum(d, "run_as_mode", RunAsMode), + schema=d.get("schema", None), + tags=d.get("tags", None), + update_time=d.get("update_time", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -4525,23 +4525,23 @@ def as_shallow_dict(self) -> dict: """Serializes the ListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.count is not None: - body["{count}"] = self.count + body["count"] = self.count if self.page is not None: - body["{page}"] = self.page + body["page"] = self.page if self.page_size is not None: - body["{page_size}"] = self.page_size + body["page_size"] = self.page_size if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListResponse: """Deserializes the ListResponse from a dictionary.""" return cls( - count=d.get("{count}", None), - page=d.get("{page}", None), - page_size=d.get("{page_size}", None), - results=_repeated_dict(d, "{results}", Dashboard), + count=d.get("count", None), + page=d.get("page", None), + page_size=d.get("page_size", None), + results=_repeated_dict(d, "results", Dashboard), ) @@ -4564,17 +4564,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListVisualizationsForQueryResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListVisualizationsForQueryResponse: """Deserializes the ListVisualizationsForQueryResponse from a dictionary.""" - return cls( - next_page_token=d.get("{next_page_token}", None), results=_repeated_dict(d, "{results}", Visualization) - ) + return cls(next_page_token=d.get("next_page_token", None), results=_repeated_dict(d, "results", Visualization)) @dataclass @@ -4593,13 +4591,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListWarehousesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.warehouses: - body["{warehouses}"] = self.warehouses + body["warehouses"] = self.warehouses return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListWarehousesResponse: """Deserializes the ListWarehousesResponse from a dictionary.""" - return cls(warehouses=_repeated_dict(d, "{warehouses}", EndpointInfo)) + return cls(warehouses=_repeated_dict(d, "warehouses", EndpointInfo)) @dataclass @@ -4628,17 +4626,17 @@ def as_shallow_dict(self) -> dict: """Serializes the MultiValuesOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.prefix is not None: - body["{prefix}"] = self.prefix + body["prefix"] = self.prefix if self.separator is not None: - body["{separator}"] = self.separator + body["separator"] = self.separator if self.suffix is not None: - body["{suffix}"] = self.suffix + body["suffix"] = self.suffix return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MultiValuesOptions: """Deserializes the MultiValuesOptions from a dictionary.""" - return cls(prefix=d.get("{prefix}", None), separator=d.get("{separator}", None), suffix=d.get("{suffix}", None)) + return cls(prefix=d.get("prefix", None), separator=d.get("separator", None), suffix=d.get("suffix", None)) @dataclass @@ -4656,13 +4654,13 @@ def as_shallow_dict(self) -> dict: """Serializes the NumericValue into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> NumericValue: """Deserializes the NumericValue from a dictionary.""" - return cls(value=d.get("{value}", None)) + return cls(value=d.get("value", None)) class ObjectType(Enum): @@ -4710,23 +4708,23 @@ def as_shallow_dict(self) -> dict: """Serializes the OdbcParams into a shallow dictionary of its immediate attributes.""" body = {} if self.hostname is not None: - body["{hostname}"] = self.hostname + body["hostname"] = self.hostname if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.port is not None: - body["{port}"] = self.port + body["port"] = self.port if self.protocol is not None: - body["{protocol}"] = self.protocol + body["protocol"] = self.protocol return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> OdbcParams: """Deserializes the OdbcParams from a dictionary.""" return cls( - hostname=d.get("{hostname}", None), - path=d.get("{path}", None), - port=d.get("{port}", None), - protocol=d.get("{protocol}", None), + hostname=d.get("hostname", None), + path=d.get("path", None), + port=d.get("port", None), + protocol=d.get("protocol", None), ) @@ -4786,32 +4784,32 @@ def as_shallow_dict(self) -> dict: """Serializes the Parameter into a shallow dictionary of its immediate attributes.""" body = {} if self.enum_options is not None: - body["{enum_options}"] = self.enum_options + body["enumOptions"] = self.enum_options if self.multi_values_options: - body["{multi_values_options}"] = self.multi_values_options + body["multiValuesOptions"] = self.multi_values_options if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["queryId"] = self.query_id if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.value: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Parameter: """Deserializes the Parameter from a dictionary.""" return cls( - enum_options=d.get("{enum_options}", None), - multi_values_options=_from_dict(d, "{multi_values_options}", MultiValuesOptions), - name=d.get("{name}", None), - query_id=d.get("{query_id}", None), - title=d.get("{title}", None), - type=_enum(d, "{type}", ParameterType), - value=d.get("{value}", None), + enum_options=d.get("enumOptions", None), + multi_values_options=_from_dict(d, "multiValuesOptions", MultiValuesOptions), + name=d.get("name", None), + query_id=d.get("queryId", None), + title=d.get("title", None), + type=_enum(d, "type", ParameterType), + value=d.get("value", None), ) @@ -4941,62 +4939,62 @@ def as_shallow_dict(self) -> dict: """Serializes the Query into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_modifier_user_name is not None: - body["{last_modifier_user_name}"] = self.last_modifier_user_name + body["last_modifier_user_name"] = self.last_modifier_user_name if self.lifecycle_state is not None: - body["{lifecycle_state}"] = self.lifecycle_state + body["lifecycle_state"] = self.lifecycle_state if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.parent_path is not None: - body["{parent_path}"] = self.parent_path + body["parent_path"] = self.parent_path if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode + body["run_as_mode"] = self.run_as_mode if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Query: """Deserializes the Query from a dictionary.""" return cls( - apply_auto_limit=d.get("{apply_auto_limit}", None), - catalog=d.get("{catalog}", None), - create_time=d.get("{create_time}", None), - description=d.get("{description}", None), - display_name=d.get("{display_name}", None), - id=d.get("{id}", None), - last_modifier_user_name=d.get("{last_modifier_user_name}", None), - lifecycle_state=_enum(d, "{lifecycle_state}", LifecycleState), - owner_user_name=d.get("{owner_user_name}", None), - parameters=_repeated_dict(d, "{parameters}", QueryParameter), - parent_path=d.get("{parent_path}", None), - query_text=d.get("{query_text}", None), - run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), - schema=d.get("{schema}", None), - tags=d.get("{tags}", None), - update_time=d.get("{update_time}", None), - warehouse_id=d.get("{warehouse_id}", None), + apply_auto_limit=d.get("apply_auto_limit", None), + catalog=d.get("catalog", None), + create_time=d.get("create_time", None), + description=d.get("description", None), + display_name=d.get("display_name", None), + id=d.get("id", None), + last_modifier_user_name=d.get("last_modifier_user_name", None), + lifecycle_state=_enum(d, "lifecycle_state", LifecycleState), + owner_user_name=d.get("owner_user_name", None), + parameters=_repeated_dict(d, "parameters", QueryParameter), + parent_path=d.get("parent_path", None), + query_text=d.get("query_text", None), + run_as_mode=_enum(d, "run_as_mode", RunAsMode), + schema=d.get("schema", None), + tags=d.get("tags", None), + update_time=d.get("update_time", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -5026,20 +5024,20 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryBackedValue into a shallow dictionary of its immediate attributes.""" body = {} if self.multi_values_options: - body["{multi_values_options}"] = self.multi_values_options + body["multi_values_options"] = self.multi_values_options if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryBackedValue: """Deserializes the QueryBackedValue from a dictionary.""" return cls( - multi_values_options=_from_dict(d, "{multi_values_options}", MultiValuesOptions), - query_id=d.get("{query_id}", None), - values=d.get("{values}", None), + multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions), + query_id=d.get("query_id", None), + values=d.get("values", None), ) @@ -5098,35 +5096,35 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryEditContent into a shallow dictionary of its immediate attributes.""" body = {} if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role + body["run_as_role"] = self.run_as_role if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryEditContent: """Deserializes the QueryEditContent from a dictionary.""" return cls( - data_source_id=d.get("{data_source_id}", None), - description=d.get("{description}", None), - name=d.get("{name}", None), - options=d.get("{options}", None), - query=d.get("{query}", None), - query_id=d.get("{query_id}", None), - run_as_role=_enum(d, "{run_as_role}", RunAsRole), - tags=d.get("{tags}", None), + data_source_id=d.get("data_source_id", None), + description=d.get("description", None), + name=d.get("name", None), + options=d.get("options", None), + query=d.get("query", None), + query_id=d.get("query_id", None), + run_as_role=_enum(d, "run_as_role", RunAsRole), + tags=d.get("tags", None), ) @@ -5165,26 +5163,26 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryFilter into a shallow dictionary of its immediate attributes.""" body = {} if self.query_start_time_range: - body["{query_start_time_range}"] = self.query_start_time_range + body["query_start_time_range"] = self.query_start_time_range if self.statement_ids: - body["{statement_ids}"] = self.statement_ids + body["statement_ids"] = self.statement_ids if self.statuses: - body["{statuses}"] = self.statuses + body["statuses"] = self.statuses if self.user_ids: - body["{user_ids}"] = self.user_ids + body["user_ids"] = self.user_ids if self.warehouse_ids: - body["{warehouse_ids}"] = self.warehouse_ids + body["warehouse_ids"] = self.warehouse_ids return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryFilter: """Deserializes the QueryFilter from a dictionary.""" return cls( - query_start_time_range=_from_dict(d, "{query_start_time_range}", TimeRange), - statement_ids=d.get("{statement_ids}", None), - statuses=_repeated_enum(d, "{statuses}", QueryStatus), - user_ids=d.get("{user_ids}", None), - warehouse_ids=d.get("{warehouse_ids}", None), + query_start_time_range=_from_dict(d, "query_start_time_range", TimeRange), + statement_ids=d.get("statement_ids", None), + statuses=_repeated_enum(d, "statuses", QueryStatus), + user_ids=d.get("user_ids", None), + warehouse_ids=d.get("warehouse_ids", None), ) @@ -5320,80 +5318,80 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.channel_used: - body["{channel_used}"] = self.channel_used + body["channel_used"] = self.channel_used if self.duration is not None: - body["{duration}"] = self.duration + body["duration"] = self.duration if self.endpoint_id is not None: - body["{endpoint_id}"] = self.endpoint_id + body["endpoint_id"] = self.endpoint_id if self.error_message is not None: - body["{error_message}"] = self.error_message + body["error_message"] = self.error_message if self.executed_as_user_id is not None: - body["{executed_as_user_id}"] = self.executed_as_user_id + body["executed_as_user_id"] = self.executed_as_user_id if self.executed_as_user_name is not None: - body["{executed_as_user_name}"] = self.executed_as_user_name + body["executed_as_user_name"] = self.executed_as_user_name if self.execution_end_time_ms is not None: - body["{execution_end_time_ms}"] = self.execution_end_time_ms + body["execution_end_time_ms"] = self.execution_end_time_ms if self.is_final is not None: - body["{is_final}"] = self.is_final + body["is_final"] = self.is_final if self.lookup_key is not None: - body["{lookup_key}"] = self.lookup_key + body["lookup_key"] = self.lookup_key if self.metrics: - body["{metrics}"] = self.metrics + body["metrics"] = self.metrics if self.plans_state is not None: - body["{plans_state}"] = self.plans_state + body["plans_state"] = self.plans_state if self.query_end_time_ms is not None: - body["{query_end_time_ms}"] = self.query_end_time_ms + body["query_end_time_ms"] = self.query_end_time_ms if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.query_source: - body["{query_source}"] = self.query_source + body["query_source"] = self.query_source if self.query_start_time_ms is not None: - body["{query_start_time_ms}"] = self.query_start_time_ms + body["query_start_time_ms"] = self.query_start_time_ms if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.rows_produced is not None: - body["{rows_produced}"] = self.rows_produced + body["rows_produced"] = self.rows_produced if self.spark_ui_url is not None: - body["{spark_ui_url}"] = self.spark_ui_url + body["spark_ui_url"] = self.spark_ui_url if self.statement_type is not None: - body["{statement_type}"] = self.statement_type + body["statement_type"] = self.statement_type if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status if self.user_id is not None: - body["{user_id}"] = self.user_id + body["user_id"] = self.user_id if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryInfo: """Deserializes the QueryInfo from a dictionary.""" return cls( - channel_used=_from_dict(d, "{channel_used}", ChannelInfo), - duration=d.get("{duration}", None), - endpoint_id=d.get("{endpoint_id}", None), - error_message=d.get("{error_message}", None), - executed_as_user_id=d.get("{executed_as_user_id}", None), - executed_as_user_name=d.get("{executed_as_user_name}", None), - execution_end_time_ms=d.get("{execution_end_time_ms}", None), - is_final=d.get("{is_final}", None), - lookup_key=d.get("{lookup_key}", None), - metrics=_from_dict(d, "{metrics}", QueryMetrics), - plans_state=_enum(d, "{plans_state}", PlansState), - query_end_time_ms=d.get("{query_end_time_ms}", None), - query_id=d.get("{query_id}", None), - query_source=_from_dict(d, "{query_source}", ExternalQuerySource), - query_start_time_ms=d.get("{query_start_time_ms}", None), - query_text=d.get("{query_text}", None), - rows_produced=d.get("{rows_produced}", None), - spark_ui_url=d.get("{spark_ui_url}", None), - statement_type=_enum(d, "{statement_type}", QueryStatementType), - status=_enum(d, "{status}", QueryStatus), - user_id=d.get("{user_id}", None), - user_name=d.get("{user_name}", None), - warehouse_id=d.get("{warehouse_id}", None), + channel_used=_from_dict(d, "channel_used", ChannelInfo), + duration=d.get("duration", None), + endpoint_id=d.get("endpoint_id", None), + error_message=d.get("error_message", None), + executed_as_user_id=d.get("executed_as_user_id", None), + executed_as_user_name=d.get("executed_as_user_name", None), + execution_end_time_ms=d.get("execution_end_time_ms", None), + is_final=d.get("is_final", None), + lookup_key=d.get("lookup_key", None), + metrics=_from_dict(d, "metrics", QueryMetrics), + plans_state=_enum(d, "plans_state", PlansState), + query_end_time_ms=d.get("query_end_time_ms", None), + query_id=d.get("query_id", None), + query_source=_from_dict(d, "query_source", ExternalQuerySource), + query_start_time_ms=d.get("query_start_time_ms", None), + query_text=d.get("query_text", None), + rows_produced=d.get("rows_produced", None), + spark_ui_url=d.get("spark_ui_url", None), + statement_type=_enum(d, "statement_type", QueryStatementType), + status=_enum(d, "status", QueryStatus), + user_id=d.get("user_id", None), + user_name=d.get("user_name", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -5428,23 +5426,23 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryList into a shallow dictionary of its immediate attributes.""" body = {} if self.count is not None: - body["{count}"] = self.count + body["count"] = self.count if self.page is not None: - body["{page}"] = self.page + body["page"] = self.page if self.page_size is not None: - body["{page_size}"] = self.page_size + body["page_size"] = self.page_size if self.results: - body["{results}"] = self.results + body["results"] = self.results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryList: """Deserializes the QueryList from a dictionary.""" return cls( - count=d.get("{count}", None), - page=d.get("{page}", None), - page_size=d.get("{page_size}", None), - results=_repeated_dict(d, "{results}", LegacyQuery), + count=d.get("count", None), + page=d.get("page", None), + page_size=d.get("page_size", None), + results=_repeated_dict(d, "results", LegacyQuery), ) @@ -5575,77 +5573,77 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryMetrics into a shallow dictionary of its immediate attributes.""" body = {} if self.compilation_time_ms is not None: - body["{compilation_time_ms}"] = self.compilation_time_ms + body["compilation_time_ms"] = self.compilation_time_ms if self.execution_time_ms is not None: - body["{execution_time_ms}"] = self.execution_time_ms + body["execution_time_ms"] = self.execution_time_ms if self.network_sent_bytes is not None: - body["{network_sent_bytes}"] = self.network_sent_bytes + body["network_sent_bytes"] = self.network_sent_bytes if self.overloading_queue_start_timestamp is not None: - body["{overloading_queue_start_timestamp}"] = self.overloading_queue_start_timestamp + body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp if self.photon_total_time_ms is not None: - body["{photon_total_time_ms}"] = self.photon_total_time_ms + body["photon_total_time_ms"] = self.photon_total_time_ms if self.provisioning_queue_start_timestamp is not None: - body["{provisioning_queue_start_timestamp}"] = self.provisioning_queue_start_timestamp + body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp if self.pruned_bytes is not None: - body["{pruned_bytes}"] = self.pruned_bytes + body["pruned_bytes"] = self.pruned_bytes if self.pruned_files_count is not None: - body["{pruned_files_count}"] = self.pruned_files_count + body["pruned_files_count"] = self.pruned_files_count if self.query_compilation_start_timestamp is not None: - body["{query_compilation_start_timestamp}"] = self.query_compilation_start_timestamp + body["query_compilation_start_timestamp"] = self.query_compilation_start_timestamp if self.read_bytes is not None: - body["{read_bytes}"] = self.read_bytes + body["read_bytes"] = self.read_bytes if self.read_cache_bytes is not None: - body["{read_cache_bytes}"] = self.read_cache_bytes + body["read_cache_bytes"] = self.read_cache_bytes if self.read_files_count is not None: - body["{read_files_count}"] = self.read_files_count + body["read_files_count"] = self.read_files_count if self.read_partitions_count is not None: - body["{read_partitions_count}"] = self.read_partitions_count + body["read_partitions_count"] = self.read_partitions_count if self.read_remote_bytes is not None: - body["{read_remote_bytes}"] = self.read_remote_bytes + body["read_remote_bytes"] = self.read_remote_bytes if self.result_fetch_time_ms is not None: - body["{result_fetch_time_ms}"] = self.result_fetch_time_ms + body["result_fetch_time_ms"] = self.result_fetch_time_ms if self.result_from_cache is not None: - body["{result_from_cache}"] = self.result_from_cache + body["result_from_cache"] = self.result_from_cache if self.rows_produced_count is not None: - body["{rows_produced_count}"] = self.rows_produced_count + body["rows_produced_count"] = self.rows_produced_count if self.rows_read_count is not None: - body["{rows_read_count}"] = self.rows_read_count + body["rows_read_count"] = self.rows_read_count if self.spill_to_disk_bytes is not None: - body["{spill_to_disk_bytes}"] = self.spill_to_disk_bytes + body["spill_to_disk_bytes"] = self.spill_to_disk_bytes if self.task_total_time_ms is not None: - body["{task_total_time_ms}"] = self.task_total_time_ms + body["task_total_time_ms"] = self.task_total_time_ms if self.total_time_ms is not None: - body["{total_time_ms}"] = self.total_time_ms + body["total_time_ms"] = self.total_time_ms if self.write_remote_bytes is not None: - body["{write_remote_bytes}"] = self.write_remote_bytes + body["write_remote_bytes"] = self.write_remote_bytes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryMetrics: """Deserializes the QueryMetrics from a dictionary.""" return cls( - compilation_time_ms=d.get("{compilation_time_ms}", None), - execution_time_ms=d.get("{execution_time_ms}", None), - network_sent_bytes=d.get("{network_sent_bytes}", None), - overloading_queue_start_timestamp=d.get("{overloading_queue_start_timestamp}", None), - photon_total_time_ms=d.get("{photon_total_time_ms}", None), - provisioning_queue_start_timestamp=d.get("{provisioning_queue_start_timestamp}", None), - pruned_bytes=d.get("{pruned_bytes}", None), - pruned_files_count=d.get("{pruned_files_count}", None), - query_compilation_start_timestamp=d.get("{query_compilation_start_timestamp}", None), - read_bytes=d.get("{read_bytes}", None), - read_cache_bytes=d.get("{read_cache_bytes}", None), - read_files_count=d.get("{read_files_count}", None), - read_partitions_count=d.get("{read_partitions_count}", None), - read_remote_bytes=d.get("{read_remote_bytes}", None), - result_fetch_time_ms=d.get("{result_fetch_time_ms}", None), - result_from_cache=d.get("{result_from_cache}", None), - rows_produced_count=d.get("{rows_produced_count}", None), - rows_read_count=d.get("{rows_read_count}", None), - spill_to_disk_bytes=d.get("{spill_to_disk_bytes}", None), - task_total_time_ms=d.get("{task_total_time_ms}", None), - total_time_ms=d.get("{total_time_ms}", None), - write_remote_bytes=d.get("{write_remote_bytes}", None), + compilation_time_ms=d.get("compilation_time_ms", None), + execution_time_ms=d.get("execution_time_ms", None), + network_sent_bytes=d.get("network_sent_bytes", None), + overloading_queue_start_timestamp=d.get("overloading_queue_start_timestamp", None), + photon_total_time_ms=d.get("photon_total_time_ms", None), + provisioning_queue_start_timestamp=d.get("provisioning_queue_start_timestamp", None), + pruned_bytes=d.get("pruned_bytes", None), + pruned_files_count=d.get("pruned_files_count", None), + query_compilation_start_timestamp=d.get("query_compilation_start_timestamp", None), + read_bytes=d.get("read_bytes", None), + read_cache_bytes=d.get("read_cache_bytes", None), + read_files_count=d.get("read_files_count", None), + read_partitions_count=d.get("read_partitions_count", None), + read_remote_bytes=d.get("read_remote_bytes", None), + result_fetch_time_ms=d.get("result_fetch_time_ms", None), + result_from_cache=d.get("result_from_cache", None), + rows_produced_count=d.get("rows_produced_count", None), + rows_read_count=d.get("rows_read_count", None), + spill_to_disk_bytes=d.get("spill_to_disk_bytes", None), + task_total_time_ms=d.get("task_total_time_ms", None), + total_time_ms=d.get("total_time_ms", None), + write_remote_bytes=d.get("write_remote_bytes", None), ) @@ -5680,23 +5678,23 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.moved_to_trash_at is not None: - body["{moved_to_trash_at}"] = self.moved_to_trash_at + body["moved_to_trash_at"] = self.moved_to_trash_at if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryOptions: """Deserializes the QueryOptions from a dictionary.""" return cls( - catalog=d.get("{catalog}", None), - moved_to_trash_at=d.get("{moved_to_trash_at}", None), - parameters=_repeated_dict(d, "{parameters}", Parameter), - schema=d.get("{schema}", None), + catalog=d.get("catalog", None), + moved_to_trash_at=d.get("moved_to_trash_at", None), + parameters=_repeated_dict(d, "parameters", Parameter), + schema=d.get("schema", None), ) @@ -5752,35 +5750,35 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryParameter into a shallow dictionary of its immediate attributes.""" body = {} if self.date_range_value: - body["{date_range_value}"] = self.date_range_value + body["date_range_value"] = self.date_range_value if self.date_value: - body["{date_value}"] = self.date_value + body["date_value"] = self.date_value if self.enum_value: - body["{enum_value}"] = self.enum_value + body["enum_value"] = self.enum_value if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.numeric_value: - body["{numeric_value}"] = self.numeric_value + body["numeric_value"] = self.numeric_value if self.query_backed_value: - body["{query_backed_value}"] = self.query_backed_value + body["query_backed_value"] = self.query_backed_value if self.text_value: - body["{text_value}"] = self.text_value + body["text_value"] = self.text_value if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryParameter: """Deserializes the QueryParameter from a dictionary.""" return cls( - date_range_value=_from_dict(d, "{date_range_value}", DateRangeValue), - date_value=_from_dict(d, "{date_value}", DateValue), - enum_value=_from_dict(d, "{enum_value}", EnumValue), - name=d.get("{name}", None), - numeric_value=_from_dict(d, "{numeric_value}", NumericValue), - query_backed_value=_from_dict(d, "{query_backed_value}", QueryBackedValue), - text_value=_from_dict(d, "{text_value}", TextValue), - title=d.get("{title}", None), + date_range_value=_from_dict(d, "date_range_value", DateRangeValue), + date_value=_from_dict(d, "date_value", DateValue), + enum_value=_from_dict(d, "enum_value", EnumValue), + name=d.get("name", None), + numeric_value=_from_dict(d, "numeric_value", NumericValue), + query_backed_value=_from_dict(d, "query_backed_value", QueryBackedValue), + text_value=_from_dict(d, "text_value", TextValue), + title=d.get("title", None), ) @@ -5840,35 +5838,35 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryPostContent into a shallow dictionary of its immediate attributes.""" body = {} if self.data_source_id is not None: - body["{data_source_id}"] = self.data_source_id + body["data_source_id"] = self.data_source_id if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.parent is not None: - body["{parent}"] = self.parent + body["parent"] = self.parent if self.query is not None: - body["{query}"] = self.query + body["query"] = self.query if self.run_as_role is not None: - body["{run_as_role}"] = self.run_as_role + body["run_as_role"] = self.run_as_role if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryPostContent: """Deserializes the QueryPostContent from a dictionary.""" return cls( - data_source_id=d.get("{data_source_id}", None), - description=d.get("{description}", None), - name=d.get("{name}", None), - options=d.get("{options}", None), - parent=d.get("{parent}", None), - query=d.get("{query}", None), - run_as_role=_enum(d, "{run_as_role}", RunAsRole), - tags=d.get("{tags}", None), + data_source_id=d.get("data_source_id", None), + description=d.get("description", None), + name=d.get("name", None), + options=d.get("options", None), + parent=d.get("parent", None), + query=d.get("query", None), + run_as_role=_enum(d, "run_as_role", RunAsRole), + tags=d.get("tags", None), ) @@ -5931,17 +5929,17 @@ def as_shallow_dict(self) -> dict: """Serializes the RepeatedEndpointConfPairs into a shallow dictionary of its immediate attributes.""" body = {} if self.config_pair: - body["{config_pair}"] = self.config_pair + body["config_pair"] = self.config_pair if self.configuration_pairs: - body["{configuration_pairs}"] = self.configuration_pairs + body["configuration_pairs"] = self.configuration_pairs return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepeatedEndpointConfPairs: """Deserializes the RepeatedEndpointConfPairs from a dictionary.""" return cls( - config_pair=_repeated_dict(d, "{config_pair}", EndpointConfPair), - configuration_pairs=_repeated_dict(d, "{configuration_pairs}", EndpointConfPair), + config_pair=_repeated_dict(d, "config_pair", EndpointConfPair), + configuration_pairs=_repeated_dict(d, "configuration_pairs", EndpointConfPair), ) @@ -6019,35 +6017,35 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultData into a shallow dictionary of its immediate attributes.""" body = {} if self.byte_count is not None: - body["{byte_count}"] = self.byte_count + body["byte_count"] = self.byte_count if self.chunk_index is not None: - body["{chunk_index}"] = self.chunk_index + body["chunk_index"] = self.chunk_index if self.data_array: - body["{data_array}"] = self.data_array + body["data_array"] = self.data_array if self.external_links: - body["{external_links}"] = self.external_links + body["external_links"] = self.external_links if self.next_chunk_index is not None: - body["{next_chunk_index}"] = self.next_chunk_index + body["next_chunk_index"] = self.next_chunk_index if self.next_chunk_internal_link is not None: - body["{next_chunk_internal_link}"] = self.next_chunk_internal_link + body["next_chunk_internal_link"] = self.next_chunk_internal_link if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count if self.row_offset is not None: - body["{row_offset}"] = self.row_offset + body["row_offset"] = self.row_offset return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultData: """Deserializes the ResultData from a dictionary.""" return cls( - byte_count=d.get("{byte_count}", None), - chunk_index=d.get("{chunk_index}", None), - data_array=d.get("{data_array}", None), - external_links=_repeated_dict(d, "{external_links}", ExternalLink), - next_chunk_index=d.get("{next_chunk_index}", None), - next_chunk_internal_link=d.get("{next_chunk_internal_link}", None), - row_count=d.get("{row_count}", None), - row_offset=d.get("{row_offset}", None), + byte_count=d.get("byte_count", None), + chunk_index=d.get("chunk_index", None), + data_array=d.get("data_array", None), + external_links=_repeated_dict(d, "external_links", ExternalLink), + next_chunk_index=d.get("next_chunk_index", None), + next_chunk_internal_link=d.get("next_chunk_internal_link", None), + row_count=d.get("row_count", None), + row_offset=d.get("row_offset", None), ) @@ -6099,32 +6097,32 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultManifest into a shallow dictionary of its immediate attributes.""" body = {} if self.chunks: - body["{chunks}"] = self.chunks + body["chunks"] = self.chunks if self.format is not None: - body["{format}"] = self.format + body["format"] = self.format if self.schema: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.total_byte_count is not None: - body["{total_byte_count}"] = self.total_byte_count + body["total_byte_count"] = self.total_byte_count if self.total_chunk_count is not None: - body["{total_chunk_count}"] = self.total_chunk_count + body["total_chunk_count"] = self.total_chunk_count if self.total_row_count is not None: - body["{total_row_count}"] = self.total_row_count + body["total_row_count"] = self.total_row_count if self.truncated is not None: - body["{truncated}"] = self.truncated + body["truncated"] = self.truncated return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultManifest: """Deserializes the ResultManifest from a dictionary.""" return cls( - chunks=_repeated_dict(d, "{chunks}", BaseChunkInfo), - format=_enum(d, "{format}", Format), - schema=_from_dict(d, "{schema}", ResultSchema), - total_byte_count=d.get("{total_byte_count}", None), - total_chunk_count=d.get("{total_chunk_count}", None), - total_row_count=d.get("{total_row_count}", None), - truncated=d.get("{truncated}", None), + chunks=_repeated_dict(d, "chunks", BaseChunkInfo), + format=_enum(d, "format", Format), + schema=_from_dict(d, "schema", ResultSchema), + total_byte_count=d.get("total_byte_count", None), + total_chunk_count=d.get("total_chunk_count", None), + total_row_count=d.get("total_row_count", None), + truncated=d.get("truncated", None), ) @@ -6149,15 +6147,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultSchema into a shallow dictionary of its immediate attributes.""" body = {} if self.column_count is not None: - body["{column_count}"] = self.column_count + body["column_count"] = self.column_count if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultSchema: """Deserializes the ResultSchema from a dictionary.""" - return cls(column_count=d.get("{column_count}", None), columns=_repeated_dict(d, "{columns}", ColumnInfo)) + return cls(column_count=d.get("column_count", None), columns=_repeated_dict(d, "columns", ColumnInfo)) class RunAsMode(Enum): @@ -6194,15 +6192,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ServiceError into a shallow dictionary of its immediate attributes.""" body = {} if self.error_code is not None: - body["{error_code}"] = self.error_code + body["error_code"] = self.error_code if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ServiceError: """Deserializes the ServiceError from a dictionary.""" - return cls(error_code=_enum(d, "{error_code}", ServiceErrorCode), message=d.get("{message}", None)) + return cls(error_code=_enum(d, "error_code", ServiceErrorCode), message=d.get("message", None)) class ServiceErrorCode(Enum): @@ -6248,20 +6246,20 @@ def as_shallow_dict(self) -> dict: """Serializes the SetResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetResponse: """Deserializes the SetResponse from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", AccessControl), - object_id=d.get("{object_id}", None), - object_type=_enum(d, "{object_type}", ObjectType), + access_control_list=_repeated_dict(d, "access_control_list", AccessControl), + object_id=d.get("object_id", None), + object_type=_enum(d, "object_type", ObjectType), ) @@ -6326,38 +6324,38 @@ def as_shallow_dict(self) -> dict: """Serializes the SetWorkspaceWarehouseConfigRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.channel: - body["{channel}"] = self.channel + body["channel"] = self.channel if self.config_param: - body["{config_param}"] = self.config_param + body["config_param"] = self.config_param if self.data_access_config: - body["{data_access_config}"] = self.data_access_config + body["data_access_config"] = self.data_access_config if self.enabled_warehouse_types: - body["{enabled_warehouse_types}"] = self.enabled_warehouse_types + body["enabled_warehouse_types"] = self.enabled_warehouse_types if self.global_param: - body["{global_param}"] = self.global_param + body["global_param"] = self.global_param if self.google_service_account is not None: - body["{google_service_account}"] = self.google_service_account + body["google_service_account"] = self.google_service_account if self.instance_profile_arn is not None: - body["{instance_profile_arn}"] = self.instance_profile_arn + body["instance_profile_arn"] = self.instance_profile_arn if self.security_policy is not None: - body["{security_policy}"] = self.security_policy + body["security_policy"] = self.security_policy if self.sql_configuration_parameters: - body["{sql_configuration_parameters}"] = self.sql_configuration_parameters + body["sql_configuration_parameters"] = self.sql_configuration_parameters return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SetWorkspaceWarehouseConfigRequest: """Deserializes the SetWorkspaceWarehouseConfigRequest from a dictionary.""" return cls( - channel=_from_dict(d, "{channel}", Channel), - config_param=_from_dict(d, "{config_param}", RepeatedEndpointConfPairs), - data_access_config=_repeated_dict(d, "{data_access_config}", EndpointConfPair), - enabled_warehouse_types=_repeated_dict(d, "{enabled_warehouse_types}", WarehouseTypePair), - global_param=_from_dict(d, "{global_param}", RepeatedEndpointConfPairs), - google_service_account=d.get("{google_service_account}", None), - instance_profile_arn=d.get("{instance_profile_arn}", None), - security_policy=_enum(d, "{security_policy}", SetWorkspaceWarehouseConfigRequestSecurityPolicy), - sql_configuration_parameters=_from_dict(d, "{sql_configuration_parameters}", RepeatedEndpointConfPairs), + channel=_from_dict(d, "channel", Channel), + config_param=_from_dict(d, "config_param", RepeatedEndpointConfPairs), + data_access_config=_repeated_dict(d, "data_access_config", EndpointConfPair), + enabled_warehouse_types=_repeated_dict(d, "enabled_warehouse_types", WarehouseTypePair), + global_param=_from_dict(d, "global_param", RepeatedEndpointConfPairs), + google_service_account=d.get("google_service_account", None), + instance_profile_arn=d.get("instance_profile_arn", None), + security_policy=_enum(d, "security_policy", SetWorkspaceWarehouseConfigRequestSecurityPolicy), + sql_configuration_parameters=_from_dict(d, "sql_configuration_parameters", RepeatedEndpointConfPairs), ) @@ -6455,17 +6453,17 @@ def as_shallow_dict(self) -> dict: """Serializes the StatementParameterListItem into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementParameterListItem: """Deserializes the StatementParameterListItem from a dictionary.""" - return cls(name=d.get("{name}", None), type=d.get("{type}", None), value=d.get("{value}", None)) + return cls(name=d.get("name", None), type=d.get("type", None), value=d.get("value", None)) @dataclass @@ -6499,23 +6497,23 @@ def as_shallow_dict(self) -> dict: """Serializes the StatementResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.manifest: - body["{manifest}"] = self.manifest + body["manifest"] = self.manifest if self.result: - body["{result}"] = self.result + body["result"] = self.result if self.statement_id is not None: - body["{statement_id}"] = self.statement_id + body["statement_id"] = self.statement_id if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementResponse: """Deserializes the StatementResponse from a dictionary.""" return cls( - manifest=_from_dict(d, "{manifest}", ResultManifest), - result=_from_dict(d, "{result}", ResultData), - statement_id=d.get("{statement_id}", None), - status=_from_dict(d, "{status}", StatementStatus), + manifest=_from_dict(d, "manifest", ResultManifest), + result=_from_dict(d, "result", ResultData), + statement_id=d.get("statement_id", None), + status=_from_dict(d, "status", StatementStatus), ) @@ -6560,15 +6558,15 @@ def as_shallow_dict(self) -> dict: """Serializes the StatementStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.error: - body["{error}"] = self.error + body["error"] = self.error if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> StatementStatus: """Deserializes the StatementStatus from a dictionary.""" - return cls(error=_from_dict(d, "{error}", ServiceError), state=_enum(d, "{state}", StatementState)) + return cls(error=_from_dict(d, "error", ServiceError), state=_enum(d, "state", StatementState)) class Status(Enum): @@ -6613,13 +6611,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Success into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Success: """Deserializes the Success from a dictionary.""" - return cls(message=_enum(d, "{message}", SuccessMessage)) + return cls(message=_enum(d, "message", SuccessMessage)) class SuccessMessage(Enum): @@ -6653,20 +6651,20 @@ def as_shallow_dict(self) -> dict: """Serializes the TerminationReason into a shallow dictionary of its immediate attributes.""" body = {} if self.code is not None: - body["{code}"] = self.code + body["code"] = self.code if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TerminationReason: """Deserializes the TerminationReason from a dictionary.""" return cls( - code=_enum(d, "{code}", TerminationReasonCode), - parameters=d.get("{parameters}", None), - type=_enum(d, "{type}", TerminationReasonType), + code=_enum(d, "code", TerminationReasonCode), + parameters=d.get("parameters", None), + type=_enum(d, "type", TerminationReasonType), ) @@ -6778,13 +6776,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TextValue into a shallow dictionary of its immediate attributes.""" body = {} if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TextValue: """Deserializes the TextValue from a dictionary.""" - return cls(value=d.get("{value}", None)) + return cls(value=d.get("value", None)) @dataclass @@ -6808,15 +6806,15 @@ def as_shallow_dict(self) -> dict: """Serializes the TimeRange into a shallow dictionary of its immediate attributes.""" body = {} if self.end_time_ms is not None: - body["{end_time_ms}"] = self.end_time_ms + body["end_time_ms"] = self.end_time_ms if self.start_time_ms is not None: - body["{start_time_ms}"] = self.start_time_ms + body["start_time_ms"] = self.start_time_ms return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TimeRange: """Deserializes the TimeRange from a dictionary.""" - return cls(end_time_ms=d.get("{end_time_ms}", None), start_time_ms=d.get("{start_time_ms}", None)) + return cls(end_time_ms=d.get("end_time_ms", None), start_time_ms=d.get("start_time_ms", None)) @dataclass @@ -6835,13 +6833,13 @@ def as_shallow_dict(self) -> dict: """Serializes the TransferOwnershipObjectId into a shallow dictionary of its immediate attributes.""" body = {} if self.new_owner is not None: - body["{new_owner}"] = self.new_owner + body["new_owner"] = self.new_owner return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> TransferOwnershipObjectId: """Deserializes the TransferOwnershipObjectId from a dictionary.""" - return cls(new_owner=d.get("{new_owner}", None)) + return cls(new_owner=d.get("new_owner", None)) @dataclass @@ -6876,20 +6874,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateAlertRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.alert: - body["{alert}"] = self.alert + body["alert"] = self.alert if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAlertRequest: """Deserializes the UpdateAlertRequest from a dictionary.""" return cls( - alert=_from_dict(d, "{alert}", UpdateAlertRequestAlert), - id=d.get("{id}", None), - update_mask=d.get("{update_mask}", None), + alert=_from_dict(d, "alert", UpdateAlertRequestAlert), + id=d.get("id", None), + update_mask=d.get("update_mask", None), ) @@ -6950,35 +6948,35 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateAlertRequestAlert into a shallow dictionary of its immediate attributes.""" body = {} if self.condition: - body["{condition}"] = self.condition + body["condition"] = self.condition if self.custom_body is not None: - body["{custom_body}"] = self.custom_body + body["custom_body"] = self.custom_body if self.custom_subject is not None: - body["{custom_subject}"] = self.custom_subject + body["custom_subject"] = self.custom_subject if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.notify_on_ok is not None: - body["{notify_on_ok}"] = self.notify_on_ok + body["notify_on_ok"] = self.notify_on_ok if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.seconds_to_retrigger is not None: - body["{seconds_to_retrigger}"] = self.seconds_to_retrigger + body["seconds_to_retrigger"] = self.seconds_to_retrigger return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateAlertRequestAlert: """Deserializes the UpdateAlertRequestAlert from a dictionary.""" return cls( - condition=_from_dict(d, "{condition}", AlertCondition), - custom_body=d.get("{custom_body}", None), - custom_subject=d.get("{custom_subject}", None), - display_name=d.get("{display_name}", None), - notify_on_ok=d.get("{notify_on_ok}", None), - owner_user_name=d.get("{owner_user_name}", None), - query_id=d.get("{query_id}", None), - seconds_to_retrigger=d.get("{seconds_to_retrigger}", None), + condition=_from_dict(d, "condition", AlertCondition), + custom_body=d.get("custom_body", None), + custom_subject=d.get("custom_subject", None), + display_name=d.get("display_name", None), + notify_on_ok=d.get("notify_on_ok", None), + owner_user_name=d.get("owner_user_name", None), + query_id=d.get("query_id", None), + seconds_to_retrigger=d.get("seconds_to_retrigger", None), ) @@ -7014,20 +7012,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateQueryRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.query: - body["{query}"] = self.query + body["query"] = self.query if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateQueryRequest: """Deserializes the UpdateQueryRequest from a dictionary.""" return cls( - id=d.get("{id}", None), - query=_from_dict(d, "{query}", UpdateQueryRequestQuery), - update_mask=d.get("{update_mask}", None), + id=d.get("id", None), + query=_from_dict(d, "query", UpdateQueryRequestQuery), + update_mask=d.get("update_mask", None), ) @@ -7096,44 +7094,44 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateQueryRequestQuery into a shallow dictionary of its immediate attributes.""" body = {} if self.apply_auto_limit is not None: - body["{apply_auto_limit}"] = self.apply_auto_limit + body["apply_auto_limit"] = self.apply_auto_limit if self.catalog is not None: - body["{catalog}"] = self.catalog + body["catalog"] = self.catalog if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.owner_user_name is not None: - body["{owner_user_name}"] = self.owner_user_name + body["owner_user_name"] = self.owner_user_name if self.parameters: - body["{parameters}"] = self.parameters + body["parameters"] = self.parameters if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.run_as_mode is not None: - body["{run_as_mode}"] = self.run_as_mode + body["run_as_mode"] = self.run_as_mode if self.schema is not None: - body["{schema}"] = self.schema + body["schema"] = self.schema if self.tags: - body["{tags}"] = self.tags + body["tags"] = self.tags if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateQueryRequestQuery: """Deserializes the UpdateQueryRequestQuery from a dictionary.""" return cls( - apply_auto_limit=d.get("{apply_auto_limit}", None), - catalog=d.get("{catalog}", None), - description=d.get("{description}", None), - display_name=d.get("{display_name}", None), - owner_user_name=d.get("{owner_user_name}", None), - parameters=_repeated_dict(d, "{parameters}", QueryParameter), - query_text=d.get("{query_text}", None), - run_as_mode=_enum(d, "{run_as_mode}", RunAsMode), - schema=d.get("{schema}", None), - tags=d.get("{tags}", None), - warehouse_id=d.get("{warehouse_id}", None), + apply_auto_limit=d.get("apply_auto_limit", None), + catalog=d.get("catalog", None), + description=d.get("description", None), + display_name=d.get("display_name", None), + owner_user_name=d.get("owner_user_name", None), + parameters=_repeated_dict(d, "parameters", QueryParameter), + query_text=d.get("query_text", None), + run_as_mode=_enum(d, "run_as_mode", RunAsMode), + schema=d.get("schema", None), + tags=d.get("tags", None), + warehouse_id=d.get("warehouse_id", None), ) @@ -7187,20 +7185,20 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateVisualizationRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.update_mask is not None: - body["{update_mask}"] = self.update_mask + body["update_mask"] = self.update_mask if self.visualization: - body["{visualization}"] = self.visualization + body["visualization"] = self.visualization return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateVisualizationRequest: """Deserializes the UpdateVisualizationRequest from a dictionary.""" return cls( - id=d.get("{id}", None), - update_mask=d.get("{update_mask}", None), - visualization=_from_dict(d, "{visualization}", UpdateVisualizationRequestVisualization), + id=d.get("id", None), + update_mask=d.get("update_mask", None), + visualization=_from_dict(d, "visualization", UpdateVisualizationRequestVisualization), ) @@ -7237,23 +7235,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateVisualizationRequestVisualization into a shallow dictionary of its immediate attributes.""" body = {} if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.serialized_options is not None: - body["{serialized_options}"] = self.serialized_options + body["serialized_options"] = self.serialized_options if self.serialized_query_plan is not None: - body["{serialized_query_plan}"] = self.serialized_query_plan + body["serialized_query_plan"] = self.serialized_query_plan if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateVisualizationRequestVisualization: """Deserializes the UpdateVisualizationRequestVisualization from a dictionary.""" return cls( - display_name=d.get("{display_name}", None), - serialized_options=d.get("{serialized_options}", None), - serialized_query_plan=d.get("{serialized_query_plan}", None), - type=d.get("{type}", None), + display_name=d.get("display_name", None), + serialized_options=d.get("serialized_options", None), + serialized_query_plan=d.get("serialized_query_plan", None), + type=d.get("type", None), ) @@ -7280,17 +7278,17 @@ def as_shallow_dict(self) -> dict: """Serializes the User into a shallow dictionary of its immediate attributes.""" body = {} if self.email is not None: - body["{email}"] = self.email + body["email"] = self.email if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> User: """Deserializes the User from a dictionary.""" - return cls(email=d.get("{email}", None), id=d.get("{id}", None), name=d.get("{name}", None)) + return cls(email=d.get("email", None), id=d.get("id", None), name=d.get("name", None)) @dataclass @@ -7346,35 +7344,35 @@ def as_shallow_dict(self) -> dict: """Serializes the Visualization into a shallow dictionary of its immediate attributes.""" body = {} if self.create_time is not None: - body["{create_time}"] = self.create_time + body["create_time"] = self.create_time if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.query_id is not None: - body["{query_id}"] = self.query_id + body["query_id"] = self.query_id if self.serialized_options is not None: - body["{serialized_options}"] = self.serialized_options + body["serialized_options"] = self.serialized_options if self.serialized_query_plan is not None: - body["{serialized_query_plan}"] = self.serialized_query_plan + body["serialized_query_plan"] = self.serialized_query_plan if self.type is not None: - body["{type}"] = self.type + body["type"] = self.type if self.update_time is not None: - body["{update_time}"] = self.update_time + body["update_time"] = self.update_time return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Visualization: """Deserializes the Visualization from a dictionary.""" return cls( - create_time=d.get("{create_time}", None), - display_name=d.get("{display_name}", None), - id=d.get("{id}", None), - query_id=d.get("{query_id}", None), - serialized_options=d.get("{serialized_options}", None), - serialized_query_plan=d.get("{serialized_query_plan}", None), - type=d.get("{type}", None), - update_time=d.get("{update_time}", None), + create_time=d.get("create_time", None), + display_name=d.get("display_name", None), + id=d.get("id", None), + query_id=d.get("query_id", None), + serialized_options=d.get("serialized_options", None), + serialized_query_plan=d.get("serialized_query_plan", None), + type=d.get("type", None), + update_time=d.get("update_time", None), ) @@ -7409,23 +7407,23 @@ def as_shallow_dict(self) -> dict: """Serializes the WarehouseAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehouseAccessControlRequest: """Deserializes the WarehouseAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", WarehousePermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", WarehousePermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -7465,26 +7463,26 @@ def as_shallow_dict(self) -> dict: """Serializes the WarehouseAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehouseAccessControlResponse: """Deserializes the WarehouseAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", WarehousePermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", WarehousePermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -7512,20 +7510,20 @@ def as_shallow_dict(self) -> dict: """Serializes the WarehousePermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermission: """Deserializes the WarehousePermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", WarehousePermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", WarehousePermissionLevel), ) @@ -7562,20 +7560,20 @@ def as_shallow_dict(self) -> dict: """Serializes the WarehousePermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissions: """Deserializes the WarehousePermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", WarehouseAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", WarehouseAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -7599,17 +7597,17 @@ def as_shallow_dict(self) -> dict: """Serializes the WarehousePermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissionsDescription: """Deserializes the WarehousePermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", WarehousePermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", WarehousePermissionLevel), ) @@ -7633,17 +7631,17 @@ def as_shallow_dict(self) -> dict: """Serializes the WarehousePermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.warehouse_id is not None: - body["{warehouse_id}"] = self.warehouse_id + body["warehouse_id"] = self.warehouse_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissionsRequest: """Deserializes the WarehousePermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", WarehouseAccessControlRequest), - warehouse_id=d.get("{warehouse_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", WarehouseAccessControlRequest), + warehouse_id=d.get("warehouse_id", None), ) @@ -7669,17 +7667,16 @@ def as_shallow_dict(self) -> dict: """Serializes the WarehouseTypePair into a shallow dictionary of its immediate attributes.""" body = {} if self.enabled is not None: - body["{enabled}"] = self.enabled + body["enabled"] = self.enabled if self.warehouse_type is not None: - body["{warehouse_type}"] = self.warehouse_type + body["warehouse_type"] = self.warehouse_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WarehouseTypePair: """Deserializes the WarehouseTypePair from a dictionary.""" return cls( - enabled=d.get("{enabled}", None), - warehouse_type=_enum(d, "{warehouse_type}", WarehouseTypePairWarehouseType), + enabled=d.get("enabled", None), warehouse_type=_enum(d, "warehouse_type", WarehouseTypePairWarehouseType) ) @@ -7724,23 +7721,23 @@ def as_shallow_dict(self) -> dict: """Serializes the Widget into a shallow dictionary of its immediate attributes.""" body = {} if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.options: - body["{options}"] = self.options + body["options"] = self.options if self.visualization: - body["{visualization}"] = self.visualization + body["visualization"] = self.visualization if self.width is not None: - body["{width}"] = self.width + body["width"] = self.width return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Widget: """Deserializes the Widget from a dictionary.""" return cls( - id=d.get("{id}", None), - options=_from_dict(d, "{options}", WidgetOptions), - visualization=_from_dict(d, "{visualization}", LegacyVisualization), - width=d.get("{width}", None), + id=d.get("id", None), + options=_from_dict(d, "options", WidgetOptions), + visualization=_from_dict(d, "visualization", LegacyVisualization), + width=d.get("width", None), ) @@ -7792,32 +7789,32 @@ def as_shallow_dict(self) -> dict: """Serializes the WidgetOptions into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.is_hidden is not None: - body["{is_hidden}"] = self.is_hidden + body["isHidden"] = self.is_hidden if self.parameter_mappings: - body["{parameter_mappings}"] = self.parameter_mappings + body["parameterMappings"] = self.parameter_mappings if self.position: - body["{position}"] = self.position + body["position"] = self.position if self.title is not None: - body["{title}"] = self.title + body["title"] = self.title if self.updated_at is not None: - body["{updated_at}"] = self.updated_at + body["updated_at"] = self.updated_at return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WidgetOptions: """Deserializes the WidgetOptions from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - description=d.get("{description}", None), - is_hidden=d.get("{is_hidden}", None), - parameter_mappings=d.get("{parameter_mappings}", None), - position=_from_dict(d, "{position}", WidgetPosition), - title=d.get("{title}", None), - updated_at=d.get("{updated_at}", None), + created_at=d.get("created_at", None), + description=d.get("description", None), + is_hidden=d.get("isHidden", None), + parameter_mappings=d.get("parameterMappings", None), + position=_from_dict(d, "position", WidgetPosition), + title=d.get("title", None), + updated_at=d.get("updated_at", None), ) @@ -7860,26 +7857,26 @@ def as_shallow_dict(self) -> dict: """Serializes the WidgetPosition into a shallow dictionary of its immediate attributes.""" body = {} if self.auto_height is not None: - body["{auto_height}"] = self.auto_height + body["autoHeight"] = self.auto_height if self.col is not None: - body["{col}"] = self.col + body["col"] = self.col if self.row is not None: - body["{row}"] = self.row + body["row"] = self.row if self.size_x is not None: - body["{size_x}"] = self.size_x + body["sizeX"] = self.size_x if self.size_y is not None: - body["{size_y}"] = self.size_y + body["sizeY"] = self.size_y return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WidgetPosition: """Deserializes the WidgetPosition from a dictionary.""" return cls( - auto_height=d.get("{auto_height}", None), - col=d.get("{col}", None), - row=d.get("{row}", None), - size_x=d.get("{size_x}", None), - size_y=d.get("{size_y}", None), + auto_height=d.get("autoHeight", None), + col=d.get("col", None), + row=d.get("row", None), + size_x=d.get("sizeX", None), + size_y=d.get("sizeY", None), ) @@ -7903,7 +7900,7 @@ def create(self, *, alert: Optional[CreateAlertRequestAlert] = None) -> Alert: """ body = {} if alert is not None: - body["{alert}"] = alert.as_dict() + body["alert"] = alert.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -7963,21 +7960,21 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/sql/alerts", query=query, headers=headers) - if "{results}" in json: - for v in json["{results}"]: + if "results" in json: + for v in json["results"]: yield ListAlertsResponseAlert.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, id: str, update_mask: str, *, alert: Optional[UpdateAlertRequestAlert] = None) -> Alert: """Update an alert. @@ -8001,9 +7998,9 @@ def update(self, id: str, update_mask: str, *, alert: Optional[UpdateAlertReques """ body = {} if alert is not None: - body["{alert}"] = alert.as_dict() + body["alert"] = alert.as_dict() if update_mask is not None: - body["{update_mask}"] = update_mask + body["update_mask"] = update_mask headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8062,15 +8059,15 @@ def create( """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options.as_dict() + body["options"] = options.as_dict() if parent is not None: - body["{parent}"] = parent + body["parent"] = parent if query_id is not None: - body["{query_id}"] = query_id + body["query_id"] = query_id if rearm is not None: - body["{rearm}"] = rearm + body["rearm"] = rearm headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8168,13 +8165,13 @@ def update(self, alert_id: str, name: str, options: AlertOptions, query_id: str, """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options.as_dict() + body["options"] = options.as_dict() if query_id is not None: - body["{query_id}"] = query_id + body["query_id"] = query_id if rearm is not None: - body["{rearm}"] = rearm + body["rearm"] = rearm headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8216,15 +8213,15 @@ def create( """ body = {} if dashboard_id is not None: - body["{dashboard_id}"] = dashboard_id + body["dashboard_id"] = dashboard_id if options is not None: - body["{options}"] = options.as_dict() + body["options"] = options.as_dict() if text is not None: - body["{text}"] = text + body["text"] = text if visualization_id is not None: - body["{visualization_id}"] = visualization_id + body["visualization_id"] = visualization_id if width is not None: - body["{width}"] = width + body["width"] = width headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8277,15 +8274,15 @@ def update( """ body = {} if dashboard_id is not None: - body["{dashboard_id}"] = dashboard_id + body["dashboard_id"] = dashboard_id if options is not None: - body["{options}"] = options.as_dict() + body["options"] = options.as_dict() if text is not None: - body["{text}"] = text + body["text"] = text if visualization_id is not None: - body["{visualization_id}"] = visualization_id + body["visualization_id"] = visualization_id if width is not None: - body["{width}"] = width + body["width"] = width headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8334,17 +8331,17 @@ def create( """ body = {} if dashboard_filters_enabled is not None: - body["{dashboard_filters_enabled}"] = dashboard_filters_enabled + body["dashboard_filters_enabled"] = dashboard_filters_enabled if is_favorite is not None: - body["{is_favorite}"] = is_favorite + body["is_favorite"] = is_favorite if name is not None: - body["{name}"] = name + body["name"] = name if parent is not None: - body["{parent}"] = parent + body["parent"] = parent if run_as_role is not None: - body["{run_as_role}"] = run_as_role.value + body["run_as_role"] = run_as_role.value if tags is not None: - body["{tags}"] = [v for v in tags] + body["tags"] = [v for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8416,32 +8413,32 @@ def list( query = {} if order is not None: - query["{order}"] = order.value + query["order"] = order.value if page is not None: - query["{page}"] = page + query["page"] = page if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if q is not None: - query["{q}"] = q + query["q"] = q headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{page}"] = 1 + query["page"] = 1 while True: json = self._api.do("GET", "/api/2.0/preview/sql/dashboards", query=query, headers=headers) - if "{results}" in json: - for v in json["{results}"]: - i = v["{id}"] + if "results" in json: + for v in json["results"]: + i = v["id"] if i in seen: continue seen.add(i) yield Dashboard.from_dict(v) - if "{results}" not in json or not json["{results}"]: + if "results" not in json or not json["results"]: return - query["{page}"] += 1 + query["page"] += 1 def restore(self, dashboard_id: str): """Restore a dashboard. @@ -8486,11 +8483,11 @@ def update( """ body = {} if name is not None: - body["{name}"] = name + body["name"] = name if run_as_role is not None: - body["{run_as_role}"] = run_as_role.value + body["run_as_role"] = run_as_role.value if tags is not None: - body["{tags}"] = [v for v in tags] + body["tags"] = [v for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8611,7 +8608,7 @@ def set( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8645,7 +8642,7 @@ def transfer_ownership( """ body = {} if new_owner is not None: - body["{new_owner}"] = new_owner + body["new_owner"] = new_owner headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8679,7 +8676,7 @@ def create(self, *, query: Optional[CreateQueryRequestQuery] = None) -> Query: """ body = {} if query is not None: - body["{query}"] = query.as_dict() + body["query"] = query.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8739,21 +8736,21 @@ def list( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/sql/queries", query=query, headers=headers) - if "{results}" in json: - for v in json["{results}"]: + if "results" in json: + for v in json["results"]: yield ListQueryObjectsResponseQuery.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def list_visualizations( self, id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None @@ -8771,21 +8768,21 @@ def list_visualizations( query = {} if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", f"/api/2.0/sql/queries/{id}/visualizations", query=query, headers=headers) - if "{results}" in json: - for v in json["{results}"]: + if "results" in json: + for v in json["results"]: yield Visualization.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def update(self, id: str, update_mask: str, *, query: Optional[UpdateQueryRequestQuery] = None) -> Query: """Update a query. @@ -8809,9 +8806,9 @@ def update(self, id: str, update_mask: str, *, query: Optional[UpdateQueryReques """ body = {} if query is not None: - body["{query}"] = query.as_dict() + body["query"] = query.as_dict() if update_mask is not None: - body["{update_mask}"] = update_mask + body["update_mask"] = update_mask headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -8888,21 +8885,21 @@ def create( """ body = {} if data_source_id is not None: - body["{data_source_id}"] = data_source_id + body["data_source_id"] = data_source_id if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options + body["options"] = options if parent is not None: - body["{parent}"] = parent + body["parent"] = parent if query is not None: - body["{query}"] = query + body["query"] = query if run_as_role is not None: - body["{run_as_role}"] = run_as_role.value + body["run_as_role"] = run_as_role.value if tags is not None: - body["{tags}"] = [v for v in tags] + body["tags"] = [v for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9002,32 +8999,32 @@ def list( query = {} if order is not None: - query["{order}"] = order + query["order"] = order if page is not None: - query["{page}"] = page + query["page"] = page if page_size is not None: - query["{page_size}"] = page_size + query["page_size"] = page_size if q is not None: - query["{q}"] = q + query["q"] = q headers = { "0": "{Accept application/json}", } # deduplicate items that may have been added during iteration seen = set() - query["{page}"] = 1 + query["page"] = 1 while True: json = self._api.do("GET", "/api/2.0/preview/sql/queries", query=query, headers=headers) - if "{results}" in json: - for v in json["{results}"]: - i = v["{id}"] + if "results" in json: + for v in json["results"]: + i = v["id"] if i in seen: continue seen.add(i) yield LegacyQuery.from_dict(v) - if "{results}" not in json or not json["{results}"]: + if "results" not in json or not json["results"]: return - query["{page}"] += 1 + query["page"] += 1 def restore(self, query_id: str): """Restore a query. @@ -9099,19 +9096,19 @@ def update( """ body = {} if data_source_id is not None: - body["{data_source_id}"] = data_source_id + body["data_source_id"] = data_source_id if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options + body["options"] = options if query is not None: - body["{query}"] = query + body["query"] = query if run_as_role is not None: - body["{run_as_role}"] = run_as_role.value + body["run_as_role"] = run_as_role.value if tags is not None: - body["{tags}"] = [v for v in tags] + body["tags"] = [v for v in tags] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9161,13 +9158,13 @@ def list( query = {} if filter_by is not None: - query["{filter_by}"] = filter_by.as_dict() + query["filter_by"] = filter_by.as_dict() if include_metrics is not None: - query["{include_metrics}"] = include_metrics + query["include_metrics"] = include_metrics if max_results is not None: - query["{max_results}"] = max_results + query["max_results"] = max_results if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } @@ -9194,7 +9191,7 @@ def create(self, *, visualization: Optional[CreateVisualizationRequestVisualizat """ body = {} if visualization is not None: - body["{visualization}"] = visualization.as_dict() + body["visualization"] = visualization.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9243,9 +9240,9 @@ def update( """ body = {} if update_mask is not None: - body["{update_mask}"] = update_mask + body["update_mask"] = update_mask if visualization is not None: - body["{visualization}"] = visualization.as_dict() + body["visualization"] = visualization.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9295,15 +9292,15 @@ def create( """ body = {} if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options + body["options"] = options if query_id is not None: - body["{query_id}"] = query_id + body["query_id"] = query_id if type is not None: - body["{type}"] = type + body["type"] = type headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9374,19 +9371,19 @@ def update( """ body = {} if created_at is not None: - body["{created_at}"] = created_at + body["created_at"] = created_at if description is not None: - body["{description}"] = description + body["description"] = description if name is not None: - body["{name}"] = name + body["name"] = name if options is not None: - body["{options}"] = options + body["options"] = options if query is not None: - body["{query}"] = query.as_dict() + body["query"] = query.as_dict() if type is not None: - body["{type}"] = type + body["type"] = type if updated_at is not None: - body["{updated_at}"] = updated_at + body["updated_at"] = updated_at headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9647,27 +9644,27 @@ def execute_statement( """ body = {} if byte_limit is not None: - body["{byte_limit}"] = byte_limit + body["byte_limit"] = byte_limit if catalog is not None: - body["{catalog}"] = catalog + body["catalog"] = catalog if disposition is not None: - body["{disposition}"] = disposition.value + body["disposition"] = disposition.value if format is not None: - body["{format}"] = format.value + body["format"] = format.value if on_wait_timeout is not None: - body["{on_wait_timeout}"] = on_wait_timeout.value + body["on_wait_timeout"] = on_wait_timeout.value if parameters is not None: - body["{parameters}"] = [v.as_dict() for v in parameters] + body["parameters"] = [v.as_dict() for v in parameters] if row_limit is not None: - body["{row_limit}"] = row_limit + body["row_limit"] = row_limit if schema is not None: - body["{schema}"] = schema + body["schema"] = schema if statement is not None: - body["{statement}"] = statement + body["statement"] = statement if wait_timeout is not None: - body["{wait_timeout}"] = wait_timeout + body["wait_timeout"] = wait_timeout if warehouse_id is not None: - body["{warehouse_id}"] = warehouse_id + body["warehouse_id"] = warehouse_id headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9819,31 +9816,31 @@ def create( """ body = {} if auto_stop_mins is not None: - body["{auto_stop_mins}"] = auto_stop_mins + body["auto_stop_mins"] = auto_stop_mins if channel is not None: - body["{channel}"] = channel.as_dict() + body["channel"] = channel.as_dict() if cluster_size is not None: - body["{cluster_size}"] = cluster_size + body["cluster_size"] = cluster_size if creator_name is not None: - body["{creator_name}"] = creator_name + body["creator_name"] = creator_name if enable_photon is not None: - body["{enable_photon}"] = enable_photon + body["enable_photon"] = enable_photon if enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = enable_serverless_compute + body["enable_serverless_compute"] = enable_serverless_compute if instance_profile_arn is not None: - body["{instance_profile_arn}"] = instance_profile_arn + body["instance_profile_arn"] = instance_profile_arn if max_num_clusters is not None: - body["{max_num_clusters}"] = max_num_clusters + body["max_num_clusters"] = max_num_clusters if min_num_clusters is not None: - body["{min_num_clusters}"] = min_num_clusters + body["min_num_clusters"] = min_num_clusters if name is not None: - body["{name}"] = name + body["name"] = name if spot_instance_policy is not None: - body["{spot_instance_policy}"] = spot_instance_policy.value + body["spot_instance_policy"] = spot_instance_policy.value if tags is not None: - body["{tags}"] = tags.as_dict() + body["tags"] = tags.as_dict() if warehouse_type is not None: - body["{warehouse_type}"] = warehouse_type.value + body["warehouse_type"] = warehouse_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -9851,9 +9848,7 @@ def create( op_response = self._api.do("POST", "/api/2.0/sql/warehouses", body=body, headers=headers) return Wait( - self.WaitGetWarehouseRunning, - response=CreateWarehouseResponse.from_dict(op_response), - id=op_response["{id}"], + self.WaitGetWarehouseRunning, response=CreateWarehouseResponse.from_dict(op_response), id=op_response["id"] ) def create_and_wait( @@ -9992,31 +9987,31 @@ def edit( """ body = {} if auto_stop_mins is not None: - body["{auto_stop_mins}"] = auto_stop_mins + body["auto_stop_mins"] = auto_stop_mins if channel is not None: - body["{channel}"] = channel.as_dict() + body["channel"] = channel.as_dict() if cluster_size is not None: - body["{cluster_size}"] = cluster_size + body["cluster_size"] = cluster_size if creator_name is not None: - body["{creator_name}"] = creator_name + body["creator_name"] = creator_name if enable_photon is not None: - body["{enable_photon}"] = enable_photon + body["enable_photon"] = enable_photon if enable_serverless_compute is not None: - body["{enable_serverless_compute}"] = enable_serverless_compute + body["enable_serverless_compute"] = enable_serverless_compute if instance_profile_arn is not None: - body["{instance_profile_arn}"] = instance_profile_arn + body["instance_profile_arn"] = instance_profile_arn if max_num_clusters is not None: - body["{max_num_clusters}"] = max_num_clusters + body["max_num_clusters"] = max_num_clusters if min_num_clusters is not None: - body["{min_num_clusters}"] = min_num_clusters + body["min_num_clusters"] = min_num_clusters if name is not None: - body["{name}"] = name + body["name"] = name if spot_instance_policy is not None: - body["{spot_instance_policy}"] = spot_instance_policy.value + body["spot_instance_policy"] = spot_instance_policy.value if tags is not None: - body["{tags}"] = tags.as_dict() + body["tags"] = tags.as_dict() if warehouse_type is not None: - body["{warehouse_type}"] = warehouse_type.value + body["warehouse_type"] = warehouse_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10145,7 +10140,7 @@ def list(self, *, run_as_user_id: Optional[int] = None) -> Iterator[EndpointInfo query = {} if run_as_user_id is not None: - query["{run_as_user_id}"] = run_as_user_id + query["run_as_user_id"] = run_as_user_id headers = { "0": "{Accept application/json}", } @@ -10170,7 +10165,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10223,23 +10218,23 @@ def set_workspace_warehouse_config( """ body = {} if channel is not None: - body["{channel}"] = channel.as_dict() + body["channel"] = channel.as_dict() if config_param is not None: - body["{config_param}"] = config_param.as_dict() + body["config_param"] = config_param.as_dict() if data_access_config is not None: - body["{data_access_config}"] = [v.as_dict() for v in data_access_config] + body["data_access_config"] = [v.as_dict() for v in data_access_config] if enabled_warehouse_types is not None: - body["{enabled_warehouse_types}"] = [v.as_dict() for v in enabled_warehouse_types] + body["enabled_warehouse_types"] = [v.as_dict() for v in enabled_warehouse_types] if global_param is not None: - body["{global_param}"] = global_param.as_dict() + body["global_param"] = global_param.as_dict() if google_service_account is not None: - body["{google_service_account}"] = google_service_account + body["google_service_account"] = google_service_account if instance_profile_arn is not None: - body["{instance_profile_arn}"] = instance_profile_arn + body["instance_profile_arn"] = instance_profile_arn if security_policy is not None: - body["{security_policy}"] = security_policy.value + body["security_policy"] = security_policy.value if sql_configuration_parameters is not None: - body["{sql_configuration_parameters}"] = sql_configuration_parameters.as_dict() + body["sql_configuration_parameters"] = sql_configuration_parameters.as_dict() headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -10309,7 +10304,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/vectorsearch/v2/impl.py b/databricks/sdk/vectorsearch/v2/impl.py index 0bd91107d..ad4bc48aa 100755 --- a/databricks/sdk/vectorsearch/v2/impl.py +++ b/databricks/sdk/vectorsearch/v2/impl.py @@ -31,13 +31,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ColumnInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" - return cls(name=d.get("{name}", None)) + return cls(name=d.get("name", None)) @dataclass @@ -61,15 +61,15 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateEndpoint into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_type is not None: - body["{endpoint_type}"] = self.endpoint_type + body["endpoint_type"] = self.endpoint_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateEndpoint: """Deserializes the CreateEndpoint from a dictionary.""" - return cls(endpoint_type=_enum(d, "{endpoint_type}", EndpointType), name=d.get("{name}", None)) + return cls(endpoint_type=_enum(d, "endpoint_type", EndpointType), name=d.get("name", None)) @dataclass @@ -118,29 +118,29 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.delta_sync_index_spec: - body["{delta_sync_index_spec}"] = self.delta_sync_index_spec + body["delta_sync_index_spec"] = self.delta_sync_index_spec if self.direct_access_index_spec: - body["{direct_access_index_spec}"] = self.direct_access_index_spec + body["direct_access_index_spec"] = self.direct_access_index_spec if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_type is not None: - body["{index_type}"] = self.index_type + body["index_type"] = self.index_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.primary_key is not None: - body["{primary_key}"] = self.primary_key + body["primary_key"] = self.primary_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVectorIndexRequest: """Deserializes the CreateVectorIndexRequest from a dictionary.""" return cls( - delta_sync_index_spec=_from_dict(d, "{delta_sync_index_spec}", DeltaSyncVectorIndexSpecRequest), - direct_access_index_spec=_from_dict(d, "{direct_access_index_spec}", DirectAccessVectorIndexSpec), - endpoint_name=d.get("{endpoint_name}", None), - index_type=_enum(d, "{index_type}", VectorIndexType), - name=d.get("{name}", None), - primary_key=d.get("{primary_key}", None), + delta_sync_index_spec=_from_dict(d, "delta_sync_index_spec", DeltaSyncVectorIndexSpecRequest), + direct_access_index_spec=_from_dict(d, "direct_access_index_spec", DirectAccessVectorIndexSpec), + endpoint_name=d.get("endpoint_name", None), + index_type=_enum(d, "index_type", VectorIndexType), + name=d.get("name", None), + primary_key=d.get("primary_key", None), ) @@ -159,13 +159,13 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.vector_index: - body["{vector_index}"] = self.vector_index + body["vector_index"] = self.vector_index return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateVectorIndexResponse: """Deserializes the CreateVectorIndexResponse from a dictionary.""" - return cls(vector_index=_from_dict(d, "{vector_index}", VectorIndex)) + return cls(vector_index=_from_dict(d, "vector_index", VectorIndex)) @dataclass @@ -191,17 +191,16 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteDataResult into a shallow dictionary of its immediate attributes.""" body = {} if self.failed_primary_keys: - body["{failed_primary_keys}"] = self.failed_primary_keys + body["failed_primary_keys"] = self.failed_primary_keys if self.success_row_count is not None: - body["{success_row_count}"] = self.success_row_count + body["success_row_count"] = self.success_row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDataResult: """Deserializes the DeleteDataResult from a dictionary.""" return cls( - failed_primary_keys=d.get("{failed_primary_keys}", None), - success_row_count=d.get("{success_row_count}", None), + failed_primary_keys=d.get("failed_primary_keys", None), success_row_count=d.get("success_row_count", None) ) @@ -236,15 +235,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteDataVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.primary_keys: - body["{primary_keys}"] = self.primary_keys + body["primary_keys"] = self.primary_keys return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDataVectorIndexRequest: """Deserializes the DeleteDataVectorIndexRequest from a dictionary.""" - return cls(index_name=d.get("{index_name}", None), primary_keys=d.get("{primary_keys}", None)) + return cls(index_name=d.get("index_name", None), primary_keys=d.get("primary_keys", None)) @dataclass @@ -270,15 +269,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteDataVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.result: - body["{result}"] = self.result + body["result"] = self.result if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteDataVectorIndexResponse: """Deserializes the DeleteDataVectorIndexResponse from a dictionary.""" - return cls(result=_from_dict(d, "{result}", DeleteDataResult), status=_enum(d, "{status}", DeleteDataStatus)) + return cls(result=_from_dict(d, "result", DeleteDataResult), status=_enum(d, "status", DeleteDataStatus)) @dataclass @@ -367,29 +366,29 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.columns_to_sync: - body["{columns_to_sync}"] = self.columns_to_sync + body["columns_to_sync"] = self.columns_to_sync if self.embedding_source_columns: - body["{embedding_source_columns}"] = self.embedding_source_columns + body["embedding_source_columns"] = self.embedding_source_columns if self.embedding_vector_columns: - body["{embedding_vector_columns}"] = self.embedding_vector_columns + body["embedding_vector_columns"] = self.embedding_vector_columns if self.embedding_writeback_table is not None: - body["{embedding_writeback_table}"] = self.embedding_writeback_table + body["embedding_writeback_table"] = self.embedding_writeback_table if self.pipeline_type is not None: - body["{pipeline_type}"] = self.pipeline_type + body["pipeline_type"] = self.pipeline_type if self.source_table is not None: - body["{source_table}"] = self.source_table + body["source_table"] = self.source_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSyncVectorIndexSpecRequest: """Deserializes the DeltaSyncVectorIndexSpecRequest from a dictionary.""" return cls( - columns_to_sync=d.get("{columns_to_sync}", None), - embedding_source_columns=_repeated_dict(d, "{embedding_source_columns}", EmbeddingSourceColumn), - embedding_vector_columns=_repeated_dict(d, "{embedding_vector_columns}", EmbeddingVectorColumn), - embedding_writeback_table=d.get("{embedding_writeback_table}", None), - pipeline_type=_enum(d, "{pipeline_type}", PipelineType), - source_table=d.get("{source_table}", None), + columns_to_sync=d.get("columns_to_sync", None), + embedding_source_columns=_repeated_dict(d, "embedding_source_columns", EmbeddingSourceColumn), + embedding_vector_columns=_repeated_dict(d, "embedding_vector_columns", EmbeddingVectorColumn), + embedding_writeback_table=d.get("embedding_writeback_table", None), + pipeline_type=_enum(d, "pipeline_type", PipelineType), + source_table=d.get("source_table", None), ) @@ -440,29 +439,29 @@ def as_shallow_dict(self) -> dict: """Serializes the DeltaSyncVectorIndexSpecResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_source_columns: - body["{embedding_source_columns}"] = self.embedding_source_columns + body["embedding_source_columns"] = self.embedding_source_columns if self.embedding_vector_columns: - body["{embedding_vector_columns}"] = self.embedding_vector_columns + body["embedding_vector_columns"] = self.embedding_vector_columns if self.embedding_writeback_table is not None: - body["{embedding_writeback_table}"] = self.embedding_writeback_table + body["embedding_writeback_table"] = self.embedding_writeback_table if self.pipeline_id is not None: - body["{pipeline_id}"] = self.pipeline_id + body["pipeline_id"] = self.pipeline_id if self.pipeline_type is not None: - body["{pipeline_type}"] = self.pipeline_type + body["pipeline_type"] = self.pipeline_type if self.source_table is not None: - body["{source_table}"] = self.source_table + body["source_table"] = self.source_table return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeltaSyncVectorIndexSpecResponse: """Deserializes the DeltaSyncVectorIndexSpecResponse from a dictionary.""" return cls( - embedding_source_columns=_repeated_dict(d, "{embedding_source_columns}", EmbeddingSourceColumn), - embedding_vector_columns=_repeated_dict(d, "{embedding_vector_columns}", EmbeddingVectorColumn), - embedding_writeback_table=d.get("{embedding_writeback_table}", None), - pipeline_id=d.get("{pipeline_id}", None), - pipeline_type=_enum(d, "{pipeline_type}", PipelineType), - source_table=d.get("{source_table}", None), + embedding_source_columns=_repeated_dict(d, "embedding_source_columns", EmbeddingSourceColumn), + embedding_vector_columns=_repeated_dict(d, "embedding_vector_columns", EmbeddingVectorColumn), + embedding_writeback_table=d.get("embedding_writeback_table", None), + pipeline_id=d.get("pipeline_id", None), + pipeline_type=_enum(d, "pipeline_type", PipelineType), + source_table=d.get("source_table", None), ) @@ -496,20 +495,20 @@ def as_shallow_dict(self) -> dict: """Serializes the DirectAccessVectorIndexSpec into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_source_columns: - body["{embedding_source_columns}"] = self.embedding_source_columns + body["embedding_source_columns"] = self.embedding_source_columns if self.embedding_vector_columns: - body["{embedding_vector_columns}"] = self.embedding_vector_columns + body["embedding_vector_columns"] = self.embedding_vector_columns if self.schema_json is not None: - body["{schema_json}"] = self.schema_json + body["schema_json"] = self.schema_json return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DirectAccessVectorIndexSpec: """Deserializes the DirectAccessVectorIndexSpec from a dictionary.""" return cls( - embedding_source_columns=_repeated_dict(d, "{embedding_source_columns}", EmbeddingSourceColumn), - embedding_vector_columns=_repeated_dict(d, "{embedding_vector_columns}", EmbeddingVectorColumn), - schema_json=d.get("{schema_json}", None), + embedding_source_columns=_repeated_dict(d, "embedding_source_columns", EmbeddingSourceColumn), + embedding_vector_columns=_repeated_dict(d, "embedding_vector_columns", EmbeddingVectorColumn), + schema_json=d.get("schema_json", None), ) @@ -534,17 +533,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EmbeddingSourceColumn into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_model_endpoint_name is not None: - body["{embedding_model_endpoint_name}"] = self.embedding_model_endpoint_name + body["embedding_model_endpoint_name"] = self.embedding_model_endpoint_name if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmbeddingSourceColumn: """Deserializes the EmbeddingSourceColumn from a dictionary.""" - return cls( - embedding_model_endpoint_name=d.get("{embedding_model_endpoint_name}", None), name=d.get("{name}", None) - ) + return cls(embedding_model_endpoint_name=d.get("embedding_model_endpoint_name", None), name=d.get("name", None)) @dataclass @@ -568,15 +565,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EmbeddingVectorColumn into a shallow dictionary of its immediate attributes.""" body = {} if self.embedding_dimension is not None: - body["{embedding_dimension}"] = self.embedding_dimension + body["embedding_dimension"] = self.embedding_dimension if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EmbeddingVectorColumn: """Deserializes the EmbeddingVectorColumn from a dictionary.""" - return cls(embedding_dimension=d.get("{embedding_dimension}", None), name=d.get("{name}", None)) + return cls(embedding_dimension=d.get("embedding_dimension", None), name=d.get("name", None)) @dataclass @@ -635,38 +632,38 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.creation_timestamp is not None: - body["{creation_timestamp}"] = self.creation_timestamp + body["creation_timestamp"] = self.creation_timestamp if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.endpoint_status: - body["{endpoint_status}"] = self.endpoint_status + body["endpoint_status"] = self.endpoint_status if self.endpoint_type is not None: - body["{endpoint_type}"] = self.endpoint_type + body["endpoint_type"] = self.endpoint_type if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp if self.last_updated_user is not None: - body["{last_updated_user}"] = self.last_updated_user + body["last_updated_user"] = self.last_updated_user if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.num_indexes is not None: - body["{num_indexes}"] = self.num_indexes + body["num_indexes"] = self.num_indexes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointInfo: """Deserializes the EndpointInfo from a dictionary.""" return cls( - creation_timestamp=d.get("{creation_timestamp}", None), - creator=d.get("{creator}", None), - endpoint_status=_from_dict(d, "{endpoint_status}", EndpointStatus), - endpoint_type=_enum(d, "{endpoint_type}", EndpointType), - id=d.get("{id}", None), - last_updated_timestamp=d.get("{last_updated_timestamp}", None), - last_updated_user=d.get("{last_updated_user}", None), - name=d.get("{name}", None), - num_indexes=d.get("{num_indexes}", None), + creation_timestamp=d.get("creation_timestamp", None), + creator=d.get("creator", None), + endpoint_status=_from_dict(d, "endpoint_status", EndpointStatus), + endpoint_type=_enum(d, "endpoint_type", EndpointType), + id=d.get("id", None), + last_updated_timestamp=d.get("last_updated_timestamp", None), + last_updated_user=d.get("last_updated_user", None), + name=d.get("name", None), + num_indexes=d.get("num_indexes", None), ) @@ -693,15 +690,15 @@ def as_shallow_dict(self) -> dict: """Serializes the EndpointStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.state is not None: - body["{state}"] = self.state + body["state"] = self.state return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> EndpointStatus: """Deserializes the EndpointStatus from a dictionary.""" - return cls(message=d.get("{message}", None), state=_enum(d, "{state}", EndpointStatusState)) + return cls(message=d.get("message", None), state=_enum(d, "state", EndpointStatusState)) class EndpointStatusState(Enum): @@ -740,16 +737,16 @@ def as_shallow_dict(self) -> dict: """Serializes the ListEndpointResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoints: - body["{endpoints}"] = self.endpoints + body["endpoints"] = self.endpoints if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListEndpointResponse: """Deserializes the ListEndpointResponse from a dictionary.""" return cls( - endpoints=_repeated_dict(d, "{endpoints}", EndpointInfo), next_page_token=d.get("{next_page_token}", None) + endpoints=_repeated_dict(d, "endpoints", EndpointInfo), next_page_token=d.get("next_page_token", None) ) @@ -768,13 +765,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListValue into a shallow dictionary of its immediate attributes.""" body = {} if self.values: - body["{values}"] = self.values + body["values"] = self.values return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListValue: """Deserializes the ListValue from a dictionary.""" - return cls(values=_repeated_dict(d, "{values}", Value)) + return cls(values=_repeated_dict(d, "values", Value)) @dataclass @@ -798,17 +795,17 @@ def as_shallow_dict(self) -> dict: """Serializes the ListVectorIndexesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.vector_indexes: - body["{vector_indexes}"] = self.vector_indexes + body["vector_indexes"] = self.vector_indexes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListVectorIndexesResponse: """Deserializes the ListVectorIndexesResponse from a dictionary.""" return cls( - next_page_token=d.get("{next_page_token}", None), - vector_indexes=_repeated_dict(d, "{vector_indexes}", MiniVectorIndex), + next_page_token=d.get("next_page_token", None), + vector_indexes=_repeated_dict(d, "vector_indexes", MiniVectorIndex), ) @@ -835,15 +832,15 @@ def as_shallow_dict(self) -> dict: """Serializes the MapStringValueEntry into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MapStringValueEntry: """Deserializes the MapStringValueEntry from a dictionary.""" - return cls(key=d.get("{key}", None), value=_from_dict(d, "{value}", Value)) + return cls(key=d.get("key", None), value=_from_dict(d, "value", Value)) @dataclass @@ -887,26 +884,26 @@ def as_shallow_dict(self) -> dict: """Serializes the MiniVectorIndex into a shallow dictionary of its immediate attributes.""" body = {} if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_type is not None: - body["{index_type}"] = self.index_type + body["index_type"] = self.index_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.primary_key is not None: - body["{primary_key}"] = self.primary_key + body["primary_key"] = self.primary_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> MiniVectorIndex: """Deserializes the MiniVectorIndex from a dictionary.""" return cls( - creator=d.get("{creator}", None), - endpoint_name=d.get("{endpoint_name}", None), - index_type=_enum(d, "{index_type}", VectorIndexType), - name=d.get("{name}", None), - primary_key=d.get("{primary_key}", None), + creator=d.get("creator", None), + endpoint_name=d.get("endpoint_name", None), + index_type=_enum(d, "index_type", VectorIndexType), + name=d.get("name", None), + primary_key=d.get("primary_key", None), ) @@ -951,20 +948,20 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryVectorIndexNextPageRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.page_token is not None: - body["{page_token}"] = self.page_token + body["page_token"] = self.page_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryVectorIndexNextPageRequest: """Deserializes the QueryVectorIndexNextPageRequest from a dictionary.""" return cls( - endpoint_name=d.get("{endpoint_name}", None), - index_name=d.get("{index_name}", None), - page_token=d.get("{page_token}", None), + endpoint_name=d.get("endpoint_name", None), + index_name=d.get("index_name", None), + page_token=d.get("page_token", None), ) @@ -1029,38 +1026,38 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns if self.columns_to_rerank: - body["{columns_to_rerank}"] = self.columns_to_rerank + body["columns_to_rerank"] = self.columns_to_rerank if self.filters_json is not None: - body["{filters_json}"] = self.filters_json + body["filters_json"] = self.filters_json if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.num_results is not None: - body["{num_results}"] = self.num_results + body["num_results"] = self.num_results if self.query_text is not None: - body["{query_text}"] = self.query_text + body["query_text"] = self.query_text if self.query_type is not None: - body["{query_type}"] = self.query_type + body["query_type"] = self.query_type if self.query_vector: - body["{query_vector}"] = self.query_vector + body["query_vector"] = self.query_vector if self.score_threshold is not None: - body["{score_threshold}"] = self.score_threshold + body["score_threshold"] = self.score_threshold return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryVectorIndexRequest: """Deserializes the QueryVectorIndexRequest from a dictionary.""" return cls( - columns=d.get("{columns}", None), - columns_to_rerank=d.get("{columns_to_rerank}", None), - filters_json=d.get("{filters_json}", None), - index_name=d.get("{index_name}", None), - num_results=d.get("{num_results}", None), - query_text=d.get("{query_text}", None), - query_type=d.get("{query_type}", None), - query_vector=d.get("{query_vector}", None), - score_threshold=d.get("{score_threshold}", None), + columns=d.get("columns", None), + columns_to_rerank=d.get("columns_to_rerank", None), + filters_json=d.get("filters_json", None), + index_name=d.get("index_name", None), + num_results=d.get("num_results", None), + query_text=d.get("query_text", None), + query_type=d.get("query_type", None), + query_vector=d.get("query_vector", None), + score_threshold=d.get("score_threshold", None), ) @@ -1092,20 +1089,20 @@ def as_shallow_dict(self) -> dict: """Serializes the QueryVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.manifest: - body["{manifest}"] = self.manifest + body["manifest"] = self.manifest if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.result: - body["{result}"] = self.result + body["result"] = self.result return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> QueryVectorIndexResponse: """Deserializes the QueryVectorIndexResponse from a dictionary.""" return cls( - manifest=_from_dict(d, "{manifest}", ResultManifest), - next_page_token=d.get("{next_page_token}", None), - result=_from_dict(d, "{result}", ResultData), + manifest=_from_dict(d, "manifest", ResultManifest), + next_page_token=d.get("next_page_token", None), + result=_from_dict(d, "result", ResultData), ) @@ -1132,15 +1129,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultData into a shallow dictionary of its immediate attributes.""" body = {} if self.data_array: - body["{data_array}"] = self.data_array + body["data_array"] = self.data_array if self.row_count is not None: - body["{row_count}"] = self.row_count + body["row_count"] = self.row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultData: """Deserializes the ResultData from a dictionary.""" - return cls(data_array=d.get("{data_array}", None), row_count=d.get("{row_count}", None)) + return cls(data_array=d.get("data_array", None), row_count=d.get("row_count", None)) @dataclass @@ -1166,15 +1163,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ResultManifest into a shallow dictionary of its immediate attributes.""" body = {} if self.column_count is not None: - body["{column_count}"] = self.column_count + body["column_count"] = self.column_count if self.columns: - body["{columns}"] = self.columns + body["columns"] = self.columns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ResultManifest: """Deserializes the ResultManifest from a dictionary.""" - return cls(column_count=d.get("{column_count}", None), columns=_repeated_dict(d, "{columns}", ColumnInfo)) + return cls(column_count=d.get("column_count", None), columns=_repeated_dict(d, "columns", ColumnInfo)) @dataclass @@ -1205,20 +1202,20 @@ def as_shallow_dict(self) -> dict: """Serializes the ScanVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.last_primary_key is not None: - body["{last_primary_key}"] = self.last_primary_key + body["last_primary_key"] = self.last_primary_key if self.num_results is not None: - body["{num_results}"] = self.num_results + body["num_results"] = self.num_results return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ScanVectorIndexRequest: """Deserializes the ScanVectorIndexRequest from a dictionary.""" return cls( - index_name=d.get("{index_name}", None), - last_primary_key=d.get("{last_primary_key}", None), - num_results=d.get("{num_results}", None), + index_name=d.get("index_name", None), + last_primary_key=d.get("last_primary_key", None), + num_results=d.get("num_results", None), ) @@ -1245,15 +1242,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ScanVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.data: - body["{data}"] = self.data + body["data"] = self.data if self.last_primary_key is not None: - body["{last_primary_key}"] = self.last_primary_key + body["last_primary_key"] = self.last_primary_key return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ScanVectorIndexResponse: """Deserializes the ScanVectorIndexResponse from a dictionary.""" - return cls(data=_repeated_dict(d, "{data}", Struct), last_primary_key=d.get("{last_primary_key}", None)) + return cls(data=_repeated_dict(d, "data", Struct), last_primary_key=d.get("last_primary_key", None)) @dataclass @@ -1272,13 +1269,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Struct into a shallow dictionary of its immediate attributes.""" body = {} if self.fields: - body["{fields}"] = self.fields + body["fields"] = self.fields return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Struct: """Deserializes the Struct from a dictionary.""" - return cls(fields=_repeated_dict(d, "{fields}", MapStringValueEntry)) + return cls(fields=_repeated_dict(d, "fields", MapStringValueEntry)) @dataclass @@ -1322,17 +1319,16 @@ def as_shallow_dict(self) -> dict: """Serializes the UpsertDataResult into a shallow dictionary of its immediate attributes.""" body = {} if self.failed_primary_keys: - body["{failed_primary_keys}"] = self.failed_primary_keys + body["failed_primary_keys"] = self.failed_primary_keys if self.success_row_count is not None: - body["{success_row_count}"] = self.success_row_count + body["success_row_count"] = self.success_row_count return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertDataResult: """Deserializes the UpsertDataResult from a dictionary.""" return cls( - failed_primary_keys=d.get("{failed_primary_keys}", None), - success_row_count=d.get("{success_row_count}", None), + failed_primary_keys=d.get("failed_primary_keys", None), success_row_count=d.get("success_row_count", None) ) @@ -1367,15 +1363,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpsertDataVectorIndexRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.index_name is not None: - body["{index_name}"] = self.index_name + body["index_name"] = self.index_name if self.inputs_json is not None: - body["{inputs_json}"] = self.inputs_json + body["inputs_json"] = self.inputs_json return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertDataVectorIndexRequest: """Deserializes the UpsertDataVectorIndexRequest from a dictionary.""" - return cls(index_name=d.get("{index_name}", None), inputs_json=d.get("{inputs_json}", None)) + return cls(index_name=d.get("index_name", None), inputs_json=d.get("inputs_json", None)) @dataclass @@ -1401,15 +1397,15 @@ def as_shallow_dict(self) -> dict: """Serializes the UpsertDataVectorIndexResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.result: - body["{result}"] = self.result + body["result"] = self.result if self.status is not None: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpsertDataVectorIndexResponse: """Deserializes the UpsertDataVectorIndexResponse from a dictionary.""" - return cls(result=_from_dict(d, "{result}", UpsertDataResult), status=_enum(d, "{status}", UpsertDataStatus)) + return cls(result=_from_dict(d, "result", UpsertDataResult), status=_enum(d, "status", UpsertDataStatus)) @dataclass @@ -1447,29 +1443,29 @@ def as_shallow_dict(self) -> dict: """Serializes the Value into a shallow dictionary of its immediate attributes.""" body = {} if self.bool_value is not None: - body["{bool_value}"] = self.bool_value + body["bool_value"] = self.bool_value if self.list_value: - body["{list_value}"] = self.list_value + body["list_value"] = self.list_value if self.null_value is not None: - body["{null_value}"] = self.null_value + body["null_value"] = self.null_value if self.number_value is not None: - body["{number_value}"] = self.number_value + body["number_value"] = self.number_value if self.string_value is not None: - body["{string_value}"] = self.string_value + body["string_value"] = self.string_value if self.struct_value: - body["{struct_value}"] = self.struct_value + body["struct_value"] = self.struct_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Value: """Deserializes the Value from a dictionary.""" return cls( - bool_value=d.get("{bool_value}", None), - list_value=_from_dict(d, "{list_value}", ListValue), - null_value=d.get("{null_value}", None), - number_value=d.get("{number_value}", None), - string_value=d.get("{string_value}", None), - struct_value=_from_dict(d, "{struct_value}", Struct), + bool_value=d.get("bool_value", None), + list_value=_from_dict(d, "list_value", ListValue), + null_value=d.get("null_value", None), + number_value=d.get("number_value", None), + string_value=d.get("string_value", None), + struct_value=_from_dict(d, "struct_value", Struct), ) @@ -1526,35 +1522,35 @@ def as_shallow_dict(self) -> dict: """Serializes the VectorIndex into a shallow dictionary of its immediate attributes.""" body = {} if self.creator is not None: - body["{creator}"] = self.creator + body["creator"] = self.creator if self.delta_sync_index_spec: - body["{delta_sync_index_spec}"] = self.delta_sync_index_spec + body["delta_sync_index_spec"] = self.delta_sync_index_spec if self.direct_access_index_spec: - body["{direct_access_index_spec}"] = self.direct_access_index_spec + body["direct_access_index_spec"] = self.direct_access_index_spec if self.endpoint_name is not None: - body["{endpoint_name}"] = self.endpoint_name + body["endpoint_name"] = self.endpoint_name if self.index_type is not None: - body["{index_type}"] = self.index_type + body["index_type"] = self.index_type if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name if self.primary_key is not None: - body["{primary_key}"] = self.primary_key + body["primary_key"] = self.primary_key if self.status: - body["{status}"] = self.status + body["status"] = self.status return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VectorIndex: """Deserializes the VectorIndex from a dictionary.""" return cls( - creator=d.get("{creator}", None), - delta_sync_index_spec=_from_dict(d, "{delta_sync_index_spec}", DeltaSyncVectorIndexSpecResponse), - direct_access_index_spec=_from_dict(d, "{direct_access_index_spec}", DirectAccessVectorIndexSpec), - endpoint_name=d.get("{endpoint_name}", None), - index_type=_enum(d, "{index_type}", VectorIndexType), - name=d.get("{name}", None), - primary_key=d.get("{primary_key}", None), - status=_from_dict(d, "{status}", VectorIndexStatus), + creator=d.get("creator", None), + delta_sync_index_spec=_from_dict(d, "delta_sync_index_spec", DeltaSyncVectorIndexSpecResponse), + direct_access_index_spec=_from_dict(d, "direct_access_index_spec", DirectAccessVectorIndexSpec), + endpoint_name=d.get("endpoint_name", None), + index_type=_enum(d, "index_type", VectorIndexType), + name=d.get("name", None), + primary_key=d.get("primary_key", None), + status=_from_dict(d, "status", VectorIndexStatus), ) @@ -1589,23 +1585,23 @@ def as_shallow_dict(self) -> dict: """Serializes the VectorIndexStatus into a shallow dictionary of its immediate attributes.""" body = {} if self.index_url is not None: - body["{index_url}"] = self.index_url + body["index_url"] = self.index_url if self.indexed_row_count is not None: - body["{indexed_row_count}"] = self.indexed_row_count + body["indexed_row_count"] = self.indexed_row_count if self.message is not None: - body["{message}"] = self.message + body["message"] = self.message if self.ready is not None: - body["{ready}"] = self.ready + body["ready"] = self.ready return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> VectorIndexStatus: """Deserializes the VectorIndexStatus from a dictionary.""" return cls( - index_url=d.get("{index_url}", None), - indexed_row_count=d.get("{indexed_row_count}", None), - message=d.get("{message}", None), - ready=d.get("{ready}", None), + index_url=d.get("index_url", None), + indexed_row_count=d.get("indexed_row_count", None), + message=d.get("message", None), + ready=d.get("ready", None), ) @@ -1643,9 +1639,9 @@ def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[Endpoi """ body = {} if endpoint_type is not None: - body["{endpoint_type}"] = endpoint_type.value + body["endpoint_type"] = endpoint_type.value if name is not None: - body["{name}"] = name + body["name"] = name headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1655,7 +1651,7 @@ def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[Endpoi return Wait( self.WaitGetEndpointVectorSearchEndpointOnline, response=EndpointInfo.from_dict(op_response), - endpoint_name=op_response["{name}"], + endpoint_name=op_response["name"], ) def create_endpoint_and_wait( @@ -1703,19 +1699,19 @@ def list_endpoints(self, *, page_token: Optional[str] = None) -> Iterator[Endpoi query = {} if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/vector-search/endpoints", query=query, headers=headers) - if "{endpoints}" in json: - for v in json["{endpoints}"]: + if "endpoints" in json: + for v in json["endpoints"]: yield EndpointInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] class VectorSearchIndexesAPI: @@ -1766,17 +1762,17 @@ def create_index( """ body = {} if delta_sync_index_spec is not None: - body["{delta_sync_index_spec}"] = delta_sync_index_spec.as_dict() + body["delta_sync_index_spec"] = delta_sync_index_spec.as_dict() if direct_access_index_spec is not None: - body["{direct_access_index_spec}"] = direct_access_index_spec.as_dict() + body["direct_access_index_spec"] = direct_access_index_spec.as_dict() if endpoint_name is not None: - body["{endpoint_name}"] = endpoint_name + body["endpoint_name"] = endpoint_name if index_type is not None: - body["{index_type}"] = index_type.value + body["index_type"] = index_type.value if name is not None: - body["{name}"] = name + body["name"] = name if primary_key is not None: - body["{primary_key}"] = primary_key + body["primary_key"] = primary_key headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1799,7 +1795,7 @@ def delete_data_vector_index(self, index_name: str, primary_keys: List[str]) -> """ body = {} if primary_keys is not None: - body["{primary_keys}"] = [v for v in primary_keys] + body["primary_keys"] = [v for v in primary_keys] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1858,21 +1854,21 @@ def list_indexes(self, endpoint_name: str, *, page_token: Optional[str] = None) query = {} if endpoint_name is not None: - query["{endpoint_name}"] = endpoint_name + query["endpoint_name"] = endpoint_name if page_token is not None: - query["{page_token}"] = page_token + query["page_token"] = page_token headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/vector-search/indexes", query=query, headers=headers) - if "{vector_indexes}" in json: - for v in json["{vector_indexes}"]: + if "vector_indexes" in json: + for v in json["vector_indexes"]: yield MiniVectorIndex.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{page_token}"] = json["{next_page_token}"] + query["page_token"] = json["next_page_token"] def query_index( self, @@ -1919,21 +1915,21 @@ def query_index( """ body = {} if columns is not None: - body["{columns}"] = [v for v in columns] + body["columns"] = [v for v in columns] if columns_to_rerank is not None: - body["{columns_to_rerank}"] = [v for v in columns_to_rerank] + body["columns_to_rerank"] = [v for v in columns_to_rerank] if filters_json is not None: - body["{filters_json}"] = filters_json + body["filters_json"] = filters_json if num_results is not None: - body["{num_results}"] = num_results + body["num_results"] = num_results if query_text is not None: - body["{query_text}"] = query_text + body["query_text"] = query_text if query_type is not None: - body["{query_type}"] = query_type + body["query_type"] = query_type if query_vector is not None: - body["{query_vector}"] = [v for v in query_vector] + body["query_vector"] = [v for v in query_vector] if score_threshold is not None: - body["{score_threshold}"] = score_threshold + body["score_threshold"] = score_threshold headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1961,9 +1957,9 @@ def query_next_page( """ body = {} if endpoint_name is not None: - body["{endpoint_name}"] = endpoint_name + body["endpoint_name"] = endpoint_name if page_token is not None: - body["{page_token}"] = page_token + body["page_token"] = page_token headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -1993,9 +1989,9 @@ def scan_index( """ body = {} if last_primary_key is not None: - body["{last_primary_key}"] = last_primary_key + body["last_primary_key"] = last_primary_key if num_results is not None: - body["{num_results}"] = num_results + body["num_results"] = num_results headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2033,7 +2029,7 @@ def upsert_data_vector_index(self, index_name: str, inputs_json: str) -> UpsertD """ body = {} if inputs_json is not None: - body["{inputs_json}"] = inputs_json + body["inputs_json"] = inputs_json headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", diff --git a/databricks/sdk/workspace/v2/impl.py b/databricks/sdk/workspace/v2/impl.py index fc0e8007b..d1491d351 100755 --- a/databricks/sdk/workspace/v2/impl.py +++ b/databricks/sdk/workspace/v2/impl.py @@ -35,15 +35,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AclItem into a shallow dictionary of its immediate attributes.""" body = {} if self.permission is not None: - body["{permission}"] = self.permission + body["permission"] = self.permission if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AclItem: """Deserializes the AclItem from a dictionary.""" - return cls(permission=_enum(d, "{permission}", AclPermission), principal=d.get("{principal}", None)) + return cls(permission=_enum(d, "permission", AclPermission), principal=d.get("principal", None)) class AclPermission(Enum): @@ -74,15 +74,15 @@ def as_shallow_dict(self) -> dict: """Serializes the AzureKeyVaultSecretScopeMetadata into a shallow dictionary of its immediate attributes.""" body = {} if self.dns_name is not None: - body["{dns_name}"] = self.dns_name + body["dns_name"] = self.dns_name if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> AzureKeyVaultSecretScopeMetadata: """Deserializes the AzureKeyVaultSecretScopeMetadata from a dictionary.""" - return cls(dns_name=d.get("{dns_name}", None), resource_id=d.get("{resource_id}", None)) + return cls(dns_name=d.get("dns_name", None), resource_id=d.get("resource_id", None)) @dataclass @@ -120,20 +120,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username if self.personal_access_token is not None: - body["{personal_access_token}"] = self.personal_access_token + body["personal_access_token"] = self.personal_access_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialsRequest: """Deserializes the CreateCredentialsRequest from a dictionary.""" return cls( - git_provider=d.get("{git_provider}", None), - git_username=d.get("{git_username}", None), - personal_access_token=d.get("{personal_access_token}", None), + git_provider=d.get("git_provider", None), + git_username=d.get("git_username", None), + personal_access_token=d.get("personal_access_token", None), ) @@ -164,20 +164,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialsResponse: """Deserializes the CreateCredentialsResponse from a dictionary.""" return cls( - credential_id=d.get("{credential_id}", None), - git_provider=d.get("{git_provider}", None), - git_username=d.get("{git_username}", None), + credential_id=d.get("credential_id", None), + git_provider=d.get("git_provider", None), + git_username=d.get("git_username", None), ) @@ -216,23 +216,23 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateRepoRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout + body["sparse_checkout"] = self.sparse_checkout if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRepoRequest: """Deserializes the CreateRepoRequest from a dictionary.""" return cls( - path=d.get("{path}", None), - provider=d.get("{provider}", None), - sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), - url=d.get("{url}", None), + path=d.get("path", None), + provider=d.get("provider", None), + sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), + url=d.get("url", None), ) @@ -282,32 +282,32 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateRepoResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.head_commit_id is not None: - body["{head_commit_id}"] = self.head_commit_id + body["head_commit_id"] = self.head_commit_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout + body["sparse_checkout"] = self.sparse_checkout if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateRepoResponse: """Deserializes the CreateRepoResponse from a dictionary.""" return cls( - branch=d.get("{branch}", None), - head_commit_id=d.get("{head_commit_id}", None), - id=d.get("{id}", None), - path=d.get("{path}", None), - provider=d.get("{provider}", None), - sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), - url=d.get("{url}", None), + branch=d.get("branch", None), + head_commit_id=d.get("head_commit_id", None), + id=d.get("id", None), + path=d.get("path", None), + provider=d.get("provider", None), + sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), + url=d.get("url", None), ) @@ -342,23 +342,23 @@ def as_shallow_dict(self) -> dict: """Serializes the CreateScope into a shallow dictionary of its immediate attributes.""" body = {} if self.backend_azure_keyvault: - body["{backend_azure_keyvault}"] = self.backend_azure_keyvault + body["backend_azure_keyvault"] = self.backend_azure_keyvault if self.initial_manage_principal is not None: - body["{initial_manage_principal}"] = self.initial_manage_principal + body["initial_manage_principal"] = self.initial_manage_principal if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope if self.scope_backend_type is not None: - body["{scope_backend_type}"] = self.scope_backend_type + body["scope_backend_type"] = self.scope_backend_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CreateScope: """Deserializes the CreateScope from a dictionary.""" return cls( - backend_azure_keyvault=_from_dict(d, "{backend_azure_keyvault}", AzureKeyVaultSecretScopeMetadata), - initial_manage_principal=d.get("{initial_manage_principal}", None), - scope=d.get("{scope}", None), - scope_backend_type=_enum(d, "{scope_backend_type}", ScopeBackendType), + backend_azure_keyvault=_from_dict(d, "backend_azure_keyvault", AzureKeyVaultSecretScopeMetadata), + initial_manage_principal=d.get("initial_manage_principal", None), + scope=d.get("scope", None), + scope_backend_type=_enum(d, "scope_backend_type", ScopeBackendType), ) @@ -407,20 +407,20 @@ def as_shallow_dict(self) -> dict: """Serializes the CredentialInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> CredentialInfo: """Deserializes the CredentialInfo from a dictionary.""" return cls( - credential_id=d.get("{credential_id}", None), - git_provider=d.get("{git_provider}", None), - git_username=d.get("{git_username}", None), + credential_id=d.get("credential_id", None), + git_provider=d.get("git_provider", None), + git_username=d.get("git_username", None), ) @@ -447,15 +447,15 @@ def as_shallow_dict(self) -> dict: """Serializes the Delete into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.recursive is not None: - body["{recursive}"] = self.recursive + body["recursive"] = self.recursive return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Delete: """Deserializes the Delete from a dictionary.""" - return cls(path=d.get("{path}", None), recursive=d.get("{recursive}", None)) + return cls(path=d.get("path", None), recursive=d.get("recursive", None)) @dataclass @@ -479,15 +479,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteAcl into a shallow dictionary of its immediate attributes.""" body = {} if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteAcl: """Deserializes the DeleteAcl from a dictionary.""" - return cls(principal=d.get("{principal}", None), scope=d.get("{scope}", None)) + return cls(principal=d.get("principal", None), scope=d.get("scope", None)) @dataclass @@ -578,13 +578,13 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteScope into a shallow dictionary of its immediate attributes.""" body = {} if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteScope: """Deserializes the DeleteScope from a dictionary.""" - return cls(scope=d.get("{scope}", None)) + return cls(scope=d.get("scope", None)) @dataclass @@ -626,15 +626,15 @@ def as_shallow_dict(self) -> dict: """Serializes the DeleteSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> DeleteSecret: """Deserializes the DeleteSecret from a dictionary.""" - return cls(key=d.get("{key}", None), scope=d.get("{scope}", None)) + return cls(key=d.get("key", None), scope=d.get("scope", None)) @dataclass @@ -692,15 +692,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ExportResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.file_type is not None: - body["{file_type}"] = self.file_type + body["file_type"] = self.file_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ExportResponse: """Deserializes the ExportResponse from a dictionary.""" - return cls(content=d.get("{content}", None), file_type=d.get("{file_type}", None)) + return cls(content=d.get("content", None), file_type=d.get("file_type", None)) @dataclass @@ -730,20 +730,20 @@ def as_shallow_dict(self) -> dict: """Serializes the GetCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetCredentialsResponse: """Deserializes the GetCredentialsResponse from a dictionary.""" return cls( - credential_id=d.get("{credential_id}", None), - git_provider=d.get("{git_provider}", None), - git_username=d.get("{git_username}", None), + credential_id=d.get("credential_id", None), + git_provider=d.get("git_provider", None), + git_username=d.get("git_username", None), ) @@ -763,13 +763,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetRepoPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRepoPermissionLevelsResponse: """Deserializes the GetRepoPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", RepoPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", RepoPermissionsDescription)) @dataclass @@ -818,32 +818,32 @@ def as_shallow_dict(self) -> dict: """Serializes the GetRepoResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.head_commit_id is not None: - body["{head_commit_id}"] = self.head_commit_id + body["head_commit_id"] = self.head_commit_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout + body["sparse_checkout"] = self.sparse_checkout if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetRepoResponse: """Deserializes the GetRepoResponse from a dictionary.""" return cls( - branch=d.get("{branch}", None), - head_commit_id=d.get("{head_commit_id}", None), - id=d.get("{id}", None), - path=d.get("{path}", None), - provider=d.get("{provider}", None), - sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), - url=d.get("{url}", None), + branch=d.get("branch", None), + head_commit_id=d.get("head_commit_id", None), + id=d.get("id", None), + path=d.get("path", None), + provider=d.get("provider", None), + sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), + url=d.get("url", None), ) @@ -868,15 +868,15 @@ def as_shallow_dict(self) -> dict: """Serializes the GetSecretResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.value is not None: - body["{value}"] = self.value + body["value"] = self.value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetSecretResponse: """Deserializes the GetSecretResponse from a dictionary.""" - return cls(key=d.get("{key}", None), value=d.get("{value}", None)) + return cls(key=d.get("key", None), value=d.get("value", None)) @dataclass @@ -895,13 +895,13 @@ def as_shallow_dict(self) -> dict: """Serializes the GetWorkspaceObjectPermissionLevelsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.permission_levels: - body["{permission_levels}"] = self.permission_levels + body["permission_levels"] = self.permission_levels return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> GetWorkspaceObjectPermissionLevelsResponse: """Deserializes the GetWorkspaceObjectPermissionLevelsResponse from a dictionary.""" - return cls(permission_levels=_repeated_dict(d, "{permission_levels}", WorkspaceObjectPermissionsDescription)) + return cls(permission_levels=_repeated_dict(d, "permission_levels", WorkspaceObjectPermissionsDescription)) @dataclass @@ -955,26 +955,26 @@ def as_shallow_dict(self) -> dict: """Serializes the Import into a shallow dictionary of its immediate attributes.""" body = {} if self.content is not None: - body["{content}"] = self.content + body["content"] = self.content if self.format is not None: - body["{format}"] = self.format + body["format"] = self.format if self.language is not None: - body["{language}"] = self.language + body["language"] = self.language if self.overwrite is not None: - body["{overwrite}"] = self.overwrite + body["overwrite"] = self.overwrite if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Import: """Deserializes the Import from a dictionary.""" return cls( - content=d.get("{content}", None), - format=_enum(d, "{format}", ImportFormat), - language=_enum(d, "{language}", Language), - overwrite=d.get("{overwrite}", None), - path=d.get("{path}", None), + content=d.get("content", None), + format=_enum(d, "format", ImportFormat), + language=_enum(d, "language", Language), + overwrite=d.get("overwrite", None), + path=d.get("path", None), ) @@ -1033,13 +1033,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListAclsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.items: - body["{items}"] = self.items + body["items"] = self.items return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListAclsResponse: """Deserializes the ListAclsResponse from a dictionary.""" - return cls(items=_repeated_dict(d, "{items}", AclItem)) + return cls(items=_repeated_dict(d, "items", AclItem)) @dataclass @@ -1058,13 +1058,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListCredentialsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.credentials: - body["{credentials}"] = self.credentials + body["credentials"] = self.credentials return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListCredentialsResponse: """Deserializes the ListCredentialsResponse from a dictionary.""" - return cls(credentials=_repeated_dict(d, "{credentials}", CredentialInfo)) + return cls(credentials=_repeated_dict(d, "credentials", CredentialInfo)) @dataclass @@ -1089,15 +1089,15 @@ def as_shallow_dict(self) -> dict: """Serializes the ListReposResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.next_page_token is not None: - body["{next_page_token}"] = self.next_page_token + body["next_page_token"] = self.next_page_token if self.repos: - body["{repos}"] = self.repos + body["repos"] = self.repos return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListReposResponse: """Deserializes the ListReposResponse from a dictionary.""" - return cls(next_page_token=d.get("{next_page_token}", None), repos=_repeated_dict(d, "{repos}", RepoInfo)) + return cls(next_page_token=d.get("next_page_token", None), repos=_repeated_dict(d, "repos", RepoInfo)) @dataclass @@ -1116,13 +1116,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.objects: - body["{objects}"] = self.objects + body["objects"] = self.objects return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListResponse: """Deserializes the ListResponse from a dictionary.""" - return cls(objects=_repeated_dict(d, "{objects}", ObjectInfo)) + return cls(objects=_repeated_dict(d, "objects", ObjectInfo)) @dataclass @@ -1141,13 +1141,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListScopesResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.scopes: - body["{scopes}"] = self.scopes + body["scopes"] = self.scopes return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListScopesResponse: """Deserializes the ListScopesResponse from a dictionary.""" - return cls(scopes=_repeated_dict(d, "{scopes}", SecretScope)) + return cls(scopes=_repeated_dict(d, "scopes", SecretScope)) @dataclass @@ -1166,13 +1166,13 @@ def as_shallow_dict(self) -> dict: """Serializes the ListSecretsResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.secrets: - body["{secrets}"] = self.secrets + body["secrets"] = self.secrets return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ListSecretsResponse: """Deserializes the ListSecretsResponse from a dictionary.""" - return cls(secrets=_repeated_dict(d, "{secrets}", SecretMetadata)) + return cls(secrets=_repeated_dict(d, "secrets", SecretMetadata)) @dataclass @@ -1192,13 +1192,13 @@ def as_shallow_dict(self) -> dict: """Serializes the Mkdirs into a shallow dictionary of its immediate attributes.""" body = {} if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Mkdirs: """Deserializes the Mkdirs from a dictionary.""" - return cls(path=d.get("{path}", None)) + return cls(path=d.get("path", None)) @dataclass @@ -1276,35 +1276,35 @@ def as_shallow_dict(self) -> dict: """Serializes the ObjectInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.created_at is not None: - body["{created_at}"] = self.created_at + body["created_at"] = self.created_at if self.language is not None: - body["{language}"] = self.language + body["language"] = self.language if self.modified_at is not None: - body["{modified_at}"] = self.modified_at + body["modified_at"] = self.modified_at if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.resource_id is not None: - body["{resource_id}"] = self.resource_id + body["resource_id"] = self.resource_id if self.size is not None: - body["{size}"] = self.size + body["size"] = self.size return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> ObjectInfo: """Deserializes the ObjectInfo from a dictionary.""" return cls( - created_at=d.get("{created_at}", None), - language=_enum(d, "{language}", Language), - modified_at=d.get("{modified_at}", None), - object_id=d.get("{object_id}", None), - object_type=_enum(d, "{object_type}", ObjectType), - path=d.get("{path}", None), - resource_id=d.get("{resource_id}", None), - size=d.get("{size}", None), + created_at=d.get("created_at", None), + language=_enum(d, "language", Language), + modified_at=d.get("modified_at", None), + object_id=d.get("object_id", None), + object_type=_enum(d, "object_type", ObjectType), + path=d.get("path", None), + resource_id=d.get("resource_id", None), + size=d.get("size", None), ) @@ -1345,20 +1345,20 @@ def as_shallow_dict(self) -> dict: """Serializes the PutAcl into a shallow dictionary of its immediate attributes.""" body = {} if self.permission is not None: - body["{permission}"] = self.permission + body["permission"] = self.permission if self.principal is not None: - body["{principal}"] = self.principal + body["principal"] = self.principal if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutAcl: """Deserializes the PutAcl from a dictionary.""" return cls( - permission=_enum(d, "{permission}", AclPermission), - principal=d.get("{principal}", None), - scope=d.get("{scope}", None), + permission=_enum(d, "permission", AclPermission), + principal=d.get("principal", None), + scope=d.get("scope", None), ) @@ -1411,23 +1411,23 @@ def as_shallow_dict(self) -> dict: """Serializes the PutSecret into a shallow dictionary of its immediate attributes.""" body = {} if self.bytes_value is not None: - body["{bytes_value}"] = self.bytes_value + body["bytes_value"] = self.bytes_value if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.scope is not None: - body["{scope}"] = self.scope + body["scope"] = self.scope if self.string_value is not None: - body["{string_value}"] = self.string_value + body["string_value"] = self.string_value return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> PutSecret: """Deserializes the PutSecret from a dictionary.""" return cls( - bytes_value=d.get("{bytes_value}", None), - key=d.get("{key}", None), - scope=d.get("{scope}", None), - string_value=d.get("{string_value}", None), + bytes_value=d.get("bytes_value", None), + key=d.get("key", None), + scope=d.get("scope", None), + string_value=d.get("string_value", None), ) @@ -1480,23 +1480,23 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoAccessControlRequest: """Deserializes the RepoAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", RepoPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", RepoPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -1536,26 +1536,26 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoAccessControlResponse: """Deserializes the RepoAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", RepoPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", RepoPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -1607,32 +1607,32 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoInfo into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.head_commit_id is not None: - body["{head_commit_id}"] = self.head_commit_id + body["head_commit_id"] = self.head_commit_id if self.id is not None: - body["{id}"] = self.id + body["id"] = self.id if self.path is not None: - body["{path}"] = self.path + body["path"] = self.path if self.provider is not None: - body["{provider}"] = self.provider + body["provider"] = self.provider if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout + body["sparse_checkout"] = self.sparse_checkout if self.url is not None: - body["{url}"] = self.url + body["url"] = self.url return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoInfo: """Deserializes the RepoInfo from a dictionary.""" return cls( - branch=d.get("{branch}", None), - head_commit_id=d.get("{head_commit_id}", None), - id=d.get("{id}", None), - path=d.get("{path}", None), - provider=d.get("{provider}", None), - sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckout), - url=d.get("{url}", None), + branch=d.get("branch", None), + head_commit_id=d.get("head_commit_id", None), + id=d.get("id", None), + path=d.get("path", None), + provider=d.get("provider", None), + sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout), + url=d.get("url", None), ) @@ -1660,20 +1660,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermission: """Deserializes the RepoPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", RepoPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", RepoPermissionLevel), ) @@ -1709,20 +1709,20 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermissions: """Deserializes the RepoPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", RepoAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", RepoAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -1746,17 +1746,16 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermissionsDescription: """Deserializes the RepoPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", RepoPermissionLevel), + description=d.get("description", None), permission_level=_enum(d, "permission_level", RepoPermissionLevel) ) @@ -1780,17 +1779,17 @@ def as_shallow_dict(self) -> dict: """Serializes the RepoPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.repo_id is not None: - body["{repo_id}"] = self.repo_id + body["repo_id"] = self.repo_id return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> RepoPermissionsRequest: """Deserializes the RepoPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", RepoAccessControlRequest), - repo_id=d.get("{repo_id}", None), + access_control_list=_repeated_dict(d, "access_control_list", RepoAccessControlRequest), + repo_id=d.get("repo_id", None), ) @@ -1821,15 +1820,15 @@ def as_shallow_dict(self) -> dict: """Serializes the SecretMetadata into a shallow dictionary of its immediate attributes.""" body = {} if self.key is not None: - body["{key}"] = self.key + body["key"] = self.key if self.last_updated_timestamp is not None: - body["{last_updated_timestamp}"] = self.last_updated_timestamp + body["last_updated_timestamp"] = self.last_updated_timestamp return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecretMetadata: """Deserializes the SecretMetadata from a dictionary.""" - return cls(key=d.get("{key}", None), last_updated_timestamp=d.get("{last_updated_timestamp}", None)) + return cls(key=d.get("key", None), last_updated_timestamp=d.get("last_updated_timestamp", None)) @dataclass @@ -1858,20 +1857,20 @@ def as_shallow_dict(self) -> dict: """Serializes the SecretScope into a shallow dictionary of its immediate attributes.""" body = {} if self.backend_type is not None: - body["{backend_type}"] = self.backend_type + body["backend_type"] = self.backend_type if self.keyvault_metadata: - body["{keyvault_metadata}"] = self.keyvault_metadata + body["keyvault_metadata"] = self.keyvault_metadata if self.name is not None: - body["{name}"] = self.name + body["name"] = self.name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SecretScope: """Deserializes the SecretScope from a dictionary.""" return cls( - backend_type=_enum(d, "{backend_type}", ScopeBackendType), - keyvault_metadata=_from_dict(d, "{keyvault_metadata}", AzureKeyVaultSecretScopeMetadata), - name=d.get("{name}", None), + backend_type=_enum(d, "backend_type", ScopeBackendType), + keyvault_metadata=_from_dict(d, "keyvault_metadata", AzureKeyVaultSecretScopeMetadata), + name=d.get("name", None), ) @@ -1895,13 +1894,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SparseCheckout into a shallow dictionary of its immediate attributes.""" body = {} if self.patterns: - body["{patterns}"] = self.patterns + body["patterns"] = self.patterns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparseCheckout: """Deserializes the SparseCheckout from a dictionary.""" - return cls(patterns=d.get("{patterns}", None)) + return cls(patterns=d.get("patterns", None)) @dataclass @@ -1924,13 +1923,13 @@ def as_shallow_dict(self) -> dict: """Serializes the SparseCheckoutUpdate into a shallow dictionary of its immediate attributes.""" body = {} if self.patterns: - body["{patterns}"] = self.patterns + body["patterns"] = self.patterns return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> SparseCheckoutUpdate: """Deserializes the SparseCheckoutUpdate from a dictionary.""" - return cls(patterns=d.get("{patterns}", None)) + return cls(patterns=d.get("patterns", None)) @dataclass @@ -1973,23 +1972,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateCredentialsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.credential_id is not None: - body["{credential_id}"] = self.credential_id + body["credential_id"] = self.credential_id if self.git_provider is not None: - body["{git_provider}"] = self.git_provider + body["git_provider"] = self.git_provider if self.git_username is not None: - body["{git_username}"] = self.git_username + body["git_username"] = self.git_username if self.personal_access_token is not None: - body["{personal_access_token}"] = self.personal_access_token + body["personal_access_token"] = self.personal_access_token return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateCredentialsRequest: """Deserializes the UpdateCredentialsRequest from a dictionary.""" return cls( - credential_id=d.get("{credential_id}", None), - git_provider=d.get("{git_provider}", None), - git_username=d.get("{git_username}", None), - personal_access_token=d.get("{personal_access_token}", None), + credential_id=d.get("credential_id", None), + git_provider=d.get("git_provider", None), + git_username=d.get("git_username", None), + personal_access_token=d.get("personal_access_token", None), ) @@ -2045,23 +2044,23 @@ def as_shallow_dict(self) -> dict: """Serializes the UpdateRepoRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.branch is not None: - body["{branch}"] = self.branch + body["branch"] = self.branch if self.repo_id is not None: - body["{repo_id}"] = self.repo_id + body["repo_id"] = self.repo_id if self.sparse_checkout: - body["{sparse_checkout}"] = self.sparse_checkout + body["sparse_checkout"] = self.sparse_checkout if self.tag is not None: - body["{tag}"] = self.tag + body["tag"] = self.tag return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> UpdateRepoRequest: """Deserializes the UpdateRepoRequest from a dictionary.""" return cls( - branch=d.get("{branch}", None), - repo_id=d.get("{repo_id}", None), - sparse_checkout=_from_dict(d, "{sparse_checkout}", SparseCheckoutUpdate), - tag=d.get("{tag}", None), + branch=d.get("branch", None), + repo_id=d.get("repo_id", None), + sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckoutUpdate), + tag=d.get("tag", None), ) @@ -2114,23 +2113,23 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectAccessControlRequest: """Deserializes the WorkspaceObjectAccessControlRequest from a dictionary.""" return cls( - group_name=d.get("{group_name}", None), - permission_level=_enum(d, "{permission_level}", WorkspaceObjectPermissionLevel), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + group_name=d.get("group_name", None), + permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -2170,26 +2169,26 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectAccessControlResponse into a shallow dictionary of its immediate attributes.""" body = {} if self.all_permissions: - body["{all_permissions}"] = self.all_permissions + body["all_permissions"] = self.all_permissions if self.display_name is not None: - body["{display_name}"] = self.display_name + body["display_name"] = self.display_name if self.group_name is not None: - body["{group_name}"] = self.group_name + body["group_name"] = self.group_name if self.service_principal_name is not None: - body["{service_principal_name}"] = self.service_principal_name + body["service_principal_name"] = self.service_principal_name if self.user_name is not None: - body["{user_name}"] = self.user_name + body["user_name"] = self.user_name return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectAccessControlResponse: """Deserializes the WorkspaceObjectAccessControlResponse from a dictionary.""" return cls( - all_permissions=_repeated_dict(d, "{all_permissions}", WorkspaceObjectPermission), - display_name=d.get("{display_name}", None), - group_name=d.get("{group_name}", None), - service_principal_name=d.get("{service_principal_name}", None), - user_name=d.get("{user_name}", None), + all_permissions=_repeated_dict(d, "all_permissions", WorkspaceObjectPermission), + display_name=d.get("display_name", None), + group_name=d.get("group_name", None), + service_principal_name=d.get("service_principal_name", None), + user_name=d.get("user_name", None), ) @@ -2217,20 +2216,20 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermission into a shallow dictionary of its immediate attributes.""" body = {} if self.inherited is not None: - body["{inherited}"] = self.inherited + body["inherited"] = self.inherited if self.inherited_from_object: - body["{inherited_from_object}"] = self.inherited_from_object + body["inherited_from_object"] = self.inherited_from_object if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermission: """Deserializes the WorkspaceObjectPermission from a dictionary.""" return cls( - inherited=d.get("{inherited}", None), - inherited_from_object=d.get("{inherited_from_object}", None), - permission_level=_enum(d, "{permission_level}", WorkspaceObjectPermissionLevel), + inherited=d.get("inherited", None), + inherited_from_object=d.get("inherited_from_object", None), + permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), ) @@ -2266,20 +2265,20 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermissions into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.object_id is not None: - body["{object_id}"] = self.object_id + body["object_id"] = self.object_id if self.object_type is not None: - body["{object_type}"] = self.object_type + body["object_type"] = self.object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissions: """Deserializes the WorkspaceObjectPermissions from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", WorkspaceObjectAccessControlResponse), - object_id=d.get("{object_id}", None), - object_type=d.get("{object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", WorkspaceObjectAccessControlResponse), + object_id=d.get("object_id", None), + object_type=d.get("object_type", None), ) @@ -2303,17 +2302,17 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsDescription into a shallow dictionary of its immediate attributes.""" body = {} if self.description is not None: - body["{description}"] = self.description + body["description"] = self.description if self.permission_level is not None: - body["{permission_level}"] = self.permission_level + body["permission_level"] = self.permission_level return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissionsDescription: """Deserializes the WorkspaceObjectPermissionsDescription from a dictionary.""" return cls( - description=d.get("{description}", None), - permission_level=_enum(d, "{permission_level}", WorkspaceObjectPermissionLevel), + description=d.get("description", None), + permission_level=_enum(d, "permission_level", WorkspaceObjectPermissionLevel), ) @@ -2342,20 +2341,20 @@ def as_shallow_dict(self) -> dict: """Serializes the WorkspaceObjectPermissionsRequest into a shallow dictionary of its immediate attributes.""" body = {} if self.access_control_list: - body["{access_control_list}"] = self.access_control_list + body["access_control_list"] = self.access_control_list if self.workspace_object_id is not None: - body["{workspace_object_id}"] = self.workspace_object_id + body["workspace_object_id"] = self.workspace_object_id if self.workspace_object_type is not None: - body["{workspace_object_type}"] = self.workspace_object_type + body["workspace_object_type"] = self.workspace_object_type return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissionsRequest: """Deserializes the WorkspaceObjectPermissionsRequest from a dictionary.""" return cls( - access_control_list=_repeated_dict(d, "{access_control_list}", WorkspaceObjectAccessControlRequest), - workspace_object_id=d.get("{workspace_object_id}", None), - workspace_object_type=d.get("{workspace_object_type}", None), + access_control_list=_repeated_dict(d, "access_control_list", WorkspaceObjectAccessControlRequest), + workspace_object_id=d.get("workspace_object_id", None), + workspace_object_type=d.get("workspace_object_type", None), ) @@ -2398,11 +2397,11 @@ def create( """ body = {} if git_provider is not None: - body["{git_provider}"] = git_provider + body["git_provider"] = git_provider if git_username is not None: - body["{git_username}"] = git_username + body["git_username"] = git_username if personal_access_token is not None: - body["{personal_access_token}"] = personal_access_token + body["personal_access_token"] = personal_access_token headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2496,11 +2495,11 @@ def update( """ body = {} if git_provider is not None: - body["{git_provider}"] = git_provider + body["git_provider"] = git_provider if git_username is not None: - body["{git_username}"] = git_username + body["git_username"] = git_username if personal_access_token is not None: - body["{personal_access_token}"] = personal_access_token + body["personal_access_token"] = personal_access_token headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2548,13 +2547,13 @@ def create( """ body = {} if path is not None: - body["{path}"] = path + body["path"] = path if provider is not None: - body["{provider}"] = provider + body["provider"] = provider if sparse_checkout is not None: - body["{sparse_checkout}"] = sparse_checkout.as_dict() + body["sparse_checkout"] = sparse_checkout.as_dict() if url is not None: - body["{url}"] = url + body["url"] = url headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2653,21 +2652,21 @@ def list(self, *, next_page_token: Optional[str] = None, path_prefix: Optional[s query = {} if next_page_token is not None: - query["{next_page_token}"] = next_page_token + query["next_page_token"] = next_page_token if path_prefix is not None: - query["{path_prefix}"] = path_prefix + query["path_prefix"] = path_prefix headers = { "0": "{Accept application/json}", } while True: json = self._api.do("GET", "/api/2.0/repos", query=query, headers=headers) - if "{repos}" in json: - for v in json["{repos}"]: + if "repos" in json: + for v in json["repos"]: yield RepoInfo.from_dict(v) - if "{next_page_token}" not in json or not json["{next_page_token}"]: + if "next_page_token" not in json or not json["next_page_token"]: return - query["{next_page_token}"] = json["{next_page_token}"] + query["next_page_token"] = json["next_page_token"] def set_permissions( self, repo_id: str, *, access_control_list: Optional[List[RepoAccessControlRequest]] = None @@ -2685,7 +2684,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2723,11 +2722,11 @@ def update( """ body = {} if branch is not None: - body["{branch}"] = branch + body["branch"] = branch if sparse_checkout is not None: - body["{sparse_checkout}"] = sparse_checkout.as_dict() + body["sparse_checkout"] = sparse_checkout.as_dict() if tag is not None: - body["{tag}"] = tag + body["tag"] = tag headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2750,7 +2749,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2800,13 +2799,13 @@ def create_scope( """ body = {} if backend_azure_keyvault is not None: - body["{backend_azure_keyvault}"] = backend_azure_keyvault.as_dict() + body["backend_azure_keyvault"] = backend_azure_keyvault.as_dict() if initial_manage_principal is not None: - body["{initial_manage_principal}"] = initial_manage_principal + body["initial_manage_principal"] = initial_manage_principal if scope is not None: - body["{scope}"] = scope + body["scope"] = scope if scope_backend_type is not None: - body["{scope_backend_type}"] = scope_backend_type.value + body["scope_backend_type"] = scope_backend_type.value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2832,9 +2831,9 @@ def delete_acl(self, scope: str, principal: str): """ body = {} if principal is not None: - body["{principal}"] = principal + body["principal"] = principal if scope is not None: - body["{scope}"] = scope + body["scope"] = scope headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2857,7 +2856,7 @@ def delete_scope(self, scope: str): """ body = {} if scope is not None: - body["{scope}"] = scope + body["scope"] = scope headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2883,9 +2882,9 @@ def delete_secret(self, scope: str, key: str): """ body = {} if key is not None: - body["{key}"] = key + body["key"] = key if scope is not None: - body["{scope}"] = scope + body["scope"] = scope headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -2912,9 +2911,9 @@ def get_acl(self, scope: str, principal: str) -> AclItem: query = {} if principal is not None: - query["{principal}"] = principal + query["principal"] = principal if scope is not None: - query["{scope}"] = scope + query["scope"] = scope headers = { "0": "{Accept application/json}", } @@ -2945,9 +2944,9 @@ def get_secret(self, scope: str, key: str) -> GetSecretResponse: query = {} if key is not None: - query["{key}"] = key + query["key"] = key if scope is not None: - query["{scope}"] = scope + query["scope"] = scope headers = { "0": "{Accept application/json}", } @@ -2971,7 +2970,7 @@ def list_acls(self, scope: str) -> Iterator[AclItem]: query = {} if scope is not None: - query["{scope}"] = scope + query["scope"] = scope headers = { "0": "{Accept application/json}", } @@ -3016,7 +3015,7 @@ def list_secrets(self, scope: str) -> Iterator[SecretMetadata]: query = {} if scope is not None: - query["{scope}"] = scope + query["scope"] = scope headers = { "0": "{Accept application/json}", } @@ -3064,11 +3063,11 @@ def put_acl(self, scope: str, principal: str, permission: AclPermission): """ body = {} if permission is not None: - body["{permission}"] = permission.value + body["permission"] = permission.value if principal is not None: - body["{principal}"] = principal + body["principal"] = principal if scope is not None: - body["{scope}"] = scope + body["scope"] = scope headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3110,13 +3109,13 @@ def put_secret( """ body = {} if bytes_value is not None: - body["{bytes_value}"] = bytes_value + body["bytes_value"] = bytes_value if key is not None: - body["{key}"] = key + body["key"] = key if scope is not None: - body["{scope}"] = scope + body["scope"] = scope if string_value is not None: - body["{string_value}"] = string_value + body["string_value"] = string_value headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3155,9 +3154,9 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): """ body = {} if path is not None: - body["{path}"] = path + body["path"] = path if recursive is not None: - body["{recursive}"] = recursive + body["recursive"] = recursive headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3195,9 +3194,9 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR query = {} if format is not None: - query["{format}"] = format.value + query["format"] = format.value if path is not None: - query["{path}"] = path + query["path"] = path headers = { "0": "{Accept application/json}", } @@ -3268,7 +3267,7 @@ def get_status(self, path: str) -> ObjectInfo: query = {} if path is not None: - query["{path}"] = path + query["path"] = path headers = { "0": "{Accept application/json}", } @@ -3322,15 +3321,15 @@ def import_( """ body = {} if content is not None: - body["{content}"] = content + body["content"] = content if format is not None: - body["{format}"] = format.value + body["format"] = format.value if language is not None: - body["{language}"] = language.value + body["language"] = language.value if overwrite is not None: - body["{overwrite}"] = overwrite + body["overwrite"] = overwrite if path is not None: - body["{path}"] = path + body["path"] = path headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3354,9 +3353,9 @@ def list(self, path: str, *, notebooks_modified_after: Optional[int] = None) -> query = {} if notebooks_modified_after is not None: - query["{notebooks_modified_after}"] = notebooks_modified_after + query["notebooks_modified_after"] = notebooks_modified_after if path is not None: - query["{path}"] = path + query["path"] = path headers = { "0": "{Accept application/json}", } @@ -3383,7 +3382,7 @@ def mkdirs(self, path: str): """ body = {} if path is not None: - body["{path}"] = path + body["path"] = path headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3414,7 +3413,7 @@ def set_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", @@ -3447,7 +3446,7 @@ def update_permissions( """ body = {} if access_control_list is not None: - body["{access_control_list}"] = [v.as_dict() for v in access_control_list] + body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { "0": "{Accept application/json}", "1": "{Content-Type application/json}", From 22b9e7e7fa66ef6f94c59ba83f86da033035fb75 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 11:41:05 +0000 Subject: [PATCH 06/20] update --- databricks/sdk/apps/v2/impl.py | 42 +- databricks/sdk/billing/v2/impl.py | 48 +- databricks/sdk/catalog/v2/impl.py | 306 +++--- databricks/sdk/cleanrooms/v2/impl.py | 34 +- databricks/sdk/compute/v2/impl.py | 198 ++-- databricks/sdk/dashboards/v2/impl.py | 86 +- databricks/sdk/files/v2/impl.py | 40 +- databricks/sdk/iam/v2/impl.py | 130 +-- databricks/sdk/jobs/v2/impl.py | 1401 +----------------------- databricks/sdk/marketplace/v2/impl.py | 130 +-- databricks/sdk/ml/v2/impl.py | 220 ++-- databricks/sdk/oauth2/v2/impl.py | 64 +- databricks/sdk/pipelines/v2/impl.py | 38 +- databricks/sdk/provisioning/v2/impl.py | 78 +- databricks/sdk/serving/v2/impl.py | 56 +- databricks/sdk/settings/v2/impl.py | 198 ++-- databricks/sdk/sharing/v2/impl.py | 56 +- databricks/sdk/sql/v2/impl.py | 166 +-- databricks/sdk/vectorsearch/v2/impl.py | 36 +- databricks/sdk/workspace/v2/impl.py | 104 +- 20 files changed, 1051 insertions(+), 2380 deletions(-) diff --git a/databricks/sdk/apps/v2/impl.py b/databricks/sdk/apps/v2/impl.py index b7b4bb868..61d86b8c3 100755 --- a/databricks/sdk/apps/v2/impl.py +++ b/databricks/sdk/apps/v2/impl.py @@ -1087,8 +1087,8 @@ def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None if no_compute is not None: query["no_compute"] = no_compute headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.0/apps", query=query, body=body, headers=headers) @@ -1111,7 +1111,7 @@ def delete(self, name: str) -> App: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("DELETE", f"/api/2.0/apps/{name}", headers=headers) @@ -1132,8 +1132,8 @@ def deploy(self, app_name: str, *, app_deployment: Optional[AppDeployment] = Non """ body = app_deployment.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", f"/api/2.0/apps/{app_name}/deployments", body=body, headers=headers) @@ -1161,7 +1161,7 @@ def get(self, name: str) -> App: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/apps/{name}", headers=headers) @@ -1181,7 +1181,7 @@ def get_deployment(self, app_name: str, deployment_id: str) -> AppDeployment: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/apps/{app_name}/deployments/{deployment_id}", headers=headers) @@ -1199,7 +1199,7 @@ def get_permission_levels(self, app_name: str) -> GetAppPermissionLevelsResponse """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/apps/{app_name}/permissionLevels", headers=headers) @@ -1217,7 +1217,7 @@ def get_permissions(self, app_name: str) -> AppPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/apps/{app_name}", headers=headers) @@ -1242,7 +1242,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1277,7 +1277,7 @@ def list_deployments( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1307,8 +1307,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) @@ -1328,8 +1328,8 @@ def start(self, name: str) -> Wait[App]: """ headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) @@ -1352,8 +1352,8 @@ def stop(self, name: str) -> Wait[App]: """ headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) @@ -1376,8 +1376,8 @@ def update(self, name: str, *, app: Optional[App] = None) -> App: """ body = app.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/apps/{name}", body=body, headers=headers) @@ -1400,8 +1400,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) diff --git a/databricks/sdk/billing/v2/impl.py b/databricks/sdk/billing/v2/impl.py index 8f0eb0bb3..f715a66d0 100755 --- a/databricks/sdk/billing/v2/impl.py +++ b/databricks/sdk/billing/v2/impl.py @@ -1765,7 +1765,7 @@ def download(self, start_month: str, end_month: str, *, personal_data: Optional[ if start_month is not None: query["start_month"] = start_month headers = { - "0": "{Accept text/plain}", + "Accept": "text/plain", } res = self._api.do( @@ -1801,8 +1801,8 @@ def create(self, *, policy: Optional[BudgetPolicy] = None, request_id: Optional[ if request_id is not None: body["request_id"] = request_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1822,7 +1822,7 @@ def delete(self, policy_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/accounts/{self._api.account_id}/budget-policies/{policy_id}", headers=headers) @@ -1839,7 +1839,7 @@ def get(self, policy_id: str) -> BudgetPolicy: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -1886,7 +1886,7 @@ def list( if sort_spec is not None: query["sort_spec"] = sort_spec.as_dict() headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1921,8 +1921,8 @@ def update( if limit_config is not None: query["limit_config"] = limit_config.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1958,8 +1958,8 @@ def create(self, budget: CreateBudgetConfigurationBudget) -> CreateBudgetConfigu if budget is not None: body["budget"] = budget.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.1/accounts/{self._api.account_id}/budgets", body=body, headers=headers) @@ -1978,7 +1978,7 @@ def delete(self, budget_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/accounts/{self._api.account_id}/budgets/{budget_id}", headers=headers) @@ -1995,7 +1995,7 @@ def get(self, budget_id: str) -> GetBudgetConfigurationResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/accounts/{self._api.account_id}/budgets/{budget_id}", headers=headers) @@ -2017,7 +2017,7 @@ def list(self, *, page_token: Optional[str] = None) -> Iterator[BudgetConfigurat if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -2048,8 +2048,8 @@ def update(self, budget_id: str, budget: UpdateBudgetConfigurationBudget) -> Upd if budget is not None: body["budget"] = budget.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2143,8 +2143,8 @@ def create( if log_delivery_configuration is not None: body["log_delivery_configuration"] = log_delivery_configuration.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/log-delivery", body=body, headers=headers) @@ -2162,7 +2162,7 @@ def get(self, log_delivery_configuration_id: str) -> WrappedLogDeliveryConfigura """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2201,7 +2201,7 @@ def list( if storage_configuration_id is not None: query["storage_configuration_id"] = storage_configuration_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do( @@ -2232,8 +2232,8 @@ def patch_status(self, log_delivery_configuration_id: str, status: LogDeliveryCo if status is not None: body["status"] = status.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do( @@ -2273,8 +2273,8 @@ def create( if workspace_id is not None: body["workspace_id"] = workspace_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/dashboard", body=body, headers=headers) @@ -2302,7 +2302,7 @@ def get( if workspace_id is not None: query["workspace_id"] = workspace_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/dashboard", query=query, headers=headers) diff --git a/databricks/sdk/catalog/v2/impl.py b/databricks/sdk/catalog/v2/impl.py index 8ce04ea44..7d6ccd6f4 100755 --- a/databricks/sdk/catalog/v2/impl.py +++ b/databricks/sdk/catalog/v2/impl.py @@ -10024,8 +10024,8 @@ def create( if metastore_assignment is not None: body["metastore_assignment"] = metastore_assignment.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do( @@ -10049,7 +10049,7 @@ def delete(self, workspace_id: int, metastore_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -10072,7 +10072,7 @@ def get(self, workspace_id: int) -> AccountsMetastoreAssignment: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -10092,7 +10092,7 @@ def list(self, metastore_id: str) -> Iterator[int]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do( @@ -10121,8 +10121,8 @@ def update( if metastore_assignment is not None: body["metastore_assignment"] = metastore_assignment.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do( @@ -10153,8 +10153,8 @@ def create(self, *, metastore_info: Optional[CreateMetastore] = None) -> Account if metastore_info is not None: body["metastore_info"] = metastore_info.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/metastores", body=body, headers=headers) @@ -10177,7 +10177,7 @@ def delete(self, metastore_id: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -10199,7 +10199,7 @@ def get(self, metastore_id: str) -> AccountsMetastoreInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -10216,7 +10216,7 @@ def list(self) -> Iterator[MetastoreInfo]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/metastores", headers=headers) @@ -10238,8 +10238,8 @@ def update(self, metastore_id: str, *, metastore_info: Optional[UpdateMetastore] if metastore_info is not None: body["metastore_info"] = metastore_info.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -10277,8 +10277,8 @@ def create( if credential_info is not None: body["credential_info"] = credential_info.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -10309,7 +10309,7 @@ def delete(self, metastore_id: str, storage_credential_name: str, *, force: Opti if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -10334,7 +10334,7 @@ def get(self, metastore_id: str, storage_credential_name: str) -> AccountsStorag """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -10356,7 +10356,7 @@ def list(self, metastore_id: str) -> Iterator[StorageCredentialInfo]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do( @@ -10391,8 +10391,8 @@ def update( if credential_info is not None: body["credential_info"] = credential_info.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -10424,7 +10424,7 @@ def get(self, artifact_type: ArtifactType) -> ArtifactAllowlistInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}", headers=headers) @@ -10448,8 +10448,8 @@ def update(self, artifact_type: ArtifactType, artifact_matchers: List[ArtifactMa if artifact_matchers is not None: body["artifact_matchers"] = [v.as_dict() for v in artifact_matchers] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -10525,8 +10525,8 @@ def create( if storage_root is not None: body["storage_root"] = storage_root headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/catalogs", body=body, headers=headers) @@ -10550,7 +10550,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/catalogs/{name}", query=query, headers=headers) @@ -10574,7 +10574,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> CatalogInf if include_browse is not None: query["include_browse"] = include_browse headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/catalogs/{name}", query=query, headers=headers) @@ -10619,7 +10619,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -10685,8 +10685,8 @@ def update( if properties is not None: body["properties"] = properties headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/catalogs/{name}", body=body, headers=headers) @@ -10752,8 +10752,8 @@ def create( if read_only is not None: body["read_only"] = read_only headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/connections", body=body, headers=headers) @@ -10771,7 +10771,7 @@ def delete(self, name: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/connections/{name}", headers=headers) @@ -10788,7 +10788,7 @@ def get(self, name: str) -> ConnectionInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/connections/{name}", headers=headers) @@ -10816,7 +10816,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -10856,8 +10856,8 @@ def update( if owner is not None: body["owner"] = owner headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/connections/{name}", body=body, headers=headers) @@ -10940,8 +10940,8 @@ def create_credential( if skip_validation is not None: body["skip_validation"] = skip_validation headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/credentials", body=body, headers=headers) @@ -10966,7 +10966,7 @@ def delete_credential(self, name_arg: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/credentials/{name_arg}", query=query, headers=headers) @@ -11000,8 +11000,8 @@ def generate_temporary_service_credential( if gcp_options is not None: body["gcp_options"] = gcp_options.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/temporary-service-credentials", body=body, headers=headers) @@ -11020,7 +11020,7 @@ def get_credential(self, name_arg: str) -> CredentialInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/credentials/{name_arg}", headers=headers) @@ -11062,7 +11062,7 @@ def list_credentials( if purpose is not None: query["purpose"] = purpose.value headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -11150,8 +11150,8 @@ def update_credential( if skip_validation is not None: body["skip_validation"] = skip_validation headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/credentials/{name_arg}", body=body, headers=headers) @@ -11224,8 +11224,8 @@ def validate_credential( if url is not None: body["url"] = url headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/validate-credentials", body=body, headers=headers) @@ -11309,8 +11309,8 @@ def create( if url is not None: body["url"] = url headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/external-locations", body=body, headers=headers) @@ -11334,7 +11334,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/external-locations/{name}", query=query, headers=headers) @@ -11358,7 +11358,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> ExternalLo if include_browse is not None: query["include_browse"] = include_browse headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/external-locations/{name}", query=query, headers=headers) @@ -11399,7 +11399,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -11492,8 +11492,8 @@ def update( if url is not None: body["url"] = url headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/external-locations/{name}", body=body, headers=headers) @@ -11530,8 +11530,8 @@ def create(self, function_info: CreateFunction) -> FunctionInfo: if function_info is not None: body["function_info"] = function_info.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/functions", body=body, headers=headers) @@ -11559,7 +11559,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/functions/{name}", query=query, headers=headers) @@ -11588,7 +11588,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> FunctionIn if include_browse is not None: query["include_browse"] = include_browse headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/functions/{name}", query=query, headers=headers) @@ -11641,7 +11641,7 @@ def list( if schema_name is not None: query["schema_name"] = schema_name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -11675,8 +11675,8 @@ def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: if owner is not None: body["owner"] = owner headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/functions/{name}", body=body, headers=headers) @@ -11716,7 +11716,7 @@ def get(self, securable_type: SecurableType, full_name: str, *, principal: Optio if principal is not None: query["principal"] = principal headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -11749,7 +11749,7 @@ def get_effective( if principal is not None: query["principal"] = principal headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -11780,8 +11780,8 @@ def update( if changes is not None: body["changes"] = [v.as_dict() for v in changes] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -11832,8 +11832,8 @@ def assign(self, workspace_id: int, metastore_id: str, default_catalog_name: str if metastore_id is not None: body["metastore_id"] = metastore_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore", body=body, headers=headers) @@ -11865,8 +11865,8 @@ def create(self, name: str, *, region: Optional[str] = None, storage_root: Optio if storage_root is not None: body["storage_root"] = storage_root headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/metastores", body=body, headers=headers) @@ -11881,7 +11881,7 @@ def current(self) -> MetastoreAssignment: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/unity-catalog/current-metastore-assignment", headers=headers) @@ -11904,7 +11904,7 @@ def delete(self, id: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/metastores/{id}", query=query, headers=headers) @@ -11922,7 +11922,7 @@ def get(self, id: str) -> MetastoreInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/metastores/{id}", headers=headers) @@ -11938,7 +11938,7 @@ def list(self) -> Iterator[MetastoreInfo]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.1/unity-catalog/metastores", headers=headers) @@ -11955,7 +11955,7 @@ def summary(self) -> GetMetastoreSummaryResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/unity-catalog/metastore_summary", headers=headers) @@ -11978,7 +11978,7 @@ def unassign(self, workspace_id: int, metastore_id: str): if metastore_id is not None: query["metastore_id"] = metastore_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -12040,8 +12040,8 @@ def update( if storage_root_credential_id is not None: body["storage_root_credential_id"] = storage_root_credential_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/metastores/{id}", body=body, headers=headers) @@ -12073,8 +12073,8 @@ def update_assignment( if metastore_id is not None: body["metastore_id"] = metastore_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore", body=body, headers=headers) @@ -12148,7 +12148,7 @@ def get( if include_browse is not None: query["include_browse"] = include_browse headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -12179,7 +12179,7 @@ def get_by_alias(self, full_name: str, alias: str, *, include_aliases: Optional[ if include_aliases is not None: query["include_aliases"] = include_aliases headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -12234,7 +12234,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -12272,8 +12272,8 @@ def update(self, full_name: str, version: int, *, comment: Optional[str] = None) if comment is not None: body["comment"] = comment headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -12302,8 +12302,8 @@ def create(self, *, table: Optional[OnlineTable] = None) -> Wait[OnlineTable]: """ body = table.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.0/online-tables", body=body, headers=headers) @@ -12328,7 +12328,7 @@ def delete(self, name: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/online-tables/{name}", headers=headers) @@ -12345,7 +12345,7 @@ def get(self, name: str) -> OnlineTable: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/online-tables/{name}", headers=headers) @@ -12483,8 +12483,8 @@ def create( if warehouse_id is not None: body["warehouse_id"] = warehouse_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", body=body, headers=headers) @@ -12536,7 +12536,7 @@ def get(self, table_name: str) -> MonitorInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", headers=headers) @@ -12563,7 +12563,7 @@ def get_refresh(self, table_name: str, refresh_id: str) -> MonitorRefreshInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -12590,7 +12590,7 @@ def list_refreshes(self, table_name: str) -> MonitorRefreshListResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", headers=headers) @@ -12623,8 +12623,8 @@ def regenerate_dashboard( if warehouse_id is not None: body["warehouse_id"] = warehouse_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -12652,7 +12652,7 @@ def run_refresh(self, table_name: str) -> MonitorRefreshInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", headers=headers) @@ -12744,8 +12744,8 @@ def update( if time_series is not None: body["time_series"] = time_series.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", body=body, headers=headers) @@ -12827,8 +12827,8 @@ def create( if storage_location is not None: body["storage_location"] = storage_location headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/models", body=body, headers=headers) @@ -12902,7 +12902,7 @@ def get( if include_browse is not None: query["include_browse"] = include_browse headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/models/{full_name}", query=query, headers=headers) @@ -12971,7 +12971,7 @@ def list( if schema_name is not None: query["schema_name"] = schema_name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -13005,8 +13005,8 @@ def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredM if version_num is not None: body["version_num"] = version_num headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -13051,8 +13051,8 @@ def update( if owner is not None: body["owner"] = owner headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/models/{full_name}", body=body, headers=headers) @@ -13089,7 +13089,7 @@ def get_quota(self, parent_securable_type: str, parent_full_name: str, quota_nam """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -13121,7 +13121,7 @@ def list_quotas( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -13184,8 +13184,8 @@ def create( if storage_root is not None: body["storage_root"] = storage_root headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/schemas", body=body, headers=headers) @@ -13209,7 +13209,7 @@ def delete(self, full_name: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/schemas/{full_name}", query=query, headers=headers) @@ -13233,7 +13233,7 @@ def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> Schem if include_browse is not None: query["include_browse"] = include_browse headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/schemas/{full_name}", query=query, headers=headers) @@ -13280,7 +13280,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -13338,8 +13338,8 @@ def update( if properties is not None: body["properties"] = properties headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/schemas/{full_name}", body=body, headers=headers) @@ -13419,8 +13419,8 @@ def create( if skip_validation is not None: body["skip_validation"] = skip_validation headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/storage-credentials", body=body, headers=headers) @@ -13444,7 +13444,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): if force is not None: query["force"] = force headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/storage-credentials/{name}", query=query, headers=headers) @@ -13462,7 +13462,7 @@ def get(self, name: str) -> StorageCredentialInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/storage-credentials/{name}", headers=headers) @@ -13496,7 +13496,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -13585,8 +13585,8 @@ def update( if skip_validation is not None: body["skip_validation"] = skip_validation headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/storage-credentials/{name}", body=body, headers=headers) @@ -13658,8 +13658,8 @@ def validate( if url is not None: body["url"] = url headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/validate-storage-credentials", body=body, headers=headers) @@ -13688,7 +13688,7 @@ def disable(self, metastore_id: str, schema_name: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -13710,7 +13710,7 @@ def enable(self, metastore_id: str, schema_name: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -13744,7 +13744,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -13802,8 +13802,8 @@ def create(self, full_name_arg: str, constraint: TableConstraint) -> TableConstr if full_name_arg is not None: body["full_name_arg"] = full_name_arg headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/constraints", body=body, headers=headers) @@ -13838,7 +13838,7 @@ def delete(self, full_name: str, constraint_name: str, cascade: bool): if constraint_name is not None: query["constraint_name"] = constraint_name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/constraints/{full_name}", query=query, headers=headers) @@ -13872,7 +13872,7 @@ def delete(self, full_name: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.1/unity-catalog/tables/{full_name}", headers=headers) @@ -13894,7 +13894,7 @@ def exists(self, full_name: str) -> TableExistsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{full_name}/exists", headers=headers) @@ -13937,7 +13937,7 @@ def get( if include_manifest_capabilities is not None: query["include_manifest_capabilities"] = include_manifest_capabilities headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{full_name}", query=query, headers=headers) @@ -14016,7 +14016,7 @@ def list( if schema_name is not None: query["schema_name"] = schema_name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -14087,7 +14087,7 @@ def list_summaries( if table_name_pattern is not None: query["table_name_pattern"] = table_name_pattern headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -14119,8 +14119,8 @@ def update(self, full_name: str, *, owner: Optional[str] = None): if owner is not None: body["owner"] = owner headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.1/unity-catalog/tables/{full_name}", body=body, headers=headers) @@ -14167,8 +14167,8 @@ def generate_temporary_table_credentials( if table_id is not None: body["table_id"] = table_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/unity-catalog/temporary-table-credentials", body=body, headers=headers) @@ -14247,8 +14247,8 @@ def create( if volume_type is not None: body["volume_type"] = volume_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/volumes", body=body, headers=headers) @@ -14332,7 +14332,7 @@ def list( if schema_name is not None: query["schema_name"] = schema_name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -14366,7 +14366,7 @@ def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInf if include_browse is not None: query["include_browse"] = include_browse headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/volumes/{name}", query=query, headers=headers) @@ -14404,8 +14404,8 @@ def update( if owner is not None: body["owner"] = owner headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/volumes/{name}", body=body, headers=headers) @@ -14444,7 +14444,7 @@ def get(self, name: str) -> CurrentWorkspaceBindings: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}", headers=headers) @@ -14484,7 +14484,7 @@ def get_bindings( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -14528,8 +14528,8 @@ def update( if unassign_workspaces is not None: body["unassign_workspaces"] = [v for v in unassign_workspaces] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -14567,8 +14567,8 @@ def update_bindings( if remove is not None: body["remove"] = [v.as_dict() for v in remove] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( diff --git a/databricks/sdk/cleanrooms/v2/impl.py b/databricks/sdk/cleanrooms/v2/impl.py index 94c4910d7..5814fddce 100755 --- a/databricks/sdk/cleanrooms/v2/impl.py +++ b/databricks/sdk/cleanrooms/v2/impl.py @@ -1758,8 +1758,8 @@ def create(self, clean_room_name: str, *, asset: Optional[CleanRoomAsset] = None """ body = asset.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/clean-rooms/{clean_room_name}/assets", body=body, headers=headers) @@ -1781,7 +1781,7 @@ def delete(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, asse """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -1806,7 +1806,7 @@ def get(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, asset_f """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -1831,7 +1831,7 @@ def list(self, clean_room_name: str, *, page_token: Optional[str] = None) -> Ite if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1875,8 +1875,8 @@ def update( """ body = asset.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1926,7 +1926,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1964,8 +1964,8 @@ def create(self, *, clean_room: Optional[CleanRoom] = None) -> CleanRoom: """ body = clean_room.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/clean-rooms", body=body, headers=headers) @@ -1986,8 +1986,8 @@ def create_output_catalog( """ body = output_catalog.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2009,7 +2009,7 @@ def delete(self, name: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/clean-rooms/{name}", headers=headers) @@ -2025,7 +2025,7 @@ def get(self, name: str) -> CleanRoom: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/clean-rooms/{name}", headers=headers) @@ -2051,7 +2051,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -2081,8 +2081,8 @@ def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanR if clean_room is not None: body["clean_room"] = clean_room.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/clean-rooms/{name}", body=body, headers=headers) diff --git a/databricks/sdk/compute/v2/impl.py b/databricks/sdk/compute/v2/impl.py index 3c4c4c771..cbfbc882b 100755 --- a/databricks/sdk/compute/v2/impl.py +++ b/databricks/sdk/compute/v2/impl.py @@ -9717,8 +9717,8 @@ def create( if policy_family_id is not None: body["policy_family_id"] = policy_family_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/policies/clusters/create", body=body, headers=headers) @@ -9738,8 +9738,8 @@ def delete(self, policy_id: str): if policy_id is not None: body["policy_id"] = policy_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/policies/clusters/delete", body=body, headers=headers) @@ -9813,8 +9813,8 @@ def edit( if policy_id is not None: body["policy_id"] = policy_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/policies/clusters/edit", body=body, headers=headers) @@ -9834,7 +9834,7 @@ def get(self, policy_id: str) -> Policy: if policy_id is not None: query["policy_id"] = policy_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/policies/clusters/get", query=query, headers=headers) @@ -9852,7 +9852,7 @@ def get_permission_levels(self, cluster_policy_id: str) -> GetClusterPolicyPermi """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -9873,7 +9873,7 @@ def get_permissions(self, cluster_policy_id: str) -> ClusterPolicyPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/cluster-policies/{cluster_policy_id}", headers=headers) @@ -9902,7 +9902,7 @@ def list( if sort_order is not None: query["sort_order"] = sort_order.value headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/policies/clusters/list", query=query, headers=headers) @@ -9927,8 +9927,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -9954,8 +9954,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -10008,8 +10008,8 @@ def change_owner(self, cluster_id: str, owner_username: str): if owner_username is not None: body["owner_username"] = owner_username headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.1/clusters/change-owner", body=body, headers=headers) @@ -10296,8 +10296,8 @@ def create( if workload_type is not None: body["workload_type"] = workload_type.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.1/clusters/create", body=body, headers=headers) @@ -10395,8 +10395,8 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: if cluster_id is not None: body["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.1/clusters/delete", body=body, headers=headers) @@ -10686,8 +10686,8 @@ def edit( if workload_type is not None: body["workload_type"] = workload_type.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.1/clusters/edit", body=body, headers=headers) @@ -10816,8 +10816,8 @@ def events( if start_time is not None: body["start_time"] = start_time headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } while True: @@ -10845,7 +10845,7 @@ def get(self, cluster_id: str) -> ClusterDetails: if cluster_id is not None: query["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/clusters/get", query=query, headers=headers) @@ -10863,7 +10863,7 @@ def get_permission_levels(self, cluster_id: str) -> GetClusterPermissionLevelsRe """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/clusters/{cluster_id}/permissionLevels", headers=headers) @@ -10881,7 +10881,7 @@ def get_permissions(self, cluster_id: str) -> ClusterPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/clusters/{cluster_id}", headers=headers) @@ -10924,7 +10924,7 @@ def list( if sort_by is not None: query["sort_by"] = sort_by.as_dict() headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -10945,7 +10945,7 @@ def list_node_types(self) -> ListNodeTypesResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/clusters/list-node-types", headers=headers) @@ -10961,7 +10961,7 @@ def list_zones(self) -> ListAvailableZonesResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/clusters/list-zones", headers=headers) @@ -10985,8 +10985,8 @@ def permanent_delete(self, cluster_id: str): if cluster_id is not None: body["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.1/clusters/permanent-delete", body=body, headers=headers) @@ -11005,8 +11005,8 @@ def pin(self, cluster_id: str): if cluster_id is not None: body["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.1/clusters/pin", body=body, headers=headers) @@ -11046,8 +11046,8 @@ def resize( if num_workers is not None: body["num_workers"] = num_workers headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.1/clusters/resize", body=body, headers=headers) @@ -11085,8 +11085,8 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai if restart_user is not None: body["restart_user"] = restart_user headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.1/clusters/restart", body=body, headers=headers) @@ -11117,8 +11117,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/clusters/{cluster_id}", body=body, headers=headers) @@ -11133,7 +11133,7 @@ def spark_versions(self) -> GetSparkVersionsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/clusters/spark-versions", headers=headers) @@ -11159,8 +11159,8 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: if cluster_id is not None: body["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.1/clusters/start", body=body, headers=headers) @@ -11186,8 +11186,8 @@ def unpin(self, cluster_id: str): if cluster_id is not None: body["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.1/clusters/unpin", body=body, headers=headers) @@ -11236,8 +11236,8 @@ def update( if update_mask is not None: body["update_mask"] = update_mask headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.1/clusters/update", body=body, headers=headers) @@ -11272,8 +11272,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/permissions/clusters/{cluster_id}", body=body, headers=headers) @@ -11312,8 +11312,8 @@ def cancel( if context_id is not None: body["contextId"] = context_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/1.2/commands/cancel", body=body, headers=headers) @@ -11357,7 +11357,7 @@ def command_status(self, cluster_id: str, context_id: str, command_id: str) -> C if context_id is not None: query["contextId"] = context_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/1.2/commands/status", query=query, headers=headers) @@ -11380,7 +11380,7 @@ def context_status(self, cluster_id: str, context_id: str) -> ContextStatusRespo if context_id is not None: query["contextId"] = context_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/1.2/contexts/status", query=query, headers=headers) @@ -11409,8 +11409,8 @@ def create( if language is not None: body["language"] = language.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/1.2/contexts/create", body=body, headers=headers) @@ -11442,8 +11442,8 @@ def destroy(self, cluster_id: str, context_id: str): if context_id is not None: body["contextId"] = context_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/1.2/contexts/destroy", body=body, headers=headers) @@ -11484,8 +11484,8 @@ def execute( if language is not None: body["language"] = language.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/1.2/commands/execute", body=body, headers=headers) @@ -11559,8 +11559,8 @@ def create( if script is not None: body["script"] = script headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/global-init-scripts", body=body, headers=headers) @@ -11578,7 +11578,7 @@ def delete(self, script_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/global-init-scripts/{script_id}", headers=headers) @@ -11595,7 +11595,7 @@ def get(self, script_id: str) -> GlobalInitScriptDetailsWithContent: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/global-init-scripts/{script_id}", headers=headers) @@ -11612,7 +11612,7 @@ def list(self) -> Iterator[GlobalInitScriptDetails]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/global-init-scripts", headers=headers) @@ -11658,8 +11658,8 @@ def update( if script is not None: body["script"] = script headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.0/global-init-scripts/{script_id}", body=body, headers=headers) @@ -11782,8 +11782,8 @@ def create( if preloaded_spark_versions is not None: body["preloaded_spark_versions"] = [v for v in preloaded_spark_versions] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/instance-pools/create", body=body, headers=headers) @@ -11803,8 +11803,8 @@ def delete(self, instance_pool_id: str): if instance_pool_id is not None: body["instance_pool_id"] = instance_pool_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/instance-pools/delete", body=body, headers=headers) @@ -11870,8 +11870,8 @@ def edit( if node_type_id is not None: body["node_type_id"] = node_type_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/instance-pools/edit", body=body, headers=headers) @@ -11891,7 +11891,7 @@ def get(self, instance_pool_id: str) -> GetInstancePool: if instance_pool_id is not None: query["instance_pool_id"] = instance_pool_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/instance-pools/get", query=query, headers=headers) @@ -11909,7 +11909,7 @@ def get_permission_levels(self, instance_pool_id: str) -> GetInstancePoolPermiss """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -11930,7 +11930,7 @@ def get_permissions(self, instance_pool_id: str) -> InstancePoolPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", headers=headers) @@ -11945,7 +11945,7 @@ def list(self) -> Iterator[InstancePoolAndStats]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/instance-pools/list", headers=headers) @@ -11970,8 +11970,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", body=body, headers=headers) @@ -11995,8 +11995,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -12063,8 +12063,8 @@ def add( if skip_validation is not None: body["skip_validation"] = skip_validation headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/instance-profiles/add", body=body, headers=headers) @@ -12117,8 +12117,8 @@ def edit( if is_meta_instance_profile is not None: body["is_meta_instance_profile"] = is_meta_instance_profile headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/instance-profiles/edit", body=body, headers=headers) @@ -12134,7 +12134,7 @@ def list(self) -> Iterator[InstanceProfile]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/instance-profiles/list", headers=headers) @@ -12158,8 +12158,8 @@ def remove(self, instance_profile_arn: str): if instance_profile_arn is not None: body["instance_profile_arn"] = instance_profile_arn headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/instance-profiles/remove", body=body, headers=headers) @@ -12193,7 +12193,7 @@ def all_cluster_statuses(self) -> Iterator[ClusterLibraryStatuses]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/libraries/all-cluster-statuses", headers=headers) @@ -12219,7 +12219,7 @@ def cluster_status(self, cluster_id: str) -> Iterator[LibraryFullStatus]: if cluster_id is not None: query["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/libraries/cluster-status", query=query, headers=headers) @@ -12245,8 +12245,8 @@ def install(self, cluster_id: str, libraries: List[Library]): if libraries is not None: body["libraries"] = [v.as_dict() for v in libraries] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/libraries/install", body=body, headers=headers) @@ -12270,8 +12270,8 @@ def uninstall(self, cluster_id: str, libraries: List[Library]): if libraries is not None: body["libraries"] = [v.as_dict() for v in libraries] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/libraries/uninstall", body=body, headers=headers) @@ -12321,8 +12321,8 @@ def enforce_compliance( if validate_only is not None: body["validate_only"] = validate_only headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/policies/clusters/enforce-compliance", body=body, headers=headers) @@ -12344,7 +12344,7 @@ def get_compliance(self, cluster_id: str) -> GetClusterComplianceResponse: if cluster_id is not None: query["cluster_id"] = cluster_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/policies/clusters/get-compliance", query=query, headers=headers) @@ -12378,7 +12378,7 @@ def list_compliance( if policy_id is not None: query["policy_id"] = policy_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -12422,7 +12422,7 @@ def get(self, policy_family_id: str, *, version: Optional[int] = None) -> Policy if version is not None: query["version"] = version headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/policy-families/{policy_family_id}", query=query, headers=headers) @@ -12448,7 +12448,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: diff --git a/databricks/sdk/dashboards/v2/impl.py b/databricks/sdk/dashboards/v2/impl.py index 4dd4bf3a3..2f87368d1 100755 --- a/databricks/sdk/dashboards/v2/impl.py +++ b/databricks/sdk/dashboards/v2/impl.py @@ -2556,8 +2556,8 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W if content is not None: body["content"] = content headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do( @@ -2602,7 +2602,7 @@ def execute_message_attachment_query( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2630,7 +2630,7 @@ def execute_message_query( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2665,7 +2665,7 @@ def generate_download_full_query_result( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2708,7 +2708,7 @@ def get_download_full_query_result( if transient_statement_id is not None: query["transient_statement_id"] = transient_statement_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2735,7 +2735,7 @@ def get_message(self, space_id: str, conversation_id: str, message_id: str) -> G """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2766,7 +2766,7 @@ def get_message_attachment_query_result( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2795,7 +2795,7 @@ def get_message_query_result( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2826,7 +2826,7 @@ def get_message_query_result_by_attachment( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2848,7 +2848,7 @@ def get_space(self, space_id: str) -> GenieSpace: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", headers=headers) @@ -2872,8 +2872,8 @@ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: if content is not None: body["content"] = content headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do( @@ -2909,8 +2909,8 @@ def create(self, *, dashboard: Optional[Dashboard] = None) -> Dashboard: """ body = dashboard.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/lakeview/dashboards", body=body, headers=headers) @@ -2927,8 +2927,8 @@ def create_schedule(self, dashboard_id: str, *, schedule: Optional[Schedule] = N """ body = schedule.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/lakeview/dashboards/{dashboard_id}/schedules", body=body, headers=headers) @@ -2949,8 +2949,8 @@ def create_subscription( """ body = subscription.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2979,7 +2979,7 @@ def delete_schedule(self, dashboard_id: str, schedule_id: str, *, etag: Optional if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -3011,7 +3011,7 @@ def delete_subscription( if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -3033,7 +3033,7 @@ def get(self, dashboard_id: str) -> Dashboard: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers) @@ -3051,7 +3051,7 @@ def get_published(self, dashboard_id: str) -> PublishedDashboard: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers) @@ -3069,7 +3069,7 @@ def get_schedule(self, dashboard_id: str, schedule_id: str) -> Schedule: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3091,7 +3091,7 @@ def get_subscription(self, dashboard_id: str, schedule_id: str, subscription_id: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3135,7 +3135,7 @@ def list( if view is not None: query["view"] = view.value headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3169,7 +3169,7 @@ def list_schedules( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3207,7 +3207,7 @@ def list_subscriptions( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3258,8 +3258,8 @@ def migrate( if update_parameter_syntax is not None: body["update_parameter_syntax"] = update_parameter_syntax headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/lakeview/dashboards/migrate", body=body, headers=headers) @@ -3288,8 +3288,8 @@ def publish( if warehouse_id is not None: body["warehouse_id"] = warehouse_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", body=body, headers=headers) @@ -3307,7 +3307,7 @@ def trash(self, dashboard_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers) @@ -3324,7 +3324,7 @@ def unpublish(self, dashboard_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers) @@ -3342,8 +3342,8 @@ def update(self, dashboard_id: str, *, dashboard: Optional[Dashboard] = None) -> """ body = dashboard.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/lakeview/dashboards/{dashboard_id}", body=body, headers=headers) @@ -3362,8 +3362,8 @@ def update_schedule(self, dashboard_id: str, schedule_id: str, *, schedule: Opti """ body = schedule.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3390,7 +3390,7 @@ def get_published_dashboard_embedded(self, dashboard_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published/embedded", headers=headers) @@ -3423,7 +3423,7 @@ def cancel_published_query_execution( if tokens is not None: query["tokens"] = [v for v in tokens] headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("DELETE", "/api/2.0/lakeview-query/query/published", query=query, headers=headers) @@ -3452,8 +3452,8 @@ def execute_published_dashboard_query( if override_warehouse_id is not None: body["override_warehouse_id"] = override_warehouse_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/lakeview-query/query/published", body=body, headers=headers) @@ -3479,7 +3479,7 @@ def poll_published_query_status( if tokens is not None: query["tokens"] = [v for v in tokens] headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/lakeview-query/query/published", query=query, headers=headers) diff --git a/databricks/sdk/files/v2/impl.py b/databricks/sdk/files/v2/impl.py index e9e897eca..5c78e21d5 100755 --- a/databricks/sdk/files/v2/impl.py +++ b/databricks/sdk/files/v2/impl.py @@ -759,8 +759,8 @@ def add_block(self, handle: int, data: str): if handle is not None: body["handle"] = handle headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/dbfs/add-block", body=body, headers=headers) @@ -780,8 +780,8 @@ def close(self, handle: int): if handle is not None: body["handle"] = handle headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/dbfs/close", body=body, headers=headers) @@ -811,8 +811,8 @@ def create(self, path: str, *, overwrite: Optional[bool] = None) -> CreateRespon if path is not None: body["path"] = path headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/dbfs/create", body=body, headers=headers) @@ -850,8 +850,8 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): if recursive is not None: body["recursive"] = recursive headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/dbfs/delete", body=body, headers=headers) @@ -872,7 +872,7 @@ def get_status(self, path: str) -> FileInfo: if path is not None: query["path"] = path headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/dbfs/get-status", query=query, headers=headers) @@ -901,7 +901,7 @@ def list(self, path: str) -> Iterator[FileInfo]: if path is not None: query["path"] = path headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/dbfs/list", query=query, headers=headers) @@ -925,8 +925,8 @@ def mkdirs(self, path: str): if path is not None: body["path"] = path headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/dbfs/mkdirs", body=body, headers=headers) @@ -952,8 +952,8 @@ def move(self, source_path: str, destination_path: str): if source_path is not None: body["source_path"] = source_path headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/dbfs/move", body=body, headers=headers) @@ -989,8 +989,8 @@ def put(self, path: str, *, contents: Optional[str] = None, overwrite: Optional[ if path is not None: body["path"] = path headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/dbfs/put", body=body, headers=headers) @@ -1025,7 +1025,7 @@ def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] if path is not None: query["path"] = path headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/dbfs/read", query=query, headers=headers) @@ -1121,7 +1121,7 @@ def download(self, file_path: str) -> DownloadResponse: """ headers = { - "0": "{Accept application/octet-stream}", + "Accept": "application/octet-stream", } response_headers = [ "{content_length}", @@ -1222,7 +1222,7 @@ def list_directory_contents( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1260,7 +1260,7 @@ def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool if overwrite is not None: query["overwrite"] = overwrite headers = { - "0": "{Content-Type application/octet-stream}", + "Content-Type": "application/octet-stream", } self._api.do( diff --git a/databricks/sdk/iam/v2/impl.py b/databricks/sdk/iam/v2/impl.py index 9922e34fa..132580aa9 100755 --- a/databricks/sdk/iam/v2/impl.py +++ b/databricks/sdk/iam/v2/impl.py @@ -2087,7 +2087,7 @@ def check_policy( if resource_info is not None: query["resource_info"] = resource_info.as_dict() headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/access-control/check-policy-v2", query=query, headers=headers) @@ -2118,7 +2118,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles if resource is not None: query["resource"] = resource headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2154,7 +2154,7 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: if name is not None: query["name"] = name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2183,8 +2183,8 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR if rule_set is not None: body["rule_set"] = rule_set.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2220,7 +2220,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles if resource is not None: query["resource"] = resource headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2253,7 +2253,7 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: if name is not None: query["name"] = name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/preview/accounts/access-control/rule-sets", query=query, headers=headers) @@ -2277,8 +2277,8 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR if rule_set is not None: body["rule_set"] = rule_set.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", "/api/2.0/preview/accounts/access-control/rule-sets", body=body, headers=headers) @@ -2354,8 +2354,8 @@ def create( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2390,7 +2390,7 @@ def get(self, id: str) -> Group: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", headers=headers) @@ -2450,7 +2450,7 @@ def list( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -2492,7 +2492,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do( @@ -2555,7 +2555,7 @@ def update( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}", body=body, headers=headers) @@ -2630,8 +2630,8 @@ def create( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2668,7 +2668,7 @@ def get(self, id: str) -> ServicePrincipal: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2730,7 +2730,7 @@ def list( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -2775,7 +2775,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do( @@ -2844,7 +2844,7 @@ def update( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do( @@ -2942,8 +2942,8 @@ def create( if user_name is not None: body["userName"] = user_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3025,7 +3025,7 @@ def get( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3088,7 +3088,7 @@ def list( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -3130,7 +3130,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do( @@ -3207,7 +3207,7 @@ def update( if user_name is not None: body["userName"] = user_name headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}", body=body, headers=headers) @@ -3228,7 +3228,7 @@ def me(self) -> User: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/preview/scim/v2/Me", headers=headers) @@ -3304,8 +3304,8 @@ def create( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/scim/v2/Groups", body=body, headers=headers) @@ -3338,7 +3338,7 @@ def get(self, id: str) -> Group: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Groups/{id}", headers=headers) @@ -3398,7 +3398,7 @@ def list( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -3438,7 +3438,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -3499,7 +3499,7 @@ def update( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -3542,8 +3542,8 @@ def migrate_permissions( if workspace_id is not None: body["workspace_id"] = workspace_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/permissionmigration", body=body, headers=headers) @@ -3621,7 +3621,7 @@ def get(self, request_object_type: str, request_object_id: str) -> ObjectPermiss """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/{request_object_type}/{request_object_id}", headers=headers) @@ -3641,7 +3641,7 @@ def get_permission_levels(self, request_object_type: str, request_object_id: str """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3676,8 +3676,8 @@ def set( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3711,8 +3711,8 @@ def update( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3790,8 +3790,8 @@ def create( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/scim/v2/ServicePrincipals", body=body, headers=headers) @@ -3824,7 +3824,7 @@ def get(self, id: str) -> ServicePrincipal: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", headers=headers) @@ -3884,7 +3884,7 @@ def list( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -3924,7 +3924,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -3988,7 +3988,7 @@ def update( if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -4081,8 +4081,8 @@ def create( if user_name is not None: body["userName"] = user_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/scim/v2/Users", body=body, headers=headers) @@ -4162,7 +4162,7 @@ def get( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Users/{id}", query=query, headers=headers) @@ -4177,7 +4177,7 @@ def get_permission_levels(self) -> GetPasswordPermissionLevelsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords/permissionLevels", headers=headers) @@ -4192,7 +4192,7 @@ def get_permissions(self) -> PasswordPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords", headers=headers) @@ -4253,7 +4253,7 @@ def list( if start_index is not None: query["startIndex"] = start_index headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -4293,7 +4293,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O if schemas is not None: body["schemas"] = [v.value for v in schemas] headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -4314,8 +4314,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) @@ -4391,7 +4391,7 @@ def update( if user_name is not None: body["userName"] = user_name headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -4411,8 +4411,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) @@ -4441,7 +4441,7 @@ def delete(self, workspace_id: int, principal_id: int): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -4462,7 +4462,7 @@ def get(self, workspace_id: int) -> WorkspacePermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -4484,7 +4484,7 @@ def list(self, workspace_id: int) -> Iterator[PermissionAssignment]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do( @@ -4520,8 +4520,8 @@ def update( if permissions is not None: body["permissions"] = [v.value for v in permissions] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( diff --git a/databricks/sdk/jobs/v2/impl.py b/databricks/sdk/jobs/v2/impl.py index c0b660253..a5df4379b 100755 --- a/databricks/sdk/jobs/v2/impl.py +++ b/databricks/sdk/jobs/v2/impl.py @@ -15,297 +15,6 @@ # all definitions in this file are in alphabetical order -@dataclass -class Adlsgen2Info: - """A storage location in Adls Gen2""" - - destination: str - """abfss destination, e.g. - `abfss://@.dfs.core.windows.net/`.""" - - def as_dict(self) -> dict: - """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: - """Deserializes the Adlsgen2Info from a dictionary.""" - return cls(destination=d.get("destination", None)) - - -@dataclass -class AutoScale: - max_workers: Optional[int] = None - """The maximum number of workers to which the cluster can scale up when overloaded. Note that - `max_workers` must be strictly greater than `min_workers`.""" - - min_workers: Optional[int] = None - """The minimum number of workers to which the cluster can scale down when underutilized. It is also - the initial number of workers the cluster will have after creation.""" - - def as_dict(self) -> dict: - """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.max_workers is not None: - body["max_workers"] = self.max_workers - if self.min_workers is not None: - body["min_workers"] = self.min_workers - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" - body = {} - if self.max_workers is not None: - body["max_workers"] = self.max_workers - if self.min_workers is not None: - body["min_workers"] = self.min_workers - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AutoScale: - """Deserializes the AutoScale from a dictionary.""" - return cls(max_workers=d.get("max_workers", None), min_workers=d.get("min_workers", None)) - - -@dataclass -class AwsAttributes: - """Attributes set during cluster creation which are related to Amazon Web Services.""" - - availability: Optional[AwsAvailability] = None - """Availability type used for all subsequent nodes past the `first_on_demand` ones. - - Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - ebs_volume_count: Optional[int] = None - """The number of volumes launched for each instance. Users can choose up to 10 volumes. This - feature is only enabled for supported node types. Legacy node types cannot specify custom EBS - volumes. For node types with no instance store, at least one EBS volume needs to be specified; - otherwise, cluster creation will fail. - - These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. Instance store volumes will be - mounted at `/local_disk0`, `/local_disk1`, and etc. - - If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for - scratch storage because heterogenously sized scratch devices can lead to inefficient disk - utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance - store volumes. - - Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` - will be overridden.""" - - ebs_volume_iops: Optional[int] = None - """If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance - of a gp2 volume with the same volume size will be used.""" - - ebs_volume_size: Optional[int] = None - """The size of each EBS volume (in GiB) launched for each instance. For general purpose SSD, this - value must be within the range 100 - 4096. For throughput optimized HDD, this value must be - within the range 500 - 4096.""" - - ebs_volume_throughput: Optional[int] = None - """If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum - performance of a gp2 volume with the same volume size will be used.""" - - ebs_volume_type: Optional[EbsVolumeType] = None - """The type of EBS volumes that will be launched with this cluster.""" - - first_on_demand: Optional[int] = None - """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. If this - value is greater than 0, the cluster driver node in particular will be placed on an on-demand - instance. If this value is greater than or equal to the current cluster size, all nodes will be - placed on on-demand instances. If this value is less than the current cluster size, - `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed - on `availability` instances. Note that this value does not affect cluster size and cannot - currently be mutated over the lifetime of a cluster.""" - - instance_profile_arn: Optional[str] = None - """Nodes for this cluster will only be placed on AWS instances with this instance profile. If - ommitted, nodes will be placed on instances without an IAM instance profile. The instance - profile must have previously been added to the Databricks environment by an account - administrator. - - This feature may only be available to certain customer plans.""" - - spot_bid_price_percent: Optional[int] = None - """The bid price for AWS spot instances, as a percentage of the corresponding instance type's - on-demand price. For example, if this field is set to 50, and the cluster needs a new - `r3.xlarge` spot instance, then the bid price is half of the price of on-demand `r3.xlarge` - instances. Similarly, if this field is set to 200, the bid price is twice the price of on-demand - `r3.xlarge` instances. If not specified, the default value is 100. When spot instances are - requested for this cluster, only spot instances whose bid price percentage matches this field - will be considered. Note that, for safety, we enforce this field to be no more than 10000.""" - - zone_id: Optional[str] = None - """Identifier for the availability zone/datacenter in which the cluster resides. This string will - be of a form like "us-west-2a". The provided availability zone must be in the same region as the - Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks - deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and - if not specified, a default zone will be used. If the zone specified is "auto", will try to - place cluster in a zone with high availability, and will retry placement in a different AZ if - there is not enough capacity. - - The list of available zones as well as the default value can be found by using the `List Zones` - method.""" - - def as_dict(self) -> dict: - """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.availability is not None: - body["availability"] = self.availability.value - if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count - if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops - if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size - if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput - if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type.value - if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand - if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn - if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent - if self.zone_id is not None: - body["zone_id"] = self.zone_id - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.availability is not None: - body["availability"] = self.availability - if self.ebs_volume_count is not None: - body["ebs_volume_count"] = self.ebs_volume_count - if self.ebs_volume_iops is not None: - body["ebs_volume_iops"] = self.ebs_volume_iops - if self.ebs_volume_size is not None: - body["ebs_volume_size"] = self.ebs_volume_size - if self.ebs_volume_throughput is not None: - body["ebs_volume_throughput"] = self.ebs_volume_throughput - if self.ebs_volume_type is not None: - body["ebs_volume_type"] = self.ebs_volume_type - if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand - if self.instance_profile_arn is not None: - body["instance_profile_arn"] = self.instance_profile_arn - if self.spot_bid_price_percent is not None: - body["spot_bid_price_percent"] = self.spot_bid_price_percent - if self.zone_id is not None: - body["zone_id"] = self.zone_id - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: - """Deserializes the AwsAttributes from a dictionary.""" - return cls( - availability=_enum(d, "availability", AwsAvailability), - ebs_volume_count=d.get("ebs_volume_count", None), - ebs_volume_iops=d.get("ebs_volume_iops", None), - ebs_volume_size=d.get("ebs_volume_size", None), - ebs_volume_throughput=d.get("ebs_volume_throughput", None), - ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), - first_on_demand=d.get("first_on_demand", None), - instance_profile_arn=d.get("instance_profile_arn", None), - spot_bid_price_percent=d.get("spot_bid_price_percent", None), - zone_id=d.get("zone_id", None), - ) - - -class AwsAvailability(Enum): - """Availability type used for all subsequent nodes past the `first_on_demand` ones. - - Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - ON_DEMAND = "ON_DEMAND" - SPOT = "SPOT" - SPOT_WITH_FALLBACK = "SPOT_WITH_FALLBACK" - - -@dataclass -class AzureAttributes: - """Attributes set during cluster creation which are related to Microsoft Azure.""" - - availability: Optional[AzureAvailability] = None - """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If - `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - first_on_demand: Optional[int] = None - """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This - value should be greater than 0, to make sure the cluster driver node is placed on an on-demand - instance. If this value is greater than or equal to the current cluster size, all nodes will be - placed on on-demand instances. If this value is less than the current cluster size, - `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed - on `availability` instances. Note that this value does not affect cluster size and cannot - currently be mutated over the lifetime of a cluster.""" - - log_analytics_info: Optional[LogAnalyticsInfo] = None - """Defines values necessary to configure and run Azure Log Analytics agent""" - - spot_bid_max_price: Optional[float] = None - """The max bid price to be used for Azure spot instances. The Max price for the bid cannot be - higher than the on-demand price of the instance. If not specified, the default value is -1, - which specifies that the instance cannot be evicted on the basis of price, and only on the basis - of availability. Further, the value should > 0 or -1.""" - - def as_dict(self) -> dict: - """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.availability is not None: - body["availability"] = self.availability.value - if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand - if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info.as_dict() - if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price - return body - - def as_shallow_dict(self) -> dict: - """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.availability is not None: - body["availability"] = self.availability - if self.first_on_demand is not None: - body["first_on_demand"] = self.first_on_demand - if self.log_analytics_info: - body["log_analytics_info"] = self.log_analytics_info - if self.spot_bid_max_price is not None: - body["spot_bid_max_price"] = self.spot_bid_max_price - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: - """Deserializes the AzureAttributes from a dictionary.""" - return cls( - availability=_enum(d, "availability", AzureAvailability), - first_on_demand=d.get("first_on_demand", None), - log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), - spot_bid_max_price=d.get("spot_bid_max_price", None), - ) - - -class AzureAvailability(Enum): - """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If - `first_on_demand` is zero, this availability type will be used for the entire cluster.""" - - ON_DEMAND_AZURE = "ON_DEMAND_AZURE" - SPOT_AZURE = "SPOT_AZURE" - SPOT_WITH_FALLBACK_AZURE = "SPOT_WITH_FALLBACK_AZURE" - - @dataclass class BaseJob: created_time: Optional[int] = None @@ -978,38 +687,6 @@ def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTaskCleanRoomsNoteboo ) -@dataclass -class ClientsTypes: - jobs: Optional[bool] = None - """With jobs set, the cluster can be used for jobs""" - - notebooks: Optional[bool] = None - """With notebooks set, this cluster can be used for notebooks""" - - def as_dict(self) -> dict: - """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.jobs is not None: - body["jobs"] = self.jobs - if self.notebooks is not None: - body["notebooks"] = self.notebooks - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.jobs is not None: - body["jobs"] = self.jobs - if self.notebooks is not None: - body["notebooks"] = self.notebooks - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: - """Deserializes the ClientsTypes from a dictionary.""" - return cls(jobs=d.get("jobs", None), notebooks=d.get("notebooks", None)) - - @dataclass class ClusterInstance: cluster_id: Optional[str] = None @@ -1053,56 +730,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterInstance: return cls(cluster_id=d.get("cluster_id", None), spark_context_id=d.get("spark_context_id", None)) -@dataclass -class ClusterLogConf: - """Cluster log delivery config""" - - dbfs: Optional[DbfsStorageInfo] = None - """destination needs to be provided. e.g. `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } - }`""" - - s3: Optional[S3StorageInfo] = None - """destination and either the region or endpoint need to be provided. e.g. `{ "s3": { "destination" - : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` Cluster iam role is used to - access s3, please make sure the cluster iam role in `instance_profile_arn` has permission to - write data to the s3 destination.""" - - volumes: Optional[VolumesStorageInfo] = None - """destination needs to be provided, e.g. `{ "volumes": { "destination": - "/Volumes/catalog/schema/volume/cluster_log" } }`""" - - def as_dict(self) -> dict: - """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() - if self.s3: - body["s3"] = self.s3.as_dict() - if self.volumes: - body["volumes"] = self.volumes.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" - body = {} - if self.dbfs: - body["dbfs"] = self.dbfs - if self.s3: - body["s3"] = self.s3 - if self.volumes: - body["volumes"] = self.volumes - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: - """Deserializes the ClusterLogConf from a dictionary.""" - return cls( - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), - ) - - @dataclass class ClusterSpec: existing_cluster_id: Optional[str] = None @@ -1638,71 +1265,6 @@ def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: ) -class DataSecurityMode(Enum): - """Data security mode decides what data governance model to use when accessing data from a cluster. - - The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: - Databricks will choose the most appropriate access mode depending on your compute configuration. - * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: - Alias for `SINGLE_USER`. - - The following modes can be used regardless of `kind`. * `NONE`: No security isolation for - multiple users sharing the cluster. Data governance features are not available in this mode. * - `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in - `single_user_name`. Most programming languages, cluster features and data governance features - are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple - users. Cluster users are fully isolated so that they cannot see each other's data and - credentials. Most data governance features are supported in this mode. But programming languages - and cluster features might be limited. - - The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for - future Databricks Runtime versions: - - * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * - `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high - concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that - doesn’t have UC nor passthrough enabled.""" - - DATA_SECURITY_MODE_AUTO = "DATA_SECURITY_MODE_AUTO" - DATA_SECURITY_MODE_DEDICATED = "DATA_SECURITY_MODE_DEDICATED" - DATA_SECURITY_MODE_STANDARD = "DATA_SECURITY_MODE_STANDARD" - LEGACY_PASSTHROUGH = "LEGACY_PASSTHROUGH" - LEGACY_SINGLE_USER = "LEGACY_SINGLE_USER" - LEGACY_SINGLE_USER_STANDARD = "LEGACY_SINGLE_USER_STANDARD" - LEGACY_TABLE_ACL = "LEGACY_TABLE_ACL" - NONE = "NONE" - SINGLE_USER = "SINGLE_USER" - USER_ISOLATION = "USER_ISOLATION" - - -@dataclass -class DbfsStorageInfo: - """A storage location in DBFS""" - - destination: str - """dbfs destination, e.g. `dbfs:/my/path`""" - - def as_dict(self) -> dict: - """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: - """Deserializes the DbfsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) - - @dataclass class DbtOutput: artifacts_headers: Optional[Dict[str, str]] = None @@ -1911,78 +1473,6 @@ def from_dict(cls, d: Dict[str, Any]) -> DeleteRunResponse: return cls() -@dataclass -class DockerBasicAuth: - password: Optional[str] = None - """Password of the user""" - - username: Optional[str] = None - """Name of the user""" - - def as_dict(self) -> dict: - """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.password is not None: - body["password"] = self.password - if self.username is not None: - body["username"] = self.username - return body - - def as_shallow_dict(self) -> dict: - """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" - body = {} - if self.password is not None: - body["password"] = self.password - if self.username is not None: - body["username"] = self.username - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: - """Deserializes the DockerBasicAuth from a dictionary.""" - return cls(password=d.get("password", None), username=d.get("username", None)) - - -@dataclass -class DockerImage: - basic_auth: Optional[DockerBasicAuth] = None - """Basic auth with username and password""" - - url: Optional[str] = None - """URL of the docker image.""" - - def as_dict(self) -> dict: - """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.basic_auth: - body["basic_auth"] = self.basic_auth.as_dict() - if self.url is not None: - body["url"] = self.url - return body - - def as_shallow_dict(self) -> dict: - """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" - body = {} - if self.basic_auth: - body["basic_auth"] = self.basic_auth - if self.url is not None: - body["url"] = self.url - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> DockerImage: - """Deserializes the DockerImage from a dictionary.""" - return cls(basic_auth=_from_dict(d, "basic_auth", DockerBasicAuth), url=d.get("url", None)) - - -class EbsVolumeType(Enum): - """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for - details.""" - - GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" - THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" - - @dataclass class EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Represents a change to the job cluster's settings that would be required for the job clusters to @@ -2425,124 +1915,6 @@ class Format(Enum): SINGLE_TASK = "SINGLE_TASK" -@dataclass -class GcpAttributes: - """Attributes set during cluster creation which are related to GCP.""" - - availability: Optional[GcpAvailability] = None - """This field determines whether the spark executors will be scheduled to run on preemptible VMs, - on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" - - boot_disk_size: Optional[int] = None - """Boot disk size in GB""" - - google_service_account: Optional[str] = None - """If provided, the cluster will impersonate the google service account when accessing gcloud - services (like GCS). The google service account must have previously been added to the - Databricks environment by an account administrator.""" - - local_ssd_count: Optional[int] = None - """If provided, each node (workers and driver) in the cluster will have this number of local SSDs - attached. Each local SSD is 375GB in size. Refer to [GCP documentation] for the supported number - of local SSDs for each instance type. - - [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds""" - - use_preemptible_executors: Optional[bool] = None - """This field determines whether the spark executors will be scheduled to run on preemptible VMs - (when set to true) versus standard compute engine VMs (when set to false; default). Note: Soon - to be deprecated, use the 'availability' field instead.""" - - zone_id: Optional[str] = None - """Identifier for the availability zone in which the cluster resides. This can be one of the - following: - "HA" => High availability, spread nodes across availability zones for a Databricks - deployment region [default]. - "AUTO" => Databricks picks an availability zone to schedule the - cluster on. - A GCP availability zone => Pick One of the available zones for (machine type + - region) from https://cloud.google.com/compute/docs/regions-zones.""" - - def as_dict(self) -> dict: - """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.availability is not None: - body["availability"] = self.availability.value - if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size - if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account - if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count - if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors - if self.zone_id is not None: - body["zone_id"] = self.zone_id - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" - body = {} - if self.availability is not None: - body["availability"] = self.availability - if self.boot_disk_size is not None: - body["boot_disk_size"] = self.boot_disk_size - if self.google_service_account is not None: - body["google_service_account"] = self.google_service_account - if self.local_ssd_count is not None: - body["local_ssd_count"] = self.local_ssd_count - if self.use_preemptible_executors is not None: - body["use_preemptible_executors"] = self.use_preemptible_executors - if self.zone_id is not None: - body["zone_id"] = self.zone_id - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: - """Deserializes the GcpAttributes from a dictionary.""" - return cls( - availability=_enum(d, "availability", GcpAvailability), - boot_disk_size=d.get("boot_disk_size", None), - google_service_account=d.get("google_service_account", None), - local_ssd_count=d.get("local_ssd_count", None), - use_preemptible_executors=d.get("use_preemptible_executors", None), - zone_id=d.get("zone_id", None), - ) - - -class GcpAvailability(Enum): - """This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or - preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" - - ON_DEMAND_GCP = "ON_DEMAND_GCP" - PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" - PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" - - -@dataclass -class GcsStorageInfo: - """A storage location in Google Cloud Platform's GCS""" - - destination: str - """GCS destination/URI, e.g. `gs://my-bucket/some-prefix`""" - - def as_dict(self) -> dict: - """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: - """Deserializes the GcsStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) - - @dataclass class GenAiComputeTask: """Next field: 9""" @@ -2829,90 +2201,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GitSource: ) -@dataclass -class InitScriptInfo: - """Config for an individual init script Next ID: 11""" - - abfss: Optional[Adlsgen2Info] = None - """destination needs to be provided, e.g. - `abfss://@.dfs.core.windows.net/`""" - - dbfs: Optional[DbfsStorageInfo] = None - """destination needs to be provided. e.g. `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } - }`""" - - file: Optional[LocalFileInfo] = None - """destination needs to be provided, e.g. `{ "file": { "destination": "file:/my/local/file.sh" } }`""" - - gcs: Optional[GcsStorageInfo] = None - """destination needs to be provided, e.g. `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }`""" - - s3: Optional[S3StorageInfo] = None - """destination and either the region or endpoint need to be provided. e.g. `{ \"s3\": { - \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` Cluster iam - role is used to access s3, please make sure the cluster iam role in `instance_profile_arn` has - permission to write data to the s3 destination.""" - - volumes: Optional[VolumesStorageInfo] = None - """destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" : - \"/Volumes/my-init.sh\" } }`""" - - workspace: Optional[WorkspaceStorageInfo] = None - """destination needs to be provided, e.g. `{ "workspace": { "destination": - "/cluster-init-scripts/setup-datadog.sh" } }`""" - - def as_dict(self) -> dict: - """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.abfss: - body["abfss"] = self.abfss.as_dict() - if self.dbfs: - body["dbfs"] = self.dbfs.as_dict() - if self.file: - body["file"] = self.file.as_dict() - if self.gcs: - body["gcs"] = self.gcs.as_dict() - if self.s3: - body["s3"] = self.s3.as_dict() - if self.volumes: - body["volumes"] = self.volumes.as_dict() - if self.workspace: - body["workspace"] = self.workspace.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.abfss: - body["abfss"] = self.abfss - if self.dbfs: - body["dbfs"] = self.dbfs - if self.file: - body["file"] = self.file - if self.gcs: - body["gcs"] = self.gcs - if self.s3: - body["s3"] = self.s3 - if self.volumes: - body["volumes"] = self.volumes - if self.workspace: - body["workspace"] = self.workspace - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: - """Deserializes the InitScriptInfo from a dictionary.""" - return cls( - abfss=_from_dict(d, "abfss", Adlsgen2Info), - dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), - file=_from_dict(d, "file", LocalFileInfo), - gcs=_from_dict(d, "gcs", GcsStorageInfo), - s3=_from_dict(d, "s3", S3StorageInfo), - volumes=_from_dict(d, "volumes", VolumesStorageInfo), - workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), - ) - - @dataclass class Job: """Job was retrieved successfully.""" @@ -3128,7 +2416,7 @@ class JobCluster: `JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution.""" - new_cluster: JobsClusterSpec + new_cluster: ClusterSpec """If new_cluster, a description of a cluster that is created for each task.""" def as_dict(self) -> dict: @@ -3153,7 +2441,7 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> JobCluster: """Deserializes the JobCluster from a dictionary.""" return cls( - job_cluster_key=d.get("job_cluster_key", None), new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec) + job_cluster_key=d.get("job_cluster_key", None), new_cluster=_from_dict(d, "new_cluster", ClusterSpec) ) @@ -3988,369 +3276,6 @@ class JobSourceDirtyState(Enum): NOT_SYNCED = "NOT_SYNCED" -@dataclass -class JobsClusterSpec: - """Contains a snapshot of the latest user specified settings that were used to create/edit the - cluster.""" - - apply_policy_default_values: Optional[bool] = None - """When set to true, fixed and default values from the policy will be used for fields that are - omitted. When set to false, only fixed values from the policy will be applied.""" - - autoscale: Optional[AutoScale] = None - """Parameters needed in order to automatically scale clusters up and down based on load. Note: - autoscaling works best with DB runtime versions 3.0 or later.""" - - autotermination_minutes: Optional[int] = None - """Automatically terminates the cluster after it is inactive for this time in minutes. If not set, - this cluster will not be automatically terminated. If specified, the threshold must be between - 10 and 10000 minutes. Users can also set this value to 0 to explicitly disable automatic - termination.""" - - aws_attributes: Optional[AwsAttributes] = None - """Attributes related to clusters running on Amazon Web Services. If not specified at cluster - creation, a set of default values will be used.""" - - azure_attributes: Optional[AzureAttributes] = None - """Attributes related to clusters running on Microsoft Azure. If not specified at cluster creation, - a set of default values will be used.""" - - cluster_log_conf: Optional[ClusterLogConf] = None - """The configuration for delivering spark logs to a long-term storage destination. Three kinds of - destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be - specified for one cluster. If the conf is given, the logs will be delivered to the destination - every `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while the - destination of executor logs is `$destination/$clusterId/executor`.""" - - cluster_name: Optional[str] = None - """Cluster name requested by the user. This doesn't have to be unique. If not specified at - creation, the cluster name will be an empty string.""" - - custom_tags: Optional[Dict[str, str]] = None - """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS - instances and EBS volumes) with these tags in addition to `default_tags`. Notes: - - - Currently, Databricks allows at most 45 custom tags - - - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster - tags""" - - data_security_mode: Optional[DataSecurityMode] = None - """Data security mode decides what data governance model to use when accessing data from a cluster. - - The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: - Databricks will choose the most appropriate access mode depending on your compute configuration. - * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: - Alias for `SINGLE_USER`. - - The following modes can be used regardless of `kind`. * `NONE`: No security isolation for - multiple users sharing the cluster. Data governance features are not available in this mode. * - `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in - `single_user_name`. Most programming languages, cluster features and data governance features - are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple - users. Cluster users are fully isolated so that they cannot see each other's data and - credentials. Most data governance features are supported in this mode. But programming languages - and cluster features might be limited. - - The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for - future Databricks Runtime versions: - - * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * - `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high - concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that - doesn’t have UC nor passthrough enabled.""" - - docker_image: Optional[DockerImage] = None - """Custom docker image BYOC""" - - driver_instance_pool_id: Optional[str] = None - """The optional ID of the instance pool for the driver of the cluster belongs. The pool cluster - uses the instance pool with id (instance_pool_id) if the driver pool is not assigned.""" - - driver_node_type_id: Optional[str] = None - """The node type of the Spark driver. Note that this field is optional; if unset, the driver node - type will be set as the same value as `node_type_id` defined above. - - This field, along with node_type_id, should not be set if virtual_cluster_size is set. If both - driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id - and node_type_id take precedence.""" - - enable_elastic_disk: Optional[bool] = None - """Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk - space when its Spark workers are running low on disk space. This feature requires specific AWS - permissions to function correctly - refer to the User Guide for more details.""" - - enable_local_disk_encryption: Optional[bool] = None - """Whether to enable LUKS on cluster VMs' local disks""" - - gcp_attributes: Optional[GcpAttributes] = None - """Attributes related to clusters running on Google Cloud Platform. If not specified at cluster - creation, a set of default values will be used.""" - - init_scripts: Optional[List[InitScriptInfo]] = None - """The configuration for storing init scripts. Any number of destinations can be specified. The - scripts are executed sequentially in the order provided. If `cluster_log_conf` is specified, - init script logs are sent to `//init_scripts`.""" - - instance_pool_id: Optional[str] = None - """The optional ID of the instance pool to which the cluster belongs.""" - - is_single_node: Optional[bool] = None - """This field can only be used when `kind = CLASSIC_PREVIEW`. - - When set to true, Databricks will automatically set single node related `custom_tags`, - `spark_conf`, and `num_workers`""" - - kind: Optional[Kind] = None - """The kind of compute described by this compute specification. - - Depending on `kind`, different validations and default values will be applied. - - Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no - specified `kind` do not. * [is_single_node](/api/workspace/clusters/create#is_single_node) * - [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) * - [data_security_mode](/api/workspace/clusters/create#data_security_mode) set to - `DATA_SECURITY_MODE_AUTO`, `DATA_SECURITY_MODE_DEDICATED`, or `DATA_SECURITY_MODE_STANDARD` - - By using the [simple form], your clusters are automatically using `kind = CLASSIC_PREVIEW`. - - [simple form]: https://docs.databricks.com/compute/simple-form.html""" - - node_type_id: Optional[str] = None - """This field encodes, through a single value, the resources available to each of the Spark nodes - in this cluster. For example, the Spark nodes can be provisioned and optimized for memory or - compute intensive workloads. A list of available node types can be retrieved by using the - :method:clusters/listNodeTypes API call.""" - - num_workers: Optional[int] = None - """Number of worker nodes that this cluster should have. A cluster has one Spark Driver and - `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. - - Note: When reading the properties of a cluster, this field reflects the desired number of - workers rather than the actual current number of workers. For instance, if a cluster is resized - from 5 to 10 workers, this field will immediately be updated to reflect the target size of 10 - workers, whereas the workers listed in `spark_info` will gradually increase from 5 to 10 as the - new nodes are provisioned.""" - - policy_id: Optional[str] = None - """The ID of the cluster policy used to create the cluster if applicable.""" - - runtime_engine: Optional[RuntimeEngine] = None - """Determines the cluster's runtime engine, either standard or Photon. - - This field is not compatible with legacy `spark_version` values that contain `-photon-`. Remove - `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. - - If left unspecified, the runtime engine defaults to standard unless the spark_version contains - -photon-, in which case Photon will be used.""" - - single_user_name: Optional[str] = None - """Single user name if data_security_mode is `SINGLE_USER`""" - - spark_conf: Optional[Dict[str, str]] = None - """An object containing a set of optional, user-specified Spark configuration key-value pairs. - Users can also pass in a string of extra JVM options to the driver and the executors via - `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively.""" - - spark_env_vars: Optional[Dict[str, str]] = None - """An object containing a set of optional, user-specified environment variable key-value pairs. - Please note that key-value pair of the form (X,Y) will be exported as is (i.e., `export X='Y'`) - while launching the driver and workers. - - In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending them - to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all default - databricks managed environmental variables are included as well. - - Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": - "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS - -Dspark.shuffle.service.enabled=true"}`""" - - spark_version: Optional[str] = None - """The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of available Spark versions can - be retrieved by using the :method:clusters/sparkVersions API call.""" - - ssh_public_keys: Optional[List[str]] = None - """SSH public key contents that will be added to each Spark node in this cluster. The corresponding - private keys can be used to login with the user name `ubuntu` on port `2200`. Up to 10 keys can - be specified.""" - - use_ml_runtime: Optional[bool] = None - """This field can only be used when `kind = CLASSIC_PREVIEW`. - - `effective_spark_version` is determined by `spark_version` (DBR release), this field - `use_ml_runtime`, and whether `node_type_id` is gpu node or not.""" - - workload_type: Optional[WorkloadType] = None - """Cluster Attributes showing for clusters workload types.""" - - def as_dict(self) -> dict: - """Serializes the JobsClusterSpec into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values - if self.autoscale: - body["autoscale"] = self.autoscale.as_dict() - if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes - if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes.as_dict() - if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes.as_dict() - if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf.as_dict() - if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name - if self.custom_tags: - body["custom_tags"] = self.custom_tags - if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode.value - if self.docker_image: - body["docker_image"] = self.docker_image.as_dict() - if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id - if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id - if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk - if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption - if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes.as_dict() - if self.init_scripts: - body["init_scripts"] = [v.as_dict() for v in self.init_scripts] - if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id - if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node - if self.kind is not None: - body["kind"] = self.kind.value - if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id - if self.num_workers is not None: - body["num_workers"] = self.num_workers - if self.policy_id is not None: - body["policy_id"] = self.policy_id - if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine.value - if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name - if self.spark_conf: - body["spark_conf"] = self.spark_conf - if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars - if self.spark_version is not None: - body["spark_version"] = self.spark_version - if self.ssh_public_keys: - body["ssh_public_keys"] = [v for v in self.ssh_public_keys] - if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime - if self.workload_type: - body["workload_type"] = self.workload_type.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the JobsClusterSpec into a shallow dictionary of its immediate attributes.""" - body = {} - if self.apply_policy_default_values is not None: - body["apply_policy_default_values"] = self.apply_policy_default_values - if self.autoscale: - body["autoscale"] = self.autoscale - if self.autotermination_minutes is not None: - body["autotermination_minutes"] = self.autotermination_minutes - if self.aws_attributes: - body["aws_attributes"] = self.aws_attributes - if self.azure_attributes: - body["azure_attributes"] = self.azure_attributes - if self.cluster_log_conf: - body["cluster_log_conf"] = self.cluster_log_conf - if self.cluster_name is not None: - body["cluster_name"] = self.cluster_name - if self.custom_tags: - body["custom_tags"] = self.custom_tags - if self.data_security_mode is not None: - body["data_security_mode"] = self.data_security_mode - if self.docker_image: - body["docker_image"] = self.docker_image - if self.driver_instance_pool_id is not None: - body["driver_instance_pool_id"] = self.driver_instance_pool_id - if self.driver_node_type_id is not None: - body["driver_node_type_id"] = self.driver_node_type_id - if self.enable_elastic_disk is not None: - body["enable_elastic_disk"] = self.enable_elastic_disk - if self.enable_local_disk_encryption is not None: - body["enable_local_disk_encryption"] = self.enable_local_disk_encryption - if self.gcp_attributes: - body["gcp_attributes"] = self.gcp_attributes - if self.init_scripts: - body["init_scripts"] = self.init_scripts - if self.instance_pool_id is not None: - body["instance_pool_id"] = self.instance_pool_id - if self.is_single_node is not None: - body["is_single_node"] = self.is_single_node - if self.kind is not None: - body["kind"] = self.kind - if self.node_type_id is not None: - body["node_type_id"] = self.node_type_id - if self.num_workers is not None: - body["num_workers"] = self.num_workers - if self.policy_id is not None: - body["policy_id"] = self.policy_id - if self.runtime_engine is not None: - body["runtime_engine"] = self.runtime_engine - if self.single_user_name is not None: - body["single_user_name"] = self.single_user_name - if self.spark_conf: - body["spark_conf"] = self.spark_conf - if self.spark_env_vars: - body["spark_env_vars"] = self.spark_env_vars - if self.spark_version is not None: - body["spark_version"] = self.spark_version - if self.ssh_public_keys: - body["ssh_public_keys"] = self.ssh_public_keys - if self.use_ml_runtime is not None: - body["use_ml_runtime"] = self.use_ml_runtime - if self.workload_type: - body["workload_type"] = self.workload_type - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> JobsClusterSpec: - """Deserializes the JobsClusterSpec from a dictionary.""" - return cls( - apply_policy_default_values=d.get("apply_policy_default_values", None), - autoscale=_from_dict(d, "autoscale", AutoScale), - autotermination_minutes=d.get("autotermination_minutes", None), - aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), - azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), - cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), - cluster_name=d.get("cluster_name", None), - custom_tags=d.get("custom_tags", None), - data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), - docker_image=_from_dict(d, "docker_image", DockerImage), - driver_instance_pool_id=d.get("driver_instance_pool_id", None), - driver_node_type_id=d.get("driver_node_type_id", None), - enable_elastic_disk=d.get("enable_elastic_disk", None), - enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), - gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), - init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), - instance_pool_id=d.get("instance_pool_id", None), - is_single_node=d.get("is_single_node", None), - kind=_enum(d, "kind", Kind), - node_type_id=d.get("node_type_id", None), - num_workers=d.get("num_workers", None), - policy_id=d.get("policy_id", None), - runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), - single_user_name=d.get("single_user_name", None), - spark_conf=d.get("spark_conf", None), - spark_env_vars=d.get("spark_env_vars", None), - spark_version=d.get("spark_version", None), - ssh_public_keys=d.get("ssh_public_keys", None), - use_ml_runtime=d.get("use_ml_runtime", None), - workload_type=_from_dict(d, "workload_type", WorkloadType), - ) - - class JobsHealthMetric(Enum): """Specifies the health metric that is being evaluated for a particular health rule. @@ -4452,24 +3377,6 @@ def from_dict(cls, d: Dict[str, Any]) -> JobsHealthRules: return cls(rules=_repeated_dict(d, "rules", JobsHealthRule)) -class Kind(Enum): - """The kind of compute described by this compute specification. - - Depending on `kind`, different validations and default values will be applied. - - Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no - specified `kind` do not. * [is_single_node](/api/workspace/clusters/create#is_single_node) * - [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) * - [data_security_mode](/api/workspace/clusters/create#data_security_mode) set to - `DATA_SECURITY_MODE_AUTO`, `DATA_SECURITY_MODE_DEDICATED`, or `DATA_SECURITY_MODE_STANDARD` - - By using the [simple form], your clusters are automatically using `kind = CLASSIC_PREVIEW`. - - [simple form]: https://docs.databricks.com/compute/simple-form.html""" - - CLASSIC_PREVIEW = "CLASSIC_PREVIEW" - - @dataclass class Library: cran: Optional[RCranLibrary] = None @@ -4709,64 +3616,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: ) -@dataclass -class LocalFileInfo: - destination: str - """local file destination, e.g. `file:/my/local/file.sh`""" - - def as_dict(self) -> dict: - """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: - """Deserializes the LocalFileInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) - - -@dataclass -class LogAnalyticsInfo: - log_analytics_primary_key: Optional[str] = None - - log_analytics_workspace_id: Optional[str] = None - - def as_dict(self) -> dict: - """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key - if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id - return body - - def as_shallow_dict(self) -> dict: - """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.log_analytics_primary_key is not None: - body["log_analytics_primary_key"] = self.log_analytics_primary_key - if self.log_analytics_workspace_id is not None: - body["log_analytics_workspace_id"] = self.log_analytics_workspace_id - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: - """Deserializes the LogAnalyticsInfo from a dictionary.""" - return cls( - log_analytics_primary_key=d.get("log_analytics_primary_key", None), - log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), - ) - - @dataclass class MavenLibrary: coordinates: str @@ -7647,102 +6496,6 @@ class RunType(Enum): WORKFLOW_RUN = "WORKFLOW_RUN" -class RuntimeEngine(Enum): - - NULL = "NULL" - PHOTON = "PHOTON" - STANDARD = "STANDARD" - - -@dataclass -class S3StorageInfo: - """A storage location in Amazon S3""" - - destination: str - """S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using cluster - iam role, please make sure you set cluster iam role and the role has write access to the - destination. Please also note that you cannot use AWS keys to deliver logs.""" - - canned_acl: Optional[str] = None - """(Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. If - `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on - the destination bucket and prefix. The full list of possible canned acl can be found at - http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. Please also note - that by default only the object owner gets full controls. If you are using cross account role - for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to - read the logs.""" - - enable_encryption: Optional[bool] = None - """(Optional) Flag to enable server side encryption, `false` by default.""" - - encryption_type: Optional[str] = None - """(Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when - encryption is enabled and the default type is `sse-s3`.""" - - endpoint: Optional[str] = None - """S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be - set. If both are set, endpoint will be used.""" - - kms_key: Optional[str] = None - """(Optional) Kms key which will be used if encryption is enabled and encryption type is set to - `sse-kms`.""" - - region: Optional[str] = None - """S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, - endpoint will be used.""" - - def as_dict(self) -> dict: - """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl - if self.destination is not None: - body["destination"] = self.destination - if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption - if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type - if self.endpoint is not None: - body["endpoint"] = self.endpoint - if self.kms_key is not None: - body["kms_key"] = self.kms_key - if self.region is not None: - body["region"] = self.region - return body - - def as_shallow_dict(self) -> dict: - """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.canned_acl is not None: - body["canned_acl"] = self.canned_acl - if self.destination is not None: - body["destination"] = self.destination - if self.enable_encryption is not None: - body["enable_encryption"] = self.enable_encryption - if self.encryption_type is not None: - body["encryption_type"] = self.encryption_type - if self.endpoint is not None: - body["endpoint"] = self.endpoint - if self.kms_key is not None: - body["kms_key"] = self.kms_key - if self.region is not None: - body["region"] = self.region - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: - """Deserializes the S3StorageInfo from a dictionary.""" - return cls( - canned_acl=d.get("canned_acl", None), - destination=d.get("destination", None), - enable_encryption=d.get("enable_encryption", None), - encryption_type=d.get("encryption_type", None), - endpoint=d.get("endpoint", None), - kms_key=d.get("kms_key", None), - region=d.get("region", None), - ) - - class Source(Enum): """Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\ from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a @@ -8741,7 +7494,7 @@ class SubmitTask: """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[JobsClusterSpec] = None + new_cluster: Optional[ClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8931,7 +7684,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), health=_from_dict(d, "health", JobsHealthRules), libraries=_repeated_dict(d, "libraries", Library), - new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), + new_cluster=_from_dict(d, "new_cluster", ClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), @@ -9077,7 +7830,7 @@ class Task: """An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.""" - new_cluster: Optional[JobsClusterSpec] = None + new_cluster: Optional[ClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -9298,7 +8051,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Task: libraries=_repeated_dict(d, "libraries", Library), max_retries=d.get("max_retries", None), min_retry_interval_millis=d.get("min_retry_interval_millis", None), - new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), + new_cluster=_from_dict(d, "new_cluster", ClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), @@ -9871,34 +8624,6 @@ class ViewsToExport(Enum): DASHBOARDS = "DASHBOARDS" -@dataclass -class VolumesStorageInfo: - """A storage location back by UC Volumes.""" - - destination: str - """UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` or - `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`""" - - def as_dict(self) -> dict: - """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: - """Deserializes the VolumesStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) - - @dataclass class Webhook: id: str @@ -9994,60 +8719,6 @@ def from_dict(cls, d: Dict[str, Any]) -> WebhookNotifications: ) -@dataclass -class WorkloadType: - """Cluster Attributes showing for clusters workload types.""" - - clients: ClientsTypes - """defined what type of clients can use the cluster. E.g. Notebooks, Jobs""" - - def as_dict(self) -> dict: - """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.clients: - body["clients"] = self.clients.as_dict() - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" - body = {} - if self.clients: - body["clients"] = self.clients - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: - """Deserializes the WorkloadType from a dictionary.""" - return cls(clients=_from_dict(d, "clients", ClientsTypes)) - - -@dataclass -class WorkspaceStorageInfo: - """A storage location in Workspace Filesystem (WSFS)""" - - destination: str - """wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh`""" - - def as_dict(self) -> dict: - """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - def as_shallow_dict(self) -> dict: - """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" - body = {} - if self.destination is not None: - body["destination"] = self.destination - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: - """Deserializes the WorkspaceStorageInfo from a dictionary.""" - return cls(destination=d.get("destination", None)) - - class JobsAPI: """The Jobs API allows you to create, edit, and delete jobs. @@ -10088,7 +8759,7 @@ def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Opt if job_id is not None: body["job_id"] = job_id headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.2/jobs/runs/cancel-all", body=body, headers=headers) @@ -10110,7 +8781,7 @@ def cancel_run(self, run_id: int) -> Wait[Run]: if run_id is not None: body["run_id"] = run_id headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.2/jobs/runs/cancel", body=body, headers=headers) @@ -10298,8 +8969,8 @@ def create( if webhook_notifications is not None: body["webhook_notifications"] = webhook_notifications.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.2/jobs/create", body=body, headers=headers) @@ -10319,7 +8990,7 @@ def delete(self, job_id: int): if job_id is not None: body["job_id"] = job_id headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.2/jobs/delete", body=body, headers=headers) @@ -10338,7 +9009,7 @@ def delete_run(self, run_id: int): if run_id is not None: body["run_id"] = run_id headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.2/jobs/runs/delete", body=body, headers=headers) @@ -10362,7 +9033,7 @@ def export_run(self, run_id: int, *, views_to_export: Optional[ViewsToExport] = if views_to_export is not None: query["views_to_export"] = views_to_export.value headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.2/jobs/runs/export", query=query, headers=headers) @@ -10395,7 +9066,7 @@ def get(self, job_id: int, *, page_token: Optional[str] = None) -> Job: if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.2/jobs/get", query=query, headers=headers) @@ -10413,7 +9084,7 @@ def get_permission_levels(self, job_id: str) -> GetJobPermissionLevelsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/jobs/{job_id}/permissionLevels", headers=headers) @@ -10431,7 +9102,7 @@ def get_permissions(self, job_id: str) -> JobPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/jobs/{job_id}", headers=headers) @@ -10479,7 +9150,7 @@ def get_run( if run_id is not None: query["run_id"] = run_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.2/jobs/runs/get", query=query, headers=headers) @@ -10507,7 +9178,7 @@ def get_run_output(self, run_id: int) -> RunOutput: if run_id is not None: query["run_id"] = run_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.2/jobs/runs/get-output", query=query, headers=headers) @@ -10556,7 +9227,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -10641,7 +9312,7 @@ def list_runs( if start_time_to is not None: query["start_time_to"] = start_time_to headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -10791,8 +9462,8 @@ def repair_run( if sql_params is not None: body["sql_params"] = sql_params headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.2/jobs/runs/repair", body=body, headers=headers) @@ -10858,7 +9529,7 @@ def reset(self, job_id: int, new_settings: JobSettings): if new_settings is not None: body["new_settings"] = new_settings.as_dict() headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.2/jobs/reset", body=body, headers=headers) @@ -11012,8 +9683,8 @@ def run_now( if sql_params is not None: body["sql_params"] = sql_params headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.2/jobs/run-now", body=body, headers=headers) @@ -11077,8 +9748,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/jobs/{job_id}", body=body, headers=headers) @@ -11191,8 +9862,8 @@ def submit( if webhook_notifications is not None: body["webhook_notifications"] = webhook_notifications.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.2/jobs/runs/submit", body=body, headers=headers) @@ -11273,7 +9944,7 @@ def update( if new_settings is not None: body["new_settings"] = new_settings.as_dict() headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.2/jobs/update", body=body, headers=headers) @@ -11295,8 +9966,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/permissions/jobs/{job_id}", body=body, headers=headers) @@ -11340,8 +10011,8 @@ def enforce_compliance( if validate_only is not None: body["validate_only"] = validate_only headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/policies/jobs/enforce-compliance", body=body, headers=headers) @@ -11364,7 +10035,7 @@ def get_compliance(self, job_id: int) -> GetPolicyComplianceResponse: if job_id is not None: query["job_id"] = job_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/policies/jobs/get-compliance", query=query, headers=headers) @@ -11399,7 +10070,7 @@ def list_compliance( if policy_id is not None: query["policy_id"] = policy_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: diff --git a/databricks/sdk/marketplace/v2/impl.py b/databricks/sdk/marketplace/v2/impl.py index c9d6ccc53..d249c3966 100755 --- a/databricks/sdk/marketplace/v2/impl.py +++ b/databricks/sdk/marketplace/v2/impl.py @@ -3529,7 +3529,7 @@ def get( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3566,7 +3566,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3623,8 +3623,8 @@ def create( if share_name is not None: body["share_name"] = share_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3644,7 +3644,7 @@ def delete(self, listing_id: str, installation_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -3672,7 +3672,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3704,7 +3704,7 @@ def list_listing_installations( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3749,8 +3749,8 @@ def update( if rotate_token is not None: body["rotate_token"] = rotate_token headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3783,7 +3783,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetListingsRespo if ids is not None: query["ids"] = [v for v in ids] headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/marketplace-consumer/listings:batchGet", query=query, headers=headers) @@ -3800,7 +3800,7 @@ def get(self, id: str) -> GetListingResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/marketplace-consumer/listings/{id}", headers=headers) @@ -3863,7 +3863,7 @@ def list( if tags is not None: query["tags"] = [v.as_dict() for v in tags] headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3926,7 +3926,7 @@ def search( if query is not None: query["query"] = query headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -3992,8 +3992,8 @@ def create( if recipient_type is not None: body["recipient_type"] = recipient_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -4016,7 +4016,7 @@ def get(self, listing_id: str) -> GetPersonalizationRequestResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -4043,7 +4043,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4078,7 +4078,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetProvidersResp if ids is not None: query["ids"] = [v for v in ids] headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.1/marketplace-consumer/providers:batchGet", query=query, headers=headers) @@ -4095,7 +4095,7 @@ def get(self, id: str) -> GetProviderResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/marketplace-consumer/providers/{id}", headers=headers) @@ -4123,7 +4123,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4155,8 +4155,8 @@ def create(self, filter: ExchangeFilter) -> CreateExchangeFilterResponse: if filter is not None: body["filter"] = filter.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/marketplace-exchange/filters", body=body, headers=headers) @@ -4173,7 +4173,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/marketplace-exchange/filters/{id}", headers=headers) @@ -4200,7 +4200,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4226,8 +4226,8 @@ def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterRespons if filter is not None: body["filter"] = filter.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/marketplace-exchange/filters/{id}", body=body, headers=headers) @@ -4256,8 +4256,8 @@ def add_listing_to_exchange(self, listing_id: str, exchange_id: str) -> AddExcha if listing_id is not None: body["listing_id"] = listing_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/marketplace-exchange/exchanges-for-listing", body=body, headers=headers) @@ -4276,8 +4276,8 @@ def create(self, exchange: Exchange) -> CreateExchangeResponse: if exchange is not None: body["exchange"] = exchange.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/marketplace-exchange/exchanges", body=body, headers=headers) @@ -4294,7 +4294,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/marketplace-exchange/exchanges/{id}", headers=headers) @@ -4310,7 +4310,7 @@ def delete_listing_from_exchange(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/marketplace-exchange/exchanges-for-listing/{id}", headers=headers) @@ -4326,7 +4326,7 @@ def get(self, id: str) -> GetExchangeResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/marketplace-exchange/exchanges/{id}", headers=headers) @@ -4349,7 +4349,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4383,7 +4383,7 @@ def list_exchanges_for_listing( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4419,7 +4419,7 @@ def list_listings_for_exchange( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4447,8 +4447,8 @@ def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: if exchange is not None: body["exchange"] = exchange.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/marketplace-exchange/exchanges/{id}", body=body, headers=headers) @@ -4490,8 +4490,8 @@ def create( if mime_type is not None: body["mime_type"] = mime_type headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/marketplace-provider/files", body=body, headers=headers) @@ -4508,7 +4508,7 @@ def delete(self, file_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/marketplace-provider/files/{file_id}", headers=headers) @@ -4524,7 +4524,7 @@ def get(self, file_id: str) -> GetFileResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/marketplace-provider/files/{file_id}", headers=headers) @@ -4552,7 +4552,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4585,8 +4585,8 @@ def create(self, listing: Listing) -> CreateListingResponse: if listing is not None: body["listing"] = listing.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/marketplace-provider/listing", body=body, headers=headers) @@ -4603,7 +4603,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/marketplace-provider/listings/{id}", headers=headers) @@ -4619,7 +4619,7 @@ def get(self, id: str) -> GetListingResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/marketplace-provider/listings/{id}", headers=headers) @@ -4642,7 +4642,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4668,8 +4668,8 @@ def update(self, id: str, listing: Listing) -> UpdateListingResponse: if listing is not None: body["listing"] = listing.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/marketplace-provider/listings/{id}", body=body, headers=headers) @@ -4703,7 +4703,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4746,8 +4746,8 @@ def update( if status is not None: body["status"] = status.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -4775,7 +4775,7 @@ def create(self) -> ProviderAnalyticsDashboard: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("POST", "/api/2.0/marketplace-provider/analytics_dashboard", headers=headers) @@ -4790,7 +4790,7 @@ def get(self) -> ListProviderAnalyticsDashboardResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/marketplace-provider/analytics_dashboard", headers=headers) @@ -4805,7 +4805,7 @@ def get_latest_version(self) -> GetLatestVersionProviderAnalyticsDashboardRespon """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/marketplace-provider/analytics_dashboard/latest", headers=headers) @@ -4828,8 +4828,8 @@ def update(self, id: str, *, version: Optional[int] = None) -> UpdateProviderAna if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/marketplace-provider/analytics_dashboard/{id}", body=body, headers=headers) @@ -4855,8 +4855,8 @@ def create(self, provider: ProviderInfo) -> CreateProviderResponse: if provider is not None: body["provider"] = provider.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/marketplace-provider/provider", body=body, headers=headers) @@ -4873,7 +4873,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/marketplace-provider/providers/{id}", headers=headers) @@ -4889,7 +4889,7 @@ def get(self, id: str) -> GetProviderResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/marketplace-provider/providers/{id}", headers=headers) @@ -4912,7 +4912,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4938,8 +4938,8 @@ def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse: if provider is not None: body["provider"] = provider.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/marketplace-provider/providers/{id}", body=body, headers=headers) diff --git a/databricks/sdk/ml/v2/impl.py b/databricks/sdk/ml/v2/impl.py index 2da3695c4..a1e4129ae 100755 --- a/databricks/sdk/ml/v2/impl.py +++ b/databricks/sdk/ml/v2/impl.py @@ -6056,8 +6056,8 @@ def create_experiment( if tags is not None: body["tags"] = [v.as_dict() for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/experiments/create", body=body, headers=headers) @@ -6104,8 +6104,8 @@ def create_run( if user_id is not None: body["user_id"] = user_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/runs/create", body=body, headers=headers) @@ -6126,8 +6126,8 @@ def delete_experiment(self, experiment_id: str): if experiment_id is not None: body["experiment_id"] = experiment_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/experiments/delete", body=body, headers=headers) @@ -6146,8 +6146,8 @@ def delete_run(self, run_id: str): if run_id is not None: body["run_id"] = run_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/delete", body=body, headers=headers) @@ -6180,8 +6180,8 @@ def delete_runs( if max_timestamp_millis is not None: body["max_timestamp_millis"] = max_timestamp_millis headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/databricks/runs/delete-runs", body=body, headers=headers) @@ -6206,8 +6206,8 @@ def delete_tag(self, run_id: str, key: str): if run_id is not None: body["run_id"] = run_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/delete-tag", body=body, headers=headers) @@ -6233,7 +6233,7 @@ def get_by_name(self, experiment_name: str) -> GetExperimentByNameResponse: if experiment_name is not None: query["experiment_name"] = experiment_name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/mlflow/experiments/get-by-name", query=query, headers=headers) @@ -6254,7 +6254,7 @@ def get_experiment(self, experiment_id: str) -> GetExperimentResponse: if experiment_id is not None: query["experiment_id"] = experiment_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/mlflow/experiments/get", query=query, headers=headers) @@ -6301,7 +6301,7 @@ def get_history( if run_uuid is not None: query["run_uuid"] = run_uuid headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -6325,7 +6325,7 @@ def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLe """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/experiments/{experiment_id}/permissionLevels", headers=headers) @@ -6343,7 +6343,7 @@ def get_permissions(self, experiment_id: str) -> ExperimentPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/experiments/{experiment_id}", headers=headers) @@ -6372,7 +6372,7 @@ def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunRespo if run_uuid is not None: query["run_uuid"] = run_uuid headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/mlflow/runs/get", query=query, headers=headers) @@ -6421,7 +6421,7 @@ def list_artifacts( if run_uuid is not None: query["run_uuid"] = run_uuid headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -6464,7 +6464,7 @@ def list_experiments( if view_type is not None: query["view_type"] = view_type.value headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -6551,8 +6551,8 @@ def log_batch( if tags is not None: body["tags"] = [v.as_dict() for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/log-batch", body=body, headers=headers) @@ -6583,8 +6583,8 @@ def log_inputs( if run_id is not None: body["run_id"] = run_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/log-inputs", body=body, headers=headers) @@ -6652,8 +6652,8 @@ def log_metric( if value is not None: body["value"] = value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/log-metric", body=body, headers=headers) @@ -6676,8 +6676,8 @@ def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = if run_id is not None: body["run_id"] = run_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/log-model", body=body, headers=headers) @@ -6711,8 +6711,8 @@ def log_param(self, key: str, value: str, *, run_id: Optional[str] = None, run_u if value is not None: body["value"] = value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/log-parameter", body=body, headers=headers) @@ -6735,8 +6735,8 @@ def restore_experiment(self, experiment_id: str): if experiment_id is not None: body["experiment_id"] = experiment_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/experiments/restore", body=body, headers=headers) @@ -6757,8 +6757,8 @@ def restore_run(self, run_id: str): if run_id is not None: body["run_id"] = run_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/restore", body=body, headers=headers) @@ -6791,8 +6791,8 @@ def restore_runs( if min_timestamp_millis is not None: body["min_timestamp_millis"] = min_timestamp_millis headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/databricks/runs/restore-runs", body=body, headers=headers) @@ -6838,8 +6838,8 @@ def search_experiments( if view_type is not None: body["view_type"] = view_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } while True: @@ -6909,8 +6909,8 @@ def search_runs( if run_view_type is not None: body["run_view_type"] = run_view_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } while True: @@ -6944,8 +6944,8 @@ def set_experiment_tag(self, experiment_id: str, key: str, value: str): if value is not None: body["value"] = value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/experiments/set-experiment-tag", body=body, headers=headers) @@ -6968,8 +6968,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/experiments/{experiment_id}", body=body, headers=headers) @@ -7002,8 +7002,8 @@ def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uui if value is not None: body["value"] = value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/runs/set-tag", body=body, headers=headers) @@ -7026,8 +7026,8 @@ def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = Non if new_name is not None: body["new_name"] = new_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/experiments/update", body=body, headers=headers) @@ -7049,8 +7049,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/permissions/experiments/{experiment_id}", body=body, headers=headers) @@ -7095,8 +7095,8 @@ def update_run( if status is not None: body["status"] = status.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/runs/update", body=body, headers=headers) @@ -7209,8 +7209,8 @@ def create_experiment( if training_frameworks is not None: body["training_frameworks"] = [v for v in training_frameworks] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.0/automl/create-forecasting-experiment", body=body, headers=headers) @@ -7270,7 +7270,7 @@ def get_experiment(self, experiment_id: str) -> ForecastingExperiment: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/automl/get-forecasting-experiment/{experiment_id}", headers=headers) @@ -7329,8 +7329,8 @@ def approve_transition_request( if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/approve", body=body, headers=headers) @@ -7359,8 +7359,8 @@ def create_comment(self, name: str, version: str, comment: str) -> CreateComment if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/comments/create", body=body, headers=headers) @@ -7392,8 +7392,8 @@ def create_model( if tags is not None: body["tags"] = [v.as_dict() for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/registered-models/create", body=body, headers=headers) @@ -7444,8 +7444,8 @@ def create_model_version( if tags is not None: body["tags"] = [v.as_dict() for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/model-versions/create", body=body, headers=headers) @@ -7487,8 +7487,8 @@ def create_transition_request( if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/create", body=body, headers=headers) @@ -7570,8 +7570,8 @@ def create_webhook( if status is not None: body["status"] = status.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/registry-webhooks/create", body=body, headers=headers) @@ -7591,7 +7591,7 @@ def delete_comment(self, id: str): if id is not None: query["id"] = id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", "/api/2.0/mlflow/comments/delete", query=query, headers=headers) @@ -7611,7 +7611,7 @@ def delete_model(self, name: str): if name is not None: query["name"] = name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete", query=query, headers=headers) @@ -7636,7 +7636,7 @@ def delete_model_tag(self, name: str, key: str): if name is not None: query["name"] = name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete-tag", query=query, headers=headers) @@ -7660,7 +7660,7 @@ def delete_model_version(self, name: str, version: str): if version is not None: query["version"] = version headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete", query=query, headers=headers) @@ -7689,7 +7689,7 @@ def delete_model_version_tag(self, name: str, version: str, key: str): if version is not None: query["version"] = version headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete-tag", query=query, headers=headers) @@ -7742,7 +7742,7 @@ def delete_transition_request( if version is not None: query["version"] = version headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", "/api/2.0/mlflow/transition-requests/delete", query=query, headers=headers) @@ -7764,7 +7764,7 @@ def delete_webhook(self, *, id: Optional[str] = None): if id is not None: query["id"] = id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", "/api/2.0/mlflow/registry-webhooks/delete", query=query, headers=headers) @@ -7787,8 +7787,8 @@ def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) if stages is not None: body["stages"] = [v for v in stages] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } json = self._api.do("POST", "/api/2.0/mlflow/registered-models/get-latest-versions", body=body, headers=headers) @@ -7814,7 +7814,7 @@ def get_model(self, name: str) -> GetModelResponse: if name is not None: query["name"] = name headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/mlflow/databricks/registered-models/get", query=query, headers=headers) @@ -7839,7 +7839,7 @@ def get_model_version(self, name: str, version: str) -> GetModelVersionResponse: if version is not None: query["version"] = version headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/mlflow/model-versions/get", query=query, headers=headers) @@ -7864,7 +7864,7 @@ def get_model_version_download_uri(self, name: str, version: str) -> GetModelVer if version is not None: query["version"] = version headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/mlflow/model-versions/get-download-uri", query=query, headers=headers) @@ -7882,7 +7882,7 @@ def get_permission_levels(self, registered_model_id: str) -> GetRegisteredModelP """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -7903,7 +7903,7 @@ def get_permissions(self, registered_model_id: str) -> RegisteredModelPermission """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/registered-models/{registered_model_id}", headers=headers) @@ -7928,7 +7928,7 @@ def list_models(self, *, max_results: Optional[int] = None, page_token: Optional if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -7959,7 +7959,7 @@ def list_transition_requests(self, name: str, version: str) -> Iterator[Activity if version is not None: query["version"] = version headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/mlflow/transition-requests/list", query=query, headers=headers) @@ -7999,7 +7999,7 @@ def list_webhooks( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -8047,8 +8047,8 @@ def reject_transition_request( if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/reject", body=body, headers=headers) @@ -8072,8 +8072,8 @@ def rename_model(self, name: str, *, new_name: Optional[str] = None) -> RenameMo if new_name is not None: body["new_name"] = new_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/registered-models/rename", body=body, headers=headers) @@ -8116,7 +8116,7 @@ def search_model_versions( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -8166,7 +8166,7 @@ def search_models( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -8203,8 +8203,8 @@ def set_model_tag(self, name: str, key: str, value: str): if value is not None: body["value"] = value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/registered-models/set-tag", body=body, headers=headers) @@ -8238,8 +8238,8 @@ def set_model_version_tag(self, name: str, version: str, key: str, value: str): if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/mlflow/model-versions/set-tag", body=body, headers=headers) @@ -8265,8 +8265,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -8297,8 +8297,8 @@ def test_registry_webhook( if id is not None: body["id"] = id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/mlflow/registry-webhooks/test", body=body, headers=headers) @@ -8347,8 +8347,8 @@ def transition_stage( if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -8374,8 +8374,8 @@ def update_comment(self, id: str, comment: str) -> UpdateCommentResponse: if id is not None: body["id"] = id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", "/api/2.0/mlflow/comments/update", body=body, headers=headers) @@ -8399,8 +8399,8 @@ def update_model(self, name: str, *, description: Optional[str] = None): if name is not None: body["name"] = name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", "/api/2.0/mlflow/registered-models/update", body=body, headers=headers) @@ -8427,8 +8427,8 @@ def update_model_version(self, name: str, version: str, *, description: Optional if version is not None: body["version"] = version headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers) @@ -8454,8 +8454,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -8539,8 +8539,8 @@ def update_webhook( if status is not None: body["status"] = status.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", "/api/2.0/mlflow/registry-webhooks/update", body=body, headers=headers) diff --git a/databricks/sdk/oauth2/v2/impl.py b/databricks/sdk/oauth2/v2/impl.py index 65425f72a..3888b3176 100755 --- a/databricks/sdk/oauth2/v2/impl.py +++ b/databricks/sdk/oauth2/v2/impl.py @@ -1205,8 +1205,8 @@ def create(self, *, policy: Optional[FederationPolicy] = None, policy_id: Option if policy_id is not None: query["policy_id"] = policy_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1228,7 +1228,7 @@ def delete(self, policy_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -1245,7 +1245,7 @@ def get(self, policy_id: str) -> FederationPolicy: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -1268,7 +1268,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1304,8 +1304,8 @@ def update( if update_mask is not None: query["update_mask"] = update_mask headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1372,8 +1372,8 @@ def create( if user_authorized_scopes is not None: body["user_authorized_scopes"] = [v for v in user_authorized_scopes] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1396,7 +1396,7 @@ def delete(self, integration_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -1417,7 +1417,7 @@ def get(self, integration_id: str) -> GetCustomAppIntegrationOutput: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -1453,7 +1453,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1508,8 +1508,8 @@ def update( if user_authorized_scopes is not None: body["user_authorized_scopes"] = [v for v in user_authorized_scopes] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do( @@ -1549,7 +1549,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1593,8 +1593,8 @@ def create( if token_access_policy is not None: body["token_access_policy"] = token_access_policy.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1617,7 +1617,7 @@ def delete(self, integration_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -1637,7 +1637,7 @@ def get(self, integration_id: str) -> GetPublishedAppIntegrationOutput: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -1666,7 +1666,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1699,8 +1699,8 @@ def update(self, integration_id: str, *, token_access_policy: Optional[TokenAcce if token_access_policy is not None: body["token_access_policy"] = token_access_policy.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do( @@ -1775,8 +1775,8 @@ def create( if policy_id is not None: query["policy_id"] = policy_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1800,7 +1800,7 @@ def delete(self, service_principal_id: int, policy_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -1821,7 +1821,7 @@ def get(self, service_principal_id: int, policy_id: str) -> FederationPolicy: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -1850,7 +1850,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1896,8 +1896,8 @@ def update( if update_mask is not None: query["update_mask"] = update_mask headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1946,8 +1946,8 @@ def create( if lifetime is not None: body["lifetime"] = lifetime headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2002,7 +2002,7 @@ def list(self, service_principal_id: int, *, page_token: Optional[str] = None) - if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: diff --git a/databricks/sdk/pipelines/v2/impl.py b/databricks/sdk/pipelines/v2/impl.py index 819f8c81d..795d123f8 100755 --- a/databricks/sdk/pipelines/v2/impl.py +++ b/databricks/sdk/pipelines/v2/impl.py @@ -4333,8 +4333,8 @@ def create( if trigger is not None: body["trigger"] = trigger.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/pipelines", body=body, headers=headers) @@ -4351,7 +4351,7 @@ def delete(self, pipeline_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/pipelines/{pipeline_id}", headers=headers) @@ -4365,7 +4365,7 @@ def get(self, pipeline_id: str) -> GetPipelineResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}", headers=headers) @@ -4383,7 +4383,7 @@ def get_permission_levels(self, pipeline_id: str) -> GetPipelinePermissionLevels """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/pipelines/{pipeline_id}/permissionLevels", headers=headers) @@ -4401,7 +4401,7 @@ def get_permissions(self, pipeline_id: str) -> PipelinePermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/pipelines/{pipeline_id}", headers=headers) @@ -4421,7 +4421,7 @@ def get_update(self, pipeline_id: str, update_id: str) -> GetUpdateResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/updates/{update_id}", headers=headers) @@ -4473,7 +4473,7 @@ def list_pipeline_events( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4529,7 +4529,7 @@ def list_pipelines( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -4573,7 +4573,7 @@ def list_updates( if until_update_id is not None: query["until_update_id"] = until_update_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/updates", query=query, headers=headers) @@ -4597,8 +4597,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/pipelines/{pipeline_id}", body=body, headers=headers) @@ -4649,8 +4649,8 @@ def start_update( if validate_only is not None: body["validate_only"] = validate_only headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/updates", body=body, headers=headers) @@ -4670,7 +4670,7 @@ def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } op_response = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/stop", headers=headers) @@ -4842,8 +4842,8 @@ def update( if trigger is not None: body["trigger"] = trigger.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/pipelines/{pipeline_id}", body=body, headers=headers) @@ -4865,8 +4865,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/permissions/pipelines/{pipeline_id}", body=body, headers=headers) diff --git a/databricks/sdk/provisioning/v2/impl.py b/databricks/sdk/provisioning/v2/impl.py index ec2ed3f51..3fb1ac672 100755 --- a/databricks/sdk/provisioning/v2/impl.py +++ b/databricks/sdk/provisioning/v2/impl.py @@ -2353,8 +2353,8 @@ def create(self, credentials_name: str, aws_credentials: CreateCredentialAwsCred if credentials_name is not None: body["credentials_name"] = credentials_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/credentials", body=body, headers=headers) @@ -2373,7 +2373,7 @@ def delete(self, credentials_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -2392,7 +2392,7 @@ def get(self, credentials_id: str) -> Credential: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2409,7 +2409,7 @@ def list(self) -> Iterator[Credential]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/credentials", headers=headers) @@ -2472,8 +2472,8 @@ def create( if use_cases is not None: body["use_cases"] = [v.value for v in use_cases] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2494,7 +2494,7 @@ def delete(self, customer_managed_key_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -2526,7 +2526,7 @@ def get(self, customer_managed_key_id: str) -> CustomerManagedKey: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2554,7 +2554,7 @@ def list(self) -> Iterator[CustomerManagedKey]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/customer-managed-keys", headers=headers) @@ -2619,8 +2619,8 @@ def create( if vpc_id is not None: body["vpc_id"] = vpc_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/networks", body=body, headers=headers) @@ -2641,7 +2641,7 @@ def delete(self, network_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/accounts/{self._api.account_id}/networks/{network_id}", headers=headers) @@ -2658,7 +2658,7 @@ def get(self, network_id: str) -> Network: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/networks/{network_id}", headers=headers) @@ -2675,7 +2675,7 @@ def list(self) -> Iterator[Network]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/networks", headers=headers) @@ -2754,8 +2754,8 @@ def create( if region is not None: body["region"] = region headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2781,7 +2781,7 @@ def delete(self, private_access_settings_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -2808,7 +2808,7 @@ def get(self, private_access_settings_id: str) -> PrivateAccessSettings: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -2827,7 +2827,7 @@ def list(self) -> Iterator[PrivateAccessSettings]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/private-access-settings", headers=headers) @@ -2907,8 +2907,8 @@ def replace( if region is not None: body["region"] = region headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do( @@ -2954,8 +2954,8 @@ def create(self, storage_configuration_name: str, root_bucket_info: RootBucketIn if storage_configuration_name is not None: body["storage_configuration_name"] = storage_configuration_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -2976,7 +2976,7 @@ def delete(self, storage_configuration_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -2997,7 +2997,7 @@ def get(self, storage_configuration_id: str) -> StorageConfiguration: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3016,7 +3016,7 @@ def list(self) -> Iterator[StorageConfiguration]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/storage-configurations", headers=headers) @@ -3073,8 +3073,8 @@ def create( if vpc_endpoint_name is not None: body["vpc_endpoint_name"] = vpc_endpoint_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3101,7 +3101,7 @@ def delete(self, vpc_endpoint_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -3124,7 +3124,7 @@ def get(self, vpc_endpoint_id: str) -> VpcEndpoint: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3145,7 +3145,7 @@ def list(self) -> Iterator[VpcEndpoint]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/vpc-endpoints", headers=headers) @@ -3324,8 +3324,8 @@ def create( if workspace_name is not None: body["workspace_name"] = workspace_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do( @@ -3396,7 +3396,7 @@ def delete(self, workspace_id: int): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}", headers=headers) @@ -3424,7 +3424,7 @@ def get(self, workspace_id: int) -> Workspace: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3444,7 +3444,7 @@ def list(self) -> Iterator[Workspace]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/workspaces", headers=headers) @@ -3614,8 +3614,8 @@ def update( if storage_customer_managed_key_id is not None: body["storage_customer_managed_key_id"] = storage_customer_managed_key_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do( diff --git a/databricks/sdk/serving/v2/impl.py b/databricks/sdk/serving/v2/impl.py index 191e7b6ec..844e7d797 100755 --- a/databricks/sdk/serving/v2/impl.py +++ b/databricks/sdk/serving/v2/impl.py @@ -4175,7 +4175,7 @@ def build_logs(self, name: str, served_model_name: str) -> BuildLogsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -4234,8 +4234,8 @@ def create( if tags is not None: body["tags"] = [v.as_dict() for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.0/serving-endpoints", body=body, headers=headers) @@ -4292,7 +4292,7 @@ def export_metrics(self, name: str) -> ExportMetricsResponse: """ headers = { - "0": "{Accept text/plain}", + "Accept": "text/plain", } res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/metrics", headers=headers, raw=True) @@ -4310,7 +4310,7 @@ def get(self, name: str) -> ServingEndpointDetailed: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}", headers=headers) @@ -4329,7 +4329,7 @@ def get_open_api(self, name: str) -> GetOpenApiResponse: """ headers = { - "0": "{Accept text/plain}", + "Accept": "text/plain", } res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/openapi", headers=headers, raw=True) @@ -4347,7 +4347,7 @@ def get_permission_levels(self, serving_endpoint_id: str) -> GetServingEndpointP """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -4368,7 +4368,7 @@ def get_permissions(self, serving_endpoint_id: str) -> ServingEndpointPermission """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}", headers=headers) @@ -4416,8 +4416,8 @@ def http_request( if path is not None: body["path"] = path headers = { - "0": "{Accept text/plain}", - "1": "{Content-Type application/json}", + "Accept": "text/plain", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/external-function", body=body, headers=headers, raw=True) @@ -4430,7 +4430,7 @@ def list(self) -> Iterator[ServingEndpoint]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/serving-endpoints", headers=headers) @@ -4451,7 +4451,7 @@ def logs(self, name: str, served_model_name: str) -> ServerLogsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -4481,8 +4481,8 @@ def patch( if delete_tags is not None: body["delete_tags"] = [v for v in delete_tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/serving-endpoints/{name}/tags", body=body, headers=headers) @@ -4505,8 +4505,8 @@ def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> Pu if rate_limits is not None: body["rate_limits"] = [v.as_dict() for v in rate_limits] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/rate-limits", body=body, headers=headers) @@ -4557,8 +4557,8 @@ def put_ai_gateway( if usage_tracking_config is not None: body["usage_tracking_config"] = usage_tracking_config.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/ai-gateway", body=body, headers=headers) @@ -4658,8 +4658,8 @@ def query( if temperature is not None: body["temperature"] = temperature headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } response_headers = [ "{served_model_name}", @@ -4694,8 +4694,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -4747,8 +4747,8 @@ def update_config( if traffic_config is not None: body["traffic_config"] = traffic_config.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/config", body=body, headers=headers) @@ -4797,8 +4797,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -4908,8 +4908,8 @@ def query( if temperature is not None: body["temperature"] = temperature headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } response_headers = [ "{served_model_name}", diff --git a/databricks/sdk/settings/v2/impl.py b/databricks/sdk/settings/v2/impl.py index 1310b85a4..2f17e7b23 100755 --- a/databricks/sdk/settings/v2/impl.py +++ b/databricks/sdk/settings/v2/impl.py @@ -4775,8 +4775,8 @@ def create( if list_type is not None: body["list_type"] = list_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -4813,7 +4813,7 @@ def get(self, ip_access_list_id: str) -> GetIpAccessListResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -4830,7 +4830,7 @@ def list(self) -> Iterator[IpAccessListInfo]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", f"/api/2.0/accounts/{self._api.account_id}/ip-access-lists", headers=headers) @@ -4883,7 +4883,7 @@ def replace( if list_type is not None: body["list_type"] = list_type.value headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do( @@ -4943,7 +4943,7 @@ def update( if list_type is not None: body["list_type"] = list_type.value headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do( @@ -4987,7 +4987,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5018,7 +5018,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingAccessPoli if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5057,8 +5057,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5094,7 +5094,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5124,7 +5124,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingApprovedDo if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5167,8 +5167,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5206,7 +5206,7 @@ def get(self, *, etag: Optional[str] = None) -> AutomaticClusterUpdateSetting: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5248,8 +5248,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5286,7 +5286,7 @@ def get(self, *, etag: Optional[str] = None) -> ComplianceSecurityProfileSetting if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5328,8 +5328,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5370,8 +5370,8 @@ def exchange_token( if token_type is not None: body["tokenType"] = [v.value for v in token_type] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/credentials-manager/exchange-tokens/token", body=body, headers=headers) @@ -5408,7 +5408,7 @@ def get(self, *, etag: Optional[str] = None) -> CspEnablementAccountSetting: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5450,8 +5450,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5500,7 +5500,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultNamespaceSetting if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5527,7 +5527,7 @@ def get(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5576,8 +5576,8 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5616,7 +5616,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyAccessResp if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5643,7 +5643,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyAccess: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5680,8 +5680,8 @@ def update(self, allow_missing: bool, setting: DisableLegacyAccess, field_mask: if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5716,7 +5716,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyDbfsRespon if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5743,7 +5743,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyDbfs: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5780,8 +5780,8 @@ def update(self, allow_missing: bool, setting: DisableLegacyDbfs, field_mask: st if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5819,7 +5819,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyFeaturesRe if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5849,7 +5849,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyFeatures: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5889,8 +5889,8 @@ def update(self, allow_missing: bool, setting: DisableLegacyFeatures, field_mask if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -5928,7 +5928,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAccountIpAccessEnableRe if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5958,7 +5958,7 @@ def get(self, *, etag: Optional[str] = None) -> AccountIpAccessEnable: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -5998,8 +5998,8 @@ def update(self, allow_missing: bool, setting: AccountIpAccessEnable, field_mask if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -6041,7 +6041,7 @@ def get(self, *, etag: Optional[str] = None) -> EnhancedSecurityMonitoringSettin if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6083,8 +6083,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -6120,7 +6120,7 @@ def get(self, *, etag: Optional[str] = None) -> EsmEnablementAccountSetting: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6162,8 +6162,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -6236,8 +6236,8 @@ def create( if list_type is not None: body["list_type"] = list_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/ip-access-lists", body=body, headers=headers) @@ -6270,7 +6270,7 @@ def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/ip-access-lists/{ip_access_list_id}", headers=headers) @@ -6285,7 +6285,7 @@ def list(self) -> Iterator[IpAccessListInfo]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/ip-access-lists", headers=headers) @@ -6339,7 +6339,7 @@ def replace( if list_type is not None: body["list_type"] = list_type.value headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/ip-access-lists/{ip_access_list_id}", body=body, headers=headers) @@ -6395,7 +6395,7 @@ def update( if list_type is not None: body["list_type"] = list_type.value headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.0/ip-access-lists/{ip_access_list_id}", body=body, headers=headers) @@ -6427,8 +6427,8 @@ def create_network_connectivity_configuration(self, name: str, region: str) -> N if region is not None: body["region"] = region headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -6467,8 +6467,8 @@ def create_private_endpoint_rule( if resource_id is not None: body["resource_id"] = resource_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -6491,7 +6491,7 @@ def delete_network_connectivity_configuration(self, network_connectivity_config_ """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -6519,7 +6519,7 @@ def delete_private_endpoint_rule( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6543,7 +6543,7 @@ def get_network_connectivity_configuration( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6569,7 +6569,7 @@ def get_private_endpoint_rule( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6596,7 +6596,7 @@ def list_network_connectivity_configurations( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -6632,7 +6632,7 @@ def list_private_endpoint_rules( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -6677,8 +6677,8 @@ def create(self, *, config: Optional[Config] = None, display_name: Optional[str] if display_name is not None: body["display_name"] = display_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/notification-destinations", body=body, headers=headers) @@ -6695,7 +6695,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/notification-destinations/{id}", headers=headers) @@ -6711,7 +6711,7 @@ def get(self, id: str) -> NotificationDestination: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/notification-destinations/{id}", headers=headers) @@ -6736,7 +6736,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -6771,8 +6771,8 @@ def update( if display_name is not None: body["display_name"] = display_name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/notification-destinations/{id}", body=body, headers=headers) @@ -6810,7 +6810,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeletePersonalComputeSettingR if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6840,7 +6840,7 @@ def get(self, *, etag: Optional[str] = None) -> PersonalComputeSetting: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6880,8 +6880,8 @@ def update(self, allow_missing: bool, setting: PersonalComputeSetting, field_mas if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -6929,7 +6929,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteRestrictWorkspaceAdmins if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6956,7 +6956,7 @@ def get(self, *, etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting: if etag is not None: query["etag"] = etag headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -6998,8 +6998,8 @@ def update( if setting is not None: body["setting"] = setting.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -7046,8 +7046,8 @@ def create_obo_token( if lifetime_seconds is not None: body["lifetime_seconds"] = lifetime_seconds headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/token-management/on-behalf-of/tokens", body=body, headers=headers) @@ -7080,7 +7080,7 @@ def get(self, token_id: str) -> GetTokenResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/token-management/tokens/{token_id}", headers=headers) @@ -7095,7 +7095,7 @@ def get_permission_levels(self) -> GetTokenPermissionLevelsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/permissions/authorization/tokens/permissionLevels", headers=headers) @@ -7110,7 +7110,7 @@ def get_permissions(self) -> TokenPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/permissions/authorization/tokens", headers=headers) @@ -7137,7 +7137,7 @@ def list( if created_by_username is not None: query["created_by_username"] = created_by_username headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/token-management/tokens", query=query, headers=headers) @@ -7160,8 +7160,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) @@ -7182,8 +7182,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) @@ -7219,8 +7219,8 @@ def create(self, *, comment: Optional[str] = None, lifetime_seconds: Optional[in if lifetime_seconds is not None: body["lifetime_seconds"] = lifetime_seconds headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/token/create", body=body, headers=headers) @@ -7242,8 +7242,8 @@ def delete(self, token_id: str): if token_id is not None: body["token_id"] = token_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/token/delete", body=body, headers=headers) @@ -7257,7 +7257,7 @@ def list(self) -> Iterator[PublicTokenInfo]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/token/list", headers=headers) @@ -7285,7 +7285,7 @@ def get_status(self, keys: str) -> WorkspaceConf: if keys is not None: query["keys"] = keys headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/workspace-conf", query=query, headers=headers) @@ -7301,7 +7301,7 @@ def set_status(self, contents: Dict[str, str]): """ headers = { - "0": "{Content-Type application/json}", + "Content-Type": "application/json", } self._api.do("PATCH", "/api/2.0/workspace-conf", body=contents, headers=headers) diff --git a/databricks/sdk/sharing/v2/impl.py b/databricks/sdk/sharing/v2/impl.py index 7ceed0b30..c8135ceb9 100755 --- a/databricks/sdk/sharing/v2/impl.py +++ b/databricks/sdk/sharing/v2/impl.py @@ -2831,8 +2831,8 @@ def create( if recipient_profile_str is not None: body["recipient_profile_str"] = recipient_profile_str headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/providers", body=body, headers=headers) @@ -2867,7 +2867,7 @@ def get(self, name: str) -> ProviderInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/providers/{name}", headers=headers) @@ -2911,7 +2911,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -2966,7 +2966,7 @@ def list_provider_share_assets( if volume_max_results is not None: query["volume_max_results"] = volume_max_results headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3005,7 +3005,7 @@ def list_shares( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -3058,8 +3058,8 @@ def update( if recipient_profile_str is not None: body["recipient_profile_str"] = recipient_profile_str headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/providers/{name}", body=body, headers=headers) @@ -3090,7 +3090,7 @@ def get_activation_url_info(self, activation_url: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do( @@ -3109,7 +3109,7 @@ def retrieve_token(self, activation_url: str) -> RetrieveTokenResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3200,8 +3200,8 @@ def create( if sharing_code is not None: body["sharing_code"] = sharing_code headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/recipients", body=body, headers=headers) @@ -3236,7 +3236,7 @@ def get(self, name: str) -> RecipientInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/recipients/{name}", headers=headers) @@ -3281,7 +3281,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -3314,8 +3314,8 @@ def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> Reci if existing_token_expire_in_seconds is not None: body["existing_token_expire_in_seconds"] = existing_token_expire_in_seconds headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.1/unity-catalog/recipients/{name}/rotate-token", body=body, headers=headers) @@ -3351,7 +3351,7 @@ def share_permissions( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3409,8 +3409,8 @@ def update( if properties_kvpairs is not None: body["properties_kvpairs"] = properties_kvpairs.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/recipients/{name}", body=body, headers=headers) @@ -3449,8 +3449,8 @@ def create(self, name: str, *, comment: Optional[str] = None, storage_root: Opti if storage_root is not None: body["storage_root"] = storage_root headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.1/unity-catalog/shares", body=body, headers=headers) @@ -3489,7 +3489,7 @@ def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> Share if include_shared_data is not None: query["include_shared_data"] = include_shared_data headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}", query=query, headers=headers) @@ -3521,7 +3521,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } if "max_results" not in query: @@ -3565,7 +3565,7 @@ def share_permissions( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}/permissions", query=query, headers=headers) @@ -3626,8 +3626,8 @@ def update( if updates is not None: body["updates"] = [v.as_dict() for v in updates] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}", body=body, headers=headers) @@ -3655,8 +3655,8 @@ def update_permissions( if changes is not None: body["changes"] = [v.as_dict() for v in changes] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}/permissions", body=body, headers=headers) diff --git a/databricks/sdk/sql/v2/impl.py b/databricks/sdk/sql/v2/impl.py index fb857324d..befe00b80 100755 --- a/databricks/sdk/sql/v2/impl.py +++ b/databricks/sdk/sql/v2/impl.py @@ -7902,8 +7902,8 @@ def create(self, *, alert: Optional[CreateAlertRequestAlert] = None) -> Alert: if alert is not None: body["alert"] = alert.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/sql/alerts", body=body, headers=headers) @@ -7922,7 +7922,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/sql/alerts/{id}", headers=headers) @@ -7938,7 +7938,7 @@ def get(self, id: str) -> Alert: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/sql/alerts/{id}", headers=headers) @@ -7964,7 +7964,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -8002,8 +8002,8 @@ def update(self, id: str, update_mask: str, *, alert: Optional[UpdateAlertReques if update_mask is not None: body["update_mask"] = update_mask headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/sql/alerts/{id}", body=body, headers=headers) @@ -8069,8 +8069,8 @@ def create( if rearm is not None: body["rearm"] = rearm headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/sql/alerts", body=body, headers=headers) @@ -8093,7 +8093,7 @@ def delete(self, alert_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/preview/sql/alerts/{alert_id}", headers=headers) @@ -8114,7 +8114,7 @@ def get(self, alert_id: str) -> LegacyAlert: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/preview/sql/alerts/{alert_id}", headers=headers) @@ -8134,7 +8134,7 @@ def list(self) -> Iterator[LegacyAlert]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/preview/sql/alerts", headers=headers) @@ -8173,8 +8173,8 @@ def update(self, alert_id: str, name: str, options: AlertOptions, query_id: str, if rearm is not None: body["rearm"] = rearm headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PUT", f"/api/2.0/preview/sql/alerts/{alert_id}", body=body, headers=headers) @@ -8223,8 +8223,8 @@ def create( if width is not None: body["width"] = width headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/sql/widgets", body=body, headers=headers) @@ -8240,7 +8240,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/preview/sql/widgets/{id}", headers=headers) @@ -8284,8 +8284,8 @@ def update( if width is not None: body["width"] = width headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/preview/sql/widgets/{id}", body=body, headers=headers) @@ -8343,8 +8343,8 @@ def create( if tags is not None: body["tags"] = [v for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/sql/dashboards", body=body, headers=headers) @@ -8362,7 +8362,7 @@ def delete(self, dashboard_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", headers=headers) @@ -8378,7 +8378,7 @@ def get(self, dashboard_id: str) -> Dashboard: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", headers=headers) @@ -8421,7 +8421,7 @@ def list( if q is not None: query["q"] = q headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -8451,7 +8451,7 @@ def restore(self, dashboard_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("POST", f"/api/2.0/preview/sql/dashboards/trash/{dashboard_id}", headers=headers) @@ -8489,8 +8489,8 @@ def update( if tags is not None: body["tags"] = [v for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", body=body, headers=headers) @@ -8529,7 +8529,7 @@ def list(self) -> Iterator[DataSource]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/preview/sql/data_sources", headers=headers) @@ -8575,7 +8575,7 @@ def get(self, object_type: ObjectTypePlural, object_id: str) -> GetResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}", headers=headers) @@ -8610,8 +8610,8 @@ def set( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -8644,8 +8644,8 @@ def transfer_ownership( if new_owner is not None: body["new_owner"] = new_owner headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -8678,8 +8678,8 @@ def create(self, *, query: Optional[CreateQueryRequestQuery] = None) -> Query: if query is not None: body["query"] = query.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/sql/queries", body=body, headers=headers) @@ -8698,7 +8698,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/sql/queries/{id}", headers=headers) @@ -8714,7 +8714,7 @@ def get(self, id: str) -> Query: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/sql/queries/{id}", headers=headers) @@ -8740,7 +8740,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -8772,7 +8772,7 @@ def list_visualizations( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -8810,8 +8810,8 @@ def update(self, id: str, update_mask: str, *, query: Optional[UpdateQueryReques if update_mask is not None: body["update_mask"] = update_mask headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/sql/queries/{id}", body=body, headers=headers) @@ -8901,8 +8901,8 @@ def create( if tags is not None: body["tags"] = [v for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/sql/queries", body=body, headers=headers) @@ -8925,7 +8925,7 @@ def delete(self, query_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/preview/sql/queries/{query_id}", headers=headers) @@ -8947,7 +8947,7 @@ def get(self, query_id: str) -> LegacyQuery: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/preview/sql/queries/{query_id}", headers=headers) @@ -9007,7 +9007,7 @@ def list( if q is not None: query["q"] = q headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } # deduplicate items that may have been added during iteration @@ -9043,7 +9043,7 @@ def restore(self, query_id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("POST", f"/api/2.0/preview/sql/queries/trash/{query_id}", headers=headers) @@ -9110,8 +9110,8 @@ def update( if tags is not None: body["tags"] = [v for v in tags] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/preview/sql/queries/{query_id}", body=body, headers=headers) @@ -9166,7 +9166,7 @@ def list( if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/sql/history/queries", query=query, headers=headers) @@ -9193,8 +9193,8 @@ def create(self, *, visualization: Optional[CreateVisualizationRequestVisualizat if visualization is not None: body["visualization"] = visualization.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/sql/visualizations", body=body, headers=headers) @@ -9211,7 +9211,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/sql/visualizations/{id}", headers=headers) @@ -9244,8 +9244,8 @@ def update( if visualization is not None: body["visualization"] = visualization.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/sql/visualizations/{id}", body=body, headers=headers) @@ -9302,8 +9302,8 @@ def create( if type is not None: body["type"] = type headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/preview/sql/visualizations", body=body, headers=headers) @@ -9326,7 +9326,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/preview/sql/visualizations/{id}", headers=headers) @@ -9385,8 +9385,8 @@ def update( if updated_at is not None: body["updated_at"] = updated_at headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/preview/sql/visualizations/{id}", body=body, headers=headers) @@ -9406,7 +9406,7 @@ def get_config(self) -> ClientConfig: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/redash-v2/config", headers=headers) @@ -9666,8 +9666,8 @@ def execute_statement( if warehouse_id is not None: body["warehouse_id"] = warehouse_id headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/sql/statements/", body=body, headers=headers) @@ -9692,7 +9692,7 @@ def get_statement(self, statement_id: str) -> StatementResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/sql/statements/{statement_id}", headers=headers) @@ -9717,7 +9717,7 @@ def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> R """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -9842,8 +9842,8 @@ def create( if warehouse_type is not None: body["warehouse_type"] = warehouse_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.0/sql/warehouses", body=body, headers=headers) @@ -9897,7 +9897,7 @@ def delete(self, id: str): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/sql/warehouses/{id}", headers=headers) @@ -10013,8 +10013,8 @@ def edit( if warehouse_type is not None: body["warehouse_type"] = warehouse_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/edit", body=body, headers=headers) @@ -10068,7 +10068,7 @@ def get(self, id: str) -> GetWarehouseResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/sql/warehouses/{id}", headers=headers) @@ -10086,7 +10086,7 @@ def get_permission_levels(self, warehouse_id: str) -> GetWarehousePermissionLeve """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/warehouses/{warehouse_id}/permissionLevels", headers=headers) @@ -10105,7 +10105,7 @@ def get_permissions(self, warehouse_id: str) -> WarehousePermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/warehouses/{warehouse_id}", headers=headers) @@ -10120,7 +10120,7 @@ def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/sql/config/warehouses", headers=headers) @@ -10142,7 +10142,7 @@ def list(self, *, run_as_user_id: Optional[int] = None) -> Iterator[EndpointInfo if run_as_user_id is not None: query["run_as_user_id"] = run_as_user_id headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/sql/warehouses", query=query, headers=headers) @@ -10167,8 +10167,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/warehouses/{warehouse_id}", body=body, headers=headers) @@ -10236,8 +10236,8 @@ def set_workspace_warehouse_config( if sql_configuration_parameters is not None: body["sql_configuration_parameters"] = sql_configuration_parameters.as_dict() headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PUT", "/api/2.0/sql/config/warehouses", body=body, headers=headers) @@ -10256,7 +10256,7 @@ def start(self, id: str) -> Wait[GetWarehouseResponse]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", headers=headers) @@ -10279,7 +10279,7 @@ def stop(self, id: str) -> Wait[GetWarehouseResponse]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", headers=headers) @@ -10306,8 +10306,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/permissions/warehouses/{warehouse_id}", body=body, headers=headers) diff --git a/databricks/sdk/vectorsearch/v2/impl.py b/databricks/sdk/vectorsearch/v2/impl.py index ad4bc48aa..b941d610f 100755 --- a/databricks/sdk/vectorsearch/v2/impl.py +++ b/databricks/sdk/vectorsearch/v2/impl.py @@ -1643,8 +1643,8 @@ def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[Endpoi if name is not None: body["name"] = name headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } op_response = self._api.do("POST", "/api/2.0/vector-search/endpoints", body=body, headers=headers) @@ -1682,7 +1682,7 @@ def get_endpoint(self, endpoint_name: str) -> EndpointInfo: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/vector-search/endpoints/{endpoint_name}", headers=headers) @@ -1701,7 +1701,7 @@ def list_endpoints(self, *, page_token: Optional[str] = None) -> Iterator[Endpoi if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1774,8 +1774,8 @@ def create_index( if primary_key is not None: body["primary_key"] = primary_key headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/vector-search/indexes", body=body, headers=headers) @@ -1797,8 +1797,8 @@ def delete_data_vector_index(self, index_name: str, primary_keys: List[str]) -> if primary_keys is not None: body["primary_keys"] = [v for v in primary_keys] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1833,7 +1833,7 @@ def get_index(self, index_name: str) -> VectorIndex: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/vector-search/indexes/{index_name}", headers=headers) @@ -1858,7 +1858,7 @@ def list_indexes(self, endpoint_name: str, *, page_token: Optional[str] = None) if page_token is not None: query["page_token"] = page_token headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -1931,8 +1931,8 @@ def query_index( if score_threshold is not None: body["score_threshold"] = score_threshold headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/query", body=body, headers=headers) @@ -1961,8 +1961,8 @@ def query_next_page( if page_token is not None: body["page_token"] = page_token headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -1993,8 +1993,8 @@ def scan_index( if num_results is not None: body["num_results"] = num_results headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/scan", body=body, headers=headers) @@ -2031,8 +2031,8 @@ def upsert_data_vector_index(self, index_name: str, inputs_json: str) -> UpsertD if inputs_json is not None: body["inputs_json"] = inputs_json headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( diff --git a/databricks/sdk/workspace/v2/impl.py b/databricks/sdk/workspace/v2/impl.py index d1491d351..502fb170e 100755 --- a/databricks/sdk/workspace/v2/impl.py +++ b/databricks/sdk/workspace/v2/impl.py @@ -2403,8 +2403,8 @@ def create( if personal_access_token is not None: body["personal_access_token"] = personal_access_token headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/git-credentials", body=body, headers=headers) @@ -2422,7 +2422,7 @@ def delete(self, credential_id: int): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/git-credentials/{credential_id}", headers=headers) @@ -2439,7 +2439,7 @@ def get(self, credential_id: int) -> GetCredentialsResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/git-credentials/{credential_id}", headers=headers) @@ -2454,7 +2454,7 @@ def list(self) -> Iterator[CredentialInfo]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/git-credentials", headers=headers) @@ -2501,8 +2501,8 @@ def update( if personal_access_token is not None: body["personal_access_token"] = personal_access_token headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.0/git-credentials/{credential_id}", body=body, headers=headers) @@ -2555,8 +2555,8 @@ def create( if url is not None: body["url"] = url headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("POST", "/api/2.0/repos", body=body, headers=headers) @@ -2574,7 +2574,7 @@ def delete(self, repo_id: int): """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } self._api.do("DELETE", f"/api/2.0/repos/{repo_id}", headers=headers) @@ -2591,7 +2591,7 @@ def get(self, repo_id: int) -> GetRepoResponse: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/repos/{repo_id}", headers=headers) @@ -2609,7 +2609,7 @@ def get_permission_levels(self, repo_id: str) -> GetRepoPermissionLevelsResponse """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/repos/{repo_id}/permissionLevels", headers=headers) @@ -2627,7 +2627,7 @@ def get_permissions(self, repo_id: str) -> RepoPermissions: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", f"/api/2.0/permissions/repos/{repo_id}", headers=headers) @@ -2656,7 +2656,7 @@ def list(self, *, next_page_token: Optional[str] = None, path_prefix: Optional[s if path_prefix is not None: query["path_prefix"] = path_prefix headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } while True: @@ -2686,8 +2686,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PUT", f"/api/2.0/permissions/repos/{repo_id}", body=body, headers=headers) @@ -2728,8 +2728,8 @@ def update( if tag is not None: body["tag"] = tag headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("PATCH", f"/api/2.0/repos/{repo_id}", body=body, headers=headers) @@ -2751,8 +2751,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do("PATCH", f"/api/2.0/permissions/repos/{repo_id}", body=body, headers=headers) @@ -2807,8 +2807,8 @@ def create_scope( if scope_backend_type is not None: body["scope_backend_type"] = scope_backend_type.value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/secrets/scopes/create", body=body, headers=headers) @@ -2835,8 +2835,8 @@ def delete_acl(self, scope: str, principal: str): if scope is not None: body["scope"] = scope headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/secrets/acls/delete", body=body, headers=headers) @@ -2858,8 +2858,8 @@ def delete_scope(self, scope: str): if scope is not None: body["scope"] = scope headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/secrets/scopes/delete", body=body, headers=headers) @@ -2886,8 +2886,8 @@ def delete_secret(self, scope: str, key: str): if scope is not None: body["scope"] = scope headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/secrets/delete", body=body, headers=headers) @@ -2915,7 +2915,7 @@ def get_acl(self, scope: str, principal: str) -> AclItem: if scope is not None: query["scope"] = scope headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/secrets/acls/get", query=query, headers=headers) @@ -2948,7 +2948,7 @@ def get_secret(self, scope: str, key: str) -> GetSecretResponse: if scope is not None: query["scope"] = scope headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/secrets/get", query=query, headers=headers) @@ -2972,7 +2972,7 @@ def list_acls(self, scope: str) -> Iterator[AclItem]: if scope is not None: query["scope"] = scope headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/secrets/acls/list", query=query, headers=headers) @@ -2990,7 +2990,7 @@ def list_scopes(self) -> Iterator[SecretScope]: """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/secrets/scopes/list", headers=headers) @@ -3017,7 +3017,7 @@ def list_secrets(self, scope: str) -> Iterator[SecretMetadata]: if scope is not None: query["scope"] = scope headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/secrets/list", query=query, headers=headers) @@ -3069,8 +3069,8 @@ def put_acl(self, scope: str, principal: str, permission: AclPermission): if scope is not None: body["scope"] = scope headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/secrets/acls/put", body=body, headers=headers) @@ -3117,8 +3117,8 @@ def put_secret( if string_value is not None: body["string_value"] = string_value headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/secrets/put", body=body, headers=headers) @@ -3158,8 +3158,8 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): if recursive is not None: body["recursive"] = recursive headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/workspace/delete", body=body, headers=headers) @@ -3198,7 +3198,7 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR if path is not None: query["path"] = path headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/workspace/export", query=query, headers=headers) @@ -3220,7 +3220,7 @@ def get_permission_levels( """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3245,7 +3245,7 @@ def get_permissions(self, workspace_object_type: str, workspace_object_id: str) """ headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do( @@ -3269,7 +3269,7 @@ def get_status(self, path: str) -> ObjectInfo: if path is not None: query["path"] = path headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } res = self._api.do("GET", "/api/2.0/workspace/get-status", query=query, headers=headers) @@ -3331,8 +3331,8 @@ def import_( if path is not None: body["path"] = path headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/workspace/import", body=body, headers=headers) @@ -3357,7 +3357,7 @@ def list(self, path: str, *, notebooks_modified_after: Optional[int] = None) -> if path is not None: query["path"] = path headers = { - "0": "{Accept application/json}", + "Accept": "application/json", } json = self._api.do("GET", "/api/2.0/workspace/list", query=query, headers=headers) @@ -3384,8 +3384,8 @@ def mkdirs(self, path: str): if path is not None: body["path"] = path headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } self._api.do("POST", "/api/2.0/workspace/mkdirs", body=body, headers=headers) @@ -3415,8 +3415,8 @@ def set_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( @@ -3448,8 +3448,8 @@ def update_permissions( if access_control_list is not None: body["access_control_list"] = [v.as_dict() for v in access_control_list] headers = { - "0": "{Accept application/json}", - "1": "{Content-Type application/json}", + "Accept": "application/json", + "Content-Type": "application/json", } res = self._api.do( From 67e78501ff430abaa05d66c104c7bb6c28ab6c26 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 11:47:08 +0000 Subject: [PATCH 07/20] update --- databricks/sdk/files/v2/impl.py | 12 +- databricks/sdk/jobs/v2/impl.py | 1337 ++++++++++++++++++++++++++++- databricks/sdk/serving/v2/impl.py | 4 +- 3 files changed, 1341 insertions(+), 12 deletions(-) diff --git a/databricks/sdk/files/v2/impl.py b/databricks/sdk/files/v2/impl.py index 5c78e21d5..c2cc92775 100755 --- a/databricks/sdk/files/v2/impl.py +++ b/databricks/sdk/files/v2/impl.py @@ -1124,9 +1124,9 @@ def download(self, file_path: str) -> DownloadResponse: "Accept": "application/octet-stream", } response_headers = [ - "{content_length}", - "{content_type}", - "{last_modified}", + "content-length", + "content-type", + "last-modified", ] res = self._api.do( "GET", @@ -1173,9 +1173,9 @@ def get_metadata(self, file_path: str) -> GetMetadataResponse: headers = {} response_headers = [ - "{content_length}", - "{content_type}", - "{last_modified}", + "content-length", + "content-type", + "last-modified", ] res = self._api.do( "HEAD", diff --git a/databricks/sdk/jobs/v2/impl.py b/databricks/sdk/jobs/v2/impl.py index a5df4379b..0a2c0df91 100755 --- a/databricks/sdk/jobs/v2/impl.py +++ b/databricks/sdk/jobs/v2/impl.py @@ -15,6 +15,297 @@ # all definitions in this file are in alphabetical order +@dataclass +class Adlsgen2Info: + """A storage location in Adls Gen2""" + + destination: str + """abfss destination, e.g. + `abfss://@.dfs.core.windows.net/`.""" + + def as_dict(self) -> dict: + """Serializes the Adlsgen2Info into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Adlsgen2Info into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: + """Deserializes the Adlsgen2Info from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class AutoScale: + max_workers: Optional[int] = None + """The maximum number of workers to which the cluster can scale up when overloaded. Note that + `max_workers` must be strictly greater than `min_workers`.""" + + min_workers: Optional[int] = None + """The minimum number of workers to which the cluster can scale down when underutilized. It is also + the initial number of workers the cluster will have after creation.""" + + def as_dict(self) -> dict: + """Serializes the AutoScale into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.max_workers is not None: + body["max_workers"] = self.max_workers + if self.min_workers is not None: + body["min_workers"] = self.min_workers + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AutoScale into a shallow dictionary of its immediate attributes.""" + body = {} + if self.max_workers is not None: + body["max_workers"] = self.max_workers + if self.min_workers is not None: + body["min_workers"] = self.min_workers + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AutoScale: + """Deserializes the AutoScale from a dictionary.""" + return cls(max_workers=d.get("max_workers", None), min_workers=d.get("min_workers", None)) + + +@dataclass +class AwsAttributes: + """Attributes set during cluster creation which are related to Amazon Web Services.""" + + availability: Optional[AwsAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ebs_volume_count: Optional[int] = None + """The number of volumes launched for each instance. Users can choose up to 10 volumes. This + feature is only enabled for supported node types. Legacy node types cannot specify custom EBS + volumes. For node types with no instance store, at least one EBS volume needs to be specified; + otherwise, cluster creation will fail. + + These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. Instance store volumes will be + mounted at `/local_disk0`, `/local_disk1`, and etc. + + If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for + scratch storage because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance + store volumes. + + Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + will be overridden.""" + + ebs_volume_iops: Optional[int] = None + """If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance + of a gp2 volume with the same volume size will be used.""" + + ebs_volume_size: Optional[int] = None + """The size of each EBS volume (in GiB) launched for each instance. For general purpose SSD, this + value must be within the range 100 - 4096. For throughput optimized HDD, this value must be + within the range 500 - 4096.""" + + ebs_volume_throughput: Optional[int] = None + """If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum + performance of a gp2 volume with the same volume size will be used.""" + + ebs_volume_type: Optional[EbsVolumeType] = None + """The type of EBS volumes that will be launched with this cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. If this + value is greater than 0, the cluster driver node in particular will be placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + instance_profile_arn: Optional[str] = None + """Nodes for this cluster will only be placed on AWS instances with this instance profile. If + ommitted, nodes will be placed on instances without an IAM instance profile. The instance + profile must have previously been added to the Databricks environment by an account + administrator. + + This feature may only be available to certain customer plans.""" + + spot_bid_price_percent: Optional[int] = None + """The bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. For example, if this field is set to 50, and the cluster needs a new + `r3.xlarge` spot instance, then the bid price is half of the price of on-demand `r3.xlarge` + instances. Similarly, if this field is set to 200, the bid price is twice the price of on-demand + `r3.xlarge` instances. If not specified, the default value is 100. When spot instances are + requested for this cluster, only spot instances whose bid price percentage matches this field + will be considered. Note that, for safety, we enforce this field to be no more than 10000.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone/datacenter in which the cluster resides. This string will + be of a form like "us-west-2a". The provided availability zone must be in the same region as the + Databricks deployment. For example, "us-west-2a" is not a valid zone id if the Databricks + deployment resides in the "us-east-1" region. This is an optional field at cluster creation, and + if not specified, a default zone will be used. If the zone specified is "auto", will try to + place cluster in a zone with high availability, and will retry placement in a different AZ if + there is not enough capacity. + + The list of available zones as well as the default value can be found by using the `List Zones` + method.""" + + def as_dict(self) -> dict: + """Serializes the AwsAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AwsAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.ebs_volume_count is not None: + body["ebs_volume_count"] = self.ebs_volume_count + if self.ebs_volume_iops is not None: + body["ebs_volume_iops"] = self.ebs_volume_iops + if self.ebs_volume_size is not None: + body["ebs_volume_size"] = self.ebs_volume_size + if self.ebs_volume_throughput is not None: + body["ebs_volume_throughput"] = self.ebs_volume_throughput + if self.ebs_volume_type is not None: + body["ebs_volume_type"] = self.ebs_volume_type + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.instance_profile_arn is not None: + body["instance_profile_arn"] = self.instance_profile_arn + if self.spot_bid_price_percent is not None: + body["spot_bid_price_percent"] = self.spot_bid_price_percent + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AwsAttributes: + """Deserializes the AwsAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AwsAvailability), + ebs_volume_count=d.get("ebs_volume_count", None), + ebs_volume_iops=d.get("ebs_volume_iops", None), + ebs_volume_size=d.get("ebs_volume_size", None), + ebs_volume_throughput=d.get("ebs_volume_throughput", None), + ebs_volume_type=_enum(d, "ebs_volume_type", EbsVolumeType), + first_on_demand=d.get("first_on_demand", None), + instance_profile_arn=d.get("instance_profile_arn", None), + spot_bid_price_percent=d.get("spot_bid_price_percent", None), + zone_id=d.get("zone_id", None), + ) + + +class AwsAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND = "ON_DEMAND" + SPOT = "SPOT" + SPOT_WITH_FALLBACK = "SPOT_WITH_FALLBACK" + + +@dataclass +class AzureAttributes: + """Attributes set during cluster creation which are related to Microsoft Azure.""" + + availability: Optional[AzureAvailability] = None + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + first_on_demand: Optional[int] = None + """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This + value should be greater than 0, to make sure the cluster driver node is placed on an on-demand + instance. If this value is greater than or equal to the current cluster size, all nodes will be + placed on on-demand instances. If this value is less than the current cluster size, + `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed + on `availability` instances. Note that this value does not affect cluster size and cannot + currently be mutated over the lifetime of a cluster.""" + + log_analytics_info: Optional[LogAnalyticsInfo] = None + """Defines values necessary to configure and run Azure Log Analytics agent""" + + spot_bid_max_price: Optional[float] = None + """The max bid price to be used for Azure spot instances. The Max price for the bid cannot be + higher than the on-demand price of the instance. If not specified, the default value is -1, + which specifies that the instance cannot be evicted on the basis of price, and only on the basis + of availability. Further, the value should > 0 or -1.""" + + def as_dict(self) -> dict: + """Serializes the AzureAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info.as_dict() + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AzureAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.first_on_demand is not None: + body["first_on_demand"] = self.first_on_demand + if self.log_analytics_info: + body["log_analytics_info"] = self.log_analytics_info + if self.spot_bid_max_price is not None: + body["spot_bid_max_price"] = self.spot_bid_max_price + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AzureAttributes: + """Deserializes the AzureAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", AzureAvailability), + first_on_demand=d.get("first_on_demand", None), + log_analytics_info=_from_dict(d, "log_analytics_info", LogAnalyticsInfo), + spot_bid_max_price=d.get("spot_bid_max_price", None), + ) + + +class AzureAvailability(Enum): + """Availability type used for all subsequent nodes past the `first_on_demand` ones. Note: If + `first_on_demand` is zero, this availability type will be used for the entire cluster.""" + + ON_DEMAND_AZURE = "ON_DEMAND_AZURE" + SPOT_AZURE = "SPOT_AZURE" + SPOT_WITH_FALLBACK_AZURE = "SPOT_WITH_FALLBACK_AZURE" + + @dataclass class BaseJob: created_time: Optional[int] = None @@ -687,6 +978,38 @@ def from_dict(cls, d: Dict[str, Any]) -> CleanRoomsNotebookTaskCleanRoomsNoteboo ) +@dataclass +class ClientsTypes: + jobs: Optional[bool] = None + """With jobs set, the cluster can be used for jobs""" + + notebooks: Optional[bool] = None + """With notebooks set, this cluster can be used for notebooks""" + + def as_dict(self) -> dict: + """Serializes the ClientsTypes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.jobs is not None: + body["jobs"] = self.jobs + if self.notebooks is not None: + body["notebooks"] = self.notebooks + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ClientsTypes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.jobs is not None: + body["jobs"] = self.jobs + if self.notebooks is not None: + body["notebooks"] = self.notebooks + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ClientsTypes: + """Deserializes the ClientsTypes from a dictionary.""" + return cls(jobs=d.get("jobs", None), notebooks=d.get("notebooks", None)) + + @dataclass class ClusterInstance: cluster_id: Optional[str] = None @@ -730,6 +1053,56 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterInstance: return cls(cluster_id=d.get("cluster_id", None), spark_context_id=d.get("spark_context_id", None)) +@dataclass +class ClusterLogConf: + """Cluster log delivery config""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } + }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ "s3": { "destination" + : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` Cluster iam role is used to + access s3, please make sure the cluster iam role in `instance_profile_arn` has permission to + write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided, e.g. `{ "volumes": { "destination": + "/Volumes/catalog/schema/volume/cluster_log" } }`""" + + def as_dict(self) -> dict: + """Serializes the ClusterLogConf into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ClusterLogConf into a shallow dictionary of its immediate attributes.""" + body = {} + if self.dbfs: + body["dbfs"] = self.dbfs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ClusterLogConf: + """Deserializes the ClusterLogConf from a dictionary.""" + return cls( + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + ) + + @dataclass class ClusterSpec: existing_cluster_id: Optional[str] = None @@ -1265,6 +1638,71 @@ def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: ) +class DataSecurityMode(Enum): + """Data security mode decides what data governance model to use when accessing data from a cluster. + + The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: + Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: + Alias for `SINGLE_USER`. + + The following modes can be used regardless of `kind`. * `NONE`: No security isolation for + multiple users sharing the cluster. Data governance features are not available in this mode. * + `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in + `single_user_name`. Most programming languages, cluster features and data governance features + are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple + users. Cluster users are fully isolated so that they cannot see each other's data and + credentials. Most data governance features are supported in this mode. But programming languages + and cluster features might be limited. + + The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for + future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * + `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high + concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy + Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that + doesn’t have UC nor passthrough enabled.""" + + DATA_SECURITY_MODE_AUTO = "DATA_SECURITY_MODE_AUTO" + DATA_SECURITY_MODE_DEDICATED = "DATA_SECURITY_MODE_DEDICATED" + DATA_SECURITY_MODE_STANDARD = "DATA_SECURITY_MODE_STANDARD" + LEGACY_PASSTHROUGH = "LEGACY_PASSTHROUGH" + LEGACY_SINGLE_USER = "LEGACY_SINGLE_USER" + LEGACY_SINGLE_USER_STANDARD = "LEGACY_SINGLE_USER_STANDARD" + LEGACY_TABLE_ACL = "LEGACY_TABLE_ACL" + NONE = "NONE" + SINGLE_USER = "SINGLE_USER" + USER_ISOLATION = "USER_ISOLATION" + + +@dataclass +class DbfsStorageInfo: + """A storage location in DBFS""" + + destination: str + """dbfs destination, e.g. `dbfs:/my/path`""" + + def as_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DbfsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DbfsStorageInfo: + """Deserializes the DbfsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class DbtOutput: artifacts_headers: Optional[Dict[str, str]] = None @@ -1473,6 +1911,78 @@ def from_dict(cls, d: Dict[str, Any]) -> DeleteRunResponse: return cls() +@dataclass +class DockerBasicAuth: + password: Optional[str] = None + """Password of the user""" + + username: Optional[str] = None + """Name of the user""" + + def as_dict(self) -> dict: + """Serializes the DockerBasicAuth into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.password is not None: + body["password"] = self.password + if self.username is not None: + body["username"] = self.username + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DockerBasicAuth into a shallow dictionary of its immediate attributes.""" + body = {} + if self.password is not None: + body["password"] = self.password + if self.username is not None: + body["username"] = self.username + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DockerBasicAuth: + """Deserializes the DockerBasicAuth from a dictionary.""" + return cls(password=d.get("password", None), username=d.get("username", None)) + + +@dataclass +class DockerImage: + basic_auth: Optional[DockerBasicAuth] = None + """Basic auth with username and password""" + + url: Optional[str] = None + """URL of the docker image.""" + + def as_dict(self) -> dict: + """Serializes the DockerImage into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.basic_auth: + body["basic_auth"] = self.basic_auth.as_dict() + if self.url is not None: + body["url"] = self.url + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DockerImage into a shallow dictionary of its immediate attributes.""" + body = {} + if self.basic_auth: + body["basic_auth"] = self.basic_auth + if self.url is not None: + body["url"] = self.url + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DockerImage: + """Deserializes the DockerImage from a dictionary.""" + return cls(basic_auth=_from_dict(d, "basic_auth", DockerBasicAuth), url=d.get("url", None)) + + +class EbsVolumeType(Enum): + """All EBS volume types that Databricks supports. See https://aws.amazon.com/ebs/details/ for + details.""" + + GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" + THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" + + @dataclass class EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Represents a change to the job cluster's settings that would be required for the job clusters to @@ -1915,6 +2425,124 @@ class Format(Enum): SINGLE_TASK = "SINGLE_TASK" +@dataclass +class GcpAttributes: + """Attributes set during cluster creation which are related to GCP.""" + + availability: Optional[GcpAvailability] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs, + on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + boot_disk_size: Optional[int] = None + """Boot disk size in GB""" + + google_service_account: Optional[str] = None + """If provided, the cluster will impersonate the google service account when accessing gcloud + services (like GCS). The google service account must have previously been added to the + Databricks environment by an account administrator.""" + + local_ssd_count: Optional[int] = None + """If provided, each node (workers and driver) in the cluster will have this number of local SSDs + attached. Each local SSD is 375GB in size. Refer to [GCP documentation] for the supported number + of local SSDs for each instance type. + + [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds""" + + use_preemptible_executors: Optional[bool] = None + """This field determines whether the spark executors will be scheduled to run on preemptible VMs + (when set to true) versus standard compute engine VMs (when set to false; default). Note: Soon + to be deprecated, use the 'availability' field instead.""" + + zone_id: Optional[str] = None + """Identifier for the availability zone in which the cluster resides. This can be one of the + following: - "HA" => High availability, spread nodes across availability zones for a Databricks + deployment region [default]. - "AUTO" => Databricks picks an availability zone to schedule the + cluster on. - A GCP availability zone => Pick One of the available zones for (machine type + + region) from https://cloud.google.com/compute/docs/regions-zones.""" + + def as_dict(self) -> dict: + """Serializes the GcpAttributes into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability.value + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcpAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: + body["availability"] = self.availability + if self.boot_disk_size is not None: + body["boot_disk_size"] = self.boot_disk_size + if self.google_service_account is not None: + body["google_service_account"] = self.google_service_account + if self.local_ssd_count is not None: + body["local_ssd_count"] = self.local_ssd_count + if self.use_preemptible_executors is not None: + body["use_preemptible_executors"] = self.use_preemptible_executors + if self.zone_id is not None: + body["zone_id"] = self.zone_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcpAttributes: + """Deserializes the GcpAttributes from a dictionary.""" + return cls( + availability=_enum(d, "availability", GcpAvailability), + boot_disk_size=d.get("boot_disk_size", None), + google_service_account=d.get("google_service_account", None), + local_ssd_count=d.get("local_ssd_count", None), + use_preemptible_executors=d.get("use_preemptible_executors", None), + zone_id=d.get("zone_id", None), + ) + + +class GcpAvailability(Enum): + """This field determines whether the instance pool will contain preemptible VMs, on-demand VMs, or + preemptible VMs with a fallback to on-demand VMs if the former is unavailable.""" + + ON_DEMAND_GCP = "ON_DEMAND_GCP" + PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" + PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" + + +@dataclass +class GcsStorageInfo: + """A storage location in Google Cloud Platform's GCS""" + + destination: str + """GCS destination/URI, e.g. `gs://my-bucket/some-prefix`""" + + def as_dict(self) -> dict: + """Serializes the GcsStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GcsStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: + """Deserializes the GcsStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class GenAiComputeTask: """Next field: 9""" @@ -2201,6 +2829,90 @@ def from_dict(cls, d: Dict[str, Any]) -> GitSource: ) +@dataclass +class InitScriptInfo: + """Config for an individual init script Next ID: 11""" + + abfss: Optional[Adlsgen2Info] = None + """destination needs to be provided, e.g. + `abfss://@.dfs.core.windows.net/`""" + + dbfs: Optional[DbfsStorageInfo] = None + """destination needs to be provided. e.g. `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } + }`""" + + file: Optional[LocalFileInfo] = None + """destination needs to be provided, e.g. `{ "file": { "destination": "file:/my/local/file.sh" } }`""" + + gcs: Optional[GcsStorageInfo] = None + """destination needs to be provided, e.g. `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }`""" + + s3: Optional[S3StorageInfo] = None + """destination and either the region or endpoint need to be provided. e.g. `{ \"s3\": { + \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` Cluster iam + role is used to access s3, please make sure the cluster iam role in `instance_profile_arn` has + permission to write data to the s3 destination.""" + + volumes: Optional[VolumesStorageInfo] = None + """destination needs to be provided. e.g. `{ \"volumes\" : { \"destination\" : + \"/Volumes/my-init.sh\" } }`""" + + workspace: Optional[WorkspaceStorageInfo] = None + """destination needs to be provided, e.g. `{ "workspace": { "destination": + "/cluster-init-scripts/setup-datadog.sh" } }`""" + + def as_dict(self) -> dict: + """Serializes the InitScriptInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss.as_dict() + if self.dbfs: + body["dbfs"] = self.dbfs.as_dict() + if self.file: + body["file"] = self.file.as_dict() + if self.gcs: + body["gcs"] = self.gcs.as_dict() + if self.s3: + body["s3"] = self.s3.as_dict() + if self.volumes: + body["volumes"] = self.volumes.as_dict() + if self.workspace: + body["workspace"] = self.workspace.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the InitScriptInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.abfss: + body["abfss"] = self.abfss + if self.dbfs: + body["dbfs"] = self.dbfs + if self.file: + body["file"] = self.file + if self.gcs: + body["gcs"] = self.gcs + if self.s3: + body["s3"] = self.s3 + if self.volumes: + body["volumes"] = self.volumes + if self.workspace: + body["workspace"] = self.workspace + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> InitScriptInfo: + """Deserializes the InitScriptInfo from a dictionary.""" + return cls( + abfss=_from_dict(d, "abfss", Adlsgen2Info), + dbfs=_from_dict(d, "dbfs", DbfsStorageInfo), + file=_from_dict(d, "file", LocalFileInfo), + gcs=_from_dict(d, "gcs", GcsStorageInfo), + s3=_from_dict(d, "s3", S3StorageInfo), + volumes=_from_dict(d, "volumes", VolumesStorageInfo), + workspace=_from_dict(d, "workspace", WorkspaceStorageInfo), + ) + + @dataclass class Job: """Job was retrieved successfully.""" @@ -2416,7 +3128,7 @@ class JobCluster: `JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution.""" - new_cluster: ClusterSpec + new_cluster: JobsClusterSpec """If new_cluster, a description of a cluster that is created for each task.""" def as_dict(self) -> dict: @@ -2441,7 +3153,7 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> JobCluster: """Deserializes the JobCluster from a dictionary.""" return cls( - job_cluster_key=d.get("job_cluster_key", None), new_cluster=_from_dict(d, "new_cluster", ClusterSpec) + job_cluster_key=d.get("job_cluster_key", None), new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec) ) @@ -3276,6 +3988,369 @@ class JobSourceDirtyState(Enum): NOT_SYNCED = "NOT_SYNCED" +@dataclass +class JobsClusterSpec: + """Contains a snapshot of the latest user specified settings that were used to create/edit the + cluster.""" + + apply_policy_default_values: Optional[bool] = None + """When set to true, fixed and default values from the policy will be used for fields that are + omitted. When set to false, only fixed values from the policy will be applied.""" + + autoscale: Optional[AutoScale] = None + """Parameters needed in order to automatically scale clusters up and down based on load. Note: + autoscaling works best with DB runtime versions 3.0 or later.""" + + autotermination_minutes: Optional[int] = None + """Automatically terminates the cluster after it is inactive for this time in minutes. If not set, + this cluster will not be automatically terminated. If specified, the threshold must be between + 10 and 10000 minutes. Users can also set this value to 0 to explicitly disable automatic + termination.""" + + aws_attributes: Optional[AwsAttributes] = None + """Attributes related to clusters running on Amazon Web Services. If not specified at cluster + creation, a set of default values will be used.""" + + azure_attributes: Optional[AzureAttributes] = None + """Attributes related to clusters running on Microsoft Azure. If not specified at cluster creation, + a set of default values will be used.""" + + cluster_log_conf: Optional[ClusterLogConf] = None + """The configuration for delivering spark logs to a long-term storage destination. Three kinds of + destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be + specified for one cluster. If the conf is given, the logs will be delivered to the destination + every `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while the + destination of executor logs is `$destination/$clusterId/executor`.""" + + cluster_name: Optional[str] = None + """Cluster name requested by the user. This doesn't have to be unique. If not specified at + creation, the cluster name will be an empty string.""" + + custom_tags: Optional[Dict[str, str]] = None + """Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + + - Currently, Databricks allows at most 45 custom tags + + - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster + tags""" + + data_security_mode: Optional[DataSecurityMode] = None + """Data security mode decides what data governance model to use when accessing data from a cluster. + + The following modes can only be used when `kind = CLASSIC_PREVIEW`. * `DATA_SECURITY_MODE_AUTO`: + Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * `DATA_SECURITY_MODE_DEDICATED`: + Alias for `SINGLE_USER`. + + The following modes can be used regardless of `kind`. * `NONE`: No security isolation for + multiple users sharing the cluster. Data governance features are not available in this mode. * + `SINGLE_USER`: A secure cluster that can only be exclusively used by a single user specified in + `single_user_name`. Most programming languages, cluster features and data governance features + are available in this mode. * `USER_ISOLATION`: A secure cluster that can be shared by multiple + users. Cluster users are fully isolated so that they cannot see each other's data and + credentials. Most data governance features are supported in this mode. But programming languages + and cluster features might be limited. + + The following modes are deprecated starting with Databricks Runtime 15.0 and will be removed for + future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. * + `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high + concurrency clusters. * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy + Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that + doesn’t have UC nor passthrough enabled.""" + + docker_image: Optional[DockerImage] = None + """Custom docker image BYOC""" + + driver_instance_pool_id: Optional[str] = None + """The optional ID of the instance pool for the driver of the cluster belongs. The pool cluster + uses the instance pool with id (instance_pool_id) if the driver pool is not assigned.""" + + driver_node_type_id: Optional[str] = None + """The node type of the Spark driver. Note that this field is optional; if unset, the driver node + type will be set as the same value as `node_type_id` defined above. + + This field, along with node_type_id, should not be set if virtual_cluster_size is set. If both + driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id + and node_type_id take precedence.""" + + enable_elastic_disk: Optional[bool] = None + """Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + space when its Spark workers are running low on disk space. This feature requires specific AWS + permissions to function correctly - refer to the User Guide for more details.""" + + enable_local_disk_encryption: Optional[bool] = None + """Whether to enable LUKS on cluster VMs' local disks""" + + gcp_attributes: Optional[GcpAttributes] = None + """Attributes related to clusters running on Google Cloud Platform. If not specified at cluster + creation, a set of default values will be used.""" + + init_scripts: Optional[List[InitScriptInfo]] = None + """The configuration for storing init scripts. Any number of destinations can be specified. The + scripts are executed sequentially in the order provided. If `cluster_log_conf` is specified, + init script logs are sent to `//init_scripts`.""" + + instance_pool_id: Optional[str] = None + """The optional ID of the instance pool to which the cluster belongs.""" + + is_single_node: Optional[bool] = None + """This field can only be used when `kind = CLASSIC_PREVIEW`. + + When set to true, Databricks will automatically set single node related `custom_tags`, + `spark_conf`, and `num_workers`""" + + kind: Optional[Kind] = None + """The kind of compute described by this compute specification. + + Depending on `kind`, different validations and default values will be applied. + + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no + specified `kind` do not. * [is_single_node](/api/workspace/clusters/create#is_single_node) * + [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) * + [data_security_mode](/api/workspace/clusters/create#data_security_mode) set to + `DATA_SECURITY_MODE_AUTO`, `DATA_SECURITY_MODE_DEDICATED`, or `DATA_SECURITY_MODE_STANDARD` + + By using the [simple form], your clusters are automatically using `kind = CLASSIC_PREVIEW`. + + [simple form]: https://docs.databricks.com/compute/simple-form.html""" + + node_type_id: Optional[str] = None + """This field encodes, through a single value, the resources available to each of the Spark nodes + in this cluster. For example, the Spark nodes can be provisioned and optimized for memory or + compute intensive workloads. A list of available node types can be retrieved by using the + :method:clusters/listNodeTypes API call.""" + + num_workers: Optional[int] = None + """Number of worker nodes that this cluster should have. A cluster has one Spark Driver and + `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + + Note: When reading the properties of a cluster, this field reflects the desired number of + workers rather than the actual current number of workers. For instance, if a cluster is resized + from 5 to 10 workers, this field will immediately be updated to reflect the target size of 10 + workers, whereas the workers listed in `spark_info` will gradually increase from 5 to 10 as the + new nodes are provisioned.""" + + policy_id: Optional[str] = None + """The ID of the cluster policy used to create the cluster if applicable.""" + + runtime_engine: Optional[RuntimeEngine] = None + """Determines the cluster's runtime engine, either standard or Photon. + + This field is not compatible with legacy `spark_version` values that contain `-photon-`. Remove + `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. + + If left unspecified, the runtime engine defaults to standard unless the spark_version contains + -photon-, in which case Photon will be used.""" + + single_user_name: Optional[str] = None + """Single user name if data_security_mode is `SINGLE_USER`""" + + spark_conf: Optional[Dict[str, str]] = None + """An object containing a set of optional, user-specified Spark configuration key-value pairs. + Users can also pass in a string of extra JVM options to the driver and the executors via + `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively.""" + + spark_env_vars: Optional[Dict[str, str]] = None + """An object containing a set of optional, user-specified environment variable key-value pairs. + Please note that key-value pair of the form (X,Y) will be exported as is (i.e., `export X='Y'`) + while launching the driver and workers. + + In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending them + to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all default + databricks managed environmental variables are included as well. + + Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": + "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS + -Dspark.shuffle.service.enabled=true"}`""" + + spark_version: Optional[str] = None + """The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of available Spark versions can + be retrieved by using the :method:clusters/sparkVersions API call.""" + + ssh_public_keys: Optional[List[str]] = None + """SSH public key contents that will be added to each Spark node in this cluster. The corresponding + private keys can be used to login with the user name `ubuntu` on port `2200`. Up to 10 keys can + be specified.""" + + use_ml_runtime: Optional[bool] = None + """This field can only be used when `kind = CLASSIC_PREVIEW`. + + `effective_spark_version` is determined by `spark_version` (DBR release), this field + `use_ml_runtime`, and whether `node_type_id` is gpu node or not.""" + + workload_type: Optional[WorkloadType] = None + """Cluster Attributes showing for clusters workload types.""" + + def as_dict(self) -> dict: + """Serializes the JobsClusterSpec into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.apply_policy_default_values is not None: + body["apply_policy_default_values"] = self.apply_policy_default_values + if self.autoscale: + body["autoscale"] = self.autoscale.as_dict() + if self.autotermination_minutes is not None: + body["autotermination_minutes"] = self.autotermination_minutes + if self.aws_attributes: + body["aws_attributes"] = self.aws_attributes.as_dict() + if self.azure_attributes: + body["azure_attributes"] = self.azure_attributes.as_dict() + if self.cluster_log_conf: + body["cluster_log_conf"] = self.cluster_log_conf.as_dict() + if self.cluster_name is not None: + body["cluster_name"] = self.cluster_name + if self.custom_tags: + body["custom_tags"] = self.custom_tags + if self.data_security_mode is not None: + body["data_security_mode"] = self.data_security_mode.value + if self.docker_image: + body["docker_image"] = self.docker_image.as_dict() + if self.driver_instance_pool_id is not None: + body["driver_instance_pool_id"] = self.driver_instance_pool_id + if self.driver_node_type_id is not None: + body["driver_node_type_id"] = self.driver_node_type_id + if self.enable_elastic_disk is not None: + body["enable_elastic_disk"] = self.enable_elastic_disk + if self.enable_local_disk_encryption is not None: + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + if self.gcp_attributes: + body["gcp_attributes"] = self.gcp_attributes.as_dict() + if self.init_scripts: + body["init_scripts"] = [v.as_dict() for v in self.init_scripts] + if self.instance_pool_id is not None: + body["instance_pool_id"] = self.instance_pool_id + if self.is_single_node is not None: + body["is_single_node"] = self.is_single_node + if self.kind is not None: + body["kind"] = self.kind.value + if self.node_type_id is not None: + body["node_type_id"] = self.node_type_id + if self.num_workers is not None: + body["num_workers"] = self.num_workers + if self.policy_id is not None: + body["policy_id"] = self.policy_id + if self.runtime_engine is not None: + body["runtime_engine"] = self.runtime_engine.value + if self.single_user_name is not None: + body["single_user_name"] = self.single_user_name + if self.spark_conf: + body["spark_conf"] = self.spark_conf + if self.spark_env_vars: + body["spark_env_vars"] = self.spark_env_vars + if self.spark_version is not None: + body["spark_version"] = self.spark_version + if self.ssh_public_keys: + body["ssh_public_keys"] = [v for v in self.ssh_public_keys] + if self.use_ml_runtime is not None: + body["use_ml_runtime"] = self.use_ml_runtime + if self.workload_type: + body["workload_type"] = self.workload_type.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the JobsClusterSpec into a shallow dictionary of its immediate attributes.""" + body = {} + if self.apply_policy_default_values is not None: + body["apply_policy_default_values"] = self.apply_policy_default_values + if self.autoscale: + body["autoscale"] = self.autoscale + if self.autotermination_minutes is not None: + body["autotermination_minutes"] = self.autotermination_minutes + if self.aws_attributes: + body["aws_attributes"] = self.aws_attributes + if self.azure_attributes: + body["azure_attributes"] = self.azure_attributes + if self.cluster_log_conf: + body["cluster_log_conf"] = self.cluster_log_conf + if self.cluster_name is not None: + body["cluster_name"] = self.cluster_name + if self.custom_tags: + body["custom_tags"] = self.custom_tags + if self.data_security_mode is not None: + body["data_security_mode"] = self.data_security_mode + if self.docker_image: + body["docker_image"] = self.docker_image + if self.driver_instance_pool_id is not None: + body["driver_instance_pool_id"] = self.driver_instance_pool_id + if self.driver_node_type_id is not None: + body["driver_node_type_id"] = self.driver_node_type_id + if self.enable_elastic_disk is not None: + body["enable_elastic_disk"] = self.enable_elastic_disk + if self.enable_local_disk_encryption is not None: + body["enable_local_disk_encryption"] = self.enable_local_disk_encryption + if self.gcp_attributes: + body["gcp_attributes"] = self.gcp_attributes + if self.init_scripts: + body["init_scripts"] = self.init_scripts + if self.instance_pool_id is not None: + body["instance_pool_id"] = self.instance_pool_id + if self.is_single_node is not None: + body["is_single_node"] = self.is_single_node + if self.kind is not None: + body["kind"] = self.kind + if self.node_type_id is not None: + body["node_type_id"] = self.node_type_id + if self.num_workers is not None: + body["num_workers"] = self.num_workers + if self.policy_id is not None: + body["policy_id"] = self.policy_id + if self.runtime_engine is not None: + body["runtime_engine"] = self.runtime_engine + if self.single_user_name is not None: + body["single_user_name"] = self.single_user_name + if self.spark_conf: + body["spark_conf"] = self.spark_conf + if self.spark_env_vars: + body["spark_env_vars"] = self.spark_env_vars + if self.spark_version is not None: + body["spark_version"] = self.spark_version + if self.ssh_public_keys: + body["ssh_public_keys"] = self.ssh_public_keys + if self.use_ml_runtime is not None: + body["use_ml_runtime"] = self.use_ml_runtime + if self.workload_type: + body["workload_type"] = self.workload_type + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> JobsClusterSpec: + """Deserializes the JobsClusterSpec from a dictionary.""" + return cls( + apply_policy_default_values=d.get("apply_policy_default_values", None), + autoscale=_from_dict(d, "autoscale", AutoScale), + autotermination_minutes=d.get("autotermination_minutes", None), + aws_attributes=_from_dict(d, "aws_attributes", AwsAttributes), + azure_attributes=_from_dict(d, "azure_attributes", AzureAttributes), + cluster_log_conf=_from_dict(d, "cluster_log_conf", ClusterLogConf), + cluster_name=d.get("cluster_name", None), + custom_tags=d.get("custom_tags", None), + data_security_mode=_enum(d, "data_security_mode", DataSecurityMode), + docker_image=_from_dict(d, "docker_image", DockerImage), + driver_instance_pool_id=d.get("driver_instance_pool_id", None), + driver_node_type_id=d.get("driver_node_type_id", None), + enable_elastic_disk=d.get("enable_elastic_disk", None), + enable_local_disk_encryption=d.get("enable_local_disk_encryption", None), + gcp_attributes=_from_dict(d, "gcp_attributes", GcpAttributes), + init_scripts=_repeated_dict(d, "init_scripts", InitScriptInfo), + instance_pool_id=d.get("instance_pool_id", None), + is_single_node=d.get("is_single_node", None), + kind=_enum(d, "kind", Kind), + node_type_id=d.get("node_type_id", None), + num_workers=d.get("num_workers", None), + policy_id=d.get("policy_id", None), + runtime_engine=_enum(d, "runtime_engine", RuntimeEngine), + single_user_name=d.get("single_user_name", None), + spark_conf=d.get("spark_conf", None), + spark_env_vars=d.get("spark_env_vars", None), + spark_version=d.get("spark_version", None), + ssh_public_keys=d.get("ssh_public_keys", None), + use_ml_runtime=d.get("use_ml_runtime", None), + workload_type=_from_dict(d, "workload_type", WorkloadType), + ) + + class JobsHealthMetric(Enum): """Specifies the health metric that is being evaluated for a particular health rule. @@ -3377,6 +4452,24 @@ def from_dict(cls, d: Dict[str, Any]) -> JobsHealthRules: return cls(rules=_repeated_dict(d, "rules", JobsHealthRule)) +class Kind(Enum): + """The kind of compute described by this compute specification. + + Depending on `kind`, different validations and default values will be applied. + + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no + specified `kind` do not. * [is_single_node](/api/workspace/clusters/create#is_single_node) * + [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) * + [data_security_mode](/api/workspace/clusters/create#data_security_mode) set to + `DATA_SECURITY_MODE_AUTO`, `DATA_SECURITY_MODE_DEDICATED`, or `DATA_SECURITY_MODE_STANDARD` + + By using the [simple form], your clusters are automatically using `kind = CLASSIC_PREVIEW`. + + [simple form]: https://docs.databricks.com/compute/simple-form.html""" + + CLASSIC_PREVIEW = "CLASSIC_PREVIEW" + + @dataclass class Library: cran: Optional[RCranLibrary] = None @@ -3616,6 +4709,64 @@ def from_dict(cls, d: Dict[str, Any]) -> ListRunsResponse: ) +@dataclass +class LocalFileInfo: + destination: str + """local file destination, e.g. `file:/my/local/file.sh`""" + + def as_dict(self) -> dict: + """Serializes the LocalFileInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LocalFileInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LocalFileInfo: + """Deserializes the LocalFileInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + +@dataclass +class LogAnalyticsInfo: + log_analytics_primary_key: Optional[str] = None + + log_analytics_workspace_id: Optional[str] = None + + def as_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the LogAnalyticsInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.log_analytics_primary_key is not None: + body["log_analytics_primary_key"] = self.log_analytics_primary_key + if self.log_analytics_workspace_id is not None: + body["log_analytics_workspace_id"] = self.log_analytics_workspace_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> LogAnalyticsInfo: + """Deserializes the LogAnalyticsInfo from a dictionary.""" + return cls( + log_analytics_primary_key=d.get("log_analytics_primary_key", None), + log_analytics_workspace_id=d.get("log_analytics_workspace_id", None), + ) + + @dataclass class MavenLibrary: coordinates: str @@ -6496,6 +7647,102 @@ class RunType(Enum): WORKFLOW_RUN = "WORKFLOW_RUN" +class RuntimeEngine(Enum): + + NULL = "NULL" + PHOTON = "PHOTON" + STANDARD = "STANDARD" + + +@dataclass +class S3StorageInfo: + """A storage location in Amazon S3""" + + destination: str + """S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using cluster + iam role, please make sure you set cluster iam role and the role has write access to the + destination. Please also note that you cannot use AWS keys to deliver logs.""" + + canned_acl: Optional[str] = None + """(Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. If + `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + the destination bucket and prefix. The full list of possible canned acl can be found at + http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. Please also note + that by default only the object owner gets full controls. If you are using cross account role + for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + read the logs.""" + + enable_encryption: Optional[bool] = None + """(Optional) Flag to enable server side encryption, `false` by default.""" + + encryption_type: Optional[str] = None + """(Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + encryption is enabled and the default type is `sse-s3`.""" + + endpoint: Optional[str] = None + """S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be + set. If both are set, endpoint will be used.""" + + kms_key: Optional[str] = None + """(Optional) Kms key which will be used if encryption is enabled and encryption type is set to + `sse-kms`.""" + + region: Optional[str] = None + """S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + endpoint will be used.""" + + def as_dict(self) -> dict: + """Serializes the S3StorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + def as_shallow_dict(self) -> dict: + """Serializes the S3StorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.canned_acl is not None: + body["canned_acl"] = self.canned_acl + if self.destination is not None: + body["destination"] = self.destination + if self.enable_encryption is not None: + body["enable_encryption"] = self.enable_encryption + if self.encryption_type is not None: + body["encryption_type"] = self.encryption_type + if self.endpoint is not None: + body["endpoint"] = self.endpoint + if self.kms_key is not None: + body["kms_key"] = self.kms_key + if self.region is not None: + body["region"] = self.region + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> S3StorageInfo: + """Deserializes the S3StorageInfo from a dictionary.""" + return cls( + canned_acl=d.get("canned_acl", None), + destination=d.get("destination", None), + enable_encryption=d.get("enable_encryption", None), + encryption_type=d.get("encryption_type", None), + endpoint=d.get("endpoint", None), + kms_key=d.get("kms_key", None), + region=d.get("region", None), + ) + + class Source(Enum): """Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\ from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a @@ -7830,7 +9077,7 @@ class Task: """An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.""" - new_cluster: Optional[ClusterSpec] = None + new_cluster: Optional[JobsClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8051,7 +9298,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Task: libraries=_repeated_dict(d, "libraries", Library), max_retries=d.get("max_retries", None), min_retry_interval_millis=d.get("min_retry_interval_millis", None), - new_cluster=_from_dict(d, "new_cluster", ClusterSpec), + new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), @@ -8624,6 +9871,34 @@ class ViewsToExport(Enum): DASHBOARDS = "DASHBOARDS" +@dataclass +class VolumesStorageInfo: + """A storage location back by UC Volumes.""" + + destination: str + """UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` or + `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the VolumesStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> VolumesStorageInfo: + """Deserializes the VolumesStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + @dataclass class Webhook: id: str @@ -8719,6 +9994,60 @@ def from_dict(cls, d: Dict[str, Any]) -> WebhookNotifications: ) +@dataclass +class WorkloadType: + """Cluster Attributes showing for clusters workload types.""" + + clients: ClientsTypes + """defined what type of clients can use the cluster. E.g. Notebooks, Jobs""" + + def as_dict(self) -> dict: + """Serializes the WorkloadType into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.clients: + body["clients"] = self.clients.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WorkloadType into a shallow dictionary of its immediate attributes.""" + body = {} + if self.clients: + body["clients"] = self.clients + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WorkloadType: + """Deserializes the WorkloadType from a dictionary.""" + return cls(clients=_from_dict(d, "clients", ClientsTypes)) + + +@dataclass +class WorkspaceStorageInfo: + """A storage location in Workspace Filesystem (WSFS)""" + + destination: str + """wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh`""" + + def as_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WorkspaceStorageInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination is not None: + body["destination"] = self.destination + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WorkspaceStorageInfo: + """Deserializes the WorkspaceStorageInfo from a dictionary.""" + return cls(destination=d.get("destination", None)) + + class JobsAPI: """The Jobs API allows you to create, edit, and delete jobs. diff --git a/databricks/sdk/serving/v2/impl.py b/databricks/sdk/serving/v2/impl.py index 844e7d797..d07624bb2 100755 --- a/databricks/sdk/serving/v2/impl.py +++ b/databricks/sdk/serving/v2/impl.py @@ -4662,7 +4662,7 @@ def query( "Content-Type": "application/json", } response_headers = [ - "{served_model_name}", + "served-model-name", ] res = self._api.do( "POST", @@ -4912,7 +4912,7 @@ def query( "Content-Type": "application/json", } response_headers = [ - "{served_model_name}", + "served-model-name", ] res = self._api.do( "POST", From 57b495b3be4af02320b75c4ed1c21ed73105c31d Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 12:35:20 +0000 Subject: [PATCH 08/20] remove andwait functions --- databricks/sdk/apps/v2/impl.py | 17 --- databricks/sdk/catalog/v2/impl.py | 4 - databricks/sdk/compute/v2/impl.py | 200 ------------------------- databricks/sdk/dashboards/v2/impl.py | 11 -- databricks/sdk/jobs/v2/impl.py | 112 -------------- databricks/sdk/ml/v2/impl.py | 39 ----- databricks/sdk/pipelines/v2/impl.py | 4 - databricks/sdk/provisioning/v2/impl.py | 71 --------- databricks/sdk/serving/v2/impl.py | 41 ----- databricks/sdk/sql/v2/impl.py | 77 ---------- databricks/sdk/vectorsearch/v2/impl.py | 6 - 11 files changed, 582 deletions(-) diff --git a/databricks/sdk/apps/v2/impl.py b/databricks/sdk/apps/v2/impl.py index 61d86b8c3..c748f0875 100755 --- a/databricks/sdk/apps/v2/impl.py +++ b/databricks/sdk/apps/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -1094,11 +1093,6 @@ def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None op_response = self._api.do("POST", "/api/2.0/apps", query=query, body=body, headers=headers) return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["name"]) - def create_and_wait( - self, *, app: Optional[App] = None, no_compute: Optional[bool] = None, timeout=timedelta(minutes=20) - ) -> App: - return self.create(app=app, no_compute=no_compute).result(timeout=timeout) - def delete(self, name: str) -> App: """Delete an app. @@ -1144,11 +1138,6 @@ def deploy(self, app_name: str, *, app_deployment: Optional[AppDeployment] = Non deployment_id=op_response["deployment_id"], ) - def deploy_and_wait( - self, app_name: str, *, app_deployment: Optional[AppDeployment] = None, timeout=timedelta(minutes=20) - ) -> AppDeployment: - return self.deploy(app_deployment=app_deployment, app_name=app_name).result(timeout=timeout) - def get(self, name: str) -> App: """Get an app. @@ -1335,9 +1324,6 @@ def start(self, name: str) -> Wait[App]: op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["name"]) - def start_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: - return self.start(name=name).result(timeout=timeout) - def stop(self, name: str) -> Wait[App]: """Stop an app. @@ -1359,9 +1345,6 @@ def stop(self, name: str) -> Wait[App]: op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) return Wait(self.WaitGetAppStopped, response=App.from_dict(op_response), name=op_response["name"]) - def stop_and_wait(self, name: str, timeout=timedelta(minutes=20)) -> App: - return self.stop(name=name).result(timeout=timeout) - def update(self, name: str, *, app: Optional[App] = None) -> App: """Update an app. diff --git a/databricks/sdk/catalog/v2/impl.py b/databricks/sdk/catalog/v2/impl.py index 7d6ccd6f4..976e75950 100755 --- a/databricks/sdk/catalog/v2/impl.py +++ b/databricks/sdk/catalog/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -12311,9 +12310,6 @@ def create(self, *, table: Optional[OnlineTable] = None) -> Wait[OnlineTable]: self.WaitGetOnlineTableActive, response=OnlineTable.from_dict(op_response), name=op_response["name"] ) - def create_and_wait(self, *, table: Optional[OnlineTable] = None, timeout=timedelta(minutes=20)) -> OnlineTable: - return self.create(table=table).result(timeout=timeout) - def delete(self, name: str): """Delete an Online Table. diff --git a/databricks/sdk/compute/v2/impl.py b/databricks/sdk/compute/v2/impl.py index cbfbc882b..db6aa555d 100755 --- a/databricks/sdk/compute/v2/impl.py +++ b/databricks/sdk/compute/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -10307,76 +10306,6 @@ def create( cluster_id=op_response["cluster_id"], ) - def create_and_wait( - self, - spark_version: str, - *, - apply_policy_default_values: Optional[bool] = None, - autoscale: Optional[AutoScale] = None, - autotermination_minutes: Optional[int] = None, - aws_attributes: Optional[AwsAttributes] = None, - azure_attributes: Optional[AzureAttributes] = None, - clone_from: Optional[CloneCluster] = None, - cluster_log_conf: Optional[ClusterLogConf] = None, - cluster_name: Optional[str] = None, - custom_tags: Optional[Dict[str, str]] = None, - data_security_mode: Optional[DataSecurityMode] = None, - docker_image: Optional[DockerImage] = None, - driver_instance_pool_id: Optional[str] = None, - driver_node_type_id: Optional[str] = None, - enable_elastic_disk: Optional[bool] = None, - enable_local_disk_encryption: Optional[bool] = None, - gcp_attributes: Optional[GcpAttributes] = None, - init_scripts: Optional[List[InitScriptInfo]] = None, - instance_pool_id: Optional[str] = None, - is_single_node: Optional[bool] = None, - kind: Optional[Kind] = None, - node_type_id: Optional[str] = None, - num_workers: Optional[int] = None, - policy_id: Optional[str] = None, - runtime_engine: Optional[RuntimeEngine] = None, - single_user_name: Optional[str] = None, - spark_conf: Optional[Dict[str, str]] = None, - spark_env_vars: Optional[Dict[str, str]] = None, - ssh_public_keys: Optional[List[str]] = None, - use_ml_runtime: Optional[bool] = None, - workload_type: Optional[WorkloadType] = None, - timeout=timedelta(minutes=20), - ) -> ClusterDetails: - return self.create( - apply_policy_default_values=apply_policy_default_values, - autoscale=autoscale, - autotermination_minutes=autotermination_minutes, - aws_attributes=aws_attributes, - azure_attributes=azure_attributes, - clone_from=clone_from, - cluster_log_conf=cluster_log_conf, - cluster_name=cluster_name, - custom_tags=custom_tags, - data_security_mode=data_security_mode, - docker_image=docker_image, - driver_instance_pool_id=driver_instance_pool_id, - driver_node_type_id=driver_node_type_id, - enable_elastic_disk=enable_elastic_disk, - enable_local_disk_encryption=enable_local_disk_encryption, - gcp_attributes=gcp_attributes, - init_scripts=init_scripts, - instance_pool_id=instance_pool_id, - is_single_node=is_single_node, - kind=kind, - node_type_id=node_type_id, - num_workers=num_workers, - policy_id=policy_id, - runtime_engine=runtime_engine, - single_user_name=single_user_name, - spark_conf=spark_conf, - spark_env_vars=spark_env_vars, - spark_version=spark_version, - ssh_public_keys=ssh_public_keys, - use_ml_runtime=use_ml_runtime, - workload_type=workload_type, - ).result(timeout=timeout) - def delete(self, cluster_id: str) -> Wait[ClusterDetails]: """Terminate cluster. @@ -10404,9 +10333,6 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: self.WaitGetClusterTerminated, response=DeleteClusterResponse.from_dict(op_response), cluster_id=cluster_id ) - def delete_and_wait(self, cluster_id: str, timeout=timedelta(minutes=20)) -> ClusterDetails: - return self.delete(cluster_id=cluster_id).result(timeout=timeout) - def edit( self, cluster_id: str, @@ -10695,76 +10621,6 @@ def edit( self.WaitGetClusterRunning, response=EditClusterResponse.from_dict(op_response), cluster_id=cluster_id ) - def edit_and_wait( - self, - cluster_id: str, - spark_version: str, - *, - apply_policy_default_values: Optional[bool] = None, - autoscale: Optional[AutoScale] = None, - autotermination_minutes: Optional[int] = None, - aws_attributes: Optional[AwsAttributes] = None, - azure_attributes: Optional[AzureAttributes] = None, - cluster_log_conf: Optional[ClusterLogConf] = None, - cluster_name: Optional[str] = None, - custom_tags: Optional[Dict[str, str]] = None, - data_security_mode: Optional[DataSecurityMode] = None, - docker_image: Optional[DockerImage] = None, - driver_instance_pool_id: Optional[str] = None, - driver_node_type_id: Optional[str] = None, - enable_elastic_disk: Optional[bool] = None, - enable_local_disk_encryption: Optional[bool] = None, - gcp_attributes: Optional[GcpAttributes] = None, - init_scripts: Optional[List[InitScriptInfo]] = None, - instance_pool_id: Optional[str] = None, - is_single_node: Optional[bool] = None, - kind: Optional[Kind] = None, - node_type_id: Optional[str] = None, - num_workers: Optional[int] = None, - policy_id: Optional[str] = None, - runtime_engine: Optional[RuntimeEngine] = None, - single_user_name: Optional[str] = None, - spark_conf: Optional[Dict[str, str]] = None, - spark_env_vars: Optional[Dict[str, str]] = None, - ssh_public_keys: Optional[List[str]] = None, - use_ml_runtime: Optional[bool] = None, - workload_type: Optional[WorkloadType] = None, - timeout=timedelta(minutes=20), - ) -> ClusterDetails: - return self.edit( - apply_policy_default_values=apply_policy_default_values, - autoscale=autoscale, - autotermination_minutes=autotermination_minutes, - aws_attributes=aws_attributes, - azure_attributes=azure_attributes, - cluster_id=cluster_id, - cluster_log_conf=cluster_log_conf, - cluster_name=cluster_name, - custom_tags=custom_tags, - data_security_mode=data_security_mode, - docker_image=docker_image, - driver_instance_pool_id=driver_instance_pool_id, - driver_node_type_id=driver_node_type_id, - enable_elastic_disk=enable_elastic_disk, - enable_local_disk_encryption=enable_local_disk_encryption, - gcp_attributes=gcp_attributes, - init_scripts=init_scripts, - instance_pool_id=instance_pool_id, - is_single_node=is_single_node, - kind=kind, - node_type_id=node_type_id, - num_workers=num_workers, - policy_id=policy_id, - runtime_engine=runtime_engine, - single_user_name=single_user_name, - spark_conf=spark_conf, - spark_env_vars=spark_env_vars, - spark_version=spark_version, - ssh_public_keys=ssh_public_keys, - use_ml_runtime=use_ml_runtime, - workload_type=workload_type, - ).result(timeout=timeout) - def events( self, cluster_id: str, @@ -11055,16 +10911,6 @@ def resize( self.WaitGetClusterRunning, response=ResizeClusterResponse.from_dict(op_response), cluster_id=cluster_id ) - def resize_and_wait( - self, - cluster_id: str, - *, - autoscale: Optional[AutoScale] = None, - num_workers: Optional[int] = None, - timeout=timedelta(minutes=20), - ) -> ClusterDetails: - return self.resize(autoscale=autoscale, cluster_id=cluster_id, num_workers=num_workers).result(timeout=timeout) - def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wait[ClusterDetails]: """Restart cluster. @@ -11094,11 +10940,6 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai self.WaitGetClusterRunning, response=RestartClusterResponse.from_dict(op_response), cluster_id=cluster_id ) - def restart_and_wait( - self, cluster_id: str, *, restart_user: Optional[str] = None, timeout=timedelta(minutes=20) - ) -> ClusterDetails: - return self.restart(cluster_id=cluster_id, restart_user=restart_user).result(timeout=timeout) - def set_permissions( self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None ) -> ClusterPermissions: @@ -11168,9 +11009,6 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: self.WaitGetClusterRunning, response=StartClusterResponse.from_dict(op_response), cluster_id=cluster_id ) - def start_and_wait(self, cluster_id: str, timeout=timedelta(minutes=20)) -> ClusterDetails: - return self.start(cluster_id=cluster_id).result(timeout=timeout) - def unpin(self, cluster_id: str): """Unpin cluster. @@ -11245,16 +11083,6 @@ def update( self.WaitGetClusterRunning, response=UpdateClusterResponse.from_dict(op_response), cluster_id=cluster_id ) - def update_and_wait( - self, - cluster_id: str, - update_mask: str, - *, - cluster: Optional[UpdateClusterResource] = None, - timeout=timedelta(minutes=20), - ) -> ClusterDetails: - return self.update(cluster=cluster, cluster_id=cluster_id, update_mask=update_mask).result(timeout=timeout) - def update_permissions( self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None ) -> ClusterPermissions: @@ -11325,16 +11153,6 @@ def cancel( context_id=context_id, ) - def cancel_and_wait( - self, - *, - cluster_id: Optional[str] = None, - command_id: Optional[str] = None, - context_id: Optional[str] = None, - timeout=timedelta(minutes=20), - ) -> CommandStatusResponse: - return self.cancel(cluster_id=cluster_id, command_id=command_id, context_id=context_id).result(timeout=timeout) - def command_status(self, cluster_id: str, context_id: str, command_id: str) -> CommandStatusResponse: """Get command info. @@ -11421,11 +11239,6 @@ def create( context_id=op_response["id"], ) - def create_and_wait( - self, *, cluster_id: Optional[str] = None, language: Optional[Language] = None, timeout=timedelta(minutes=20) - ) -> ContextStatusResponse: - return self.create(cluster_id=cluster_id, language=language).result(timeout=timeout) - def destroy(self, cluster_id: str, context_id: str): """Delete an execution context. @@ -11497,19 +11310,6 @@ def execute( context_id=context_id, ) - def execute_and_wait( - self, - *, - cluster_id: Optional[str] = None, - command: Optional[str] = None, - context_id: Optional[str] = None, - language: Optional[Language] = None, - timeout=timedelta(minutes=20), - ) -> CommandStatusResponse: - return self.execute(cluster_id=cluster_id, command=command, context_id=context_id, language=language).result( - timeout=timeout - ) - class GlobalInitScriptsAPI: """The Global Init Scripts API enables Workspace administrators to configure global initialization scripts diff --git a/databricks/sdk/dashboards/v2/impl.py b/databricks/sdk/dashboards/v2/impl.py index 2f87368d1..fc4e20174 100755 --- a/databricks/sdk/dashboards/v2/impl.py +++ b/databricks/sdk/dashboards/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -2574,13 +2573,6 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W space_id=space_id, ) - def create_message_and_wait( - self, space_id: str, conversation_id: str, content: str, timeout=timedelta(minutes=20) - ) -> GenieMessage: - return self.create_message(content=content, conversation_id=conversation_id, space_id=space_id).result( - timeout=timeout - ) - def execute_message_attachment_query( self, space_id: str, conversation_id: str, message_id: str, attachment_id: str ) -> GenieGetMessageQueryResultResponse: @@ -2887,9 +2879,6 @@ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: space_id=space_id, ) - def start_conversation_and_wait(self, space_id: str, content: str, timeout=timedelta(minutes=20)) -> GenieMessage: - return self.start_conversation(content=content, space_id=space_id).result(timeout=timeout) - class LakeviewAPI: """These APIs provide specific management operations for Lakeview dashboards. Generic resource management can diff --git a/databricks/sdk/jobs/v2/impl.py b/databricks/sdk/jobs/v2/impl.py index 0a2c0df91..c55ad1808 100755 --- a/databricks/sdk/jobs/v2/impl.py +++ b/databricks/sdk/jobs/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -10118,9 +10117,6 @@ def cancel_run(self, run_id: int) -> Wait[Run]: self.WaitGetRunJobTerminatedOrSkipped, response=CancelRunResponse.from_dict(op_response), run_id=run_id ) - def cancel_run_and_wait(self, run_id: int, timeout=timedelta(minutes=20)) -> Run: - return self.cancel_run(run_id=run_id).result(timeout=timeout) - def create( self, *, @@ -10800,42 +10796,6 @@ def repair_run( self.WaitGetRunJobTerminatedOrSkipped, response=RepairRunResponse.from_dict(op_response), run_id=run_id ) - def repair_run_and_wait( - self, - run_id: int, - *, - dbt_commands: Optional[List[str]] = None, - jar_params: Optional[List[str]] = None, - job_parameters: Optional[Dict[str, str]] = None, - latest_repair_id: Optional[int] = None, - notebook_params: Optional[Dict[str, str]] = None, - pipeline_params: Optional[PipelineParams] = None, - python_named_params: Optional[Dict[str, str]] = None, - python_params: Optional[List[str]] = None, - rerun_all_failed_tasks: Optional[bool] = None, - rerun_dependent_tasks: Optional[bool] = None, - rerun_tasks: Optional[List[str]] = None, - spark_submit_params: Optional[List[str]] = None, - sql_params: Optional[Dict[str, str]] = None, - timeout=timedelta(minutes=20), - ) -> Run: - return self.repair_run( - dbt_commands=dbt_commands, - jar_params=jar_params, - job_parameters=job_parameters, - latest_repair_id=latest_repair_id, - notebook_params=notebook_params, - pipeline_params=pipeline_params, - python_named_params=python_named_params, - python_params=python_params, - rerun_all_failed_tasks=rerun_all_failed_tasks, - rerun_dependent_tasks=rerun_dependent_tasks, - rerun_tasks=rerun_tasks, - run_id=run_id, - spark_submit_params=spark_submit_params, - sql_params=sql_params, - ).result(timeout=timeout) - def reset(self, job_id: int, new_settings: JobSettings): """Update all job settings (reset). @@ -11023,42 +10983,6 @@ def run_now( run_id=op_response["run_id"], ) - def run_now_and_wait( - self, - job_id: int, - *, - dbt_commands: Optional[List[str]] = None, - idempotency_token: Optional[str] = None, - jar_params: Optional[List[str]] = None, - job_parameters: Optional[Dict[str, str]] = None, - notebook_params: Optional[Dict[str, str]] = None, - only: Optional[List[str]] = None, - performance_target: Optional[PerformanceTarget] = None, - pipeline_params: Optional[PipelineParams] = None, - python_named_params: Optional[Dict[str, str]] = None, - python_params: Optional[List[str]] = None, - queue: Optional[QueueSettings] = None, - spark_submit_params: Optional[List[str]] = None, - sql_params: Optional[Dict[str, str]] = None, - timeout=timedelta(minutes=20), - ) -> Run: - return self.run_now( - dbt_commands=dbt_commands, - idempotency_token=idempotency_token, - jar_params=jar_params, - job_id=job_id, - job_parameters=job_parameters, - notebook_params=notebook_params, - only=only, - performance_target=performance_target, - pipeline_params=pipeline_params, - python_named_params=python_named_params, - python_params=python_params, - queue=queue, - spark_submit_params=spark_submit_params, - sql_params=sql_params, - ).result(timeout=timeout) - def set_permissions( self, job_id: str, *, access_control_list: Optional[List[JobAccessControlRequest]] = None ) -> JobPermissions: @@ -11202,42 +11126,6 @@ def submit( run_id=op_response["run_id"], ) - def submit_and_wait( - self, - *, - access_control_list: Optional[List[JobAccessControlRequest]] = None, - budget_policy_id: Optional[str] = None, - email_notifications: Optional[JobEmailNotifications] = None, - environments: Optional[List[JobEnvironment]] = None, - git_source: Optional[GitSource] = None, - health: Optional[JobsHealthRules] = None, - idempotency_token: Optional[str] = None, - notification_settings: Optional[JobNotificationSettings] = None, - queue: Optional[QueueSettings] = None, - run_as: Optional[JobRunAs] = None, - run_name: Optional[str] = None, - tasks: Optional[List[SubmitTask]] = None, - timeout_seconds: Optional[int] = None, - webhook_notifications: Optional[WebhookNotifications] = None, - timeout=timedelta(minutes=20), - ) -> Run: - return self.submit( - access_control_list=access_control_list, - budget_policy_id=budget_policy_id, - email_notifications=email_notifications, - environments=environments, - git_source=git_source, - health=health, - idempotency_token=idempotency_token, - notification_settings=notification_settings, - queue=queue, - run_as=run_as, - run_name=run_name, - tasks=tasks, - timeout_seconds=timeout_seconds, - webhook_notifications=webhook_notifications, - ).result(timeout=timeout) - def update( self, job_id: int, *, fields_to_remove: Optional[List[str]] = None, new_settings: Optional[JobSettings] = None ): diff --git a/databricks/sdk/ml/v2/impl.py b/databricks/sdk/ml/v2/impl.py index a1e4129ae..2069b5fd4 100755 --- a/databricks/sdk/ml/v2/impl.py +++ b/databricks/sdk/ml/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -7220,44 +7219,6 @@ def create_experiment( experiment_id=op_response["experiment_id"], ) - def create_experiment_and_wait( - self, - train_data_path: str, - target_column: str, - time_column: str, - forecast_granularity: str, - forecast_horizon: int, - *, - custom_weights_column: Optional[str] = None, - experiment_path: Optional[str] = None, - holiday_regions: Optional[List[str]] = None, - max_runtime: Optional[int] = None, - prediction_data_path: Optional[str] = None, - primary_metric: Optional[str] = None, - register_to: Optional[str] = None, - split_column: Optional[str] = None, - timeseries_identifier_columns: Optional[List[str]] = None, - training_frameworks: Optional[List[str]] = None, - timeout=timedelta(minutes=120), - ) -> ForecastingExperiment: - return self.create_experiment( - custom_weights_column=custom_weights_column, - experiment_path=experiment_path, - forecast_granularity=forecast_granularity, - forecast_horizon=forecast_horizon, - holiday_regions=holiday_regions, - max_runtime=max_runtime, - prediction_data_path=prediction_data_path, - primary_metric=primary_metric, - register_to=register_to, - split_column=split_column, - target_column=target_column, - time_column=time_column, - timeseries_identifier_columns=timeseries_identifier_columns, - train_data_path=train_data_path, - training_frameworks=training_frameworks, - ).result(timeout=timeout) - def get_experiment(self, experiment_id: str) -> ForecastingExperiment: """Get a forecasting experiment. diff --git a/databricks/sdk/pipelines/v2/impl.py b/databricks/sdk/pipelines/v2/impl.py index 795d123f8..3fefe3444 100755 --- a/databricks/sdk/pipelines/v2/impl.py +++ b/databricks/sdk/pipelines/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -4678,9 +4677,6 @@ def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: self.WaitGetPipelineIdle, response=StopPipelineResponse.from_dict(op_response), pipeline_id=pipeline_id ) - def stop_and_wait(self, pipeline_id: str, timeout=timedelta(minutes=20)) -> GetPipelineResponse: - return self.stop(pipeline_id=pipeline_id).result(timeout=timeout) - def update( self, pipeline_id: str, diff --git a/databricks/sdk/provisioning/v2/impl.py b/databricks/sdk/provisioning/v2/impl.py index 3fb1ac672..06bdba3a5 100755 --- a/databricks/sdk/provisioning/v2/impl.py +++ b/databricks/sdk/provisioning/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -3337,48 +3336,6 @@ def create( workspace_id=op_response["workspace_id"], ) - def create_and_wait( - self, - workspace_name: str, - *, - aws_region: Optional[str] = None, - cloud: Optional[str] = None, - cloud_resource_container: Optional[CloudResourceContainer] = None, - credentials_id: Optional[str] = None, - custom_tags: Optional[Dict[str, str]] = None, - deployment_name: Optional[str] = None, - gcp_managed_network_config: Optional[GcpManagedNetworkConfig] = None, - gke_config: Optional[GkeConfig] = None, - is_no_public_ip_enabled: Optional[bool] = None, - location: Optional[str] = None, - managed_services_customer_managed_key_id: Optional[str] = None, - network_id: Optional[str] = None, - pricing_tier: Optional[PricingTier] = None, - private_access_settings_id: Optional[str] = None, - storage_configuration_id: Optional[str] = None, - storage_customer_managed_key_id: Optional[str] = None, - timeout=timedelta(minutes=20), - ) -> Workspace: - return self.create( - aws_region=aws_region, - cloud=cloud, - cloud_resource_container=cloud_resource_container, - credentials_id=credentials_id, - custom_tags=custom_tags, - deployment_name=deployment_name, - gcp_managed_network_config=gcp_managed_network_config, - gke_config=gke_config, - is_no_public_ip_enabled=is_no_public_ip_enabled, - location=location, - managed_services_customer_managed_key_id=managed_services_customer_managed_key_id, - network_id=network_id, - pricing_tier=pricing_tier, - private_access_settings_id=private_access_settings_id, - storage_configuration_id=storage_configuration_id, - storage_customer_managed_key_id=storage_customer_managed_key_id, - workspace_name=workspace_name, - ).result(timeout=timeout) - def delete(self, workspace_id: int): """Delete a workspace. @@ -3624,31 +3581,3 @@ def update( return Wait( self.WaitGetWorkspaceRunning, response=UpdateResponse.from_dict(op_response), workspace_id=workspace_id ) - - def update_and_wait( - self, - workspace_id: int, - *, - aws_region: Optional[str] = None, - credentials_id: Optional[str] = None, - custom_tags: Optional[Dict[str, str]] = None, - managed_services_customer_managed_key_id: Optional[str] = None, - network_connectivity_config_id: Optional[str] = None, - network_id: Optional[str] = None, - private_access_settings_id: Optional[str] = None, - storage_configuration_id: Optional[str] = None, - storage_customer_managed_key_id: Optional[str] = None, - timeout=timedelta(minutes=20), - ) -> Workspace: - return self.update( - aws_region=aws_region, - credentials_id=credentials_id, - custom_tags=custom_tags, - managed_services_customer_managed_key_id=managed_services_customer_managed_key_id, - network_connectivity_config_id=network_connectivity_config_id, - network_id=network_id, - private_access_settings_id=private_access_settings_id, - storage_configuration_id=storage_configuration_id, - storage_customer_managed_key_id=storage_customer_managed_key_id, - workspace_id=workspace_id, - ).result(timeout=timeout) diff --git a/databricks/sdk/serving/v2/impl.py b/databricks/sdk/serving/v2/impl.py index d07624bb2..b9a256c6b 100755 --- a/databricks/sdk/serving/v2/impl.py +++ b/databricks/sdk/serving/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, BinaryIO, Dict, Iterator, List, Optional @@ -4245,28 +4244,6 @@ def create( name=op_response["name"], ) - def create_and_wait( - self, - name: str, - *, - ai_gateway: Optional[AiGatewayConfig] = None, - budget_policy_id: Optional[str] = None, - config: Optional[EndpointCoreConfigInput] = None, - rate_limits: Optional[List[RateLimit]] = None, - route_optimized: Optional[bool] = None, - tags: Optional[List[EndpointTag]] = None, - timeout=timedelta(minutes=20), - ) -> ServingEndpointDetailed: - return self.create( - ai_gateway=ai_gateway, - budget_policy_id=budget_policy_id, - config=config, - name=name, - rate_limits=rate_limits, - route_optimized=route_optimized, - tags=tags, - ).result(timeout=timeout) - def delete(self, name: str): """Delete a serving endpoint. @@ -4758,24 +4735,6 @@ def update_config( name=op_response["name"], ) - def update_config_and_wait( - self, - name: str, - *, - auto_capture_config: Optional[AutoCaptureConfigInput] = None, - served_entities: Optional[List[ServedEntityInput]] = None, - served_models: Optional[List[ServedModelInput]] = None, - traffic_config: Optional[TrafficConfig] = None, - timeout=timedelta(minutes=20), - ) -> ServingEndpointDetailed: - return self.update_config( - auto_capture_config=auto_capture_config, - name=name, - served_entities=served_entities, - served_models=served_models, - traffic_config=traffic_config, - ).result(timeout=timeout) - def update_permissions( self, serving_endpoint_id: str, diff --git a/databricks/sdk/sql/v2/impl.py b/databricks/sdk/sql/v2/impl.py index befe00b80..9619cd32e 100755 --- a/databricks/sdk/sql/v2/impl.py +++ b/databricks/sdk/sql/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -9851,40 +9850,6 @@ def create( self.WaitGetWarehouseRunning, response=CreateWarehouseResponse.from_dict(op_response), id=op_response["id"] ) - def create_and_wait( - self, - *, - auto_stop_mins: Optional[int] = None, - channel: Optional[Channel] = None, - cluster_size: Optional[str] = None, - creator_name: Optional[str] = None, - enable_photon: Optional[bool] = None, - enable_serverless_compute: Optional[bool] = None, - instance_profile_arn: Optional[str] = None, - max_num_clusters: Optional[int] = None, - min_num_clusters: Optional[int] = None, - name: Optional[str] = None, - spot_instance_policy: Optional[SpotInstancePolicy] = None, - tags: Optional[EndpointTags] = None, - warehouse_type: Optional[CreateWarehouseRequestWarehouseType] = None, - timeout=timedelta(minutes=20), - ) -> GetWarehouseResponse: - return self.create( - auto_stop_mins=auto_stop_mins, - channel=channel, - cluster_size=cluster_size, - creator_name=creator_name, - enable_photon=enable_photon, - enable_serverless_compute=enable_serverless_compute, - instance_profile_arn=instance_profile_arn, - max_num_clusters=max_num_clusters, - min_num_clusters=min_num_clusters, - name=name, - spot_instance_policy=spot_instance_policy, - tags=tags, - warehouse_type=warehouse_type, - ).result(timeout=timeout) - def delete(self, id: str): """Delete a warehouse. @@ -10020,42 +9985,6 @@ def edit( op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/edit", body=body, headers=headers) return Wait(self.WaitGetWarehouseRunning, response=EditWarehouseResponse.from_dict(op_response), id=id) - def edit_and_wait( - self, - id: str, - *, - auto_stop_mins: Optional[int] = None, - channel: Optional[Channel] = None, - cluster_size: Optional[str] = None, - creator_name: Optional[str] = None, - enable_photon: Optional[bool] = None, - enable_serverless_compute: Optional[bool] = None, - instance_profile_arn: Optional[str] = None, - max_num_clusters: Optional[int] = None, - min_num_clusters: Optional[int] = None, - name: Optional[str] = None, - spot_instance_policy: Optional[SpotInstancePolicy] = None, - tags: Optional[EndpointTags] = None, - warehouse_type: Optional[EditWarehouseRequestWarehouseType] = None, - timeout=timedelta(minutes=20), - ) -> GetWarehouseResponse: - return self.edit( - auto_stop_mins=auto_stop_mins, - channel=channel, - cluster_size=cluster_size, - creator_name=creator_name, - enable_photon=enable_photon, - enable_serverless_compute=enable_serverless_compute, - id=id, - instance_profile_arn=instance_profile_arn, - max_num_clusters=max_num_clusters, - min_num_clusters=min_num_clusters, - name=name, - spot_instance_policy=spot_instance_policy, - tags=tags, - warehouse_type=warehouse_type, - ).result(timeout=timeout) - def get(self, id: str) -> GetWarehouseResponse: """Get warehouse info. @@ -10262,9 +10191,6 @@ def start(self, id: str) -> Wait[GetWarehouseResponse]: op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", headers=headers) return Wait(self.WaitGetWarehouseRunning, response=StartWarehouseResponse.from_dict(op_response), id=id) - def start_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse: - return self.start(id=id).result(timeout=timeout) - def stop(self, id: str) -> Wait[GetWarehouseResponse]: """Stop a warehouse. @@ -10285,9 +10211,6 @@ def stop(self, id: str) -> Wait[GetWarehouseResponse]: op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", headers=headers) return Wait(self.WaitGetWarehouseStopped, response=StopWarehouseResponse.from_dict(op_response), id=id) - def stop_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse: - return self.stop(id=id).result(timeout=timeout) - def update_permissions( self, warehouse_id: str, *, access_control_list: Optional[List[WarehouseAccessControlRequest]] = None ) -> WarehousePermissions: diff --git a/databricks/sdk/vectorsearch/v2/impl.py b/databricks/sdk/vectorsearch/v2/impl.py index b941d610f..ed22b72c2 100755 --- a/databricks/sdk/vectorsearch/v2/impl.py +++ b/databricks/sdk/vectorsearch/v2/impl.py @@ -4,7 +4,6 @@ import logging from dataclasses import dataclass -from datetime import timedelta from enum import Enum from typing import Any, Dict, Iterator, List, Optional @@ -1654,11 +1653,6 @@ def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[Endpoi endpoint_name=op_response["name"], ) - def create_endpoint_and_wait( - self, name: str, endpoint_type: EndpointType, timeout=timedelta(minutes=20) - ) -> EndpointInfo: - return self.create_endpoint(endpoint_type=endpoint_type, name=name).result(timeout=timeout) - def delete_endpoint(self, endpoint_name: str): """Delete an endpoint. From 0350064da6657961a0e21047d70f3bd9ffb91f1b Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 12:50:30 +0000 Subject: [PATCH 09/20] update --- databricks/sdk/apps/v2/impl.py | 31 ++++----- databricks/sdk/catalog/v2/impl.py | 10 ++- databricks/sdk/compute/v2/impl.py | 94 +++++++------------------- databricks/sdk/dashboards/v2/impl.py | 28 ++------ databricks/sdk/jobs/v2/impl.py | 41 ++++------- databricks/sdk/ml/v2/impl.py | 12 ++-- databricks/sdk/pipelines/v2/impl.py | 9 +-- databricks/sdk/provisioning/v2/impl.py | 21 ++---- databricks/sdk/serving/v2/impl.py | 22 ++---- databricks/sdk/sql/v2/impl.py | 25 +++---- databricks/sdk/vectorsearch/v2/impl.py | 12 ++-- 11 files changed, 96 insertions(+), 209 deletions(-) diff --git a/databricks/sdk/apps/v2/impl.py b/databricks/sdk/apps/v2/impl.py index c748f0875..0beb5434c 100755 --- a/databricks/sdk/apps/v2/impl.py +++ b/databricks/sdk/apps/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") @@ -1068,7 +1068,7 @@ class AppsAPI: def __init__(self, api_client): self._api = api_client - def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None) -> Wait[App]: + def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None) -> App: """Create an app. Creates a new app. @@ -1090,8 +1090,8 @@ def create(self, *, app: Optional[App] = None, no_compute: Optional[bool] = None "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.0/apps", query=query, body=body, headers=headers) - return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["name"]) + res = self._api.do("POST", "/api/2.0/apps", query=query, body=body, headers=headers) + return App.from_dict(res) def delete(self, name: str) -> App: """Delete an app. @@ -1111,7 +1111,7 @@ def delete(self, name: str) -> App: res = self._api.do("DELETE", f"/api/2.0/apps/{name}", headers=headers) return App.from_dict(res) - def deploy(self, app_name: str, *, app_deployment: Optional[AppDeployment] = None) -> Wait[AppDeployment]: + def deploy(self, app_name: str, *, app_deployment: Optional[AppDeployment] = None) -> AppDeployment: """Create an app deployment. Creates an app deployment for the app with the supplied name. @@ -1130,13 +1130,8 @@ def deploy(self, app_name: str, *, app_deployment: Optional[AppDeployment] = Non "Content-Type": "application/json", } - op_response = self._api.do("POST", f"/api/2.0/apps/{app_name}/deployments", body=body, headers=headers) - return Wait( - self.WaitGetDeploymentAppSucceeded, - response=AppDeployment.from_dict(op_response), - app_name=app_name, - deployment_id=op_response["deployment_id"], - ) + res = self._api.do("POST", f"/api/2.0/apps/{app_name}/deployments", body=body, headers=headers) + return AppDeployment.from_dict(res) def get(self, name: str) -> App: """Get an app. @@ -1303,7 +1298,7 @@ def set_permissions( res = self._api.do("PUT", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) return AppPermissions.from_dict(res) - def start(self, name: str) -> Wait[App]: + def start(self, name: str) -> App: """Start an app. Start the last active deployment of the app in the workspace. @@ -1321,10 +1316,10 @@ def start(self, name: str) -> Wait[App]: "Content-Type": "application/json", } - op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) - return Wait(self.WaitGetAppActive, response=App.from_dict(op_response), name=op_response["name"]) + res = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) + return App.from_dict(res) - def stop(self, name: str) -> Wait[App]: + def stop(self, name: str) -> App: """Stop an app. Stops the active deployment of the app in the workspace. @@ -1342,8 +1337,8 @@ def stop(self, name: str) -> Wait[App]: "Content-Type": "application/json", } - op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) - return Wait(self.WaitGetAppStopped, response=App.from_dict(op_response), name=op_response["name"]) + res = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) + return App.from_dict(res) def update(self, name: str, *, app: Optional[App] = None) -> App: """Update an app. diff --git a/databricks/sdk/catalog/v2/impl.py b/databricks/sdk/catalog/v2/impl.py index 976e75950..4b5959161 100755 --- a/databricks/sdk/catalog/v2/impl.py +++ b/databricks/sdk/catalog/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, +from ...service._internal import (_enum, _from_dict, _repeated_dict, _repeated_enum) _LOG = logging.getLogger("databricks.sdk") @@ -12287,7 +12287,7 @@ class OnlineTablesAPI: def __init__(self, api_client): self._api = api_client - def create(self, *, table: Optional[OnlineTable] = None) -> Wait[OnlineTable]: + def create(self, *, table: Optional[OnlineTable] = None) -> OnlineTable: """Create an Online Table. Create a new Online Table. @@ -12305,10 +12305,8 @@ def create(self, *, table: Optional[OnlineTable] = None) -> Wait[OnlineTable]: "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.0/online-tables", body=body, headers=headers) - return Wait( - self.WaitGetOnlineTableActive, response=OnlineTable.from_dict(op_response), name=op_response["name"] - ) + res = self._api.do("POST", "/api/2.0/online-tables", body=body, headers=headers) + return OnlineTable.from_dict(res) def delete(self, name: str): """Delete an Online Table. diff --git a/databricks/sdk/compute/v2/impl.py b/databricks/sdk/compute/v2/impl.py index db6aa555d..e18ca98a1 100755 --- a/databricks/sdk/compute/v2/impl.py +++ b/databricks/sdk/compute/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, +from ...service._internal import (_enum, _from_dict, _repeated_dict, _repeated_enum) _LOG = logging.getLogger("databricks.sdk") @@ -10047,7 +10047,7 @@ def create( ssh_public_keys: Optional[List[str]] = None, use_ml_runtime: Optional[bool] = None, workload_type: Optional[WorkloadType] = None, - ) -> Wait[ClusterDetails]: + ) -> CreateClusterResponse: """Create new cluster. Creates a new Spark cluster. This method will acquire new instances from the cloud provider if @@ -10299,14 +10299,10 @@ def create( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.1/clusters/create", body=body, headers=headers) - return Wait( - self.WaitGetClusterRunning, - response=CreateClusterResponse.from_dict(op_response), - cluster_id=op_response["cluster_id"], - ) + res = self._api.do("POST", "/api/2.1/clusters/create", body=body, headers=headers) + return CreateClusterResponse.from_dict(res) - def delete(self, cluster_id: str) -> Wait[ClusterDetails]: + def delete(self, cluster_id: str): """Terminate cluster. Terminates the Spark cluster with the specified ID. The cluster is removed asynchronously. Once the @@ -10328,10 +10324,7 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.1/clusters/delete", body=body, headers=headers) - return Wait( - self.WaitGetClusterTerminated, response=DeleteClusterResponse.from_dict(op_response), cluster_id=cluster_id - ) + self._api.do("POST", "/api/2.1/clusters/delete", body=body, headers=headers) def edit( self, @@ -10367,7 +10360,7 @@ def edit( ssh_public_keys: Optional[List[str]] = None, use_ml_runtime: Optional[bool] = None, workload_type: Optional[WorkloadType] = None, - ) -> Wait[ClusterDetails]: + ): """Update cluster configuration. Updates the configuration of a cluster to match the provided attributes and size. A cluster can be @@ -10616,10 +10609,7 @@ def edit( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.1/clusters/edit", body=body, headers=headers) - return Wait( - self.WaitGetClusterRunning, response=EditClusterResponse.from_dict(op_response), cluster_id=cluster_id - ) + self._api.do("POST", "/api/2.1/clusters/edit", body=body, headers=headers) def events( self, @@ -10867,9 +10857,7 @@ def pin(self, cluster_id: str): self._api.do("POST", "/api/2.1/clusters/pin", body=body, headers=headers) - def resize( - self, cluster_id: str, *, autoscale: Optional[AutoScale] = None, num_workers: Optional[int] = None - ) -> Wait[ClusterDetails]: + def resize(self, cluster_id: str, *, autoscale: Optional[AutoScale] = None, num_workers: Optional[int] = None): """Resize cluster. Resizes a cluster to have a desired number of workers. This will fail unless the cluster is in a @@ -10906,12 +10894,9 @@ def resize( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.1/clusters/resize", body=body, headers=headers) - return Wait( - self.WaitGetClusterRunning, response=ResizeClusterResponse.from_dict(op_response), cluster_id=cluster_id - ) + self._api.do("POST", "/api/2.1/clusters/resize", body=body, headers=headers) - def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wait[ClusterDetails]: + def restart(self, cluster_id: str, *, restart_user: Optional[str] = None): """Restart cluster. Restarts a Spark cluster with the supplied ID. If the cluster is not currently in a `RUNNING` state, @@ -10935,10 +10920,7 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.1/clusters/restart", body=body, headers=headers) - return Wait( - self.WaitGetClusterRunning, response=RestartClusterResponse.from_dict(op_response), cluster_id=cluster_id - ) + self._api.do("POST", "/api/2.1/clusters/restart", body=body, headers=headers) def set_permissions( self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None @@ -10980,7 +10962,7 @@ def spark_versions(self) -> GetSparkVersionsResponse: res = self._api.do("GET", "/api/2.1/clusters/spark-versions", headers=headers) return GetSparkVersionsResponse.from_dict(res) - def start(self, cluster_id: str) -> Wait[ClusterDetails]: + def start(self, cluster_id: str): """Start terminated cluster. Starts a terminated Spark cluster with the supplied ID. This works similar to `createCluster` except: @@ -11004,10 +10986,7 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.1/clusters/start", body=body, headers=headers) - return Wait( - self.WaitGetClusterRunning, response=StartClusterResponse.from_dict(op_response), cluster_id=cluster_id - ) + self._api.do("POST", "/api/2.1/clusters/start", body=body, headers=headers) def unpin(self, cluster_id: str): """Unpin cluster. @@ -11030,9 +11009,7 @@ def unpin(self, cluster_id: str): self._api.do("POST", "/api/2.1/clusters/unpin", body=body, headers=headers) - def update( - self, cluster_id: str, update_mask: str, *, cluster: Optional[UpdateClusterResource] = None - ) -> Wait[ClusterDetails]: + def update(self, cluster_id: str, update_mask: str, *, cluster: Optional[UpdateClusterResource] = None): """Update cluster configuration (partial). Updates the configuration of a cluster to match the partial set of attributes and size. Denote which @@ -11078,10 +11055,7 @@ def update( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.1/clusters/update", body=body, headers=headers) - return Wait( - self.WaitGetClusterRunning, response=UpdateClusterResponse.from_dict(op_response), cluster_id=cluster_id - ) + self._api.do("POST", "/api/2.1/clusters/update", body=body, headers=headers) def update_permissions( self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None @@ -11117,7 +11091,7 @@ def __init__(self, api_client): def cancel( self, *, cluster_id: Optional[str] = None, command_id: Optional[str] = None, context_id: Optional[str] = None - ) -> Wait[CommandStatusResponse]: + ): """Cancel a command. Cancels a currently running command within an execution context. @@ -11144,14 +11118,7 @@ def cancel( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/1.2/commands/cancel", body=body, headers=headers) - return Wait( - self.WaitCommandStatusCommandExecutionCancelled, - response=CancelResponse.from_dict(op_response), - cluster_id=cluster_id, - command_id=command_id, - context_id=context_id, - ) + self._api.do("POST", "/api/1.2/commands/cancel", body=body, headers=headers) def command_status(self, cluster_id: str, context_id: str, command_id: str) -> CommandStatusResponse: """Get command info. @@ -11204,9 +11171,7 @@ def context_status(self, cluster_id: str, context_id: str) -> ContextStatusRespo res = self._api.do("GET", "/api/1.2/contexts/status", query=query, headers=headers) return ContextStatusResponse.from_dict(res) - def create( - self, *, cluster_id: Optional[str] = None, language: Optional[Language] = None - ) -> Wait[ContextStatusResponse]: + def create(self, *, cluster_id: Optional[str] = None, language: Optional[Language] = None) -> Created: """Create an execution context. Creates an execution context for running cluster commands. @@ -11231,13 +11196,8 @@ def create( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/1.2/contexts/create", body=body, headers=headers) - return Wait( - self.WaitContextStatusCommandExecutionRunning, - response=Created.from_dict(op_response), - cluster_id=cluster_id, - context_id=op_response["id"], - ) + res = self._api.do("POST", "/api/1.2/contexts/create", body=body, headers=headers) + return Created.from_dict(res) def destroy(self, cluster_id: str, context_id: str): """Delete an execution context. @@ -11268,7 +11228,7 @@ def execute( command: Optional[str] = None, context_id: Optional[str] = None, language: Optional[Language] = None, - ) -> Wait[CommandStatusResponse]: + ) -> Created: """Run a command. Runs a cluster command in the given execution context, using the provided language. @@ -11301,14 +11261,8 @@ def execute( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/1.2/commands/execute", body=body, headers=headers) - return Wait( - self.WaitCommandStatusCommandExecutionFinishedOrError, - response=Created.from_dict(op_response), - cluster_id=cluster_id, - command_id=op_response["id"], - context_id=context_id, - ) + res = self._api.do("POST", "/api/1.2/commands/execute", body=body, headers=headers) + return Created.from_dict(res) class GlobalInitScriptsAPI: diff --git a/databricks/sdk/dashboards/v2/impl.py b/databricks/sdk/dashboards/v2/impl.py index fc4e20174..6fbe88eca 100755 --- a/databricks/sdk/dashboards/v2/impl.py +++ b/databricks/sdk/dashboards/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") @@ -2534,7 +2534,7 @@ class GenieAPI: def __init__(self, api_client): self._api = api_client - def create_message(self, space_id: str, conversation_id: str, content: str) -> Wait[GenieMessage]: + def create_message(self, space_id: str, conversation_id: str, content: str) -> GenieMessage: """Create conversation message. Create new message in a [conversation](:method:genie/startconversation). The AI response uses all @@ -2559,19 +2559,13 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W "Content-Type": "application/json", } - op_response = self._api.do( + res = self._api.do( "POST", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages", body=body, headers=headers, ) - return Wait( - self.WaitGetMessageGenieCompleted, - response=GenieMessage.from_dict(op_response), - conversation_id=conversation_id, - message_id=op_response["id"], - space_id=space_id, - ) + return GenieMessage.from_dict(res) def execute_message_attachment_query( self, space_id: str, conversation_id: str, message_id: str, attachment_id: str @@ -2846,7 +2840,7 @@ def get_space(self, space_id: str) -> GenieSpace: res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", headers=headers) return GenieSpace.from_dict(res) - def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: + def start_conversation(self, space_id: str, content: str) -> GenieStartConversationResponse: """Start conversation. Start a new conversation. @@ -2868,16 +2862,8 @@ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: "Content-Type": "application/json", } - op_response = self._api.do( - "POST", f"/api/2.0/genie/spaces/{space_id}/start-conversation", body=body, headers=headers - ) - return Wait( - self.WaitGetMessageGenieCompleted, - response=GenieStartConversationResponse.from_dict(op_response), - conversation_id=op_response["conversation_id"], - message_id=op_response["message_id"], - space_id=space_id, - ) + res = self._api.do("POST", f"/api/2.0/genie/spaces/{space_id}/start-conversation", body=body, headers=headers) + return GenieStartConversationResponse.from_dict(res) class LakeviewAPI: diff --git a/databricks/sdk/jobs/v2/impl.py b/databricks/sdk/jobs/v2/impl.py index c55ad1808..ad3141e1a 100755 --- a/databricks/sdk/jobs/v2/impl.py +++ b/databricks/sdk/jobs/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") @@ -8740,7 +8740,7 @@ class SubmitTask: """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[ClusterSpec] = None + new_cluster: Optional[JobsClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8930,7 +8930,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), health=_from_dict(d, "health", JobsHealthRules), libraries=_repeated_dict(d, "libraries", Library), - new_cluster=_from_dict(d, "new_cluster", ClusterSpec), + new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), @@ -10092,7 +10092,7 @@ def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Opt self._api.do("POST", "/api/2.2/jobs/runs/cancel-all", body=body, headers=headers) - def cancel_run(self, run_id: int) -> Wait[Run]: + def cancel_run(self, run_id: int): """Cancel a run. Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when @@ -10112,10 +10112,7 @@ def cancel_run(self, run_id: int) -> Wait[Run]: "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.2/jobs/runs/cancel", body=body, headers=headers) - return Wait( - self.WaitGetRunJobTerminatedOrSkipped, response=CancelRunResponse.from_dict(op_response), run_id=run_id - ) + self._api.do("POST", "/api/2.2/jobs/runs/cancel", body=body, headers=headers) def create( self, @@ -10666,7 +10663,7 @@ def repair_run( rerun_tasks: Optional[List[str]] = None, spark_submit_params: Optional[List[str]] = None, sql_params: Optional[Dict[str, str]] = None, - ) -> Wait[Run]: + ) -> RepairRunResponse: """Repair a job run. Re-run one or more tasks. Tasks are re-run as part of the original job run. They use the current job @@ -10791,10 +10788,8 @@ def repair_run( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.2/jobs/runs/repair", body=body, headers=headers) - return Wait( - self.WaitGetRunJobTerminatedOrSkipped, response=RepairRunResponse.from_dict(op_response), run_id=run_id - ) + res = self._api.do("POST", "/api/2.2/jobs/runs/repair", body=body, headers=headers) + return RepairRunResponse.from_dict(res) def reset(self, job_id: int, new_settings: JobSettings): """Update all job settings (reset). @@ -10840,7 +10835,7 @@ def run_now( queue: Optional[QueueSettings] = None, spark_submit_params: Optional[List[str]] = None, sql_params: Optional[Dict[str, str]] = None, - ) -> Wait[Run]: + ) -> RunNowResponse: """Trigger a new job run. Run a job and return the `run_id` of the triggered run. @@ -10976,12 +10971,8 @@ def run_now( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.2/jobs/run-now", body=body, headers=headers) - return Wait( - self.WaitGetRunJobTerminatedOrSkipped, - response=RunNowResponse.from_dict(op_response), - run_id=op_response["run_id"], - ) + res = self._api.do("POST", "/api/2.2/jobs/run-now", body=body, headers=headers) + return RunNowResponse.from_dict(res) def set_permissions( self, job_id: str, *, access_control_list: Optional[List[JobAccessControlRequest]] = None @@ -11025,7 +11016,7 @@ def submit( tasks: Optional[List[SubmitTask]] = None, timeout_seconds: Optional[int] = None, webhook_notifications: Optional[WebhookNotifications] = None, - ) -> Wait[Run]: + ) -> SubmitRunResponse: """Create and trigger a one-time run. Submit a one-time run. This endpoint allows you to submit a workload directly without creating a job. @@ -11119,12 +11110,8 @@ def submit( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.2/jobs/runs/submit", body=body, headers=headers) - return Wait( - self.WaitGetRunJobTerminatedOrSkipped, - response=SubmitRunResponse.from_dict(op_response), - run_id=op_response["run_id"], - ) + res = self._api.do("POST", "/api/2.2/jobs/runs/submit", body=body, headers=headers) + return SubmitRunResponse.from_dict(res) def update( self, job_id: int, *, fields_to_remove: Optional[List[str]] = None, new_settings: Optional[JobSettings] = None diff --git a/databricks/sdk/ml/v2/impl.py b/databricks/sdk/ml/v2/impl.py index 2069b5fd4..98124a335 100755 --- a/databricks/sdk/ml/v2/impl.py +++ b/databricks/sdk/ml/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, +from ...service._internal import (_enum, _from_dict, _repeated_dict, _repeated_enum) _LOG = logging.getLogger("databricks.sdk") @@ -7126,7 +7126,7 @@ def create_experiment( split_column: Optional[str] = None, timeseries_identifier_columns: Optional[List[str]] = None, training_frameworks: Optional[List[str]] = None, - ) -> Wait[ForecastingExperiment]: + ) -> CreateForecastingExperimentResponse: """Create a forecasting experiment. Creates a serverless forecasting experiment. Returns the experiment ID. @@ -7212,12 +7212,8 @@ def create_experiment( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.0/automl/create-forecasting-experiment", body=body, headers=headers) - return Wait( - self.WaitGetExperimentForecastingSucceeded, - response=CreateForecastingExperimentResponse.from_dict(op_response), - experiment_id=op_response["experiment_id"], - ) + res = self._api.do("POST", "/api/2.0/automl/create-forecasting-experiment", body=body, headers=headers) + return CreateForecastingExperimentResponse.from_dict(res) def get_experiment(self, experiment_id: str) -> ForecastingExperiment: """Get a forecasting experiment. diff --git a/databricks/sdk/pipelines/v2/impl.py b/databricks/sdk/pipelines/v2/impl.py index 3fefe3444..d6e732f3a 100755 --- a/databricks/sdk/pipelines/v2/impl.py +++ b/databricks/sdk/pipelines/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, +from ...service._internal import (_enum, _from_dict, _repeated_dict, _repeated_enum) _LOG = logging.getLogger("databricks.sdk") @@ -4655,7 +4655,7 @@ def start_update( res = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/updates", body=body, headers=headers) return StartUpdateResponse.from_dict(res) - def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: + def stop(self, pipeline_id: str): """Stop a pipeline. Stops the pipeline by canceling the active update. If there is no active update for the pipeline, this @@ -4672,10 +4672,7 @@ def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: "Accept": "application/json", } - op_response = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/stop", headers=headers) - return Wait( - self.WaitGetPipelineIdle, response=StopPipelineResponse.from_dict(op_response), pipeline_id=pipeline_id - ) + self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/stop", headers=headers) def update( self, diff --git a/databricks/sdk/provisioning/v2/impl.py b/databricks/sdk/provisioning/v2/impl.py index 06bdba3a5..263203849 100755 --- a/databricks/sdk/provisioning/v2/impl.py +++ b/databricks/sdk/provisioning/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, +from ...service._internal import (_enum, _from_dict, _repeated_dict, _repeated_enum) _LOG = logging.getLogger("databricks.sdk") @@ -3182,7 +3182,7 @@ def create( private_access_settings_id: Optional[str] = None, storage_configuration_id: Optional[str] = None, storage_customer_managed_key_id: Optional[str] = None, - ) -> Wait[Workspace]: + ) -> Workspace: """Create a new workspace. Creates a new workspace. @@ -3327,14 +3327,8 @@ def create( "Content-Type": "application/json", } - op_response = self._api.do( - "POST", f"/api/2.0/accounts/{self._api.account_id}/workspaces", body=body, headers=headers - ) - return Wait( - self.WaitGetWorkspaceRunning, - response=Workspace.from_dict(op_response), - workspace_id=op_response["workspace_id"], - ) + res = self._api.do("POST", f"/api/2.0/accounts/{self._api.account_id}/workspaces", body=body, headers=headers) + return Workspace.from_dict(res) def delete(self, workspace_id: int): """Delete a workspace. @@ -3420,7 +3414,7 @@ def update( private_access_settings_id: Optional[str] = None, storage_configuration_id: Optional[str] = None, storage_customer_managed_key_id: Optional[str] = None, - ) -> Wait[Workspace]: + ): """Update workspace configuration. Updates a workspace configuration for either a running workspace or a failed workspace. The elements @@ -3575,9 +3569,6 @@ def update( "Content-Type": "application/json", } - op_response = self._api.do( + self._api.do( "PATCH", f"/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}", body=body, headers=headers ) - return Wait( - self.WaitGetWorkspaceRunning, response=UpdateResponse.from_dict(op_response), workspace_id=workspace_id - ) diff --git a/databricks/sdk/serving/v2/impl.py b/databricks/sdk/serving/v2/impl.py index b9a256c6b..bab0fcdbd 100755 --- a/databricks/sdk/serving/v2/impl.py +++ b/databricks/sdk/serving/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, BinaryIO, Dict, Iterator, List, Optional -from ...service._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") @@ -4192,7 +4192,7 @@ def create( rate_limits: Optional[List[RateLimit]] = None, route_optimized: Optional[bool] = None, tags: Optional[List[EndpointTag]] = None, - ) -> Wait[ServingEndpointDetailed]: + ) -> ServingEndpointDetailed: """Create a new serving endpoint. :param name: str @@ -4237,12 +4237,8 @@ def create( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.0/serving-endpoints", body=body, headers=headers) - return Wait( - self.WaitGetServingEndpointNotUpdating, - response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], - ) + res = self._api.do("POST", "/api/2.0/serving-endpoints", body=body, headers=headers) + return ServingEndpointDetailed.from_dict(res) def delete(self, name: str): """Delete a serving endpoint. @@ -4688,7 +4684,7 @@ def update_config( served_entities: Optional[List[ServedEntityInput]] = None, served_models: Optional[List[ServedModelInput]] = None, traffic_config: Optional[TrafficConfig] = None, - ) -> Wait[ServingEndpointDetailed]: + ) -> ServingEndpointDetailed: """Update config of a serving endpoint. Updates any combination of the serving endpoint's served entities, the compute configuration of those @@ -4728,12 +4724,8 @@ def update_config( "Content-Type": "application/json", } - op_response = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/config", body=body, headers=headers) - return Wait( - self.WaitGetServingEndpointNotUpdating, - response=ServingEndpointDetailed.from_dict(op_response), - name=op_response["name"], - ) + res = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/config", body=body, headers=headers) + return ServingEndpointDetailed.from_dict(res) def update_permissions( self, diff --git a/databricks/sdk/sql/v2/impl.py b/databricks/sdk/sql/v2/impl.py index 9619cd32e..096df9d6c 100755 --- a/databricks/sdk/sql/v2/impl.py +++ b/databricks/sdk/sql/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import (Wait, _enum, _from_dict, _repeated_dict, +from ...service._internal import (_enum, _from_dict, _repeated_dict, _repeated_enum) _LOG = logging.getLogger("databricks.sdk") @@ -9748,7 +9748,7 @@ def create( spot_instance_policy: Optional[SpotInstancePolicy] = None, tags: Optional[EndpointTags] = None, warehouse_type: Optional[CreateWarehouseRequestWarehouseType] = None, - ) -> Wait[GetWarehouseResponse]: + ) -> CreateWarehouseResponse: """Create a warehouse. Creates a new SQL warehouse. @@ -9845,10 +9845,8 @@ def create( "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.0/sql/warehouses", body=body, headers=headers) - return Wait( - self.WaitGetWarehouseRunning, response=CreateWarehouseResponse.from_dict(op_response), id=op_response["id"] - ) + res = self._api.do("POST", "/api/2.0/sql/warehouses", body=body, headers=headers) + return CreateWarehouseResponse.from_dict(res) def delete(self, id: str): """Delete a warehouse. @@ -9884,7 +9882,7 @@ def edit( spot_instance_policy: Optional[SpotInstancePolicy] = None, tags: Optional[EndpointTags] = None, warehouse_type: Optional[EditWarehouseRequestWarehouseType] = None, - ) -> Wait[GetWarehouseResponse]: + ): """Update a warehouse. Updates the configuration for a SQL warehouse. @@ -9982,8 +9980,7 @@ def edit( "Content-Type": "application/json", } - op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/edit", body=body, headers=headers) - return Wait(self.WaitGetWarehouseRunning, response=EditWarehouseResponse.from_dict(op_response), id=id) + self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/edit", body=body, headers=headers) def get(self, id: str) -> GetWarehouseResponse: """Get warehouse info. @@ -10171,7 +10168,7 @@ def set_workspace_warehouse_config( self._api.do("PUT", "/api/2.0/sql/config/warehouses", body=body, headers=headers) - def start(self, id: str) -> Wait[GetWarehouseResponse]: + def start(self, id: str): """Start a warehouse. Starts a SQL warehouse. @@ -10188,10 +10185,9 @@ def start(self, id: str) -> Wait[GetWarehouseResponse]: "Accept": "application/json", } - op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", headers=headers) - return Wait(self.WaitGetWarehouseRunning, response=StartWarehouseResponse.from_dict(op_response), id=id) + self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", headers=headers) - def stop(self, id: str) -> Wait[GetWarehouseResponse]: + def stop(self, id: str): """Stop a warehouse. Stops a SQL warehouse. @@ -10208,8 +10204,7 @@ def stop(self, id: str) -> Wait[GetWarehouseResponse]: "Accept": "application/json", } - op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", headers=headers) - return Wait(self.WaitGetWarehouseStopped, response=StopWarehouseResponse.from_dict(op_response), id=id) + self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", headers=headers) def update_permissions( self, warehouse_id: str, *, access_control_list: Optional[List[WarehouseAccessControlRequest]] = None diff --git a/databricks/sdk/vectorsearch/v2/impl.py b/databricks/sdk/vectorsearch/v2/impl.py index ed22b72c2..a0145cbf7 100755 --- a/databricks/sdk/vectorsearch/v2/impl.py +++ b/databricks/sdk/vectorsearch/v2/impl.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any, Dict, Iterator, List, Optional -from ...service._internal import Wait, _enum, _from_dict, _repeated_dict +from ...service._internal import _enum, _from_dict, _repeated_dict _LOG = logging.getLogger("databricks.sdk") @@ -1622,7 +1622,7 @@ class VectorSearchEndpointsAPI: def __init__(self, api_client): self._api = api_client - def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[EndpointInfo]: + def create_endpoint(self, name: str, endpoint_type: EndpointType) -> EndpointInfo: """Create an endpoint. Create a new endpoint. @@ -1646,12 +1646,8 @@ def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[Endpoi "Content-Type": "application/json", } - op_response = self._api.do("POST", "/api/2.0/vector-search/endpoints", body=body, headers=headers) - return Wait( - self.WaitGetEndpointVectorSearchEndpointOnline, - response=EndpointInfo.from_dict(op_response), - endpoint_name=op_response["name"], - ) + res = self._api.do("POST", "/api/2.0/vector-search/endpoints", body=body, headers=headers) + return EndpointInfo.from_dict(res) def delete_endpoint(self, endpoint_name: str): """Delete an endpoint. From b297ef4ff09c4644866e89891481e2d21404485e Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Fri, 28 Mar 2025 13:05:27 +0000 Subject: [PATCH 10/20] update --- databricks/sdk/apps/v2/{impl.py => apps.py} | 0 databricks/sdk/billing/v2/{impl.py => billing.py} | 0 databricks/sdk/catalog/v2/{impl.py => catalog.py} | 0 databricks/sdk/cleanrooms/v2/{impl.py => cleanrooms.py} | 0 databricks/sdk/compute/v2/{impl.py => compute.py} | 0 databricks/sdk/dashboards/v2/{impl.py => dashboards.py} | 0 databricks/sdk/files/v2/{impl.py => files.py} | 0 databricks/sdk/iam/v2/{impl.py => iam.py} | 0 databricks/sdk/jobs/v2/{impl.py => jobs.py} | 4 ++-- databricks/sdk/marketplace/v2/{impl.py => marketplace.py} | 0 databricks/sdk/ml/v2/{impl.py => ml.py} | 0 databricks/sdk/oauth2/v2/{impl.py => oauth2.py} | 0 databricks/sdk/pipelines/v2/{impl.py => pipelines.py} | 0 databricks/sdk/provisioning/v2/{impl.py => provisioning.py} | 0 databricks/sdk/serving/v2/{impl.py => serving.py} | 0 databricks/sdk/settings/v2/{impl.py => settings.py} | 0 databricks/sdk/sharing/v2/{impl.py => sharing.py} | 0 databricks/sdk/sql/v2/{impl.py => sql.py} | 0 databricks/sdk/vectorsearch/v2/{impl.py => vectorsearch.py} | 0 databricks/sdk/workspace/v2/{impl.py => workspace.py} | 0 20 files changed, 2 insertions(+), 2 deletions(-) rename databricks/sdk/apps/v2/{impl.py => apps.py} (100%) rename databricks/sdk/billing/v2/{impl.py => billing.py} (100%) rename databricks/sdk/catalog/v2/{impl.py => catalog.py} (100%) rename databricks/sdk/cleanrooms/v2/{impl.py => cleanrooms.py} (100%) rename databricks/sdk/compute/v2/{impl.py => compute.py} (100%) rename databricks/sdk/dashboards/v2/{impl.py => dashboards.py} (100%) rename databricks/sdk/files/v2/{impl.py => files.py} (100%) rename databricks/sdk/iam/v2/{impl.py => iam.py} (100%) rename databricks/sdk/jobs/v2/{impl.py => jobs.py} (99%) rename databricks/sdk/marketplace/v2/{impl.py => marketplace.py} (100%) rename databricks/sdk/ml/v2/{impl.py => ml.py} (100%) rename databricks/sdk/oauth2/v2/{impl.py => oauth2.py} (100%) rename databricks/sdk/pipelines/v2/{impl.py => pipelines.py} (100%) rename databricks/sdk/provisioning/v2/{impl.py => provisioning.py} (100%) rename databricks/sdk/serving/v2/{impl.py => serving.py} (100%) rename databricks/sdk/settings/v2/{impl.py => settings.py} (100%) rename databricks/sdk/sharing/v2/{impl.py => sharing.py} (100%) rename databricks/sdk/sql/v2/{impl.py => sql.py} (100%) rename databricks/sdk/vectorsearch/v2/{impl.py => vectorsearch.py} (100%) rename databricks/sdk/workspace/v2/{impl.py => workspace.py} (100%) diff --git a/databricks/sdk/apps/v2/impl.py b/databricks/sdk/apps/v2/apps.py similarity index 100% rename from databricks/sdk/apps/v2/impl.py rename to databricks/sdk/apps/v2/apps.py diff --git a/databricks/sdk/billing/v2/impl.py b/databricks/sdk/billing/v2/billing.py similarity index 100% rename from databricks/sdk/billing/v2/impl.py rename to databricks/sdk/billing/v2/billing.py diff --git a/databricks/sdk/catalog/v2/impl.py b/databricks/sdk/catalog/v2/catalog.py similarity index 100% rename from databricks/sdk/catalog/v2/impl.py rename to databricks/sdk/catalog/v2/catalog.py diff --git a/databricks/sdk/cleanrooms/v2/impl.py b/databricks/sdk/cleanrooms/v2/cleanrooms.py similarity index 100% rename from databricks/sdk/cleanrooms/v2/impl.py rename to databricks/sdk/cleanrooms/v2/cleanrooms.py diff --git a/databricks/sdk/compute/v2/impl.py b/databricks/sdk/compute/v2/compute.py similarity index 100% rename from databricks/sdk/compute/v2/impl.py rename to databricks/sdk/compute/v2/compute.py diff --git a/databricks/sdk/dashboards/v2/impl.py b/databricks/sdk/dashboards/v2/dashboards.py similarity index 100% rename from databricks/sdk/dashboards/v2/impl.py rename to databricks/sdk/dashboards/v2/dashboards.py diff --git a/databricks/sdk/files/v2/impl.py b/databricks/sdk/files/v2/files.py similarity index 100% rename from databricks/sdk/files/v2/impl.py rename to databricks/sdk/files/v2/files.py diff --git a/databricks/sdk/iam/v2/impl.py b/databricks/sdk/iam/v2/iam.py similarity index 100% rename from databricks/sdk/iam/v2/impl.py rename to databricks/sdk/iam/v2/iam.py diff --git a/databricks/sdk/jobs/v2/impl.py b/databricks/sdk/jobs/v2/jobs.py similarity index 99% rename from databricks/sdk/jobs/v2/impl.py rename to databricks/sdk/jobs/v2/jobs.py index ad3141e1a..8309ccc23 100755 --- a/databricks/sdk/jobs/v2/impl.py +++ b/databricks/sdk/jobs/v2/jobs.py @@ -8740,7 +8740,7 @@ class SubmitTask: """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[JobsClusterSpec] = None + new_cluster: Optional[ClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8930,7 +8930,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), health=_from_dict(d, "health", JobsHealthRules), libraries=_repeated_dict(d, "libraries", Library), - new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), + new_cluster=_from_dict(d, "new_cluster", ClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), diff --git a/databricks/sdk/marketplace/v2/impl.py b/databricks/sdk/marketplace/v2/marketplace.py similarity index 100% rename from databricks/sdk/marketplace/v2/impl.py rename to databricks/sdk/marketplace/v2/marketplace.py diff --git a/databricks/sdk/ml/v2/impl.py b/databricks/sdk/ml/v2/ml.py similarity index 100% rename from databricks/sdk/ml/v2/impl.py rename to databricks/sdk/ml/v2/ml.py diff --git a/databricks/sdk/oauth2/v2/impl.py b/databricks/sdk/oauth2/v2/oauth2.py similarity index 100% rename from databricks/sdk/oauth2/v2/impl.py rename to databricks/sdk/oauth2/v2/oauth2.py diff --git a/databricks/sdk/pipelines/v2/impl.py b/databricks/sdk/pipelines/v2/pipelines.py similarity index 100% rename from databricks/sdk/pipelines/v2/impl.py rename to databricks/sdk/pipelines/v2/pipelines.py diff --git a/databricks/sdk/provisioning/v2/impl.py b/databricks/sdk/provisioning/v2/provisioning.py similarity index 100% rename from databricks/sdk/provisioning/v2/impl.py rename to databricks/sdk/provisioning/v2/provisioning.py diff --git a/databricks/sdk/serving/v2/impl.py b/databricks/sdk/serving/v2/serving.py similarity index 100% rename from databricks/sdk/serving/v2/impl.py rename to databricks/sdk/serving/v2/serving.py diff --git a/databricks/sdk/settings/v2/impl.py b/databricks/sdk/settings/v2/settings.py similarity index 100% rename from databricks/sdk/settings/v2/impl.py rename to databricks/sdk/settings/v2/settings.py diff --git a/databricks/sdk/sharing/v2/impl.py b/databricks/sdk/sharing/v2/sharing.py similarity index 100% rename from databricks/sdk/sharing/v2/impl.py rename to databricks/sdk/sharing/v2/sharing.py diff --git a/databricks/sdk/sql/v2/impl.py b/databricks/sdk/sql/v2/sql.py similarity index 100% rename from databricks/sdk/sql/v2/impl.py rename to databricks/sdk/sql/v2/sql.py diff --git a/databricks/sdk/vectorsearch/v2/impl.py b/databricks/sdk/vectorsearch/v2/vectorsearch.py similarity index 100% rename from databricks/sdk/vectorsearch/v2/impl.py rename to databricks/sdk/vectorsearch/v2/vectorsearch.py diff --git a/databricks/sdk/workspace/v2/impl.py b/databricks/sdk/workspace/v2/workspace.py similarity index 100% rename from databricks/sdk/workspace/v2/impl.py rename to databricks/sdk/workspace/v2/workspace.py From 006d880288cd5ee990646885d70856edc8e73249 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Mon, 31 Mar 2025 08:25:36 +0000 Subject: [PATCH 11/20] Add Clients and Update tests --- .gitattributes | 103 +- databricks/sdk/__init__.py | 1071 +--------- databricks/sdk/apps/v2/apps.py | 0 databricks/sdk/apps/v2/client.py | 78 + databricks/sdk/billing/v2/client.py | 396 ++++ databricks/sdk/catalog/v2/client.py | 1764 +++++++++++++++++ databricks/sdk/cleanrooms/v2/client.py | 212 ++ databricks/sdk/compute/v2/client.py | 703 +++++++ .../compute.py => compute/v2/mixin.py} | 3 +- databricks/sdk/dashboards/v2/client.py | 280 +++ databricks/sdk/databricks/azure.py | 3 +- databricks/sdk/databricks/dbutils.py | 13 +- databricks/sdk/files/v2/client.py | 162 ++ .../{mixins/files.py => files/v2/mixin.py} | 30 +- databricks/sdk/iam/v2/client.py | 963 +++++++++ databricks/sdk/jobs/v2/client.py | 170 ++ databricks/sdk/jobs/v2/jobs.py | 4 +- .../sdk/{mixins/jobs.py => jobs/v2/mixin.py} | 4 +- databricks/sdk/marketplace/v2/client.py | 817 ++++++++ databricks/sdk/mixins/__init__.py | 0 databricks/sdk/ml/v2/client.py | 221 +++ databricks/sdk/oauth2/v2/client.py | 508 +++++ databricks/sdk/pipelines/v2/client.py | 89 + databricks/sdk/provisioning/v2/client.py | 501 +++++ databricks/sdk/service/_internal.py | 14 +- databricks/sdk/serving/v2/client.py | 154 ++ .../open_ai_client.py => serving/v2/mixin.py} | 3 +- databricks/sdk/settings/v2/client.py | 1709 ++++++++++++++++ databricks/sdk/sharing/v2/client.py | 300 +++ databricks/sdk/sql/v2/client.py | 1089 ++++++++++ databricks/sdk/vectorsearch/v2/client.py | 150 ++ databricks/sdk/workspace/v2/client.py | 300 +++ .../workspace.py => workspace/v2/mixin.py} | 7 +- tests/conftest.py | 4 +- tests/integration/conftest.py | 31 +- tests/integration/test_auth.py | 8 +- tests/integration/test_clusters.py | 42 +- tests/integration/test_commands.py | 4 +- tests/integration/test_data_plane.py | 30 +- tests/integration/test_deployment.py | 6 +- tests/integration/test_external_browser.py | 17 +- tests/integration/test_files.py | 94 +- tests/integration/test_iam.py | 16 +- tests/integration/test_jobs.py | 89 +- tests/integration/test_repos.py | 5 +- tests/integration/test_settings.py | 11 +- tests/integration/test_sql.py | 13 +- tests/integration/test_workspace.py | 2 +- tests/test_client.py | 18 +- tests/test_compute_mixins.py | 2 +- tests/test_core.py | 24 +- tests/test_dbfs_mixins.py | 56 +- tests/test_dbutils.py | 282 +-- tests/test_files.py | 22 +- tests/test_jobs_mixin.py | 50 +- tests/test_misc.py | 17 +- tests/test_open_ai_mixin.py | 18 +- 57 files changed, 11166 insertions(+), 1516 deletions(-) mode change 100755 => 100644 databricks/sdk/apps/v2/apps.py create mode 100644 databricks/sdk/apps/v2/client.py create mode 100755 databricks/sdk/billing/v2/client.py create mode 100755 databricks/sdk/catalog/v2/client.py create mode 100755 databricks/sdk/cleanrooms/v2/client.py create mode 100755 databricks/sdk/compute/v2/client.py rename databricks/sdk/{mixins/compute.py => compute/v2/mixin.py} (99%) create mode 100755 databricks/sdk/dashboards/v2/client.py create mode 100755 databricks/sdk/files/v2/client.py rename databricks/sdk/{mixins/files.py => files/v2/mixin.py} (98%) create mode 100755 databricks/sdk/iam/v2/client.py create mode 100755 databricks/sdk/jobs/v2/client.py rename databricks/sdk/{mixins/jobs.py => jobs/v2/mixin.py} (99%) create mode 100755 databricks/sdk/marketplace/v2/client.py delete mode 100644 databricks/sdk/mixins/__init__.py create mode 100755 databricks/sdk/ml/v2/client.py create mode 100755 databricks/sdk/oauth2/v2/client.py create mode 100755 databricks/sdk/pipelines/v2/client.py create mode 100755 databricks/sdk/provisioning/v2/client.py create mode 100755 databricks/sdk/serving/v2/client.py rename databricks/sdk/{mixins/open_ai_client.py => serving/v2/mixin.py} (96%) create mode 100755 databricks/sdk/settings/v2/client.py create mode 100755 databricks/sdk/sharing/v2/client.py create mode 100755 databricks/sdk/sql/v2/client.py create mode 100755 databricks/sdk/vectorsearch/v2/client.py create mode 100755 databricks/sdk/workspace/v2/client.py rename databricks/sdk/{mixins/workspace.py => workspace/v2/mixin.py} (96%) diff --git a/.gitattributes b/.gitattributes index a4029b165..d240f2758 100755 --- a/.gitattributes +++ b/.gitattributes @@ -1,23 +1,80 @@ -databricks/sdk/__init__.py linguist-generated=true -databricks/sdk/databricks/errors/overrides.py linguist-generated=true -databricks/sdk/databricks/errors/platform.py linguist-generated=true -databricks/sdk/service/apps.py linguist-generated=true -databricks/sdk/service/billing.py linguist-generated=true -databricks/sdk/service/catalog.py linguist-generated=true -databricks/sdk/service/cleanrooms.py linguist-generated=true -databricks/sdk/service/compute.py linguist-generated=true -databricks/sdk/service/dashboards.py linguist-generated=true -databricks/sdk/service/files.py linguist-generated=true -databricks/sdk/service/iam.py linguist-generated=true -databricks/sdk/service/jobs.py linguist-generated=true -databricks/sdk/service/marketplace.py linguist-generated=true -databricks/sdk/service/ml.py linguist-generated=true -databricks/sdk/service/oauth2.py linguist-generated=true -databricks/sdk/service/pipelines.py linguist-generated=true -databricks/sdk/service/provisioning.py linguist-generated=true -databricks/sdk/service/serving.py linguist-generated=true -databricks/sdk/service/settings.py linguist-generated=true -databricks/sdk/service/sharing.py linguist-generated=true -databricks/sdk/service/sql.py linguist-generated=true -databricks/sdk/service/vectorsearch.py linguist-generated=true -databricks/sdk/service/workspace.py linguist-generated=true +databricks/sdk/apps/__init__.py linguist-generated=true +databricks/sdk/apps/v2/__init__.py linguist-generated=true +databricks/sdk/apps/v2/apps.py linguist-generated=true +databricks/sdk/apps/v2/client.py linguist-generated=true +databricks/sdk/billing/__init__.py linguist-generated=true +databricks/sdk/billing/v2/__init__.py linguist-generated=true +databricks/sdk/billing/v2/billing.py linguist-generated=true +databricks/sdk/billing/v2/client.py linguist-generated=true +databricks/sdk/catalog/__init__.py linguist-generated=true +databricks/sdk/catalog/v2/__init__.py linguist-generated=true +databricks/sdk/catalog/v2/catalog.py linguist-generated=true +databricks/sdk/catalog/v2/client.py linguist-generated=true +databricks/sdk/cleanrooms/__init__.py linguist-generated=true +databricks/sdk/cleanrooms/v2/__init__.py linguist-generated=true +databricks/sdk/cleanrooms/v2/cleanrooms.py linguist-generated=true +databricks/sdk/cleanrooms/v2/client.py linguist-generated=true +databricks/sdk/compute/__init__.py linguist-generated=true +databricks/sdk/compute/v2/__init__.py linguist-generated=true +databricks/sdk/compute/v2/client.py linguist-generated=true +databricks/sdk/compute/v2/compute.py linguist-generated=true +databricks/sdk/dashboards/__init__.py linguist-generated=true +databricks/sdk/dashboards/v2/__init__.py linguist-generated=true +databricks/sdk/dashboards/v2/client.py linguist-generated=true +databricks/sdk/dashboards/v2/dashboards.py linguist-generated=true +databricks/sdk/files/__init__.py linguist-generated=true +databricks/sdk/files/v2/__init__.py linguist-generated=true +databricks/sdk/files/v2/client.py linguist-generated=true +databricks/sdk/files/v2/files.py linguist-generated=true +databricks/sdk/iam/__init__.py linguist-generated=true +databricks/sdk/iam/v2/__init__.py linguist-generated=true +databricks/sdk/iam/v2/client.py linguist-generated=true +databricks/sdk/iam/v2/iam.py linguist-generated=true +databricks/sdk/jobs/__init__.py linguist-generated=true +databricks/sdk/jobs/v2/__init__.py linguist-generated=true +databricks/sdk/jobs/v2/client.py linguist-generated=true +databricks/sdk/jobs/v2/jobs.py linguist-generated=true +databricks/sdk/marketplace/__init__.py linguist-generated=true +databricks/sdk/marketplace/v2/__init__.py linguist-generated=true +databricks/sdk/marketplace/v2/client.py linguist-generated=true +databricks/sdk/marketplace/v2/marketplace.py linguist-generated=true +databricks/sdk/ml/__init__.py linguist-generated=true +databricks/sdk/ml/v2/__init__.py linguist-generated=true +databricks/sdk/ml/v2/client.py linguist-generated=true +databricks/sdk/ml/v2/ml.py linguist-generated=true +databricks/sdk/oauth2/__init__.py linguist-generated=true +databricks/sdk/oauth2/v2/__init__.py linguist-generated=true +databricks/sdk/oauth2/v2/client.py linguist-generated=true +databricks/sdk/oauth2/v2/oauth2.py linguist-generated=true +databricks/sdk/pipelines/__init__.py linguist-generated=true +databricks/sdk/pipelines/v2/__init__.py linguist-generated=true +databricks/sdk/pipelines/v2/client.py linguist-generated=true +databricks/sdk/pipelines/v2/pipelines.py linguist-generated=true +databricks/sdk/provisioning/__init__.py linguist-generated=true +databricks/sdk/provisioning/v2/__init__.py linguist-generated=true +databricks/sdk/provisioning/v2/client.py linguist-generated=true +databricks/sdk/provisioning/v2/provisioning.py linguist-generated=true +databricks/sdk/serving/__init__.py linguist-generated=true +databricks/sdk/serving/v2/__init__.py linguist-generated=true +databricks/sdk/serving/v2/client.py linguist-generated=true +databricks/sdk/serving/v2/serving.py linguist-generated=true +databricks/sdk/settings/__init__.py linguist-generated=true +databricks/sdk/settings/v2/__init__.py linguist-generated=true +databricks/sdk/settings/v2/client.py linguist-generated=true +databricks/sdk/settings/v2/settings.py linguist-generated=true +databricks/sdk/sharing/__init__.py linguist-generated=true +databricks/sdk/sharing/v2/__init__.py linguist-generated=true +databricks/sdk/sharing/v2/client.py linguist-generated=true +databricks/sdk/sharing/v2/sharing.py linguist-generated=true +databricks/sdk/sql/__init__.py linguist-generated=true +databricks/sdk/sql/v2/__init__.py linguist-generated=true +databricks/sdk/sql/v2/client.py linguist-generated=true +databricks/sdk/sql/v2/sql.py linguist-generated=true +databricks/sdk/vectorsearch/__init__.py linguist-generated=true +databricks/sdk/vectorsearch/v2/__init__.py linguist-generated=true +databricks/sdk/vectorsearch/v2/client.py linguist-generated=true +databricks/sdk/vectorsearch/v2/vectorsearch.py linguist-generated=true +databricks/sdk/workspace/__init__.py linguist-generated=true +databricks/sdk/workspace/v2/__init__.py linguist-generated=true +databricks/sdk/workspace/v2/client.py linguist-generated=true +databricks/sdk/workspace/v2/workspace.py linguist-generated=true diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index 4cbfc92c1..9367e9487 100755 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -9,104 +9,8 @@ from databricks.sdk.databricks import azure from databricks.sdk.databricks.credentials_provider import CredentialsStrategy from databricks.sdk.databricks.data_plane import DataPlaneTokenSource -from databricks.sdk.mixins.compute import ClustersExt -from databricks.sdk.mixins.files import DbfsExt, FilesExt -from databricks.sdk.mixins.jobs import JobsExt -from databricks.sdk.mixins.open_ai_client import ServingEndpointsExt -from databricks.sdk.mixins.workspace import WorkspaceExt -from databricks.sdk.service.apps import AppsAPI -from databricks.sdk.service.billing import (BillableUsageAPI, BudgetPolicyAPI, - BudgetsAPI, LogDeliveryAPI, - UsageDashboardsAPI) -from databricks.sdk.service.catalog import (AccountMetastoreAssignmentsAPI, - AccountMetastoresAPI, - AccountStorageCredentialsAPI, - ArtifactAllowlistsAPI, CatalogsAPI, - ConnectionsAPI, CredentialsAPI, - ExternalLocationsAPI, FunctionsAPI, - GrantsAPI, MetastoresAPI, - ModelVersionsAPI, OnlineTablesAPI, - QualityMonitorsAPI, - RegisteredModelsAPI, - ResourceQuotasAPI, SchemasAPI, - StorageCredentialsAPI, - SystemSchemasAPI, - TableConstraintsAPI, TablesAPI, - TemporaryTableCredentialsAPI, - VolumesAPI, WorkspaceBindingsAPI) -from databricks.sdk.service.cleanrooms import (CleanRoomAssetsAPI, - CleanRoomsAPI, - CleanRoomTaskRunsAPI) -from databricks.sdk.service.compute import (ClusterPoliciesAPI, ClustersAPI, - CommandExecutionAPI, - GlobalInitScriptsAPI, - InstancePoolsAPI, - InstanceProfilesAPI, LibrariesAPI, - PolicyComplianceForClustersAPI, - PolicyFamiliesAPI) -from databricks.sdk.service.dashboards import (GenieAPI, LakeviewAPI, - LakeviewEmbeddedAPI, - QueryExecutionAPI) -from databricks.sdk.service.files import DbfsAPI, FilesAPI -from databricks.sdk.service.iam import (AccessControlAPI, - AccountAccessControlAPI, - AccountAccessControlProxyAPI, - AccountGroupsAPI, - AccountServicePrincipalsAPI, - AccountUsersAPI, CurrentUserAPI, - GroupsAPI, PermissionMigrationAPI, - PermissionsAPI, ServicePrincipalsAPI, - UsersAPI, WorkspaceAssignmentAPI) -from databricks.sdk.service.jobs import JobsAPI, PolicyComplianceForJobsAPI -from databricks.sdk.service.marketplace import ( - ConsumerFulfillmentsAPI, ConsumerInstallationsAPI, ConsumerListingsAPI, - ConsumerPersonalizationRequestsAPI, ConsumerProvidersAPI, - ProviderExchangeFiltersAPI, ProviderExchangesAPI, ProviderFilesAPI, - ProviderListingsAPI, ProviderPersonalizationRequestsAPI, - ProviderProviderAnalyticsDashboardsAPI, ProviderProvidersAPI) -from databricks.sdk.service.ml import (ExperimentsAPI, ForecastingAPI, - ModelRegistryAPI) -from databricks.sdk.service.oauth2 import (AccountFederationPolicyAPI, - CustomAppIntegrationAPI, - OAuthPublishedAppsAPI, - PublishedAppIntegrationAPI, - ServicePrincipalFederationPolicyAPI, - ServicePrincipalSecretsAPI) -from databricks.sdk.service.pipelines import PipelinesAPI -from databricks.sdk.service.provisioning import (CredentialsAPI, - EncryptionKeysAPI, - NetworksAPI, PrivateAccessAPI, - StorageAPI, VpcEndpointsAPI, - Workspace, WorkspacesAPI) -from databricks.sdk.service.serving import (ServingEndpointsAPI, - ServingEndpointsDataPlaneAPI) -from databricks.sdk.service.settings import ( - AccountIpAccessListsAPI, AccountSettingsAPI, - AibiDashboardEmbeddingAccessPolicyAPI, - AibiDashboardEmbeddingApprovedDomainsAPI, AutomaticClusterUpdateAPI, - ComplianceSecurityProfileAPI, CredentialsManagerAPI, - CspEnablementAccountAPI, DefaultNamespaceAPI, DisableLegacyAccessAPI, - DisableLegacyDbfsAPI, DisableLegacyFeaturesAPI, EnableIpAccessListsAPI, - EnhancedSecurityMonitoringAPI, EsmEnablementAccountAPI, IpAccessListsAPI, - NetworkConnectivityAPI, NotificationDestinationsAPI, PersonalComputeAPI, - RestrictWorkspaceAdminsAPI, SettingsAPI, TokenManagementAPI, TokensAPI, - WorkspaceConfAPI) -from databricks.sdk.service.sharing import (ProvidersAPI, - RecipientActivationAPI, - RecipientsAPI, SharesAPI) -from databricks.sdk.service.sql import (AlertsAPI, AlertsLegacyAPI, - DashboardsAPI, DashboardWidgetsAPI, - DataSourcesAPI, DbsqlPermissionsAPI, - QueriesAPI, QueriesLegacyAPI, - QueryHistoryAPI, - QueryVisualizationsAPI, - QueryVisualizationsLegacyAPI, - RedashConfigAPI, StatementExecutionAPI, - WarehousesAPI) -from databricks.sdk.service.vectorsearch import (VectorSearchEndpointsAPI, - VectorSearchIndexesAPI) -from databricks.sdk.service.workspace import (GitCredentialsAPI, ReposAPI, - SecretsAPI, WorkspaceAPI) +from databricks.sdk.files.v2.mixin import DbfsExt, FilesExt +from databricks.sdk.files.v2.files import FilesAPI _LOG = logging.getLogger(__name__) @@ -134,974 +38,3 @@ def _make_files_client(apiClient: client.ApiClient, config: client.Config): return FilesExt(apiClient, config) else: return FilesAPI(apiClient) - - -class WorkspaceClient: - """ - The WorkspaceClient is a client for the workspace-level Databricks REST API. - """ - - def __init__( - self, - *, - host: Optional[str] = None, - account_id: Optional[str] = None, - username: Optional[str] = None, - password: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - token: Optional[str] = None, - profile: Optional[str] = None, - config_file: Optional[str] = None, - azure_workspace_resource_id: Optional[str] = None, - azure_client_secret: Optional[str] = None, - azure_client_id: Optional[str] = None, - azure_tenant_id: Optional[str] = None, - azure_environment: Optional[str] = None, - auth_type: Optional[str] = None, - cluster_id: Optional[str] = None, - google_credentials: Optional[str] = None, - google_service_account: Optional[str] = None, - debug_truncate_bytes: Optional[int] = None, - debug_headers: Optional[bool] = None, - product="unknown", - product_version="0.0.0", - credentials_strategy: Optional[CredentialsStrategy] = None, - credentials_provider: Optional[CredentialsStrategy] = None, - config: Optional[client.Config] = None, - ): - if not config: - config = client.Config( - host=host, - account_id=account_id, - username=username, - password=password, - client_id=client_id, - client_secret=client_secret, - token=token, - profile=profile, - config_file=config_file, - azure_workspace_resource_id=azure_workspace_resource_id, - azure_client_secret=azure_client_secret, - azure_client_id=azure_client_id, - azure_tenant_id=azure_tenant_id, - azure_environment=azure_environment, - auth_type=auth_type, - cluster_id=cluster_id, - google_credentials=google_credentials, - google_service_account=google_service_account, - credentials_strategy=credentials_strategy, - credentials_provider=credentials_provider, - debug_truncate_bytes=debug_truncate_bytes, - debug_headers=debug_headers, - product=product, - product_version=product_version, - ) - self._config = config.copy() - self._dbutils = _make_dbutils(self._config) - self._api_client = client.ApiClient(self._config) - serving_endpoints = ServingEndpointsExt(self._api_client) - self._access_control = service.iam.AccessControlAPI(self._api_client) - self._account_access_control_proxy = service.iam.AccountAccessControlProxyAPI(self._api_client) - self._alerts = service.sql.AlertsAPI(self._api_client) - self._alerts_legacy = service.sql.AlertsLegacyAPI(self._api_client) - self._apps = service.apps.AppsAPI(self._api_client) - self._artifact_allowlists = service.catalog.ArtifactAllowlistsAPI(self._api_client) - self._catalogs = service.catalog.CatalogsAPI(self._api_client) - self._clean_room_assets = service.cleanrooms.CleanRoomAssetsAPI(self._api_client) - self._clean_room_task_runs = service.cleanrooms.CleanRoomTaskRunsAPI(self._api_client) - self._clean_rooms = service.cleanrooms.CleanRoomsAPI(self._api_client) - self._cluster_policies = service.compute.ClusterPoliciesAPI(self._api_client) - self._clusters = ClustersExt(self._api_client) - self._command_execution = service.compute.CommandExecutionAPI(self._api_client) - self._connections = service.catalog.ConnectionsAPI(self._api_client) - self._consumer_fulfillments = service.marketplace.ConsumerFulfillmentsAPI(self._api_client) - self._consumer_installations = service.marketplace.ConsumerInstallationsAPI(self._api_client) - self._consumer_listings = service.marketplace.ConsumerListingsAPI(self._api_client) - self._consumer_personalization_requests = service.marketplace.ConsumerPersonalizationRequestsAPI( - self._api_client - ) - self._consumer_providers = service.marketplace.ConsumerProvidersAPI(self._api_client) - self._credentials = service.catalog.CredentialsAPI(self._api_client) - self._credentials_manager = service.settings.CredentialsManagerAPI(self._api_client) - self._current_user = service.iam.CurrentUserAPI(self._api_client) - self._dashboard_widgets = service.sql.DashboardWidgetsAPI(self._api_client) - self._dashboards = service.sql.DashboardsAPI(self._api_client) - self._data_sources = service.sql.DataSourcesAPI(self._api_client) - self._dbfs = DbfsExt(self._api_client) - self._dbsql_permissions = service.sql.DbsqlPermissionsAPI(self._api_client) - self._experiments = service.ml.ExperimentsAPI(self._api_client) - self._external_locations = service.catalog.ExternalLocationsAPI(self._api_client) - self._files = _make_files_client(self._api_client, self._config) - self._functions = service.catalog.FunctionsAPI(self._api_client) - self._genie = service.dashboards.GenieAPI(self._api_client) - self._git_credentials = service.workspace.GitCredentialsAPI(self._api_client) - self._global_init_scripts = service.compute.GlobalInitScriptsAPI(self._api_client) - self._grants = service.catalog.GrantsAPI(self._api_client) - self._groups = service.iam.GroupsAPI(self._api_client) - self._instance_pools = service.compute.InstancePoolsAPI(self._api_client) - self._instance_profiles = service.compute.InstanceProfilesAPI(self._api_client) - self._ip_access_lists = service.settings.IpAccessListsAPI(self._api_client) - self._jobs = JobsExt(self._api_client) - self._lakeview = service.dashboards.LakeviewAPI(self._api_client) - self._lakeview_embedded = service.dashboards.LakeviewEmbeddedAPI(self._api_client) - self._libraries = service.compute.LibrariesAPI(self._api_client) - self._metastores = service.catalog.MetastoresAPI(self._api_client) - self._model_registry = service.ml.ModelRegistryAPI(self._api_client) - self._model_versions = service.catalog.ModelVersionsAPI(self._api_client) - self._notification_destinations = service.settings.NotificationDestinationsAPI(self._api_client) - self._online_tables = service.catalog.OnlineTablesAPI(self._api_client) - self._permission_migration = service.iam.PermissionMigrationAPI(self._api_client) - self._permissions = service.iam.PermissionsAPI(self._api_client) - self._pipelines = service.pipelines.PipelinesAPI(self._api_client) - self._policy_compliance_for_clusters = service.compute.PolicyComplianceForClustersAPI(self._api_client) - self._policy_compliance_for_jobs = service.jobs.PolicyComplianceForJobsAPI(self._api_client) - self._policy_families = service.compute.PolicyFamiliesAPI(self._api_client) - self._provider_exchange_filters = service.marketplace.ProviderExchangeFiltersAPI(self._api_client) - self._provider_exchanges = service.marketplace.ProviderExchangesAPI(self._api_client) - self._provider_files = service.marketplace.ProviderFilesAPI(self._api_client) - self._provider_listings = service.marketplace.ProviderListingsAPI(self._api_client) - self._provider_personalization_requests = service.marketplace.ProviderPersonalizationRequestsAPI( - self._api_client - ) - self._provider_provider_analytics_dashboards = service.marketplace.ProviderProviderAnalyticsDashboardsAPI( - self._api_client - ) - self._provider_providers = service.marketplace.ProviderProvidersAPI(self._api_client) - self._providers = service.sharing.ProvidersAPI(self._api_client) - self._quality_monitors = service.catalog.QualityMonitorsAPI(self._api_client) - self._queries = service.sql.QueriesAPI(self._api_client) - self._queries_legacy = service.sql.QueriesLegacyAPI(self._api_client) - self._query_execution = service.dashboards.QueryExecutionAPI(self._api_client) - self._query_history = service.sql.QueryHistoryAPI(self._api_client) - self._query_visualizations = service.sql.QueryVisualizationsAPI(self._api_client) - self._query_visualizations_legacy = service.sql.QueryVisualizationsLegacyAPI(self._api_client) - self._recipient_activation = service.sharing.RecipientActivationAPI(self._api_client) - self._recipients = service.sharing.RecipientsAPI(self._api_client) - self._redash_config = service.sql.RedashConfigAPI(self._api_client) - self._registered_models = service.catalog.RegisteredModelsAPI(self._api_client) - self._repos = service.workspace.ReposAPI(self._api_client) - self._resource_quotas = service.catalog.ResourceQuotasAPI(self._api_client) - self._schemas = service.catalog.SchemasAPI(self._api_client) - self._secrets = service.workspace.SecretsAPI(self._api_client) - self._service_principals = service.iam.ServicePrincipalsAPI(self._api_client) - self._serving_endpoints = serving_endpoints - serving_endpoints_data_plane_token_source = DataPlaneTokenSource( - self._config.host, self._config.oauth_token, not self._config.enable_experimental_async_token_refresh - ) - self._serving_endpoints_data_plane = service.serving.ServingEndpointsDataPlaneAPI( - self._api_client, serving_endpoints, serving_endpoints_data_plane_token_source - ) - self._settings = service.settings.SettingsAPI(self._api_client) - self._shares = service.sharing.SharesAPI(self._api_client) - self._statement_execution = service.sql.StatementExecutionAPI(self._api_client) - self._storage_credentials = service.catalog.StorageCredentialsAPI(self._api_client) - self._system_schemas = service.catalog.SystemSchemasAPI(self._api_client) - self._table_constraints = service.catalog.TableConstraintsAPI(self._api_client) - self._tables = service.catalog.TablesAPI(self._api_client) - self._temporary_table_credentials = service.catalog.TemporaryTableCredentialsAPI(self._api_client) - self._token_management = service.settings.TokenManagementAPI(self._api_client) - self._tokens = service.settings.TokensAPI(self._api_client) - self._users = service.iam.UsersAPI(self._api_client) - self._vector_search_endpoints = service.vectorsearch.VectorSearchEndpointsAPI(self._api_client) - self._vector_search_indexes = service.vectorsearch.VectorSearchIndexesAPI(self._api_client) - self._volumes = service.catalog.VolumesAPI(self._api_client) - self._warehouses = service.sql.WarehousesAPI(self._api_client) - self._workspace = WorkspaceExt(self._api_client) - self._workspace_bindings = service.catalog.WorkspaceBindingsAPI(self._api_client) - self._workspace_conf = service.settings.WorkspaceConfAPI(self._api_client) - self._forecasting = service.ml.ForecastingAPI(self._api_client) - - @property - def config(self) -> client.Config: - return self._config - - @property - def api_client(self) -> client.ApiClient: - return self._api_client - - @property - def dbutils(self) -> dbutils.RemoteDbUtils: - return self._dbutils - - @property - def access_control(self) -> service.iam.AccessControlAPI: - """Rule based Access Control for Databricks Resources.""" - return self._access_control - - @property - def account_access_control_proxy(self) -> service.iam.AccountAccessControlProxyAPI: - """These APIs manage access rules on resources in an account.""" - return self._account_access_control_proxy - - @property - def alerts(self) -> service.sql.AlertsAPI: - """The alerts API can be used to perform CRUD operations on alerts.""" - return self._alerts - - @property - def alerts_legacy(self) -> service.sql.AlertsLegacyAPI: - """The alerts API can be used to perform CRUD operations on alerts.""" - return self._alerts_legacy - - @property - def apps(self) -> service.apps.AppsAPI: - """Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend Databricks services, and enable users to interact through single sign-on.""" - return self._apps - - @property - def artifact_allowlists(self) -> service.catalog.ArtifactAllowlistsAPI: - """In Databricks Runtime 13.3 and above, you can add libraries and init scripts to the `allowlist` in UC so that users can leverage these artifacts on compute configured with shared access mode.""" - return self._artifact_allowlists - - @property - def catalogs(self) -> service.catalog.CatalogsAPI: - """A catalog is the first layer of Unity Catalog’s three-level namespace.""" - return self._catalogs - - @property - def clean_room_assets(self) -> service.cleanrooms.CleanRoomAssetsAPI: - """Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the clean room.""" - return self._clean_room_assets - - @property - def clean_room_task_runs(self) -> service.cleanrooms.CleanRoomTaskRunsAPI: - """Clean room task runs are the executions of notebooks in a clean room.""" - return self._clean_room_task_runs - - @property - def clean_rooms(self) -> service.cleanrooms.CleanRoomsAPI: - """A clean room uses Delta Sharing and serverless compute to provide a secure and privacy-protecting environment where multiple parties can work together on sensitive enterprise data without direct access to each other’s data.""" - return self._clean_rooms - - @property - def cluster_policies(self) -> service.compute.ClusterPoliciesAPI: - """You can use cluster policies to control users' ability to configure clusters based on a set of rules.""" - return self._cluster_policies - - @property - def clusters(self) -> ClustersExt: - """The Clusters API allows you to create, start, edit, list, terminate, and delete clusters.""" - return self._clusters - - @property - def command_execution(self) -> service.compute.CommandExecutionAPI: - """This API allows execution of Python, Scala, SQL, or R commands on running Databricks Clusters.""" - return self._command_execution - - @property - def connections(self) -> service.catalog.ConnectionsAPI: - """Connections allow for creating a connection to an external data source.""" - return self._connections - - @property - def consumer_fulfillments(self) -> service.marketplace.ConsumerFulfillmentsAPI: - """Fulfillments are entities that allow consumers to preview installations.""" - return self._consumer_fulfillments - - @property - def consumer_installations(self) -> service.marketplace.ConsumerInstallationsAPI: - """Installations are entities that allow consumers to interact with Databricks Marketplace listings.""" - return self._consumer_installations - - @property - def consumer_listings(self) -> service.marketplace.ConsumerListingsAPI: - """Listings are the core entities in the Marketplace.""" - return self._consumer_listings - - @property - def consumer_personalization_requests(self) -> service.marketplace.ConsumerPersonalizationRequestsAPI: - """Personalization Requests allow customers to interact with the individualized Marketplace listing flow.""" - return self._consumer_personalization_requests - - @property - def consumer_providers(self) -> service.marketplace.ConsumerProvidersAPI: - """Providers are the entities that publish listings to the Marketplace.""" - return self._consumer_providers - - @property - def credentials(self) -> service.catalog.CredentialsAPI: - """A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant.""" - return self._credentials - - @property - def credentials_manager(self) -> service.settings.CredentialsManagerAPI: - """Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens.""" - return self._credentials_manager - - @property - def current_user(self) -> service.iam.CurrentUserAPI: - """This API allows retrieving information about currently authenticated user or service principal.""" - return self._current_user - - @property - def dashboard_widgets(self) -> service.sql.DashboardWidgetsAPI: - """This is an evolving API that facilitates the addition and removal of widgets from existing dashboards within the Databricks Workspace.""" - return self._dashboard_widgets - - @property - def dashboards(self) -> service.sql.DashboardsAPI: - """In general, there is little need to modify dashboards using the API.""" - return self._dashboards - - @property - def data_sources(self) -> service.sql.DataSourcesAPI: - """This API is provided to assist you in making new query objects.""" - return self._data_sources - - @property - def dbfs(self) -> DbfsExt: - """DBFS API makes it simple to interact with various data sources without having to include a users credentials every time to read a file.""" - return self._dbfs - - @property - def dbsql_permissions(self) -> service.sql.DbsqlPermissionsAPI: - """The SQL Permissions API is similar to the endpoints of the :method:permissions/set.""" - return self._dbsql_permissions - - @property - def experiments(self) -> service.ml.ExperimentsAPI: - """Experiments are the primary unit of organization in MLflow; all MLflow runs belong to an experiment.""" - return self._experiments - - @property - def external_locations(self) -> service.catalog.ExternalLocationsAPI: - """An external location is an object that combines a cloud storage path with a storage credential that authorizes access to the cloud storage path.""" - return self._external_locations - - @property - def files(self) -> service.files.FilesAPI: - """The Files API is a standard HTTP API that allows you to read, write, list, and delete files and directories by referring to their URI.""" - return self._files - - @property - def functions(self) -> service.catalog.FunctionsAPI: - """Functions implement User-Defined Functions (UDFs) in Unity Catalog.""" - return self._functions - - @property - def genie(self) -> service.dashboards.GenieAPI: - """Genie provides a no-code experience for business users, powered by AI/BI.""" - return self._genie - - @property - def git_credentials(self) -> service.workspace.GitCredentialsAPI: - """Registers personal access token for Databricks to do operations on behalf of the user.""" - return self._git_credentials - - @property - def global_init_scripts(self) -> service.compute.GlobalInitScriptsAPI: - """The Global Init Scripts API enables Workspace administrators to configure global initialization scripts for their workspace.""" - return self._global_init_scripts - - @property - def grants(self) -> service.catalog.GrantsAPI: - """In Unity Catalog, data is secure by default.""" - return self._grants - - @property - def groups(self) -> service.iam.GroupsAPI: - """Groups simplify identity management, making it easier to assign access to Databricks workspace, data, and other securable objects.""" - return self._groups - - @property - def instance_pools(self) -> service.compute.InstancePoolsAPI: - """Instance Pools API are used to create, edit, delete and list instance pools by using ready-to-use cloud instances which reduces a cluster start and auto-scaling times.""" - return self._instance_pools - - @property - def instance_profiles(self) -> service.compute.InstanceProfilesAPI: - """The Instance Profiles API allows admins to add, list, and remove instance profiles that users can launch clusters with.""" - return self._instance_profiles - - @property - def ip_access_lists(self) -> service.settings.IpAccessListsAPI: - """IP Access List enables admins to configure IP access lists.""" - return self._ip_access_lists - - @property - def jobs(self) -> JobsExt: - """The Jobs API allows you to create, edit, and delete jobs.""" - return self._jobs - - @property - def lakeview(self) -> service.dashboards.LakeviewAPI: - """These APIs provide specific management operations for Lakeview dashboards.""" - return self._lakeview - - @property - def lakeview_embedded(self) -> service.dashboards.LakeviewEmbeddedAPI: - """Token-based Lakeview APIs for embedding dashboards in external applications.""" - return self._lakeview_embedded - - @property - def libraries(self) -> service.compute.LibrariesAPI: - """The Libraries API allows you to install and uninstall libraries and get the status of libraries on a cluster.""" - return self._libraries - - @property - def metastores(self) -> service.catalog.MetastoresAPI: - """A metastore is the top-level container of objects in Unity Catalog.""" - return self._metastores - - @property - def model_registry(self) -> service.ml.ModelRegistryAPI: - """Note: This API reference documents APIs for the Workspace Model Registry.""" - return self._model_registry - - @property - def model_versions(self) -> service.catalog.ModelVersionsAPI: - """Databricks provides a hosted version of MLflow Model Registry in Unity Catalog.""" - return self._model_versions - - @property - def notification_destinations(self) -> service.settings.NotificationDestinationsAPI: - """The notification destinations API lets you programmatically manage a workspace's notification destinations.""" - return self._notification_destinations - - @property - def online_tables(self) -> service.catalog.OnlineTablesAPI: - """Online tables provide lower latency and higher QPS access to data from Delta tables.""" - return self._online_tables - - @property - def permission_migration(self) -> service.iam.PermissionMigrationAPI: - """APIs for migrating acl permissions, used only by the ucx tool: https://github.com/databrickslabs/ucx.""" - return self._permission_migration - - @property - def permissions(self) -> service.iam.PermissionsAPI: - """Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints.""" - return self._permissions - - @property - def pipelines(self) -> service.pipelines.PipelinesAPI: - """The Delta Live Tables API allows you to create, edit, delete, start, and view details about pipelines.""" - return self._pipelines - - @property - def policy_compliance_for_clusters(self) -> service.compute.PolicyComplianceForClustersAPI: - """The policy compliance APIs allow you to view and manage the policy compliance status of clusters in your workspace.""" - return self._policy_compliance_for_clusters - - @property - def policy_compliance_for_jobs(self) -> service.jobs.PolicyComplianceForJobsAPI: - """The compliance APIs allow you to view and manage the policy compliance status of jobs in your workspace.""" - return self._policy_compliance_for_jobs - - @property - def policy_families(self) -> service.compute.PolicyFamiliesAPI: - """View available policy families.""" - return self._policy_families - - @property - def provider_exchange_filters(self) -> service.marketplace.ProviderExchangeFiltersAPI: - """Marketplace exchanges filters curate which groups can access an exchange.""" - return self._provider_exchange_filters - - @property - def provider_exchanges(self) -> service.marketplace.ProviderExchangesAPI: - """Marketplace exchanges allow providers to share their listings with a curated set of customers.""" - return self._provider_exchanges - - @property - def provider_files(self) -> service.marketplace.ProviderFilesAPI: - """Marketplace offers a set of file APIs for various purposes such as preview notebooks and provider icons.""" - return self._provider_files - - @property - def provider_listings(self) -> service.marketplace.ProviderListingsAPI: - """Listings are the core entities in the Marketplace.""" - return self._provider_listings - - @property - def provider_personalization_requests(self) -> service.marketplace.ProviderPersonalizationRequestsAPI: - """Personalization requests are an alternate to instantly available listings.""" - return self._provider_personalization_requests - - @property - def provider_provider_analytics_dashboards(self) -> service.marketplace.ProviderProviderAnalyticsDashboardsAPI: - """Manage templated analytics solution for providers.""" - return self._provider_provider_analytics_dashboards - - @property - def provider_providers(self) -> service.marketplace.ProviderProvidersAPI: - """Providers are entities that manage assets in Marketplace.""" - return self._provider_providers - - @property - def providers(self) -> service.sharing.ProvidersAPI: - """A data provider is an object representing the organization in the real world who shares the data.""" - return self._providers - - @property - def quality_monitors(self) -> service.catalog.QualityMonitorsAPI: - """A monitor computes and monitors data or model quality metrics for a table over time.""" - return self._quality_monitors - - @property - def queries(self) -> service.sql.QueriesAPI: - """The queries API can be used to perform CRUD operations on queries.""" - return self._queries - - @property - def queries_legacy(self) -> service.sql.QueriesLegacyAPI: - """These endpoints are used for CRUD operations on query definitions.""" - return self._queries_legacy - - @property - def query_execution(self) -> service.dashboards.QueryExecutionAPI: - """Query execution APIs for AI / BI Dashboards.""" - return self._query_execution - - @property - def query_history(self) -> service.sql.QueryHistoryAPI: - """A service responsible for storing and retrieving the list of queries run against SQL endpoints and serverless compute.""" - return self._query_history - - @property - def query_visualizations(self) -> service.sql.QueryVisualizationsAPI: - """This is an evolving API that facilitates the addition and removal of visualizations from existing queries in the Databricks Workspace.""" - return self._query_visualizations - - @property - def query_visualizations_legacy(self) -> service.sql.QueryVisualizationsLegacyAPI: - """This is an evolving API that facilitates the addition and removal of vizualisations from existing queries within the Databricks Workspace.""" - return self._query_visualizations_legacy - - @property - def recipient_activation(self) -> service.sharing.RecipientActivationAPI: - """The Recipient Activation API is only applicable in the open sharing model where the recipient object has the authentication type of `TOKEN`.""" - return self._recipient_activation - - @property - def recipients(self) -> service.sharing.RecipientsAPI: - """A recipient is an object you create using :method:recipients/create to represent an organization which you want to allow access shares.""" - return self._recipients - - @property - def redash_config(self) -> service.sql.RedashConfigAPI: - """Redash V2 service for workspace configurations (internal).""" - return self._redash_config - - @property - def registered_models(self) -> service.catalog.RegisteredModelsAPI: - """Databricks provides a hosted version of MLflow Model Registry in Unity Catalog.""" - return self._registered_models - - @property - def repos(self) -> service.workspace.ReposAPI: - """The Repos API allows users to manage their git repos.""" - return self._repos - - @property - def resource_quotas(self) -> service.catalog.ResourceQuotasAPI: - """Unity Catalog enforces resource quotas on all securable objects, which limits the number of resources that can be created.""" - return self._resource_quotas - - @property - def schemas(self) -> service.catalog.SchemasAPI: - """A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace.""" - return self._schemas - - @property - def secrets(self) -> service.workspace.SecretsAPI: - """The Secrets API allows you to manage secrets, secret scopes, and access permissions.""" - return self._secrets - - @property - def service_principals(self) -> service.iam.ServicePrincipalsAPI: - """Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.""" - return self._service_principals - - @property - def serving_endpoints(self) -> ServingEndpointsExt: - """The Serving Endpoints API allows you to create, update, and delete model serving endpoints.""" - return self._serving_endpoints - - @property - def serving_endpoints_data_plane(self) -> service.serving.ServingEndpointsDataPlaneAPI: - """Serving endpoints DataPlane provides a set of operations to interact with data plane endpoints for Serving endpoints service.""" - return self._serving_endpoints_data_plane - - @property - def settings(self) -> service.settings.SettingsAPI: - """Workspace Settings API allows users to manage settings at the workspace level.""" - return self._settings - - @property - def shares(self) -> service.sharing.SharesAPI: - """A share is a container instantiated with :method:shares/create.""" - return self._shares - - @property - def statement_execution(self) -> service.sql.StatementExecutionAPI: - """The Databricks SQL Statement Execution API can be used to execute SQL statements on a SQL warehouse and fetch the result.""" - return self._statement_execution - - @property - def storage_credentials(self) -> service.catalog.StorageCredentialsAPI: - """A storage credential represents an authentication and authorization mechanism for accessing data stored on your cloud tenant.""" - return self._storage_credentials - - @property - def system_schemas(self) -> service.catalog.SystemSchemasAPI: - """A system schema is a schema that lives within the system catalog.""" - return self._system_schemas - - @property - def table_constraints(self) -> service.catalog.TableConstraintsAPI: - """Primary key and foreign key constraints encode relationships between fields in tables.""" - return self._table_constraints - - @property - def tables(self) -> service.catalog.TablesAPI: - """A table resides in the third layer of Unity Catalog’s three-level namespace.""" - return self._tables - - @property - def temporary_table_credentials(self) -> service.catalog.TemporaryTableCredentialsAPI: - """Temporary Table Credentials refer to short-lived, downscoped credentials used to access cloud storage locationswhere table data is stored in Databricks.""" - return self._temporary_table_credentials - - @property - def token_management(self) -> service.settings.TokenManagementAPI: - """Enables administrators to get all tokens and delete tokens for other users.""" - return self._token_management - - @property - def tokens(self) -> service.settings.TokensAPI: - """The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.""" - return self._tokens - - @property - def users(self) -> service.iam.UsersAPI: - """User identities recognized by Databricks and represented by email addresses.""" - return self._users - - @property - def vector_search_endpoints(self) -> service.vectorsearch.VectorSearchEndpointsAPI: - """**Endpoint**: Represents the compute resources to host vector search indexes.""" - return self._vector_search_endpoints - - @property - def vector_search_indexes(self) -> service.vectorsearch.VectorSearchIndexesAPI: - """**Index**: An efficient representation of your embedding vectors that supports real-time and efficient approximate nearest neighbor (ANN) search queries.""" - return self._vector_search_indexes - - @property - def volumes(self) -> service.catalog.VolumesAPI: - """Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing and processing files.""" - return self._volumes - - @property - def warehouses(self) -> service.sql.WarehousesAPI: - """A SQL warehouse is a compute resource that lets you run SQL commands on data objects within Databricks SQL.""" - return self._warehouses - - @property - def workspace(self) -> WorkspaceExt: - """The Workspace API allows you to list, import, export, and delete notebooks and folders.""" - return self._workspace - - @property - def workspace_bindings(self) -> service.catalog.WorkspaceBindingsAPI: - """A securable in Databricks can be configured as __OPEN__ or __ISOLATED__.""" - return self._workspace_bindings - - @property - def workspace_conf(self) -> service.settings.WorkspaceConfAPI: - """This API allows updating known workspace settings for advanced users.""" - return self._workspace_conf - - @property - def forecasting(self) -> service.ml.ForecastingAPI: - """The Forecasting API allows you to create and get serverless forecasting experiments.""" - return self._forecasting - - def get_workspace_id(self) -> int: - """Get the workspace ID of the workspace that this client is connected to.""" - response = self._api_client.do("GET", "/api/2.0/preview/scim/v2/Me", response_headers=["X-Databricks-Org-Id"]) - return int(response["X-Databricks-Org-Id"]) - - def __repr__(self): - return f"WorkspaceClient(host='{self._config.host}', auth_type='{self._config.auth_type}', ...)" - - -class AccountClient: - """ - The AccountClient is a client for the account-level Databricks REST API. - """ - - def __init__( - self, - *, - host: Optional[str] = None, - account_id: Optional[str] = None, - username: Optional[str] = None, - password: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - token: Optional[str] = None, - profile: Optional[str] = None, - config_file: Optional[str] = None, - azure_workspace_resource_id: Optional[str] = None, - azure_client_secret: Optional[str] = None, - azure_client_id: Optional[str] = None, - azure_tenant_id: Optional[str] = None, - azure_environment: Optional[str] = None, - auth_type: Optional[str] = None, - cluster_id: Optional[str] = None, - google_credentials: Optional[str] = None, - google_service_account: Optional[str] = None, - debug_truncate_bytes: Optional[int] = None, - debug_headers: Optional[bool] = None, - product="unknown", - product_version="0.0.0", - credentials_strategy: Optional[CredentialsStrategy] = None, - credentials_provider: Optional[CredentialsStrategy] = None, - config: Optional[client.Config] = None, - ): - if not config: - config = client.Config( - host=host, - account_id=account_id, - username=username, - password=password, - client_id=client_id, - client_secret=client_secret, - token=token, - profile=profile, - config_file=config_file, - azure_workspace_resource_id=azure_workspace_resource_id, - azure_client_secret=azure_client_secret, - azure_client_id=azure_client_id, - azure_tenant_id=azure_tenant_id, - azure_environment=azure_environment, - auth_type=auth_type, - cluster_id=cluster_id, - google_credentials=google_credentials, - google_service_account=google_service_account, - credentials_strategy=credentials_strategy, - credentials_provider=credentials_provider, - debug_truncate_bytes=debug_truncate_bytes, - debug_headers=debug_headers, - product=product, - product_version=product_version, - ) - self._config = config.copy() - self._api_client = client.ApiClient(self._config) - self._access_control = service.iam.AccountAccessControlAPI(self._api_client) - self._billable_usage = service.billing.BillableUsageAPI(self._api_client) - self._budget_policy = service.billing.BudgetPolicyAPI(self._api_client) - self._credentials = service.provisioning.CredentialsAPI(self._api_client) - self._custom_app_integration = service.oauth2.CustomAppIntegrationAPI(self._api_client) - self._encryption_keys = service.provisioning.EncryptionKeysAPI(self._api_client) - self._federation_policy = service.oauth2.AccountFederationPolicyAPI(self._api_client) - self._groups = service.iam.AccountGroupsAPI(self._api_client) - self._ip_access_lists = service.settings.AccountIpAccessListsAPI(self._api_client) - self._log_delivery = service.billing.LogDeliveryAPI(self._api_client) - self._metastore_assignments = service.catalog.AccountMetastoreAssignmentsAPI(self._api_client) - self._metastores = service.catalog.AccountMetastoresAPI(self._api_client) - self._network_connectivity = service.settings.NetworkConnectivityAPI(self._api_client) - self._networks = service.provisioning.NetworksAPI(self._api_client) - self._o_auth_published_apps = service.oauth2.OAuthPublishedAppsAPI(self._api_client) - self._private_access = service.provisioning.PrivateAccessAPI(self._api_client) - self._published_app_integration = service.oauth2.PublishedAppIntegrationAPI(self._api_client) - self._service_principal_federation_policy = service.oauth2.ServicePrincipalFederationPolicyAPI(self._api_client) - self._service_principal_secrets = service.oauth2.ServicePrincipalSecretsAPI(self._api_client) - self._service_principals = service.iam.AccountServicePrincipalsAPI(self._api_client) - self._settings = service.settings.AccountSettingsAPI(self._api_client) - self._storage = service.provisioning.StorageAPI(self._api_client) - self._storage_credentials = service.catalog.AccountStorageCredentialsAPI(self._api_client) - self._usage_dashboards = service.billing.UsageDashboardsAPI(self._api_client) - self._users = service.iam.AccountUsersAPI(self._api_client) - self._vpc_endpoints = service.provisioning.VpcEndpointsAPI(self._api_client) - self._workspace_assignment = service.iam.WorkspaceAssignmentAPI(self._api_client) - self._workspaces = service.provisioning.WorkspacesAPI(self._api_client) - self._budgets = service.billing.BudgetsAPI(self._api_client) - - @property - def config(self) -> client.Config: - return self._config - - @property - def api_client(self) -> client.ApiClient: - return self._api_client - - @property - def access_control(self) -> service.iam.AccountAccessControlAPI: - """These APIs manage access rules on resources in an account.""" - return self._access_control - - @property - def billable_usage(self) -> service.billing.BillableUsageAPI: - """This API allows you to download billable usage logs for the specified account and date range.""" - return self._billable_usage - - @property - def budget_policy(self) -> service.billing.BudgetPolicyAPI: - """A service serves REST API about Budget policies.""" - return self._budget_policy - - @property - def credentials(self) -> service.provisioning.CredentialsAPI: - """These APIs manage credential configurations for this workspace.""" - return self._credentials - - @property - def custom_app_integration(self) -> service.oauth2.CustomAppIntegrationAPI: - """These APIs enable administrators to manage custom OAuth app integrations, which is required for adding/using Custom OAuth App Integration like Tableau Cloud for Databricks in AWS cloud.""" - return self._custom_app_integration - - @property - def encryption_keys(self) -> service.provisioning.EncryptionKeysAPI: - """These APIs manage encryption key configurations for this workspace (optional).""" - return self._encryption_keys - - @property - def federation_policy(self) -> service.oauth2.AccountFederationPolicyAPI: - """These APIs manage account federation policies.""" - return self._federation_policy - - @property - def groups(self) -> service.iam.AccountGroupsAPI: - """Groups simplify identity management, making it easier to assign access to Databricks account, data, and other securable objects.""" - return self._groups - - @property - def ip_access_lists(self) -> service.settings.AccountIpAccessListsAPI: - """The Accounts IP Access List API enables account admins to configure IP access lists for access to the account console.""" - return self._ip_access_lists - - @property - def log_delivery(self) -> service.billing.LogDeliveryAPI: - """These APIs manage log delivery configurations for this account.""" - return self._log_delivery - - @property - def metastore_assignments(self) -> service.catalog.AccountMetastoreAssignmentsAPI: - """These APIs manage metastore assignments to a workspace.""" - return self._metastore_assignments - - @property - def metastores(self) -> service.catalog.AccountMetastoresAPI: - """These APIs manage Unity Catalog metastores for an account.""" - return self._metastores - - @property - def network_connectivity(self) -> service.settings.NetworkConnectivityAPI: - """These APIs provide configurations for the network connectivity of your workspaces for serverless compute resources.""" - return self._network_connectivity - - @property - def networks(self) -> service.provisioning.NetworksAPI: - """These APIs manage network configurations for customer-managed VPCs (optional).""" - return self._networks - - @property - def o_auth_published_apps(self) -> service.oauth2.OAuthPublishedAppsAPI: - """These APIs enable administrators to view all the available published OAuth applications in Databricks.""" - return self._o_auth_published_apps - - @property - def private_access(self) -> service.provisioning.PrivateAccessAPI: - """These APIs manage private access settings for this account.""" - return self._private_access - - @property - def published_app_integration(self) -> service.oauth2.PublishedAppIntegrationAPI: - """These APIs enable administrators to manage published OAuth app integrations, which is required for adding/using Published OAuth App Integration like Tableau Desktop for Databricks in AWS cloud.""" - return self._published_app_integration - - @property - def service_principal_federation_policy(self) -> service.oauth2.ServicePrincipalFederationPolicyAPI: - """These APIs manage service principal federation policies.""" - return self._service_principal_federation_policy - - @property - def service_principal_secrets(self) -> service.oauth2.ServicePrincipalSecretsAPI: - """These APIs enable administrators to manage service principal secrets.""" - return self._service_principal_secrets - - @property - def service_principals(self) -> service.iam.AccountServicePrincipalsAPI: - """Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.""" - return self._service_principals - - @property - def settings(self) -> service.settings.AccountSettingsAPI: - """Accounts Settings API allows users to manage settings at the account level.""" - return self._settings - - @property - def storage(self) -> service.provisioning.StorageAPI: - """These APIs manage storage configurations for this workspace.""" - return self._storage - - @property - def storage_credentials(self) -> service.catalog.AccountStorageCredentialsAPI: - """These APIs manage storage credentials for a particular metastore.""" - return self._storage_credentials - - @property - def usage_dashboards(self) -> service.billing.UsageDashboardsAPI: - """These APIs manage usage dashboards for this account.""" - return self._usage_dashboards - - @property - def users(self) -> service.iam.AccountUsersAPI: - """User identities recognized by Databricks and represented by email addresses.""" - return self._users - - @property - def vpc_endpoints(self) -> service.provisioning.VpcEndpointsAPI: - """These APIs manage VPC endpoint configurations for this account.""" - return self._vpc_endpoints - - @property - def workspace_assignment(self) -> service.iam.WorkspaceAssignmentAPI: - """The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account.""" - return self._workspace_assignment - - @property - def workspaces(self) -> service.provisioning.WorkspacesAPI: - """These APIs manage workspaces for this account.""" - return self._workspaces - - @property - def budgets(self) -> service.billing.BudgetsAPI: - """These APIs manage budget configurations for this account.""" - return self._budgets - - def get_workspace_client(self, workspace: Workspace) -> WorkspaceClient: - """Constructs a ``WorkspaceClient`` for the given workspace. - - Returns a ``WorkspaceClient`` that is configured to use the same - credentials as this ``AccountClient``. The underlying config is - copied from this ``AccountClient``, but the ``host`` and - ``azure_workspace_resource_id`` are overridden to match the - given workspace, and the ``account_id`` field is cleared. - - Usage: - - .. code-block:: - - wss = list(a.workspaces.list()) - if len(wss) == 0: - pytest.skip("no workspaces") - w = a.get_workspace_client(wss[0]) - assert w.current_user.me().active - - :param workspace: The workspace to construct a client for. - :return: A ``WorkspaceClient`` for the given workspace. - """ - config = self._config.deep_copy() - config.host = config.environment.deployment_url(workspace.deployment_name) - config.azure_workspace_resource_id = azure.get_azure_resource_id(workspace) - config.account_id = None - config.init_auth() - return WorkspaceClient(config=config) - - def __repr__(self): - return f"AccountClient(account_id='{self._config.account_id}', auth_type='{self._config.auth_type}', ...)" diff --git a/databricks/sdk/apps/v2/apps.py b/databricks/sdk/apps/v2/apps.py old mode 100755 new mode 100644 diff --git a/databricks/sdk/apps/v2/client.py b/databricks/sdk/apps/v2/client.py new file mode 100644 index 000000000..ff2cc6315 --- /dev/null +++ b/databricks/sdk/apps/v2/client.py @@ -0,0 +1,78 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .apps import AppsAPI + +_LOG = logging.getLogger(__name__) + + +class AppsClient(AppsAPI): + """ + Apps run directly on a customer’s Databricks instance, integrate with their data, use and + extend Databricks services, and enable users to interact through single sign-on. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/billing/v2/client.py b/databricks/sdk/billing/v2/client.py new file mode 100755 index 000000000..440feb981 --- /dev/null +++ b/databricks/sdk/billing/v2/client.py @@ -0,0 +1,396 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .billing import (BillableUsageAPI, BudgetPolicyAPI, BudgetsAPI, + LogDeliveryAPI, UsageDashboardsAPI) + +_LOG = logging.getLogger(__name__) + + +class BillableUsageClient(BillableUsageAPI): + """ + This API allows you to download billable usage logs for the specified account and date range. + This feature works with all account types. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class BudgetPolicyClient(BudgetPolicyAPI): + """ + A service serves REST API about Budget policies + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class BudgetsClient(BudgetsAPI): + """ + These APIs manage budget configurations for this account. Budgets enable you to monitor usage + across your account. You can set up budgets to either track account-wide spending, or apply + filters to track the spending of specific teams, projects, or workspaces. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class LogDeliveryClient(LogDeliveryAPI): + """ + These APIs manage log delivery configurations for this account. The two supported log types for + this API are _billable usage logs_ and _audit logs_. This feature is in Public Preview. This + feature works with all account ID types. + + Log delivery works with all account types. However, if your account is on the E2 version of the + platform or on a select custom plan that allows multiple workspaces per account, you can + optionally configure different storage destinations for each workspace. Log delivery status is + also provided to know the latest status of log delivery attempts. The high-level flow of + billable usage delivery: + + 1. **Create storage**: In AWS, [create a new AWS S3 bucket] with a specific bucket policy. Using + Databricks APIs, call the Account API to create a [storage configuration + object](:method:Storage/Create) that uses the bucket name. 2. **Create credentials**: In AWS, + create the appropriate AWS IAM role. For full details, including the required IAM role policies + and trust relationship, see [Billable usage log delivery]. Using Databricks APIs, call the + Account API to create a [credential configuration object](:method:Credentials/Create) that uses + the IAM role"s ARN. 3. **Create log delivery configuration**: Using Databricks APIs, call the + Account API to [create a log delivery configuration](:method:LogDelivery/Create) that uses the + credential and storage configuration objects from previous steps. You can specify if the logs + should include all events of that log type in your account (_Account level_ delivery) or only + events for a specific set of workspaces (_workspace level_ delivery). Account level log delivery + applies to all current and future workspaces plus account level logs, while workspace level log + delivery solely delivers logs related to the specified workspaces. You can create multiple types + of delivery configurations per account. + + For billable usage delivery: * For more information about billable usage logs, see [Billable + usage log delivery]. For the CSV schema, see the [Usage page]. * The delivery location is + `//billable-usage/csv/`, where `` is the name of the optional + delivery path prefix you set up during log delivery configuration. Files are named + `workspaceId=-usageMonth=.csv`. * All billable usage logs apply to specific + workspaces (_workspace level_ logs). You can aggregate usage for your entire account by creating + an _account level_ delivery configuration that delivers logs for all current and future + workspaces in your account. * The files are delivered daily by overwriting the month's CSV file + for each workspace. + + For audit log delivery: * For more information about about audit log delivery, see [Audit log + delivery], which includes information about the used JSON schema. * The delivery location is + `//workspaceId=/date=/auditlogs_.json`. + Files may get overwritten with the same content multiple times to achieve exactly-once delivery. + * If the audit log delivery configuration included specific workspace IDs, only + _workspace-level_ audit logs for those workspaces are delivered. If the log delivery + configuration applies to the entire account (_account level_ delivery configuration), the audit + log delivery includes workspace-level audit logs for all workspaces in the account as well as + account-level audit logs. See [Audit log delivery] for details. * Auditable events are typically + available in logs within 15 minutes. + + [Audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html + [Billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html + [Usage page]: https://docs.databricks.com/administration-guide/account-settings/usage.html + [create a new AWS S3 bucket]: https://docs.databricks.com/administration-guide/account-api/aws-storage.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class UsageDashboardsClient(UsageDashboardsAPI): + """ + These APIs manage usage dashboards for this account. Usage dashboards enable you to gain + insights into your usage with pre-built dashboards: visualize breakdowns, analyze tag + attributions, and identify cost drivers. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/catalog/v2/client.py b/databricks/sdk/catalog/v2/client.py new file mode 100755 index 000000000..a5994ecde --- /dev/null +++ b/databricks/sdk/catalog/v2/client.py @@ -0,0 +1,1764 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .catalog import (AccountMetastoreAssignmentsAPI, AccountMetastoresAPI, + AccountStorageCredentialsAPI, ArtifactAllowlistsAPI, + CatalogsAPI, ConnectionsAPI, CredentialsAPI, + ExternalLocationsAPI, FunctionsAPI, GrantsAPI, + MetastoresAPI, ModelVersionsAPI, OnlineTablesAPI, + QualityMonitorsAPI, RegisteredModelsAPI, + ResourceQuotasAPI, SchemasAPI, StorageCredentialsAPI, + SystemSchemasAPI, TableConstraintsAPI, TablesAPI, + TemporaryTableCredentialsAPI, VolumesAPI, + WorkspaceBindingsAPI) + +_LOG = logging.getLogger(__name__) + + +class AccountMetastoreAssignmentsClient(AccountMetastoreAssignmentsAPI): + """ + These APIs manage metastore assignments to a workspace. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountMetastoresClient(AccountMetastoresAPI): + """ + These APIs manage Unity Catalog metastores for an account. A metastore contains catalogs that + can be associated with workspaces + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountStorageCredentialsClient(AccountStorageCredentialsAPI): + """ + These APIs manage storage credentials for a particular metastore. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ArtifactAllowlistsClient(ArtifactAllowlistsAPI): + """ + In Databricks Runtime 13.3 and above, you can add libraries and init scripts to the `allowlist` + in UC so that users can leverage these artifacts on compute configured with shared access mode. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CatalogsClient(CatalogsAPI): + """ + A catalog is the first layer of Unity Catalog’s three-level namespace. It’s used to organize + your data assets. Users can see all catalogs on which they have been assigned the USE_CATALOG + data permission. + + In Unity Catalog, admins and data stewards manage users and their access to data centrally + across all of the workspaces in a Databricks account. Users in different workspaces can share + access to the same data, depending on privileges granted centrally in Unity Catalog. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ConnectionsClient(ConnectionsAPI): + """ + Connections allow for creating a connection to an external data source. + + A connection is an abstraction of an external data source that can be connected from Databricks + Compute. Creating a connection object is the first step to managing external data sources within + Unity Catalog, with the second step being creating a data object (catalog, schema, or table) + using the connection. Data objects derived from a connection can be written to or read from + similar to other Unity Catalog data objects based on cloud storage. Users may create different + types of connections with each connection having a unique set of configuration options to + support credential management and other settings. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CredentialsClient(CredentialsAPI): + """ + A credential represents an authentication and authorization mechanism for accessing services on + your cloud tenant. Each credential is subject to Unity Catalog access-control policies that + control which users and groups can access the credential. + + To create credentials, you must be a Databricks account admin or have the `CREATE SERVICE + CREDENTIAL` privilege. The user who creates the credential can delegate ownership to another + user or group to manage permissions on it. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ExternalLocationsClient(ExternalLocationsAPI): + """ + An external location is an object that combines a cloud storage path with a storage credential + that authorizes access to the cloud storage path. Each external location is subject to Unity + Catalog access-control policies that control which users and groups can access the credential. + If a user does not have access to an external location in Unity Catalog, the request fails and + Unity Catalog does not attempt to authenticate to your cloud tenant on the user’s behalf. + + Databricks recommends using external locations rather than using storage credentials directly. + + To create external locations, you must be a metastore admin or a user with the + **CREATE_EXTERNAL_LOCATION** privilege. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class FunctionsClient(FunctionsAPI): + """ + Functions implement User-Defined Functions (UDFs) in Unity Catalog. + + The function implementation can be any SQL expression or Query, and it can be invoked wherever a + table reference is allowed in a query. In Unity Catalog, a function resides at the same level as + a table, so it can be referenced with the form + __catalog_name__.__schema_name__.__function_name__. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class GrantsClient(GrantsAPI): + """ + In Unity Catalog, data is secure by default. Initially, users have no access to data in a + metastore. Access can be granted by either a metastore admin, the owner of an object, or the + owner of the catalog or schema that contains the object. Securable objects in Unity Catalog are + hierarchical and privileges are inherited downward. + + Securable objects in Unity Catalog are hierarchical and privileges are inherited downward. This + means that granting a privilege on the catalog automatically grants the privilege to all current + and future objects within the catalog. Similarly, privileges granted on a schema are inherited + by all current and future objects within that schema. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class MetastoresClient(MetastoresAPI): + """ + A metastore is the top-level container of objects in Unity Catalog. It stores data assets + (tables and views) and the permissions that govern access to them. Databricks account admins can + create metastores and assign them to Databricks workspaces to control which workloads use each + metastore. For a workspace to use Unity Catalog, it must have a Unity Catalog metastore + attached. + + Each metastore is configured with a root storage location in a cloud storage account. This + storage location is used for metadata and managed tables data. + + NOTE: This metastore is distinct from the metastore included in Databricks workspaces created + before Unity Catalog was released. If your workspace includes a legacy Hive metastore, the data + in that metastore is available in a catalog named hive_metastore. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ModelVersionsClient(ModelVersionsAPI): + """ + Databricks provides a hosted version of MLflow Model Registry in Unity Catalog. Models in Unity + Catalog provide centralized access control, auditing, lineage, and discovery of ML models across + Databricks workspaces. + + This API reference documents the REST endpoints for managing model versions in Unity Catalog. + For more details, see the [registered models API docs](/api/workspace/registeredmodels). + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class OnlineTablesClient(OnlineTablesAPI): + """ + Online tables provide lower latency and higher QPS access to data from Delta tables. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class QualityMonitorsClient(QualityMonitorsAPI): + """ + A monitor computes and monitors data or model quality metrics for a table over time. It + generates metrics tables and a dashboard that you can use to monitor table health and set + alerts. + + Most write operations require the user to be the owner of the table (or its parent schema or + parent catalog). Viewing the dashboard, computed metrics, or monitor configuration only requires + the user to have **SELECT** privileges on the table (along with **USE_SCHEMA** and + **USE_CATALOG**). + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class RegisteredModelsClient(RegisteredModelsAPI): + """ + Databricks provides a hosted version of MLflow Model Registry in Unity Catalog. Models in Unity + Catalog provide centralized access control, auditing, lineage, and discovery of ML models across + Databricks workspaces. + + An MLflow registered model resides in the third layer of Unity Catalog’s three-level + namespace. Registered models contain model versions, which correspond to actual ML models + (MLflow models). Creating new model versions currently requires use of the MLflow Python client. + Once model versions are created, you can load them for batch inference using MLflow Python + client APIs, or deploy them for real-time serving using Databricks Model Serving. + + All operations on registered models and model versions require USE_CATALOG permissions on the + enclosing catalog and USE_SCHEMA permissions on the enclosing schema. In addition, the following + additional privileges are required for various operations: + + * To create a registered model, users must additionally have the CREATE_MODEL permission on the + target schema. * To view registered model or model version metadata, model version data files, + or invoke a model version, users must additionally have the EXECUTE permission on the registered + model * To update registered model or model version tags, users must additionally have APPLY TAG + permissions on the registered model * To update other registered model or model version metadata + (comments, aliases) create a new model version, or update permissions on the registered model, + users must be owners of the registered model. + + Note: The securable type for models is "FUNCTION". When using REST APIs (e.g. tagging, grants) + that specify a securable type, use "FUNCTION" as the securable type. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ResourceQuotasClient(ResourceQuotasAPI): + """ + Unity Catalog enforces resource quotas on all securable objects, which limits the number of + resources that can be created. Quotas are expressed in terms of a resource type and a parent + (for example, tables per metastore or schemas per catalog). The resource quota APIs enable you + to monitor your current usage and limits. For more information on resource quotas see the [Unity + Catalog documentation]. + + [Unity Catalog documentation]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#resource-quotas + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class SchemasClient(SchemasAPI): + """ + A schema (also called a database) is the second layer of Unity Catalog’s three-level + namespace. A schema organizes tables, views and functions. To access (or list) a table or view + in a schema, users must have the USE_SCHEMA data permission on the schema and its parent + catalog, and they must have the SELECT permission on the table or view. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class StorageCredentialsClient(StorageCredentialsAPI): + """ + A storage credential represents an authentication and authorization mechanism for accessing data + stored on your cloud tenant. Each storage credential is subject to Unity Catalog access-control + policies that control which users and groups can access the credential. If a user does not have + access to a storage credential in Unity Catalog, the request fails and Unity Catalog does not + attempt to authenticate to your cloud tenant on the user’s behalf. + + Databricks recommends using external locations rather than using storage credentials directly. + + To create storage credentials, you must be a Databricks account admin. The account admin who + creates the storage credential can delegate ownership to another user or group to manage + permissions on it. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class SystemSchemasClient(SystemSchemasAPI): + """ + A system schema is a schema that lives within the system catalog. A system schema may contain + information about customer usage of Unity Catalog such as audit-logs, billing-logs, lineage + information, etc. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class TableConstraintsClient(TableConstraintsAPI): + """ + Primary key and foreign key constraints encode relationships between fields in tables. + + Primary and foreign keys are informational only and are not enforced. Foreign keys must + reference a primary key in another table. This primary key is the parent constraint of the + foreign key and the table this primary key is on is the parent table of the foreign key. + Similarly, the foreign key is the child constraint of its referenced primary key; the table of + the foreign key is the child table of the primary key. + + You can declare primary keys and foreign keys as part of the table specification during table + creation. You can also add or drop constraints on existing tables. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class TablesClient(TablesAPI): + """ + A table resides in the third layer of Unity Catalog’s three-level namespace. It contains rows + of data. To create a table, users must have CREATE_TABLE and USE_SCHEMA permissions on the + schema, and they must have the USE_CATALOG permission on its parent catalog. To query a table, + users must have the SELECT permission on the table, and they must have the USE_CATALOG + permission on its parent catalog and the USE_SCHEMA permission on its parent schema. + + A table can be managed or external. From an API perspective, a __VIEW__ is a particular kind of + table (rather than a managed or external table). + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class TemporaryTableCredentialsClient(TemporaryTableCredentialsAPI): + """ + Temporary Table Credentials refer to short-lived, downscoped credentials used to access cloud + storage locationswhere table data is stored in Databricks. These credentials are employed to + provide secure and time-limitedaccess to data in cloud environments such as AWS, Azure, and + Google Cloud. Each cloud provider has its own typeof credentials: AWS uses temporary session + tokens via AWS Security Token Service (STS), Azure utilizesShared Access Signatures (SAS) for + its data storage services, and Google Cloud supports temporary credentialsthrough OAuth + 2.0.Temporary table credentials ensure that data access is limited in scope and duration, + reducing the risk ofunauthorized access or misuse. To use the temporary table credentials API, a + metastore admin needs to enable the external_access_enabled flag (off by default) at the + metastore level, and user needs to be granted the EXTERNAL USE SCHEMA permission at the schema + level by catalog admin. Note that EXTERNAL USE SCHEMA is a schema level permission that can only + be granted by catalog admin explicitly and is not included in schema ownership or ALL PRIVILEGES + on the schema for security reason. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class VolumesClient(VolumesAPI): + """ + Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing and + processing files. Use cases include running machine learning on unstructured data such as image, + audio, video, or PDF files, organizing data sets during the data exploration stages in data + science, working with libraries that require access to the local file system on cluster + machines, storing library and config files of arbitrary formats such as .whl or .txt centrally + and providing secure access across workspaces to it, or transforming and querying non-tabular + data files in ETL. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class WorkspaceBindingsClient(WorkspaceBindingsAPI): + """ + A securable in Databricks can be configured as __OPEN__ or __ISOLATED__. An __OPEN__ securable + can be accessed from any workspace, while an __ISOLATED__ securable can only be accessed from a + configured list of workspaces. This API allows you to configure (bind) securables to workspaces. + + NOTE: The __isolation_mode__ is configured for the securable itself (using its Update method) + and the workspace bindings are only consulted when the securable's __isolation_mode__ is set to + __ISOLATED__. + + A securable's workspace bindings can be configured by a metastore admin or the owner of the + securable. + + The original path (/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}) is deprecated. + Please use the new path (/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}) + which introduces the ability to bind a securable in READ_ONLY mode (catalogs only). + + Securable types that support binding: - catalog - storage_credential - external_location + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/cleanrooms/v2/client.py b/databricks/sdk/cleanrooms/v2/client.py new file mode 100755 index 000000000..477d58621 --- /dev/null +++ b/databricks/sdk/cleanrooms/v2/client.py @@ -0,0 +1,212 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .cleanrooms import CleanRoomAssetsAPI, CleanRoomsAPI, CleanRoomTaskRunsAPI + +_LOG = logging.getLogger(__name__) + + +class CleanRoomAssetsClient(CleanRoomAssetsAPI): + """ + Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared + with the clean room. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CleanRoomTaskRunsClient(CleanRoomTaskRunsAPI): + """ + Clean room task runs are the executions of notebooks in a clean room. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CleanRoomsClient(CleanRoomsAPI): + """ + A clean room uses Delta Sharing and serverless compute to provide a secure and + privacy-protecting environment where multiple parties can work together on sensitive enterprise + data without direct access to each other’s data. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/compute/v2/client.py b/databricks/sdk/compute/v2/client.py new file mode 100755 index 000000000..7f167e6cc --- /dev/null +++ b/databricks/sdk/compute/v2/client.py @@ -0,0 +1,703 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .compute import (ClusterPoliciesAPI, CommandExecutionAPI, + GlobalInitScriptsAPI, InstancePoolsAPI, + InstanceProfilesAPI, LibrariesAPI, + PolicyComplianceForClustersAPI, PolicyFamiliesAPI) +from .mixin import ClustersExt + +_LOG = logging.getLogger(__name__) + + +class ClusterPoliciesClient(ClusterPoliciesAPI): + """ + You can use cluster policies to control users' ability to configure clusters based on a set of + rules. These rules specify which attributes or attribute values can be used during cluster + creation. Cluster policies have ACLs that limit their use to specific users and groups. + + With cluster policies, you can: - Auto-install cluster libraries on the next restart by listing + them in the policy's "libraries" field (Public Preview). - Limit users to creating clusters with + the prescribed settings. - Simplify the user interface, enabling more users to create clusters, + by fixing and hiding some fields. - Manage costs by setting limits on attributes that impact the + hourly rate. + + Cluster policy permissions limit which policies a user can select in the Policy drop-down when + the user creates a cluster: - A user who has unrestricted cluster create permission can select + the Unrestricted policy and create fully-configurable clusters. - A user who has both + unrestricted cluster create permission and access to cluster policies can select the + Unrestricted policy and policies they have access to. - A user that has access to only cluster + policies, can select the policies they have access to. + + If no policies exist in the workspace, the Policy drop-down doesn't appear. Only admin users can + create, edit, and delete policies. Admin users also have access to all policies. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ClustersClient(ClustersExt): + """ + The Clusters API allows you to create, start, edit, list, terminate, and delete clusters. + + Databricks maps cluster node instance types to compute units known as DBUs. See the instance + type pricing page for a list of the supported instance types and their corresponding DBUs. + + A Databricks cluster is a set of computation resources and configurations on which you run data + engineering, data science, and data analytics workloads, such as production ETL pipelines, + streaming analytics, ad-hoc analytics, and machine learning. + + You run these workloads as a set of commands in a notebook or as an automated job. Databricks + makes a distinction between all-purpose clusters and job clusters. You use all-purpose clusters + to analyze data collaboratively using interactive notebooks. You use job clusters to run fast + and robust automated jobs. + + You can create an all-purpose cluster using the UI, CLI, or REST API. You can manually terminate + and restart an all-purpose cluster. Multiple users can share such clusters to do collaborative + interactive analysis. + + IMPORTANT: Databricks retains cluster configuration information for terminated clusters for 30 + days. To keep an all-purpose cluster configuration even after it has been terminated for more + than 30 days, an administrator can pin a cluster to the cluster list. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CommandExecutionClient(CommandExecutionAPI): + """ + This API allows execution of Python, Scala, SQL, or R commands on running Databricks Clusters. + This API only supports (classic) all-purpose clusters. Serverless compute is not supported. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class GlobalInitScriptsClient(GlobalInitScriptsAPI): + """ + The Global Init Scripts API enables Workspace administrators to configure global initialization + scripts for their workspace. These scripts run on every node in every cluster in the workspace. + + **Important:** Existing clusters must be restarted to pick up any changes made to global init + scripts. Global init scripts are run in order. If the init script returns with a bad exit code, + the Apache Spark container fails to launch and init scripts with later position are skipped. If + enough containers fail, the entire cluster fails with a `GLOBAL_INIT_SCRIPT_FAILURE` error code. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class InstancePoolsClient(InstancePoolsAPI): + """ + Instance Pools API are used to create, edit, delete and list instance pools by using + ready-to-use cloud instances which reduces a cluster start and auto-scaling times. + + Databricks pools reduce cluster start and auto-scaling times by maintaining a set of idle, + ready-to-use instances. When a cluster is attached to a pool, cluster nodes are created using + the pool’s idle instances. If the pool has no idle instances, the pool expands by allocating a + new instance from the instance provider in order to accommodate the cluster’s request. When a + cluster releases an instance, it returns to the pool and is free for another cluster to use. + Only clusters attached to a pool can use that pool’s idle instances. + + You can specify a different pool for the driver node and worker nodes, or use the same pool for + both. + + Databricks does not charge DBUs while instances are idle in the pool. Instance provider billing + does apply. See pricing. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class InstanceProfilesClient(InstanceProfilesAPI): + """ + The Instance Profiles API allows admins to add, list, and remove instance profiles that users + can launch clusters with. Regular users can list the instance profiles available to them. See + [Secure access to S3 buckets] using instance profiles for more information. + + [Secure access to S3 buckets]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/instance-profiles.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class LibrariesClient(LibrariesAPI): + """ + The Libraries API allows you to install and uninstall libraries and get the status of libraries + on a cluster. + + To make third-party or custom code available to notebooks and jobs running on your clusters, you + can install a library. Libraries can be written in Python, Java, Scala, and R. You can upload + Python, Java, Scala and R libraries and point to external packages in PyPI, Maven, and CRAN + repositories. + + Cluster libraries can be used by all notebooks running on a cluster. You can install a cluster + library directly from a public repository such as PyPI or Maven, using a previously installed + workspace library, or using an init script. + + When you uninstall a library from a cluster, the library is removed only when you restart the + cluster. Until you restart the cluster, the status of the uninstalled library appears as + Uninstall pending restart. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PolicyComplianceForClustersClient(PolicyComplianceForClustersAPI): + """ + The policy compliance APIs allow you to view and manage the policy compliance status of clusters + in your workspace. + + A cluster is compliant with its policy if its configuration satisfies all its policy rules. + Clusters could be out of compliance if their policy was updated after the cluster was last + edited. + + The get and list compliance APIs allow you to view the policy compliance status of a cluster. + The enforce compliance API allows you to update a cluster to be compliant with the current + version of its policy. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PolicyFamiliesClient(PolicyFamiliesAPI): + """ + View available policy families. A policy family contains a policy definition providing best + practices for configuring clusters for a particular use case. + + Databricks manages and provides policy families for several common cluster use cases. You cannot + create, edit, or delete policy families. + + Policy families cannot be used directly to create clusters. Instead, you create cluster policies + using a policy family. Cluster policies created using a policy family inherit the policy + family's policy definition. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/mixins/compute.py b/databricks/sdk/compute/v2/mixin.py similarity index 99% rename from databricks/sdk/mixins/compute.py rename to databricks/sdk/compute/v2/mixin.py index 3fafb416e..00f6ad575 100644 --- a/databricks/sdk/mixins/compute.py +++ b/databricks/sdk/compute/v2/mixin.py @@ -7,7 +7,8 @@ from databricks.sdk.databricks.core import DatabricksError from databricks.sdk.databricks.errors import OperationFailed -from databricks.sdk.service import compute + +from . import compute _LOG = logging.getLogger("databricks.sdk") diff --git a/databricks/sdk/dashboards/v2/client.py b/databricks/sdk/dashboards/v2/client.py new file mode 100755 index 000000000..8d083a841 --- /dev/null +++ b/databricks/sdk/dashboards/v2/client.py @@ -0,0 +1,280 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .dashboards import (GenieAPI, LakeviewAPI, LakeviewEmbeddedAPI, + QueryExecutionAPI) + +_LOG = logging.getLogger(__name__) + + +class GenieClient(GenieAPI): + """ + Genie provides a no-code experience for business users, powered by AI/BI. Analysts set up spaces + that business users can use to ask questions using natural language. Genie uses data registered + to Unity Catalog and requires at least CAN USE permission on a Pro or Serverless SQL warehouse. + Also, Databricks Assistant must be enabled. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class LakeviewClient(LakeviewAPI): + """ + These APIs provide specific management operations for Lakeview dashboards. Generic resource + management can be done with Workspace API (import, export, get-status, list, delete). + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class LakeviewEmbeddedClient(LakeviewEmbeddedAPI): + """ + Token-based Lakeview APIs for embedding dashboards in external applications. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class QueryExecutionClient(QueryExecutionAPI): + """ + Query execution APIs for AI / BI Dashboards + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/databricks/azure.py b/databricks/sdk/databricks/azure.py index 84a638969..abfda955a 100644 --- a/databricks/sdk/databricks/azure.py +++ b/databricks/sdk/databricks/azure.py @@ -1,6 +1,7 @@ from typing import Dict -from ..service.provisioning import Workspace +from databricks.sdk.provisioning.v2.provisioning import Workspace + from .oauth import TokenSource diff --git a/databricks/sdk/databricks/dbutils.py b/databricks/sdk/databricks/dbutils.py index 64b410e36..1c09f028c 100644 --- a/databricks/sdk/databricks/dbutils.py +++ b/databricks/sdk/databricks/dbutils.py @@ -7,9 +7,10 @@ from dataclasses import dataclass from typing import Any, Callable, Dict, List, Optional -from ..mixins import compute as compute_ext -from ..mixins import files as dbfs_ext -from ..service import compute, workspace +from ..compute.v2 import compute +from ..compute.v2.mixin import ClustersExt as compute_ext +from ..files.v2.mixin import DbfsExt as dbfs_ext +from ..workspace.v2 import workspace from .core import ApiClient, Config, DatabricksError _LOG = logging.getLogger("databricks.sdk") @@ -38,7 +39,7 @@ class _FsUtil: def __init__( self, - dbfs_ext: dbfs_ext.DbfsExt, + dbfs_ext: dbfs_ext, proxy_factory: Callable[[str], "_ProxyUtil"], ): self._dbfs = dbfs_ext @@ -212,12 +213,12 @@ class RemoteDbUtils: def __init__(self, config: "Config" = None): self._config = Config() if not config else config self._client = ApiClient(self._config) - self._clusters = compute_ext.ClustersExt(self._client) + self._clusters = compute_ext(self._client) self._commands = compute.CommandExecutionAPI(self._client) self._lock = threading.Lock() self._ctx = None - self.fs = _FsUtil(dbfs_ext.DbfsExt(self._client), self.__getattr__) + self.fs = _FsUtil(dbfs_ext(self._client), self.__getattr__) self.secrets = _SecretsUtil(workspace.SecretsAPI(self._client)) self.jobs = _JobsUtil() self._widgets = None diff --git a/databricks/sdk/files/v2/client.py b/databricks/sdk/files/v2/client.py new file mode 100755 index 000000000..f8c15a843 --- /dev/null +++ b/databricks/sdk/files/v2/client.py @@ -0,0 +1,162 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .files import FilesAPI +from .mixin import DbfsExt, FilesExt + +_LOG = logging.getLogger(__name__) + + +class DbfsClient(DbfsExt): + """ + DBFS API makes it simple to interact with various data sources without having to include a users + credentials every time to read a file. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class FilesClient(FilesExt): + """ + The Files API is a standard HTTP API that allows you to read, write, list, and delete files and + directories by referring to their URI. The API makes working with file content as raw bytes + easier and more efficient. + + The API supports [Unity Catalog volumes], where files and directories to operate on are + specified using their volume URI path, which follows the format + /Volumes/<catalog_name>/<schema_name>/<volume_name>/<path_to_file>. + + The Files API has two distinct endpoints, one for working with files (`/fs/files`) and another + one for working with directories (`/fs/directories`). Both endpoints use the standard HTTP + methods GET, HEAD, PUT, and DELETE to manage files and directories specified using their URI + path. The path is always absolute. + + Some Files API client features are currently experimental. To enable them, set + `enable_experimental_files_api_client = True` in your configuration profile or use the + environment variable `DATABRICKS_ENABLE_EXPERIMENTAL_FILES_API_CLIENT=True`. + + [Unity Catalog volumes]: https://docs.databricks.com/en/connect/unity-catalog/volumes.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config), config=config) diff --git a/databricks/sdk/mixins/files.py b/databricks/sdk/files/v2/mixin.py similarity index 98% rename from databricks/sdk/mixins/files.py rename to databricks/sdk/files/v2/mixin.py index 08c4d4806..597024a21 100644 --- a/databricks/sdk/mixins/files.py +++ b/databricks/sdk/files/v2/mixin.py @@ -24,17 +24,17 @@ import requests.adapters from requests import RequestException -from ..databricks._base_client import (_BaseClient, _RawResponse, - _StreamingResponse) -from ..databricks._property import _cached_property -from ..databricks.config import Config -from ..databricks.errors import AlreadyExists, NotFound -from ..databricks.errors.customizer import _RetryAfterCustomizer -from ..databricks.errors.mapper import _error_mapper -from ..databricks.retries import retried -from ..service import files -from ..service._internal import _escape_multi_segment_path_parameter -from ..service.files import DownloadResponse +from ...databricks._base_client import (_BaseClient, _RawResponse, + _StreamingResponse) +from ...databricks._property import _cached_property +from ...databricks.config import Config +from ...databricks.errors import AlreadyExists, NotFound +from ...databricks.errors.customizer import _RetryAfterCustomizer +from ...databricks.errors.mapper import _error_mapper +from ...databricks.retries import retried +from ...service._internal import _escape_multi_segment_path_parameter +from . import files +from .files import DownloadResponse if TYPE_CHECKING: from _typeshed import Self @@ -718,6 +718,10 @@ def download(self, file_path: str) -> DownloadResponse: :returns: :class:`DownloadResponse` """ + if not self._config.enable_experimental_files_api_client: + # Use the new Files API client for downloads + return super().download(file_path) + initial_response: DownloadResponse = self._open_download_stream( file_path=file_path, start_byte_offset=0, @@ -743,6 +747,10 @@ def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool If true, an existing file will be overwritten. When not specified, assumed True. """ + if not self._config.enable_experimental_files_api_client: + # Use the new Files API client for downloads + return super().upload(file_path, contents, overwrite=overwrite) + # Upload empty and small files with one-shot upload. pre_read_buffer = contents.read(self._config.multipart_upload_min_stream_size) if len(pre_read_buffer) < self._config.multipart_upload_min_stream_size: diff --git a/databricks/sdk/iam/v2/client.py b/databricks/sdk/iam/v2/client.py new file mode 100755 index 000000000..4c5c27cc0 --- /dev/null +++ b/databricks/sdk/iam/v2/client.py @@ -0,0 +1,963 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .iam import (AccessControlAPI, AccountAccessControlAPI, + AccountAccessControlProxyAPI, AccountGroupsAPI, + AccountServicePrincipalsAPI, AccountUsersAPI, CurrentUserAPI, + GroupsAPI, PermissionMigrationAPI, PermissionsAPI, + ServicePrincipalsAPI, UsersAPI, WorkspaceAssignmentAPI) + +_LOG = logging.getLogger(__name__) + + +class AccessControlClient(AccessControlAPI): + """ + Rule based Access Control for Databricks Resources. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountAccessControlClient(AccountAccessControlAPI): + """ + These APIs manage access rules on resources in an account. Currently, only grant rules are + supported. A grant rule specifies a role assigned to a set of principals. A list of rules + attached to a resource is called a rule set. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountAccessControlProxyClient(AccountAccessControlProxyAPI): + """ + These APIs manage access rules on resources in an account. Currently, only grant rules are + supported. A grant rule specifies a role assigned to a set of principals. A list of rules + attached to a resource is called a rule set. A workspace must belong to an account for these + APIs to work. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountGroupsClient(AccountGroupsAPI): + """ + Groups simplify identity management, making it easier to assign access to Databricks account, + data, and other securable objects. + + It is best practice to assign access to workspaces and access-control policies in Unity Catalog + to groups, instead of to users individually. All Databricks account identities can be assigned + as members of groups, and members inherit permissions that are assigned to their group. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountServicePrincipalsClient(AccountServicePrincipalsAPI): + """ + Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD + platforms. Databricks recommends creating service principals to run production jobs or modify + production data. If all processes that act on production data run with service principals, + interactive users do not need any write, delete, or modify privileges in production. This + eliminates the risk of a user overwriting production data by accident. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountUsersClient(AccountUsersAPI): + """ + User identities recognized by Databricks and represented by email addresses. + + Databricks recommends using SCIM provisioning to sync users and groups automatically from your + identity provider to your Databricks account. SCIM streamlines onboarding a new employee or team + by using your identity provider to create users and groups in Databricks account and give them + the proper level of access. When a user leaves your organization or no longer needs access to + Databricks account, admins can terminate the user in your identity provider and that user’s + account will also be removed from Databricks account. This ensures a consistent offboarding + process and prevents unauthorized users from accessing sensitive data. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CurrentUserClient(CurrentUserAPI): + """ + This API allows retrieving information about currently authenticated user or service principal. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class GroupsClient(GroupsAPI): + """ + Groups simplify identity management, making it easier to assign access to Databricks workspace, + data, and other securable objects. + + It is best practice to assign access to workspaces and access-control policies in Unity Catalog + to groups, instead of to users individually. All Databricks workspace identities can be assigned + as members of groups, and members inherit permissions that are assigned to their group. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PermissionMigrationClient(PermissionMigrationAPI): + """ + APIs for migrating acl permissions, used only by the ucx tool: + https://github.com/databrickslabs/ucx + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PermissionsClient(PermissionsAPI): + """ + Permissions API are used to create read, write, edit, update and manage access for various users + on different objects and endpoints. + + * **[Apps permissions](:service:apps)** — Manage which users can manage or use apps. + + * **[Cluster permissions](:service:clusters)** — Manage which users can manage, restart, or + attach to clusters. + + * **[Cluster policy permissions](:service:clusterpolicies)** — Manage which users can use + cluster policies. + + * **[Delta Live Tables pipeline permissions](:service:pipelines)** — Manage which users can + view, manage, run, cancel, or own a Delta Live Tables pipeline. + + * **[Job permissions](:service:jobs)** — Manage which users can view, manage, trigger, cancel, + or own a job. + + * **[MLflow experiment permissions](:service:experiments)** — Manage which users can read, + edit, or manage MLflow experiments. + + * **[MLflow registered model permissions](:service:modelregistry)** — Manage which users can + read, edit, or manage MLflow registered models. + + * **[Password permissions](:service:users)** — Manage which users can use password login when + SSO is enabled. + + * **[Instance Pool permissions](:service:instancepools)** — Manage which users can manage or + attach to pools. + + * **[Repo permissions](repos)** — Manage which users can read, run, edit, or manage a repo. + + * **[Serving endpoint permissions](:service:servingendpoints)** — Manage which users can view, + query, or manage a serving endpoint. + + * **[SQL warehouse permissions](:service:warehouses)** — Manage which users can use or manage + SQL warehouses. + + * **[Token permissions](:service:tokenmanagement)** — Manage which users can create or use + tokens. + + * **[Workspace object permissions](:service:workspace)** — Manage which users can read, run, + edit, or manage alerts, dbsql-dashboards, directories, files, notebooks and queries. + + For the mapping of the required permissions for specific actions or abilities and other + important information, see [Access Control]. + + Note that to manage access control on service principals, use **[Account Access Control + Proxy](:service:accountaccesscontrolproxy)**. + + [Access Control]: https://docs.databricks.com/security/auth-authz/access-control/index.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ServicePrincipalsClient(ServicePrincipalsAPI): + """ + Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD + platforms. Databricks recommends creating service principals to run production jobs or modify + production data. If all processes that act on production data run with service principals, + interactive users do not need any write, delete, or modify privileges in production. This + eliminates the risk of a user overwriting production data by accident. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class UsersClient(UsersAPI): + """ + User identities recognized by Databricks and represented by email addresses. + + Databricks recommends using SCIM provisioning to sync users and groups automatically from your + identity provider to your Databricks workspace. SCIM streamlines onboarding a new employee or + team by using your identity provider to create users and groups in Databricks workspace and give + them the proper level of access. When a user leaves your organization or no longer needs access + to Databricks workspace, admins can terminate the user in your identity provider and that + user’s account will also be removed from Databricks workspace. This ensures a consistent + offboarding process and prevents unauthorized users from accessing sensitive data. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class WorkspaceAssignmentClient(WorkspaceAssignmentAPI): + """ + The Workspace Permission Assignment API allows you to manage workspace permissions for + principals in your account. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/jobs/v2/client.py b/databricks/sdk/jobs/v2/client.py new file mode 100755 index 000000000..8a7ef9d23 --- /dev/null +++ b/databricks/sdk/jobs/v2/client.py @@ -0,0 +1,170 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .jobs import PolicyComplianceForJobsAPI +from .mixin import JobsExt + +_LOG = logging.getLogger(__name__) + + +class JobsClient(JobsExt): + """ + The Jobs API allows you to create, edit, and delete jobs. + + You can use a Databricks job to run a data processing or data analysis task in a Databricks + cluster with scalable resources. Your job can consist of a single task or can be a large, + multi-task workflow with complex dependencies. Databricks manages the task orchestration, + cluster management, monitoring, and error reporting for all of your jobs. You can run your jobs + immediately or periodically through an easy-to-use scheduling system. You can implement job + tasks using notebooks, JARS, Delta Live Tables pipelines, or Python, Scala, Spark submit, and + Java applications. + + You should never hard code secrets or store them in plain text. Use the [Secrets CLI] to manage + secrets in the [Databricks CLI]. Use the [Secrets utility] to reference secrets in notebooks and + jobs. + + [Databricks CLI]: https://docs.databricks.com/dev-tools/cli/index.html + [Secrets CLI]: https://docs.databricks.com/dev-tools/cli/secrets-cli.html + [Secrets utility]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-secrets + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PolicyComplianceForJobsClient(PolicyComplianceForJobsAPI): + """ + The compliance APIs allow you to view and manage the policy compliance status of jobs in your + workspace. This API currently only supports compliance controls for cluster policies. + + A job is in compliance if its cluster configurations satisfy the rules of all their respective + cluster policies. A job could be out of compliance if a cluster policy it uses was updated after + the job was last edited. The job is considered out of compliance if any of its clusters no + longer comply with their updated policies. + + The get and list compliance APIs allow you to view the policy compliance status of a job. The + enforce compliance API allows you to update a job so that it becomes compliant with all of its + policies. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/jobs/v2/jobs.py b/databricks/sdk/jobs/v2/jobs.py index 8309ccc23..ad3141e1a 100755 --- a/databricks/sdk/jobs/v2/jobs.py +++ b/databricks/sdk/jobs/v2/jobs.py @@ -8740,7 +8740,7 @@ class SubmitTask: """An optional list of libraries to be installed on the cluster. The default value is an empty list.""" - new_cluster: Optional[ClusterSpec] = None + new_cluster: Optional[JobsClusterSpec] = None """If new_cluster, a description of a new cluster that is created for each run.""" notebook_task: Optional[NotebookTask] = None @@ -8930,7 +8930,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: gen_ai_compute_task=_from_dict(d, "gen_ai_compute_task", GenAiComputeTask), health=_from_dict(d, "health", JobsHealthRules), libraries=_repeated_dict(d, "libraries", Library), - new_cluster=_from_dict(d, "new_cluster", ClusterSpec), + new_cluster=_from_dict(d, "new_cluster", JobsClusterSpec), notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), diff --git a/databricks/sdk/mixins/jobs.py b/databricks/sdk/jobs/v2/mixin.py similarity index 99% rename from databricks/sdk/mixins/jobs.py rename to databricks/sdk/jobs/v2/mixin.py index 1e6cf25d5..9618143d6 100644 --- a/databricks/sdk/mixins/jobs.py +++ b/databricks/sdk/jobs/v2/mixin.py @@ -1,7 +1,7 @@ from typing import Iterator, Optional -from databricks.sdk.service import jobs -from databricks.sdk.service.jobs import BaseJob, BaseRun, Job, RunType +from . import jobs +from .jobs import BaseJob, BaseRun, Job, RunType class JobsExt(jobs.JobsAPI): diff --git a/databricks/sdk/marketplace/v2/client.py b/databricks/sdk/marketplace/v2/client.py new file mode 100755 index 000000000..0ce4fb7bd --- /dev/null +++ b/databricks/sdk/marketplace/v2/client.py @@ -0,0 +1,817 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .marketplace import (ConsumerFulfillmentsAPI, ConsumerInstallationsAPI, + ConsumerListingsAPI, + ConsumerPersonalizationRequestsAPI, + ConsumerProvidersAPI, ProviderExchangeFiltersAPI, + ProviderExchangesAPI, ProviderFilesAPI, + ProviderListingsAPI, + ProviderPersonalizationRequestsAPI, + ProviderProviderAnalyticsDashboardsAPI, + ProviderProvidersAPI) + +_LOG = logging.getLogger(__name__) + + +class ConsumerFulfillmentsClient(ConsumerFulfillmentsAPI): + """ + Fulfillments are entities that allow consumers to preview installations. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ConsumerInstallationsClient(ConsumerInstallationsAPI): + """ + Installations are entities that allow consumers to interact with Databricks Marketplace + listings. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ConsumerListingsClient(ConsumerListingsAPI): + """ + Listings are the core entities in the Marketplace. They represent the products that are + available for consumption. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ConsumerPersonalizationRequestsClient(ConsumerPersonalizationRequestsAPI): + """ + Personalization Requests allow customers to interact with the individualized Marketplace listing + flow. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ConsumerProvidersClient(ConsumerProvidersAPI): + """ + Providers are the entities that publish listings to the Marketplace. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ProviderExchangeFiltersClient(ProviderExchangeFiltersAPI): + """ + Marketplace exchanges filters curate which groups can access an exchange. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ProviderExchangesClient(ProviderExchangesAPI): + """ + Marketplace exchanges allow providers to share their listings with a curated set of customers. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ProviderFilesClient(ProviderFilesAPI): + """ + Marketplace offers a set of file APIs for various purposes such as preview notebooks and + provider icons. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ProviderListingsClient(ProviderListingsAPI): + """ + Listings are the core entities in the Marketplace. They represent the products that are + available for consumption. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ProviderPersonalizationRequestsClient(ProviderPersonalizationRequestsAPI): + """ + Personalization requests are an alternate to instantly available listings. Control the lifecycle + of personalized solutions. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ProviderProviderAnalyticsDashboardsClient(ProviderProviderAnalyticsDashboardsAPI): + """ + Manage templated analytics solution for providers. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ProviderProvidersClient(ProviderProvidersAPI): + """ + Providers are entities that manage assets in Marketplace. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/mixins/__init__.py b/databricks/sdk/mixins/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/databricks/sdk/ml/v2/client.py b/databricks/sdk/ml/v2/client.py new file mode 100755 index 000000000..56b465241 --- /dev/null +++ b/databricks/sdk/ml/v2/client.py @@ -0,0 +1,221 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .ml import ExperimentsAPI, ForecastingAPI, ModelRegistryAPI + +_LOG = logging.getLogger(__name__) + + +class ExperimentsClient(ExperimentsAPI): + """ + Experiments are the primary unit of organization in MLflow; all MLflow runs belong to an + experiment. Each experiment lets you visualize, search, and compare runs, as well as download + run artifacts or metadata for analysis in other tools. Experiments are maintained in a + Databricks hosted MLflow tracking server. + + Experiments are located in the workspace file tree. You manage experiments using the same tools + you use to manage other workspace objects such as folders, notebooks, and libraries. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ForecastingClient(ForecastingAPI): + """ + The Forecasting API allows you to create and get serverless forecasting experiments + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ModelRegistryClient(ModelRegistryAPI): + """ + Note: This API reference documents APIs for the Workspace Model Registry. Databricks recommends + using [Models in Unity Catalog](/api/workspace/registeredmodels) instead. Models in Unity + Catalog provides centralized model governance, cross-workspace access, lineage, and deployment. + Workspace Model Registry will be deprecated in the future. + + The Workspace Model Registry is a centralized model repository and a UI and set of APIs that + enable you to manage the full lifecycle of MLflow Models. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/oauth2/v2/client.py b/databricks/sdk/oauth2/v2/client.py new file mode 100755 index 000000000..94a48913d --- /dev/null +++ b/databricks/sdk/oauth2/v2/client.py @@ -0,0 +1,508 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .oauth2 import (AccountFederationPolicyAPI, CustomAppIntegrationAPI, + OAuthPublishedAppsAPI, PublishedAppIntegrationAPI, + ServicePrincipalFederationPolicyAPI, + ServicePrincipalSecretsAPI) + +_LOG = logging.getLogger(__name__) + + +class AccountFederationPolicyClient(AccountFederationPolicyAPI): + """ + These APIs manage account federation policies. + + Account federation policies allow users and service principals in your Databricks account to + securely access Databricks APIs using tokens from your trusted identity providers (IdPs). + + With token federation, your users and service principals can exchange tokens from your IdP for + Databricks OAuth tokens, which can be used to access Databricks APIs. Token federation + eliminates the need to manage Databricks secrets, and allows you to centralize management of + token issuance policies in your IdP. Databricks token federation is typically used in + combination with [SCIM], so users in your IdP are synchronized into your Databricks account. + + Token federation is configured in your Databricks account using an account federation policy. An + account federation policy specifies: * which IdP, or issuer, your Databricks account should + accept tokens from * how to determine which Databricks user, or subject, a token is issued for + + To configure a federation policy, you provide the following: * The required token __issuer__, as + specified in the “iss” claim of your tokens. The issuer is an https URL that identifies your + IdP. * The allowed token __audiences__, as specified in the “aud” claim of your tokens. This + identifier is intended to represent the recipient of the token. As long as the audience in the + token matches at least one audience in the policy, the token is considered a match. If + unspecified, the default value is your Databricks account id. * The __subject claim__, which + indicates which token claim contains the Databricks username of the user the token was issued + for. If unspecified, the default value is “sub”. * Optionally, the public keys used to + validate the signature of your tokens, in JWKS format. If unspecified (recommended), Databricks + automatically fetches the public keys from your issuer’s well known endpoint. Databricks + strongly recommends relying on your issuer’s well known endpoint for discovering public keys. + + An example federation policy is: ``` issuer: "https://idp.mycompany.com/oidc" audiences: + ["databricks"] subject_claim: "sub" ``` + + An example JWT token body that matches this policy and could be used to authenticate to + Databricks as user `username@mycompany.com` is: ``` { "iss": "https://idp.mycompany.com/oidc", + "aud": "databricks", "sub": "username@mycompany.com" } ``` + + You may also need to configure your IdP to generate tokens for your users to exchange with + Databricks, if your users do not already have the ability to generate tokens that are compatible + with your federation policy. + + You do not need to configure an OAuth application in Databricks to use token federation. + + [SCIM]: https://docs.databricks.com/admin/users-groups/scim/index.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CustomAppIntegrationClient(CustomAppIntegrationAPI): + """ + These APIs enable administrators to manage custom OAuth app integrations, which is required for + adding/using Custom OAuth App Integration like Tableau Cloud for Databricks in AWS cloud. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class OAuthPublishedAppsClient(OAuthPublishedAppsAPI): + """ + These APIs enable administrators to view all the available published OAuth applications in + Databricks. Administrators can add the published OAuth applications to their account through the + OAuth Published App Integration APIs. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PublishedAppIntegrationClient(PublishedAppIntegrationAPI): + """ + These APIs enable administrators to manage published OAuth app integrations, which is required + for adding/using Published OAuth App Integration like Tableau Desktop for Databricks in AWS + cloud. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ServicePrincipalFederationPolicyClient(ServicePrincipalFederationPolicyAPI): + """ + These APIs manage service principal federation policies. + + Service principal federation, also known as Workload Identity Federation, allows your automated + workloads running outside of Databricks to securely access Databricks APIs without the need for + Databricks secrets. With Workload Identity Federation, your application (or workload) + authenticates to Databricks as a Databricks service principal, using tokens provided by the + workload runtime. + + Databricks strongly recommends using Workload Identity Federation to authenticate to Databricks + from automated workloads, over alternatives such as OAuth client secrets or Personal Access + Tokens, whenever possible. Workload Identity Federation is supported by many popular services, + including Github Actions, Azure DevOps, GitLab, Terraform Cloud, and Kubernetes clusters, among + others. + + Workload identity federation is configured in your Databricks account using a service principal + federation policy. A service principal federation policy specifies: * which IdP, or issuer, the + service principal is allowed to authenticate from * which workload identity, or subject, is + allowed to authenticate as the Databricks service principal + + To configure a federation policy, you provide the following: * The required token __issuer__, as + specified in the “iss” claim of workload identity tokens. The issuer is an https URL that + identifies the workload identity provider. * The required token __subject__, as specified in the + “sub” claim of workload identity tokens. The subject uniquely identifies the workload in the + workload runtime environment. * The allowed token __audiences__, as specified in the “aud” + claim of workload identity tokens. The audience is intended to represent the recipient of the + token. As long as the audience in the token matches at least one audience in the policy, the + token is considered a match. If unspecified, the default value is your Databricks account id. * + Optionally, the public keys used to validate the signature of the workload identity tokens, in + JWKS format. If unspecified (recommended), Databricks automatically fetches the public keys from + the issuer’s well known endpoint. Databricks strongly recommends relying on the issuer’s + well known endpoint for discovering public keys. + + An example service principal federation policy, for a Github Actions workload, is: ``` issuer: + "https://token.actions.githubusercontent.com" audiences: ["https://github.com/my-github-org"] + subject: "repo:my-github-org/my-repo:environment:prod" ``` + + An example JWT token body that matches this policy and could be used to authenticate to + Databricks is: ``` { "iss": "https://token.actions.githubusercontent.com", "aud": + "https://github.com/my-github-org", "sub": "repo:my-github-org/my-repo:environment:prod" } ``` + + You may also need to configure the workload runtime to generate tokens for your workloads. + + You do not need to configure an OAuth application in Databricks to use token federation. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ServicePrincipalSecretsClient(ServicePrincipalSecretsAPI): + """ + These APIs enable administrators to manage service principal secrets. + + You can use the generated secrets to obtain OAuth access tokens for a service principal, which + can then be used to access Databricks Accounts and Workspace APIs. For more information, see + [Authentication using OAuth tokens for service principals], + + In addition, the generated secrets can be used to configure the Databricks Terraform Provider to + authenticate with the service principal. For more information, see [Databricks Terraform + Provider]. + + [Authentication using OAuth tokens for service principals]: https://docs.databricks.com/dev-tools/authentication-oauth.html + [Databricks Terraform Provider]: https://github.com/databricks/terraform-provider-databricks/blob/master/docs/index.md#authenticating-with-service-principal + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/pipelines/v2/client.py b/databricks/sdk/pipelines/v2/client.py new file mode 100755 index 000000000..6403ca237 --- /dev/null +++ b/databricks/sdk/pipelines/v2/client.py @@ -0,0 +1,89 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .pipelines import PipelinesAPI + +_LOG = logging.getLogger(__name__) + + +class PipelinesClient(PipelinesAPI): + """ + The Delta Live Tables API allows you to create, edit, delete, start, and view details about + pipelines. + + Delta Live Tables is a framework for building reliable, maintainable, and testable data + processing pipelines. You define the transformations to perform on your data, and Delta Live + Tables manages task orchestration, cluster management, monitoring, data quality, and error + handling. + + Instead of defining your data pipelines using a series of separate Apache Spark tasks, Delta + Live Tables manages how your data is transformed based on a target schema you define for each + processing step. You can also enforce data quality with Delta Live Tables expectations. + Expectations allow you to define expected data quality and specify how to handle records that + fail those expectations. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/provisioning/v2/client.py b/databricks/sdk/provisioning/v2/client.py new file mode 100755 index 000000000..dd0136540 --- /dev/null +++ b/databricks/sdk/provisioning/v2/client.py @@ -0,0 +1,501 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .provisioning import (CredentialsAPI, EncryptionKeysAPI, NetworksAPI, + PrivateAccessAPI, StorageAPI, VpcEndpointsAPI, + WorkspacesAPI) + +_LOG = logging.getLogger(__name__) + + +class CredentialsClient(CredentialsAPI): + """ + These APIs manage credential configurations for this workspace. Databricks needs access to a + cross-account service IAM role in your AWS account so that Databricks can deploy clusters in the + appropriate VPC for the new workspace. A credential configuration encapsulates this role + information, and its ID is used when creating a new workspace. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class EncryptionKeysClient(EncryptionKeysAPI): + """ + These APIs manage encryption key configurations for this workspace (optional). A key + configuration encapsulates the AWS KMS key information and some information about how the key + configuration can be used. There are two possible uses for key configurations: + + * Managed services: A key configuration can be used to encrypt a workspace's notebook and secret + data in the control plane, as well as Databricks SQL queries and query history. * Storage: A key + configuration can be used to encrypt a workspace's DBFS and EBS data in the data plane. + + In both of these cases, the key configuration's ID is used when creating a new workspace. This + Preview feature is available if your account is on the E2 version of the platform. Updating a + running workspace with workspace storage encryption requires that the workspace is on the E2 + version of the platform. If you have an older workspace, it might not be on the E2 version of + the platform. If you are not sure, contact your Databricks representative. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class NetworksClient(NetworksAPI): + """ + These APIs manage network configurations for customer-managed VPCs (optional). Its ID is used + when creating a new workspace if you use customer-managed VPCs. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PrivateAccessClient(PrivateAccessAPI): + """ + These APIs manage private access settings for this account. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class StorageClient(StorageAPI): + """ + These APIs manage storage configurations for this workspace. A root storage S3 bucket in your + account is required to store objects like cluster logs, notebook revisions, and job results. You + can also use the root storage S3 bucket for storage of non-production DBFS data. A storage + configuration encapsulates this bucket information, and its ID is used when creating a new + workspace. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class VpcEndpointsClient(VpcEndpointsAPI): + """ + These APIs manage VPC endpoint configurations for this account. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class WorkspacesClient(WorkspacesAPI): + """ + These APIs manage workspaces for this account. A Databricks workspace is an environment for + accessing all of your Databricks assets. The workspace organizes objects (notebooks, libraries, + and experiments) into folders, and provides access to data and computational resources such as + clusters and jobs. + + These endpoints are available if your account is on the E2 version of the platform or on a + select custom plan that allows multiple workspaces per account. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/service/_internal.py b/databricks/sdk/service/_internal.py index 1e501e0e0..d1c124832 100644 --- a/databricks/sdk/service/_internal.py +++ b/databricks/sdk/service/_internal.py @@ -1,15 +1,15 @@ import datetime import urllib.parse -from typing import Callable, Dict, Generic, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Generic, Optional, Type, TypeVar -def _from_dict(d: Dict[str, any], field: str, cls: Type) -> any: +def _from_dict(d: Dict[str, Any], field: str, cls: Type) -> Any: if field not in d or d[field] is None: return None return getattr(cls, "from_dict")(d[field]) -def _repeated_dict(d: Dict[str, any], field: str, cls: Type) -> any: +def _repeated_dict(d: Dict[str, Any], field: str, cls: Type) -> Any: if field not in d or not d[field]: return [] from_dict = getattr(cls, "from_dict") @@ -23,14 +23,14 @@ def _get_enum_value(cls: Type, value: str) -> Optional[Type]: ) -def _enum(d: Dict[str, any], field: str, cls: Type) -> any: +def _enum(d: Dict[str, Any], field: str, cls: Type) -> Any: """Unknown enum values are returned as None.""" if field not in d or not d[field]: return None return _get_enum_value(cls, d[field]) -def _repeated_enum(d: Dict[str, any], field: str, cls: Type) -> any: +def _repeated_enum(d: Dict[str, Any], field: str, cls: Type) -> Any: """For now, unknown enum values are not included in the response.""" if field not in d or not d[field]: return None @@ -51,13 +51,13 @@ def _escape_multi_segment_path_parameter(param: str) -> str: class Wait(Generic[ReturnType]): - def __init__(self, waiter: Callable, response: any = None, **kwargs) -> None: + def __init__(self, waiter: Callable, response: Any = None, **kwargs) -> None: self.response = response self._waiter = waiter self._bind = kwargs - def __getattr__(self, key) -> any: + def __getattr__(self, key) -> Any: return self._bind[key] def bind(self) -> dict: diff --git a/databricks/sdk/serving/v2/client.py b/databricks/sdk/serving/v2/client.py new file mode 100755 index 000000000..e8cebcb09 --- /dev/null +++ b/databricks/sdk/serving/v2/client.py @@ -0,0 +1,154 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .mixin import ServingEndpointsExt +from .serving import ServingEndpointsDataPlaneAPI + +_LOG = logging.getLogger(__name__) + + +class ServingEndpointsClient(ServingEndpointsExt): + """ + The Serving Endpoints API allows you to create, update, and delete model serving endpoints. + + You can use a serving endpoint to serve models from the Databricks Model Registry or from Unity + Catalog. Endpoints expose the underlying models as scalable REST API endpoints using serverless + compute. This means the endpoints and associated compute resources are fully managed by + Databricks and will not appear in your cloud account. A serving endpoint can consist of one or + more MLflow models from the Databricks Model Registry, called served entities. A serving + endpoint can have at most ten served entities. You can configure traffic settings to define how + requests should be routed to your served entities behind an endpoint. Additionally, you can + configure the scale of resources that should be applied to each served entity. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ServingEndpointsDataPlaneClient(ServingEndpointsDataPlaneAPI): + """ + Serving endpoints DataPlane provides a set of operations to interact with data plane endpoints + for Serving endpoints service. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/mixins/open_ai_client.py b/databricks/sdk/serving/v2/mixin.py similarity index 96% rename from databricks/sdk/mixins/open_ai_client.py rename to databricks/sdk/serving/v2/mixin.py index 62835dcec..0fb198565 100644 --- a/databricks/sdk/mixins/open_ai_client.py +++ b/databricks/sdk/serving/v2/mixin.py @@ -3,8 +3,7 @@ from requests import Response -from databricks.sdk.service.serving import (ExternalFunctionRequestHttpMethod, - ServingEndpointsAPI) +from .serving import ExternalFunctionRequestHttpMethod, ServingEndpointsAPI class ServingEndpointsExt(ServingEndpointsAPI): diff --git a/databricks/sdk/settings/v2/client.py b/databricks/sdk/settings/v2/client.py new file mode 100755 index 000000000..45973adc5 --- /dev/null +++ b/databricks/sdk/settings/v2/client.py @@ -0,0 +1,1709 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .settings import (AccountIpAccessListsAPI, AccountSettingsAPI, + AibiDashboardEmbeddingAccessPolicyAPI, + AibiDashboardEmbeddingApprovedDomainsAPI, + AutomaticClusterUpdateAPI, ComplianceSecurityProfileAPI, + CredentialsManagerAPI, CspEnablementAccountAPI, + DefaultNamespaceAPI, DisableLegacyAccessAPI, + DisableLegacyDbfsAPI, DisableLegacyFeaturesAPI, + EnableIpAccessListsAPI, EnhancedSecurityMonitoringAPI, + EsmEnablementAccountAPI, IpAccessListsAPI, + NetworkConnectivityAPI, NotificationDestinationsAPI, + PersonalComputeAPI, RestrictWorkspaceAdminsAPI, + SettingsAPI, TokenManagementAPI, TokensAPI, + WorkspaceConfAPI) + +_LOG = logging.getLogger(__name__) + + +class AccountIpAccessListsClient(AccountIpAccessListsAPI): + """ + The Accounts IP Access List API enables account admins to configure IP access lists for access + to the account console. + + Account IP Access Lists affect web application access and REST API access to the account console + and account APIs. If the feature is disabled for the account, all access is allowed for this + account. There is support for allow lists (inclusion) and block lists (exclusion). + + When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP + address matches any block list, the connection is rejected. 2. **If the connection was not + rejected by block lists**, the IP address is compared with the allow lists. + + If there is at least one allow list for the account, the connection is allowed only if the IP + address matches an allow list. If there are no allow lists for the account, all IP addresses are + allowed. + + For all allow lists and block lists combined, the account supports a maximum of 1000 IP/CIDR + values, where one CIDR counts as a single value. + + After changes to the account-level IP access lists, it can take a few minutes for changes to + take effect. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AccountSettingsClient(AccountSettingsAPI): + """ + Accounts Settings API allows users to manage settings at the account level. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AibiDashboardEmbeddingAccessPolicyClient(AibiDashboardEmbeddingAccessPolicyAPI): + """ + Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or + disabled at the workspace level. By default, this setting is conditionally enabled + (ALLOW_APPROVED_DOMAINS). + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AibiDashboardEmbeddingApprovedDomainsClient(AibiDashboardEmbeddingApprovedDomainsAPI): + """ + Controls the list of domains approved to host the embedded AI/BI dashboards. The approved + domains list can't be mutated when the current access policy is not set to + ALLOW_APPROVED_DOMAINS. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AutomaticClusterUpdateClient(AutomaticClusterUpdateAPI): + """ + Controls whether automatic cluster update is enabled for the current workspace. By default, it + is turned off. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ComplianceSecurityProfileClient(ComplianceSecurityProfileAPI): + """ + Controls whether to enable the compliance security profile for the current workspace. Enabling + it on a workspace is permanent. By default, it is turned off. + + This settings can NOT be disabled once it is enabled. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CredentialsManagerClient(CredentialsManagerAPI): + """ + Credentials manager interacts with with Identity Providers to to perform token exchanges using + stored credentials and refresh tokens. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class CspEnablementAccountClient(CspEnablementAccountAPI): + """ + The compliance security profile settings at the account level control whether to enable it for + new workspaces. By default, this account-level setting is disabled for new workspaces. After + workspace creation, account admins can enable the compliance security profile individually for + each workspace. + + This settings can be disabled so that new workspaces do not have compliance security profile + enabled by default. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DefaultNamespaceClient(DefaultNamespaceAPI): + """ + The default namespace setting API allows users to configure the default namespace for a + Databricks workspace. + + Through this API, users can retrieve, set, or modify the default namespace used when queries do + not reference a fully qualified three-level name. For example, if you use the API to set + 'retail_prod' as the default catalog, then a query 'SELECT * FROM myTable' would reference the + object 'retail_prod.default.myTable' (the schema 'default' is always assumed). + + This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the + default namespace only applies when using Unity Catalog-enabled compute. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DisableLegacyAccessClient(DisableLegacyAccessAPI): + """ + 'Disabling legacy access' has the following impacts: + + 1. Disables direct access to the Hive Metastore. However, you can still access Hive Metastore + through HMS Federation. 2. Disables Fallback Mode (docs link) on any External Location access + from the workspace. 3. Alters DBFS path access to use External Location permissions in place of + legacy credentials. 4. Enforces Unity Catalog access on all path based access. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DisableLegacyDbfsClient(DisableLegacyDbfsAPI): + """ + When this setting is on, access to DBFS root and DBFS mounts is disallowed (as well as creation + of new mounts). When the setting is off, all DBFS functionality is enabled + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DisableLegacyFeaturesClient(DisableLegacyFeaturesAPI): + """ + Disable legacy features for new Databricks workspaces. + + For newly created workspaces: 1. Disables the use of DBFS root and mounts. 2. Hive Metastore + will not be provisioned. 3. Disables the use of ‘No-isolation clusters’. 4. Disables + Databricks Runtime versions prior to 13.3LTS. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class EnableIpAccessListsClient(EnableIpAccessListsAPI): + """ + Controls the enforcement of IP access lists for accessing the account console. Allowing you to + enable or disable restricted access based on IP addresses. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class EnhancedSecurityMonitoringClient(EnhancedSecurityMonitoringAPI): + """ + Controls whether enhanced security monitoring is enabled for the current workspace. If the + compliance security profile is enabled, this is automatically enabled. By default, it is + disabled. However, if the compliance security profile is enabled, this is automatically enabled. + + If the compliance security profile is disabled, you can enable or disable this setting and it is + not permanent. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class EsmEnablementAccountClient(EsmEnablementAccountAPI): + """ + The enhanced security monitoring setting at the account level controls whether to enable the + feature on new workspaces. By default, this account-level setting is disabled for new + workspaces. After workspace creation, account admins can enable enhanced security monitoring + individually for each workspace. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class IpAccessListsClient(IpAccessListsAPI): + """ + IP Access List enables admins to configure IP access lists. + + IP access lists affect web application access and REST API access to this workspace only. If the + feature is disabled for a workspace, all access is allowed for this workspace. There is support + for allow lists (inclusion) and block lists (exclusion). + + When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP + address matches any block list, the connection is rejected. 2. **If the connection was not + rejected by block lists**, the IP address is compared with the allow lists. + + If there is at least one allow list for the workspace, the connection is allowed only if the IP + address matches an allow list. If there are no allow lists for the workspace, all IP addresses + are allowed. + + For all allow lists and block lists combined, the workspace supports a maximum of 1000 IP/CIDR + values, where one CIDR counts as a single value. + + After changes to the IP access list feature, it can take a few minutes for changes to take + effect. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class NetworkConnectivityClient(NetworkConnectivityAPI): + """ + These APIs provide configurations for the network connectivity of your workspaces for serverless + compute resources. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class NotificationDestinationsClient(NotificationDestinationsAPI): + """ + The notification destinations API lets you programmatically manage a workspace's notification + destinations. Notification destinations are used to send notifications for query alerts and jobs + to destinations outside of Databricks. Only workspace admins can create, update, and delete + notification destinations. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class PersonalComputeClient(PersonalComputeAPI): + """ + The Personal Compute enablement setting lets you control which users can use the Personal + Compute default policy to create compute resources. By default all users in all workspaces have + access (ON), but you can change the setting to instead let individual workspaces configure + access control (DELEGATE). + + There is only one instance of this setting per account. Since this setting has a default value, + this setting is present on all accounts even though it's never set on a given account. Deletion + reverts the value of the setting back to the default value. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class RestrictWorkspaceAdminsClient(RestrictWorkspaceAdminsAPI): + """ + The Restrict Workspace Admins setting lets you control the capabilities of workspace admins. + With the setting status set to ALLOW_ALL, workspace admins can create service principal personal + access tokens on behalf of any service principal in their workspace. Workspace admins can also + change a job owner to any user in their workspace. And they can change the job run_as setting to + any user in their workspace or to a service principal on which they have the Service Principal + User role. With the setting status set to RESTRICT_TOKENS_AND_JOB_RUN_AS, workspace admins can + only create personal access tokens on behalf of service principals they have the Service + Principal User role on. They can also only change a job owner to themselves. And they can change + the job run_as setting to themselves or to a service principal on which they have the Service + Principal User role. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class SettingsClient(SettingsAPI): + """ + Workspace Settings API allows users to manage settings at the workspace level. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class TokenManagementClient(TokenManagementAPI): + """ + Enables administrators to get all tokens and delete tokens for other users. Admins can either + get every token, get a specific token by ID, or get all tokens for a particular user. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class TokensClient(TokensAPI): + """ + The Token API allows you to create, list, and revoke tokens that can be used to authenticate and + access Databricks REST APIs. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class WorkspaceConfClient(WorkspaceConfAPI): + """ + This API allows updating known workspace settings for advanced users. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/sharing/v2/client.py b/databricks/sdk/sharing/v2/client.py new file mode 100755 index 000000000..5dd358003 --- /dev/null +++ b/databricks/sdk/sharing/v2/client.py @@ -0,0 +1,300 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .sharing import (ProvidersAPI, RecipientActivationAPI, RecipientsAPI, + SharesAPI) + +_LOG = logging.getLogger(__name__) + + +class ProvidersClient(ProvidersAPI): + """ + A data provider is an object representing the organization in the real world who shares the + data. A provider contains shares which further contain the shared data. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class RecipientActivationClient(RecipientActivationAPI): + """ + The Recipient Activation API is only applicable in the open sharing model where the recipient + object has the authentication type of `TOKEN`. The data recipient follows the activation link + shared by the data provider to download the credential file that includes the access token. The + recipient will then use the credential file to establish a secure connection with the provider + to receive the shared data. + + Note that you can download the credential file only once. Recipients should treat the downloaded + credential as a secret and must not share it outside of their organization. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class RecipientsClient(RecipientsAPI): + """ + A recipient is an object you create using :method:recipients/create to represent an organization + which you want to allow access shares. The way how sharing works differs depending on whether or + not your recipient has access to a Databricks workspace that is enabled for Unity Catalog: + + - For recipients with access to a Databricks workspace that is enabled for Unity Catalog, you + can create a recipient object along with a unique sharing identifier you get from the recipient. + The sharing identifier is the key identifier that enables the secure connection. This sharing + mode is called **Databricks-to-Databricks sharing**. + + - For recipients without access to a Databricks workspace that is enabled for Unity Catalog, + when you create a recipient object, Databricks generates an activation link you can send to the + recipient. The recipient follows the activation link to download the credential file, and then + uses the credential file to establish a secure connection to receive the shared data. This + sharing mode is called **open sharing**. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class SharesClient(SharesAPI): + """ + A share is a container instantiated with :method:shares/create. Once created you can iteratively + register a collection of existing data assets defined within the metastore using + :method:shares/update. You can register data assets under their original name, qualified by + their original schema, or provide alternate exposed names. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/sql/v2/client.py b/databricks/sdk/sql/v2/client.py new file mode 100755 index 000000000..f3c53b12b --- /dev/null +++ b/databricks/sdk/sql/v2/client.py @@ -0,0 +1,1089 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .sql import (AlertsAPI, AlertsLegacyAPI, DashboardsAPI, + DashboardWidgetsAPI, DataSourcesAPI, DbsqlPermissionsAPI, + QueriesAPI, QueriesLegacyAPI, QueryHistoryAPI, + QueryVisualizationsAPI, QueryVisualizationsLegacyAPI, + RedashConfigAPI, StatementExecutionAPI, WarehousesAPI) + +_LOG = logging.getLogger(__name__) + + +class AlertsClient(AlertsAPI): + """ + The alerts API can be used to perform CRUD operations on alerts. An alert is a Databricks SQL + object that periodically runs a query, evaluates a condition of its result, and notifies one or + more users and/or notification destinations if the condition was met. Alerts can be scheduled + using the `sql_task` type of the Jobs API, e.g. :method:jobs/create. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class AlertsLegacyClient(AlertsLegacyAPI): + """ + The alerts API can be used to perform CRUD operations on alerts. An alert is a Databricks SQL + object that periodically runs a query, evaluates a condition of its result, and notifies one or + more users and/or notification destinations if the condition was met. Alerts can be scheduled + using the `sql_task` type of the Jobs API, e.g. :method:jobs/create. + + **Note**: A new version of the Databricks SQL API is now available. Please see the latest + version. [Learn more] + + [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DashboardWidgetsClient(DashboardWidgetsAPI): + """ + This is an evolving API that facilitates the addition and removal of widgets from existing + dashboards within the Databricks Workspace. Data structures may change over time. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DashboardsClient(DashboardsAPI): + """ + In general, there is little need to modify dashboards using the API. However, it can be useful + to use dashboard objects to look-up a collection of related query IDs. The API can also be used + to duplicate multiple dashboards at once since you can get a dashboard definition with a GET + request and then POST it to create a new one. Dashboards can be scheduled using the `sql_task` + type of the Jobs API, e.g. :method:jobs/create. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DataSourcesClient(DataSourcesAPI): + """ + This API is provided to assist you in making new query objects. When creating a query object, + you may optionally specify a `data_source_id` for the SQL warehouse against which it will run. + If you don't already know the `data_source_id` for your desired SQL warehouse, this API will + help you find it. + + This API does not support searches. It returns the full list of SQL warehouses in your + workspace. We advise you to use any text editor, REST client, or `grep` to search the response + from this API for the name of your SQL warehouse as it appears in Databricks SQL. + + **Note**: A new version of the Databricks SQL API is now available. [Learn more] + + [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class DbsqlPermissionsClient(DbsqlPermissionsAPI): + """ + The SQL Permissions API is similar to the endpoints of the :method:permissions/set. However, + this exposes only one endpoint, which gets the Access Control List for a given object. You + cannot modify any permissions using this API. + + There are three levels of permission: + + - `CAN_VIEW`: Allows read-only access + + - `CAN_RUN`: Allows read access and run access (superset of `CAN_VIEW`) + + - `CAN_MANAGE`: Allows all actions: read, run, edit, delete, modify permissions (superset of + `CAN_RUN`) + + **Note**: A new version of the Databricks SQL API is now available. [Learn more] + + [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class QueriesClient(QueriesAPI): + """ + The queries API can be used to perform CRUD operations on queries. A query is a Databricks SQL + object that includes the target SQL warehouse, query text, name, description, tags, and + parameters. Queries can be scheduled using the `sql_task` type of the Jobs API, e.g. + :method:jobs/create. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class QueriesLegacyClient(QueriesLegacyAPI): + """ + These endpoints are used for CRUD operations on query definitions. Query definitions include the + target SQL warehouse, query text, name, description, tags, parameters, and visualizations. + Queries can be scheduled using the `sql_task` type of the Jobs API, e.g. :method:jobs/create. + + **Note**: A new version of the Databricks SQL API is now available. Please see the latest + version. [Learn more] + + [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class QueryHistoryClient(QueryHistoryAPI): + """ + A service responsible for storing and retrieving the list of queries run against SQL endpoints + and serverless compute. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class QueryVisualizationsClient(QueryVisualizationsAPI): + """ + This is an evolving API that facilitates the addition and removal of visualizations from + existing queries in the Databricks Workspace. Data structures can change over time. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class QueryVisualizationsLegacyClient(QueryVisualizationsLegacyAPI): + """ + This is an evolving API that facilitates the addition and removal of vizualisations from + existing queries within the Databricks Workspace. Data structures may change over time. + + **Note**: A new version of the Databricks SQL API is now available. Please see the latest + version. [Learn more] + + [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class RedashConfigClient(RedashConfigAPI): + """ + Redash V2 service for workspace configurations (internal) + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class StatementExecutionClient(StatementExecutionAPI): + """ + The Databricks SQL Statement Execution API can be used to execute SQL statements on a SQL + warehouse and fetch the result. + + **Getting started** + + We suggest beginning with the [Databricks SQL Statement Execution API tutorial]. + + **Overview of statement execution and result fetching** + + Statement execution begins by issuing a :method:statementexecution/executeStatement request with + a valid SQL statement and warehouse ID, along with optional parameters such as the data catalog + and output format. If no other parameters are specified, the server will wait for up to 10s + before returning a response. If the statement has completed within this timespan, the response + will include the result data as a JSON array and metadata. Otherwise, if no result is available + after the 10s timeout expired, the response will provide the statement ID that can be used to + poll for results by using a :method:statementexecution/getStatement request. + + You can specify whether the call should behave synchronously, asynchronously or start + synchronously with a fallback to asynchronous execution. This is controlled with the + `wait_timeout` and `on_wait_timeout` settings. If `wait_timeout` is set between 5-50 seconds + (default: 10s), the call waits for results up to the specified timeout; when set to `0s`, the + call is asynchronous and responds immediately with a statement ID. The `on_wait_timeout` setting + specifies what should happen when the timeout is reached while the statement execution has not + yet finished. This can be set to either `CONTINUE`, to fallback to asynchronous mode, or it can + be set to `CANCEL`, which cancels the statement. + + In summary: - Synchronous mode - `wait_timeout=30s` and `on_wait_timeout=CANCEL` - The call + waits up to 30 seconds; if the statement execution finishes within this time, the result data is + returned directly in the response. If the execution takes longer than 30 seconds, the execution + is canceled and the call returns with a `CANCELED` state. - Asynchronous mode - + `wait_timeout=0s` (`on_wait_timeout` is ignored) - The call doesn't wait for the statement to + finish but returns directly with a statement ID. The status of the statement execution can be + polled by issuing :method:statementexecution/getStatement with the statement ID. Once the + execution has succeeded, this call also returns the result and metadata in the response. - + Hybrid mode (default) - `wait_timeout=10s` and `on_wait_timeout=CONTINUE` - The call waits for + up to 10 seconds; if the statement execution finishes within this time, the result data is + returned directly in the response. If the execution takes longer than 10 seconds, a statement ID + is returned. The statement ID can be used to fetch status and results in the same way as in the + asynchronous mode. + + Depending on the size, the result can be split into multiple chunks. If the statement execution + is successful, the statement response contains a manifest and the first chunk of the result. The + manifest contains schema information and provides metadata for each chunk in the result. Result + chunks can be retrieved by index with :method:statementexecution/getStatementResultChunkN which + may be called in any order and in parallel. For sequential fetching, each chunk, apart from the + last, also contains a `next_chunk_index` and `next_chunk_internal_link` that point to the next + chunk. + + A statement can be canceled with :method:statementexecution/cancelExecution. + + **Fetching result data: format and disposition** + + To specify the format of the result data, use the `format` field, which can be set to one of the + following options: `JSON_ARRAY` (JSON), `ARROW_STREAM` ([Apache Arrow Columnar]), or `CSV`. + + There are two ways to receive statement results, controlled by the `disposition` setting, which + can be either `INLINE` or `EXTERNAL_LINKS`: + + - `INLINE`: In this mode, the result data is directly included in the response. It's best suited + for smaller results. This mode can only be used with the `JSON_ARRAY` format. + + - `EXTERNAL_LINKS`: In this mode, the response provides links that can be used to download the + result data in chunks separately. This approach is ideal for larger results and offers higher + throughput. This mode can be used with all the formats: `JSON_ARRAY`, `ARROW_STREAM`, and `CSV`. + + By default, the API uses `format=JSON_ARRAY` and `disposition=INLINE`. + + **Limits and limitations** + + Note: The byte limit for INLINE disposition is based on internal storage metrics and will not + exactly match the byte count of the actual payload. + + - Statements with `disposition=INLINE` are limited to 25 MiB and will fail when this limit is + exceeded. - Statements with `disposition=EXTERNAL_LINKS` are limited to 100 GiB. Result sets + larger than this limit will be truncated. Truncation is indicated by the `truncated` field in + the result manifest. - The maximum query text size is 16 MiB. - Cancelation might silently fail. + A successful response from a cancel request indicates that the cancel request was successfully + received and sent to the processing engine. However, an outstanding statement might have already + completed execution when the cancel request arrives. Polling for status until a terminal state + is reached is a reliable way to determine the final state. - Wait timeouts are approximate, + occur server-side, and cannot account for things such as caller delays and network latency from + caller to service. - To guarantee that the statement is kept alive, you must poll at least once + every 15 minutes. - The results are only available for one hour after success; polling does not + extend this. - The SQL Execution API must be used for the entire lifecycle of the statement. For + example, you cannot use the Jobs API to execute the command, and then the SQL Execution API to + cancel it. + + [Apache Arrow Columnar]: https://arrow.apache.org/overview/ + [Databricks SQL Statement Execution API tutorial]: https://docs.databricks.com/sql/api/sql-execution-tutorial.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class WarehousesClient(WarehousesAPI): + """ + A SQL warehouse is a compute resource that lets you run SQL commands on data objects within + Databricks SQL. Compute resources are infrastructure resources that provide processing + capabilities in the cloud. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/vectorsearch/v2/client.py b/databricks/sdk/vectorsearch/v2/client.py new file mode 100755 index 000000000..d78b24681 --- /dev/null +++ b/databricks/sdk/vectorsearch/v2/client.py @@ -0,0 +1,150 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .vectorsearch import VectorSearchEndpointsAPI, VectorSearchIndexesAPI + +_LOG = logging.getLogger(__name__) + + +class VectorSearchEndpointsClient(VectorSearchEndpointsAPI): + """ + **Endpoint**: Represents the compute resources to host vector search indexes. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class VectorSearchIndexesClient(VectorSearchIndexesAPI): + """ + **Index**: An efficient representation of your embedding vectors that supports real-time and + efficient approximate nearest neighbor (ANN) search queries. + + There are 2 types of Vector Search indexes: * **Delta Sync Index**: An index that automatically + syncs with a source Delta Table, automatically and incrementally updating the index as the + underlying data in the Delta Table changes. * **Direct Vector Access Index**: An index that + supports direct read and write of vectors and metadata through our REST and SDK APIs. With this + model, the user manages index updates. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/workspace/v2/client.py b/databricks/sdk/workspace/v2/client.py new file mode 100755 index 000000000..29394271b --- /dev/null +++ b/databricks/sdk/workspace/v2/client.py @@ -0,0 +1,300 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +import logging +from typing import Optional + +import databricks.sdk.databricks.core as client +from databricks.sdk.databricks.credentials_provider import CredentialsStrategy + +from .mixin import WorkspaceExt +from .workspace import GitCredentialsAPI, ReposAPI, SecretsAPI + +_LOG = logging.getLogger(__name__) + + +class GitCredentialsClient(GitCredentialsAPI): + """ + Registers personal access token for Databricks to do operations on behalf of the user. + + See [more info]. + + [more info]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class ReposClient(ReposAPI): + """ + The Repos API allows users to manage their git repos. Users can use the API to access all repos + that they have manage permissions on. + + Databricks Repos is a visual Git client in Databricks. It supports common Git operations such a + cloning a repository, committing and pushing, pulling, branch management, and visual comparison + of diffs when committing. + + Within Repos you can develop code in notebooks or other files and follow data science and + engineering code development best practices using Git for version control, collaboration, and + CI/CD. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class SecretsClient(SecretsAPI): + """ + The Secrets API allows you to manage secrets, secret scopes, and access permissions. + + Sometimes accessing data requires that you authenticate to external data sources through JDBC. + Instead of directly entering your credentials into a notebook, use Databricks secrets to store + your credentials and reference them in notebooks and jobs. + + Administrators, secret creators, and users granted permission can read Databricks secrets. While + Databricks makes an effort to redact secret values that might be displayed in notebooks, it is + not possible to prevent such users from reading secrets. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + +class WorkspaceClient(WorkspaceExt): + """ + The Workspace API allows you to list, import, export, and delete notebooks and folders. + + A notebook is a web-based interface to a document that contains runnable code, visualizations, + and explanatory text. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) diff --git a/databricks/sdk/mixins/workspace.py b/databricks/sdk/workspace/v2/mixin.py similarity index 96% rename from databricks/sdk/mixins/workspace.py rename to databricks/sdk/workspace/v2/mixin.py index e77e117bc..c29db98ee 100644 --- a/databricks/sdk/mixins/workspace.py +++ b/databricks/sdk/workspace/v2/mixin.py @@ -1,8 +1,9 @@ from typing import Any, BinaryIO, Iterator, Optional, Union -from ..databricks.core import DatabricksError -from ..service.workspace import (ExportFormat, ImportFormat, Language, - ObjectInfo, ObjectType, WorkspaceAPI) +from databricks.sdk.databricks.core import DatabricksError + +from .workspace import (ExportFormat, ImportFormat, Language, ObjectInfo, + ObjectType, WorkspaceAPI) def _fqcn(x: Any) -> str: diff --git a/tests/conftest.py b/tests/conftest.py index d51d017b6..a0795acdb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,9 +23,7 @@ def config(): @pytest.fixture def w(config): - from databricks.sdk import WorkspaceClient - - return WorkspaceClient(config=config) + return config __tests__ = os.path.dirname(__file__) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 55114bd84..0e5ce275a 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -7,8 +7,10 @@ import pytest -from databricks.sdk import AccountClient, FilesAPI, FilesExt, WorkspaceClient -from databricks.sdk.service.catalog import VolumeType +from databricks.sdk import FilesExt +from databricks.sdk.catalog.v2.catalog import VolumeType +from databricks.sdk.databricks.config import Config +from databricks.sdk.files.v2.files import FilesAPI def pytest_addoption(parser): @@ -59,45 +61,45 @@ def inner(k=16) -> str: @pytest.fixture(scope="session") -def a(env_or_skip) -> AccountClient: +def a(env_or_skip) -> Config: _load_debug_env_if_runs_from_ide("account") env_or_skip("CLOUD_ENV") - account_client = AccountClient() - if not account_client.config.is_account_client: + cfg = Config() + if not cfg.is_account_client: pytest.skip("not Databricks Account client") - return account_client + return cfg @pytest.fixture(scope="session") -def ucacct(env_or_skip) -> AccountClient: +def ucacct(env_or_skip) -> Config: _load_debug_env_if_runs_from_ide("ucacct") env_or_skip("CLOUD_ENV") - account_client = AccountClient() - if not account_client.config.is_account_client: + cfg = Config() + if not cfg.is_account_client: pytest.skip("not Databricks Account client") if "TEST_METASTORE_ID" not in os.environ: pytest.skip("not in Unity Catalog Workspace test env") - return account_client + return cfg @pytest.fixture(scope="session") -def w(env_or_skip) -> WorkspaceClient: +def w(env_or_skip) -> Config: _load_debug_env_if_runs_from_ide("workspace") env_or_skip("CLOUD_ENV") if "DATABRICKS_ACCOUNT_ID" in os.environ: pytest.skip("Skipping workspace test on account level") - return WorkspaceClient() + return Config() @pytest.fixture(scope="session") -def ucws(env_or_skip) -> WorkspaceClient: +def ucws(env_or_skip) -> Config: _load_debug_env_if_runs_from_ide("ucws") env_or_skip("CLOUD_ENV") if "DATABRICKS_ACCOUNT_ID" in os.environ: pytest.skip("Skipping workspace test on account level") if "TEST_METASTORE_ID" not in os.environ: pytest.skip("not in Unity Catalog Workspace test env") - return WorkspaceClient() + return Config() @pytest.fixture(scope="session") @@ -162,6 +164,7 @@ def _is_in_debug() -> bool: return os.path.basename(sys.argv[0]) in [ "_jb_pytest_runner.py", "testlauncher.py", + "run_pytest_script.py", ] diff --git a/tests/integration/test_auth.py b/tests/integration/test_auth.py index b6b0d6289..7b1d2d51f 100644 --- a/tests/integration/test_auth.py +++ b/tests/integration/test_auth.py @@ -10,8 +10,8 @@ import pytest -from databricks.sdk.service.compute import SparkVersion -from databricks.sdk.service.jobs import ViewType +from databricks.sdk.compute.v2 import compute +from databricks.sdk.jobs.v2 import jobs @pytest.fixture @@ -101,7 +101,7 @@ def fresh_wheel_file(tmp_path) -> Path: # ucws.clusters.permanent_delete(interactive_cluster.cluster_id) -def _get_lts_versions(w) -> typing.List[SparkVersion]: +def _get_lts_versions(w) -> typing.List[compute.SparkVersion]: v = w.clusters.spark_versions() lts_runtimes = [ x @@ -186,7 +186,7 @@ def _task_outputs(w, run): output = "" run_output = w.jobs.export_run(task_run.run_id) for view in run_output.views: - if view.type != ViewType.NOTEBOOK: + if view.type != jobs.ViewType.NOTEBOOK: continue for b64 in notebook_model_re.findall(view.content): url_encoded: bytes = base64.b64decode(b64) diff --git a/tests/integration/test_clusters.py b/tests/integration/test_clusters.py index 8b3d2f014..0808752ff 100644 --- a/tests/integration/test_clusters.py +++ b/tests/integration/test_clusters.py @@ -4,46 +4,58 @@ import pytest from databricks.sdk.databricks.core import DatabricksError -from databricks.sdk.service.compute import EventType +from databricks.sdk.compute.v2.client import ClustersClient +from databricks.sdk.compute.v2 import compute +# from databricks.sdk.service.compute import EventType def test_smallest_node_type(w): - node_type_id = w.clusters.select_node_type(local_disk=True) + cc = ClustersClient(config=w) + node_type_id = cc.select_node_type(local_disk=True) assert node_type_id is not None def test_latest_runtime(w): - spark_version = w.clusters.select_spark_version(long_term_support=True) + cc = ClustersClient(config=w) + spark_version = cc.select_spark_version(long_term_support=True) assert spark_version is not None def test_cluster_events(w, env_or_skip): cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") count = 0 - for e in w.clusters.events(cluster_id, event_types=[EventType.STARTING, EventType.TERMINATING]): + cc = ClustersClient(config=w) + for e in cc.events(cluster_id, event_types=[compute.EventType.STARTING, compute.EventType.TERMINATING]): count += 1 assert count > 0 def test_ensure_cluster_is_running(w, env_or_skip): cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") - w.clusters.ensure_cluster_is_running(cluster_id) + cc = ClustersClient(config=w) + cc.ensure_cluster_is_running(cluster_id) -def test_create_cluster(w, env_or_skip, random): - info = w.clusters.create( - cluster_name=f"databricks-sdk-py-{random(8)}", - spark_version=w.clusters.select_spark_version(long_term_support=True), - instance_pool_id=env_or_skip("TEST_INSTANCE_POOL_ID"), - autotermination_minutes=10, - num_workers=1, - ).result(timeout=timedelta(minutes=20)) - logging.info(f"Created: {info}") +# TODO: Re-enable this test after adding LRO support to the SDK +# def test_create_cluster(w, env_or_skip, random): +# from databricks.sdk.compute.v2.client import ClustersClient +# cc = ClustersClient(config=w) + +# info = cc.create( +# cluster_name=f"databricks-sdk-py-{random(8)}", +# spark_version=cc.select_spark_version(long_term_support=True), +# instance_pool_id=env_or_skip("TEST_INSTANCE_POOL_ID"), +# autotermination_minutes=10, +# num_workers=1, +# ).result(timeout=timedelta(minutes=20)) +# logging.info(f"Created: {info}") def test_error_unmarshall(w, random): + from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient(config=w) with pytest.raises(DatabricksError) as exc_info: - w.clusters.get("123__non_existing__") + cc.get("123__non_existing__") err = exc_info.value assert "Cluster 123__non_existing__ does not exist" in str(err) assert "INVALID_PARAMETER_VALUE" == err.error_code diff --git a/tests/integration/test_commands.py b/tests/integration/test_commands.py index 407f9ba20..1b2c87062 100644 --- a/tests/integration/test_commands.py +++ b/tests/integration/test_commands.py @@ -4,8 +4,10 @@ def test_error_unmarshall(w, random): + from databricks.sdk.compute.v2.client import CommandExecutionClient + cec = CommandExecutionClient(config=w) with pytest.raises(DatabricksError) as exc_info: - w.command_execution.execute(cluster_id="__non_existing__") + cec.execute(cluster_id="__non_existing__") err = exc_info.value assert "requirement failed: missing contextId" in str(err) assert err.error_code is None diff --git a/tests/integration/test_data_plane.py b/tests/integration/test_data_plane.py index 2558cb0bb..c1538a8d3 100644 --- a/tests/integration/test_data_plane.py +++ b/tests/integration/test_data_plane.py @@ -1,22 +1,22 @@ from databricks.sdk.databricks.data_plane import DataPlaneTokenSource +# TODO: Re-enable this after adding data plane services to the SDK +# def test_data_plane_token_source(ucws, env_or_skip): +# endpoint = env_or_skip("SERVING_ENDPOINT_NAME") +# serving_endpoint = ucws.serving_endpoints.get(endpoint) +# assert serving_endpoint.data_plane_info is not None +# assert serving_endpoint.data_plane_info.query_info is not None -def test_data_plane_token_source(ucws, env_or_skip): - endpoint = env_or_skip("SERVING_ENDPOINT_NAME") - serving_endpoint = ucws.serving_endpoints.get(endpoint) - assert serving_endpoint.data_plane_info is not None - assert serving_endpoint.data_plane_info.query_info is not None +# info = serving_endpoint.data_plane_info.query_info - info = serving_endpoint.data_plane_info.query_info +# ts = DataPlaneTokenSource(ucws.config.host, ucws._config.oauth_token) +# dp_token = ts.token(info.endpoint_url, info.authorization_details) - ts = DataPlaneTokenSource(ucws.config.host, ucws._config.oauth_token) - dp_token = ts.token(info.endpoint_url, info.authorization_details) +# assert dp_token.valid - assert dp_token.valid - -def test_model_serving_data_plane(ucws, env_or_skip): - endpoint = env_or_skip("SERVING_ENDPOINT_NAME") - serving_endpoints = ucws.serving_endpoints_data_plane - response = serving_endpoints.query(name=endpoint, dataframe_records=[{"col": 1.0}]) - assert response is not None +# def test_model_serving_data_plane(ucws, env_or_skip): +# endpoint = env_or_skip("SERVING_ENDPOINT_NAME") +# serving_endpoints = ucws.serving_endpoints_data_plane +# response = serving_endpoints.query(name=endpoint, dataframe_records=[{"col": 1.0}]) +# assert response is not None diff --git a/tests/integration/test_deployment.py b/tests/integration/test_deployment.py index 2071645d2..2b168c828 100644 --- a/tests/integration/test_deployment.py +++ b/tests/integration/test_deployment.py @@ -4,7 +4,9 @@ def test_workspaces(a): - if a.config.is_azure: + from databricks.sdk.provisioning.v2.client import WorkspacesClient + wc = WorkspacesClient(config=a) + if a.is_azure: pytest.skip("not available on Azure") - for w in a.workspaces.list(): + for w in wc.list(): logging.info(f"Found workspace: {w.workspace_name}") diff --git a/tests/integration/test_external_browser.py b/tests/integration/test_external_browser.py index 883069217..68f7b4778 100644 --- a/tests/integration/test_external_browser.py +++ b/tests/integration/test_external_browser.py @@ -1,7 +1,5 @@ import pytest -from databricks.sdk import WorkspaceClient - from .conftest import _load_debug_env_if_runs_from_ide @@ -13,34 +11,37 @@ def env(env_or_skip): def test_pkce_app(env): - w = WorkspaceClient( + from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient( host=env("DATABRICKS_HOST"), client_id=env("TEST_PKCE_APP_CLIENT_ID"), auth_type="external-browser", ) - clusters = w.clusters.list() + clusters = cc.list() for cl in clusters: print(f" - {cl.cluster_name} is {cl.state}") def test_public_app(env): - w = WorkspaceClient( + from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient( host=env("DATABRICKS_HOST"), client_id=env("TEST_PUBLIC_APP_CLIENT_ID"), auth_type="external-browser", ) - clusters = w.clusters.list() + clusters = cc.list() for cl in clusters: print(f" - {cl.cluster_name} is {cl.state}") def test_private_app(env): - w = WorkspaceClient( + from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient( host=env("DATABRICKS_HOST"), client_id=env("TEST_PRIVATE_APP_CLIENT_ID"), client_secret=env("TEST_PRIVATE_APP_CLIENT_SECRET"), auth_type="external-browser", ) - clusters = w.clusters.list() + clusters = cc.list() for cl in clusters: print(f" - {cl.cluster_name} is {cl.state}") diff --git a/tests/integration/test_files.py b/tests/integration/test_files.py index 4b3b9a649..42e3b35e4 100644 --- a/tests/integration/test_files.py +++ b/tests/integration/test_files.py @@ -8,7 +8,6 @@ import pytest from databricks.sdk.databricks.core import DatabricksError -from databricks.sdk.service.catalog import VolumeType def test_local_io(random): @@ -41,10 +40,11 @@ def test_dbfs_io(w, random): @pytest.fixture def junk(w, random): - + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) def inner(path: str, size=256) -> bytes: to_write = random(size).encode() - with w.dbfs.open(path, write=True) as f: + with dc.open(path, write=True) as f: written = f.write(to_write) assert len(to_write) == written return to_write @@ -54,9 +54,10 @@ def inner(path: str, size=256) -> bytes: @pytest.fixture def ls(w): - + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) def inner(root: str, recursive=False) -> List[str]: - return [f.path.removeprefix(root) for f in w.dbfs.list(root, recursive=recursive)] + return [f.path.removeprefix(root) for f in dc.list(root, recursive=recursive)] return inner @@ -70,7 +71,9 @@ def test_recursive_listing(w, random, junk, ls): assert ["/01", "/a"] == ls(root) assert ["/01", "/a/02", "/a/b/03"] == ls(root, recursive=True) - w.dbfs.delete(root, recursive=True) + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + dc.delete(root, recursive=True) def test_cp_dbfs_folder_to_folder_non_recursive(w, random, junk, ls): @@ -80,7 +83,10 @@ def test_cp_dbfs_folder_to_folder_non_recursive(w, random, junk, ls): junk(f"{root}/a/b/03") new_root = f"/tmp/{random()}" - w.dbfs.copy(root, new_root) + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.copy(root, new_root) assert ["/01"] == ls(new_root, recursive=True) @@ -92,7 +98,10 @@ def test_cp_dbfs_folder_to_folder_recursive(w, random, junk, ls): junk(f"{root}/a/b/03") new_root = f"/tmp/{random()}" - w.dbfs.copy(root, new_root, recursive=True, overwrite=True) + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.copy(root, new_root, recursive=True, overwrite=True) assert ["/01", "/a/02", "/a/b/03"] == ls(new_root, recursive=True) @@ -104,8 +113,11 @@ def test_cp_dbfs_folder_to_existing_folder_recursive(w, random, junk, ls): junk(f"{root}/a/b/03") new_root = f"/tmp/{random()}" - w.dbfs.mkdirs(new_root) - w.dbfs.copy(root, new_root, recursive=True, overwrite=True) + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.mkdirs(new_root) + dc.copy(root, new_root, recursive=True, overwrite=True) base = root.split("/")[-1] assert [f"/{base}/01", f"/{base}/a/02", f"/{base}/a/b/03"] == ls(new_root, recursive=True) @@ -116,19 +128,26 @@ def test_cp_dbfs_file_to_non_existing_location(w, random, junk): payload = junk(f"{root}/01") copy_destination = f"{root}/{random()}" - w.dbfs.copy(f"{root}/01", copy_destination) + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.copy(f"{root}/01", copy_destination) - with w.dbfs.open(copy_destination, read=True) as f: + with dc.open(copy_destination, read=True) as f: assert f.read() == payload def test_cp_dbfs_file_to_existing_folder(w, random, junk): root = f"/tmp/{random()}" payload = junk(f"{root}/01") - w.dbfs.mkdirs(f"{root}/02") - w.dbfs.copy(f"{root}/01", f"{root}/02") - - with w.dbfs.open(f"{root}/02/01", read=True) as f: + + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.mkdirs(f"{root}/02") + dc.copy(f"{root}/01", f"{root}/02") + + with dc.open(f"{root}/02/01", read=True) as f: assert f.read() == payload @@ -136,8 +155,12 @@ def test_cp_dbfs_file_to_existing_location(w, random, junk): root = f"/tmp/{random()}" junk(f"{root}/01") junk(f"{root}/02") + + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + with pytest.raises(DatabricksError) as ei: - w.dbfs.copy(f"{root}/01", f"{root}/02") + dc.copy(f"{root}/01", f"{root}/02") assert "A file or directory already exists" in str(ei.value) @@ -146,9 +169,12 @@ def test_cp_dbfs_file_to_existing_location_with_overwrite(w, random, junk): payload = junk(f"{root}/01") junk(f"{root}/02") - w.dbfs.copy(f"{root}/01", f"{root}/02", overwrite=True) + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.copy(f"{root}/01", f"{root}/02", overwrite=True) - with w.dbfs.open(f"{root}/02", read=True) as f: + with dc.open(f"{root}/02", read=True) as f: assert f.read() == payload @@ -156,10 +182,13 @@ def test_move_within_dbfs(w, random, junk): root = f"/tmp/{random()}" payload = junk(f"{root}/01") - w.dbfs.move_(f"{root}/01", f"{root}/02") + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.move_(f"{root}/01", f"{root}/02") - assert w.dbfs.exists(f"{root}/01") is False - with w.dbfs.open(f"{root}/02", read=True) as f: + assert dc.exists(f"{root}/01") is False + with dc.open(f"{root}/02", read=True) as f: assert f.read() == payload @@ -168,10 +197,13 @@ def test_move_from_dbfs_to_local(w, random, junk, tmp_path): payload_01 = junk(f"{root}/01") payload_02 = junk(f"{root}/a/02") payload_03 = junk(f"{root}/a/b/03") + + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) - w.dbfs.move_(root, f"file:{tmp_path}", recursive=True) + dc.move_(root, f"file:{tmp_path}", recursive=True) - assert w.dbfs.exists(root) is False + assert dc.exists(root) is False with (tmp_path / root.name / "01").open("rb") as f: assert f.read() == payload_01 with (tmp_path / root.name / "a/02").open("rb") as f: @@ -184,9 +216,12 @@ def test_dbfs_upload_download(w, random, junk, tmp_path): root = pathlib.Path(f"/tmp/{random()}") f = io.BytesIO(b"some text data") - w.dbfs.upload(f"{root}/01", f) + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + + dc.upload(f"{root}/01", f) - with w.dbfs.download(f"{root}/01") as f: + with dc.download(f"{root}/01") as f: assert f.read() == b"some text data" @@ -207,9 +242,14 @@ def create_schema(w, catalog, schema): res = w.schemas.create(catalog_name=catalog, name=schema) return ResourceWithCleanup(lambda: w.schemas.delete(res.full_name)) + @staticmethod def create_volume(w, catalog, schema, volume): - res = w.volumes.create( + from databricks.sdk.catalog.v2.client import VolumesClient + from databricks.sdk.catalog.v2.catalog import VolumeType + + vc = VolumesClient(config=w) + res = vc.create( catalog_name=catalog, schema_name=schema, name=volume, diff --git a/tests/integration/test_iam.py b/tests/integration/test_iam.py index 36c2a0b87..575e09db4 100644 --- a/tests/integration/test_iam.py +++ b/tests/integration/test_iam.py @@ -2,24 +2,32 @@ from databricks.sdk.databricks import errors from databricks.sdk.databricks.core import DatabricksError +from databricks.sdk.iam.v2.client import GroupsClient +from databricks.sdk.iam.v2.client import UsersClient def test_filtering_groups(w, random): - all = w.groups.list(filter=f"displayName eq any-{random(12)}") + gc = GroupsClient(config=w) + + all = gc.list(filter=f"displayName eq any-{random(12)}") found = len(list(all)) assert found == 0 def test_scim_error_unmarshall(w, random): + gc = GroupsClient(config=w) + with pytest.raises(DatabricksError) as exc_info: - groups = w.groups.list(filter=random(12)) + groups = gc.list(filter=random(12)) next(groups) assert isinstance(exc_info.value, errors.BadRequest) def test_scim_get_user_as_dict(w): - first_user = next(w.users.list()) - user = w.users.get(first_user.id) + uc = UsersClient(config=w) + + first_user = next(uc.list()) + user = uc.get(first_user.id) # should not throw user.as_dict() diff --git a/tests/integration/test_jobs.py b/tests/integration/test_jobs.py index cfc8de0b7..f1365b379 100644 --- a/tests/integration/test_jobs.py +++ b/tests/integration/test_jobs.py @@ -1,47 +1,58 @@ import datetime import logging - +from databricks.sdk.jobs.v2.client import JobsClient +from databricks.sdk.iam.v2.client import CurrentUserClient +from databricks.sdk.files.v2.client import DbfsClient +from databricks.sdk.compute.v2.client import ClustersClient def test_jobs(w): found = 0 - for job in w.jobs.list(): + jc = JobsClient(config=w) + + for job in jc.list(): logging.info(f"Looking at {job.settings.name}") found += 1 assert found > 0 -def test_submitting_jobs(w, random, env_or_skip): - from databricks.sdk.service import compute, jobs - - py_on_dbfs = f"/home/{w.current_user.me().user_name}/sample.py" - with w.dbfs.open(py_on_dbfs, write=True, overwrite=True) as f: - f.write(b'import time; time.sleep(10); print("Hello, World!")') - - waiter = w.jobs.submit( - run_name=f"py-sdk-{random(8)}", - tasks=[ - jobs.SubmitTask( - task_key="pi", - new_cluster=compute.ClusterSpec( - spark_version=w.clusters.select_spark_version(long_term_support=True), - # node_type_id=w.clusters.select_node_type(local_disk=True), - instance_pool_id=env_or_skip("TEST_INSTANCE_POOL_ID"), - num_workers=1, - ), - spark_python_task=jobs.SparkPythonTask(python_file=f"dbfs:{py_on_dbfs}"), - ) - ], - ) +# TODO: Re-enable this after adding waiters to the SDK +# def test_submitting_jobs(w, random, env_or_skip): +# from databricks.sdk.jobs.v2 import jobs +# from databricks.sdk.compute.v2 import compute + +# cuc = CurrentUserClient(config=w) +# jc = JobsClient(config=w) +# dc = DbfsClient(config=w) + +# py_on_dbfs = f"/home/{cuc.me().user_name}/sample.py" +# with dc.open(py_on_dbfs, write=True, overwrite=True) as f: +# f.write(b'import time; time.sleep(10); print("Hello, World!")') + +# waiter = jc.submit( +# run_name=f"py-sdk-{random(8)}", +# tasks=[ +# jobs.SubmitTask( +# task_key="pi", +# new_cluster=jobs.JobsClusterSpec( +# spark_version=w.clusters.select_spark_version(long_term_support=True), +# # node_type_id=w.clusters.select_node_type(local_disk=True), +# instance_pool_id=env_or_skip("TEST_INSTANCE_POOL_ID"), +# num_workers=1, +# ), +# spark_python_task=jobs.SparkPythonTask(python_file=f"dbfs:{py_on_dbfs}"), +# ) +# ], +# ) - logging.info(f"starting to poll: {waiter.run_id}") +# logging.info(f"starting to poll: {waiter.run_id}") - def print_status(run: jobs.Run): - statuses = [f"{t.task_key}: {t.state.life_cycle_state}" for t in run.tasks] - logging.info(f'workflow intermediate status: {", ".join(statuses)}') +# def print_status(run: jobs.Run): +# statuses = [f"{t.task_key}: {t.state.life_cycle_state}" for t in run.tasks] +# logging.info(f'workflow intermediate status: {", ".join(statuses)}') - run = waiter.result(timeout=datetime.timedelta(minutes=15), callback=print_status) +# run = waiter.result(timeout=datetime.timedelta(minutes=15), callback=print_status) - logging.info(f"job finished: {run.run_page_url}") +# logging.info(f"job finished: {run.run_page_url}") def test_last_job_runs(w): @@ -52,9 +63,10 @@ def test_last_job_runs(w): all_jobs = {} durations = defaultdict(list) - for job in w.jobs.list(): + jc = JobsClient(config=w) + for job in jc.list(): all_jobs[job.job_id] = job - for run in w.jobs.list_runs(job_id=job.job_id, expand_tasks=False): + for run in jc.list_runs(job_id=job.job_id, expand_tasks=False): durations[job.job_id].append(run.run_duration) if job.job_id not in latest_state: latest_state[job.job_id] = run @@ -79,14 +91,17 @@ def test_last_job_runs(w): def test_create_job(w): - from databricks.sdk.service import compute, jobs + from databricks.sdk.jobs.v2 import jobs + jc = JobsClient(config=w) + cc = ClustersClient(config=w) + cluster = jobs.JobCluster( job_cluster_key="cluster1", - new_cluster=compute.ClusterSpec( + new_cluster=jobs.JobsClusterSpec( num_workers=2, - spark_version=w.clusters.select_spark_version(), - node_type_id=w.clusters.select_node_type(local_disk=True), + spark_version=cc.select_spark_version(), + node_type_id=cc.select_node_type(local_disk=True), ), ) @@ -96,4 +111,4 @@ def test_create_job(w): python_wheel_task=jobs.PythonWheelTask(entry_point="test", package_name="deepspeed"), ) - w.jobs.create(job_clusters=[cluster], tasks=[task1]) + jc.create(job_clusters=[cluster], tasks=[task1]) diff --git a/tests/integration/test_repos.py b/tests/integration/test_repos.py index 1682d9b87..ea56cd320 100644 --- a/tests/integration/test_repos.py +++ b/tests/integration/test_repos.py @@ -1,6 +1,7 @@ import logging - +from databricks.sdk.workspace.v2.client import ReposClient def test_repos_list(w): - for repo in w.repos.list(): + rc = ReposClient(config=w) + for repo in rc.list(): logging.info(f"Found repo: {repo}") diff --git a/tests/integration/test_settings.py b/tests/integration/test_settings.py index a14466815..572a34a40 100644 --- a/tests/integration/test_settings.py +++ b/tests/integration/test_settings.py @@ -1,7 +1,10 @@ +from databricks.sdk.settings.v2.client import WorkspaceConfClient + def test_workspace_conf(w): - w.workspace_conf.set_status({"enableResultsDownloading": "false"}) - conf = w.workspace_conf.get_status(keys="enableResultsDownloading") + wcc = WorkspaceConfClient(config=w) + wcc.set_status({"enableResultsDownloading": "false"}) + conf = wcc.get_status(keys="enableResultsDownloading") assert conf["enableResultsDownloading"] == "false" - w.workspace_conf.set_status({"enableResultsDownloading": "true"}) - conf = w.workspace_conf.get_status(keys="enableResultsDownloading") + wcc.set_status({"enableResultsDownloading": "true"}) + conf = wcc.get_status(keys="enableResultsDownloading") assert conf["enableResultsDownloading"] == "true" diff --git a/tests/integration/test_sql.py b/tests/integration/test_sql.py index 4ab775a0a..5636b0ff2 100644 --- a/tests/integration/test_sql.py +++ b/tests/integration/test_sql.py @@ -1,19 +1,22 @@ from datetime import datetime -from databricks.sdk.service.sql import QueryFilter, TimeRange - +from databricks.sdk.sql.v2.client import QueryHistoryClient +from databricks.sdk.sql.v2 import sql def test_query_history_list_with_filter(w): def date_to_ms(date): return int(datetime.strptime(date, "%Y-%m-%d").timestamp() * 1000) - filter = QueryFilter( - query_start_time_range=TimeRange( + qhc = QueryHistoryClient(config=w) + + filter = sql.QueryFilter( + query_start_time_range=sql.TimeRange( start_time_ms=date_to_ms("2023-01-01"), end_time_ms=date_to_ms("2023-01-02"), ) ) - queries = w.query_history.list(filter_by=filter) + queries = qhc.list(filter_by=filter) + assert queries.res is not None, "Query history result list (queries.res) is None" for q in queries.res: print(q) diff --git a/tests/integration/test_workspace.py b/tests/integration/test_workspace.py index a3b4fd9c5..8e6b26d20 100644 --- a/tests/integration/test_workspace.py +++ b/tests/integration/test_workspace.py @@ -1,6 +1,6 @@ import io -from databricks.sdk.service.workspace import ImportFormat, Language +from databricks.sdk.workspace.v2.workspace import ImportFormat, Language def test_workspace_recursive_list(w, workspace_dir, random): diff --git a/tests/test_client.py b/tests/test_client.py index 7eaf308f1..f5b0b35e1 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -2,16 +2,16 @@ import pytest -from databricks.sdk import WorkspaceClient +# from databricks.sdk import WorkspaceClient -def test_autospec_fails_on_unknown_service(): - w = create_autospec(WorkspaceClient) - with pytest.raises(AttributeError): - w.foo.bar() +# def test_autospec_fails_on_unknown_service(): +# w = create_autospec(WorkspaceClient) +# with pytest.raises(AttributeError): +# w.foo.bar() -def test_autospec_fails_on_setting_unknown_property(): - w = create_autospec(WorkspaceClient, spec_set=True) - with pytest.raises(AttributeError): - w.bar = 1 +# def test_autospec_fails_on_setting_unknown_property(): +# w = create_autospec(WorkspaceClient, spec_set=True) +# with pytest.raises(AttributeError): +# w.bar = 1 diff --git a/tests/test_compute_mixins.py b/tests/test_compute_mixins.py index ec895b022..5b637a249 100644 --- a/tests/test_compute_mixins.py +++ b/tests/test_compute_mixins.py @@ -1,6 +1,6 @@ import pytest -from databricks.sdk.mixins.compute import SemVer +from databricks.sdk.compute.v2.mixin import SemVer @pytest.mark.parametrize( diff --git a/tests/test_core.py b/tests/test_core.py index 9de0cb90d..b161a27d2 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -8,7 +8,6 @@ import pytest -from databricks.sdk import WorkspaceClient from databricks.sdk.databricks import errors, useragent from databricks.sdk.databricks.core import ApiClient, Config, DatabricksError from databricks.sdk.databricks.credentials_provider import ( @@ -18,8 +17,6 @@ AzureEnvironment, Cloud, DatabricksEnvironment) from databricks.sdk.databricks.oauth import Token -from databricks.sdk.service.catalog import PermissionsChange -from databricks.sdk.service.iam import AccessControlRequest from databricks.sdk.version import __version__ from .conftest import noop_credentials @@ -288,8 +285,10 @@ def test_access_control_list(config, requests_mock): request_headers={"User-Agent": config.user_agent}, ) - w = WorkspaceClient(config=config) - res = w.jobs.create(access_control_list=[AccessControlRequest(group_name="group")]) + from databricks.sdk.jobs.v2.client import JobsClient + from databricks.sdk.jobs.v2.jobs import JobAccessControlRequest + jc = JobsClient(config=config) + res = jc.create(access_control_list=[JobAccessControlRequest(group_name="group")]) assert requests_mock.call_count == 1 assert requests_mock.called @@ -301,9 +300,11 @@ def test_shares(config, requests_mock): "http://localhost/api/2.1/unity-catalog/shares/jobId/permissions", request_headers={"User-Agent": config.user_agent}, ) - - w = WorkspaceClient(config=config) - res = w.shares.update_permissions(name="jobId", changes=[PermissionsChange(principal="principal")]) + from databricks.sdk.sharing.v2.client import SharesClient + from databricks.sdk.sharing.v2.sharing import PermissionsChange + + sc = SharesClient(config=config) + res = sc.update_permissions(name="jobId", changes=[PermissionsChange(principal="principal")]) assert requests_mock.call_count == 1 assert requests_mock.called @@ -316,9 +317,10 @@ def test_deletes(config, requests_mock): request_headers={"User-Agent": config.user_agent}, text="null", ) - - w = WorkspaceClient(config=config) - res = w.alerts.delete(id="alertId") + from databricks.sdk.sql.v2.client import AlertsClient + + ac = AlertsClient(config=config) + res = ac.delete(id="alertId") assert requests_mock.call_count == 1 assert requests_mock.called diff --git a/tests/test_dbfs_mixins.py b/tests/test_dbfs_mixins.py index 7184af843..38afc9177 100644 --- a/tests/test_dbfs_mixins.py +++ b/tests/test_dbfs_mixins.py @@ -1,16 +1,16 @@ import pytest from databricks.sdk.databricks.errors import NotFound -from databricks.sdk.mixins.files import (DbfsExt, _DbfsPath, _LocalPath, +from databricks.sdk.files.v2.mixin import (DbfsExt, _DbfsPath, _LocalPath, _VolumesPath) def test_moving_dbfs_file_to_local_dir(config, tmp_path, mocker): - from databricks.sdk import WorkspaceClient - from databricks.sdk.service.files import FileInfo, ReadResponse + from databricks.sdk.files.v2.client import DbfsClient + from databricks.sdk.files.v2.files import FileInfo, ReadResponse get_status = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.get_status", + "databricks.sdk.files.v2.files.DbfsAPI.get_status", return_value=FileInfo(path="a", is_dir=False, file_size=4), ) @@ -21,11 +21,11 @@ def fake_read(path: str, *, length: int = None, offset: int = None): return ReadResponse(bytes_read=4, data="aGVsbG8=") return ReadResponse(bytes_read=0) - mocker.patch("databricks.sdk.service.files.DbfsAPI.read", wraps=fake_read) - delete = mocker.patch("databricks.sdk.service.files.DbfsAPI.delete") + mocker.patch("databricks.sdk.files.v2.files.DbfsAPI.read", wraps=fake_read) + delete = mocker.patch("databricks.sdk.files.v2.files.DbfsAPI.delete") - w = WorkspaceClient(config=config) - w.dbfs.move_("a", f"file:{tmp_path}", recursive=True) + jc = DbfsClient(config=config) + jc.move_("a", f"file:{tmp_path}", recursive=True) get_status.assert_called_with("a") delete.assert_called_with("a", recursive=True) @@ -35,26 +35,26 @@ def fake_read(path: str, *, length: int = None, offset: int = None): def test_moving_local_dir_to_dbfs(config, tmp_path, mocker): - from databricks.sdk import WorkspaceClient - from databricks.sdk.service.files import CreateResponse + from databricks.sdk.files.v2.client import DbfsClient + from databricks.sdk.files.v2.files import CreateResponse with (tmp_path / "a").open("wb") as f: f.write(b"hello") mocker.patch( - "databricks.sdk.service.files.DbfsAPI.create", + "databricks.sdk.files.v2.files.DbfsAPI.create", return_value=CreateResponse(123), ) get_status = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.get_status", + "databricks.sdk.files.v2.files.DbfsAPI.get_status", side_effect=NotFound(), ) - add_block = mocker.patch("databricks.sdk.service.files.DbfsAPI.add_block") - close = mocker.patch("databricks.sdk.service.files.DbfsAPI.close") + add_block = mocker.patch("databricks.sdk.files.v2.files.DbfsAPI.add_block") + close = mocker.patch("databricks.sdk.files.v2.files.DbfsAPI.close") - w = WorkspaceClient(config=config) - w.dbfs.move_(f"file:{tmp_path}", "a", recursive=True) + dc = DbfsClient(config=config) + dc.move_(f"file:{tmp_path}", "a", recursive=True) get_status.assert_called_with("a") close.assert_called_with(123) @@ -86,33 +86,33 @@ def test_fs_path_invalid(config): def test_dbfs_local_path_mkdir(config, tmp_path): - from databricks.sdk import WorkspaceClient + from databricks.sdk.files.v2.client import DbfsClient - w = WorkspaceClient(config=config) - w.dbfs._path(f"file:{tmp_path}/test_dir").mkdir() - assert w.dbfs.exists(f"file:{tmp_path}/test_dir") + dc = DbfsClient(config=config) + dc._path(f"file:{tmp_path}/test_dir").mkdir() + assert dc.exists(f"file:{tmp_path}/test_dir") def test_dbfs_exists(config, mocker): - from databricks.sdk import WorkspaceClient + from databricks.sdk.files.v2.client import DbfsClient get_status = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.get_status", + "databricks.sdk.files.v2.files.DbfsAPI.get_status", side_effect=NotFound(), ) - client = WorkspaceClient(config=config) - client.dbfs.exists("/abc/def/ghi") + client = DbfsClient(config=config) + client.exists("/abc/def/ghi") get_status.assert_called_with("/abc/def/ghi") def test_volume_exists(config, mocker): - from databricks.sdk import WorkspaceClient + from databricks.sdk.files.v2.client import DbfsClient - get_metadata = mocker.patch("databricks.sdk.service.files.FilesAPI.get_metadata") + get_metadata = mocker.patch("databricks.sdk.files.v2.files.FilesAPI.get_metadata") - client = WorkspaceClient(config=config) - client.dbfs.exists("/Volumes/abc/def/ghi") + client = DbfsClient(config=config) + client.exists("/Volumes/abc/def/ghi") get_metadata.assert_called_with("/Volumes/abc/def/ghi") diff --git a/tests/test_dbutils.py b/tests/test_dbutils.py index 7c0933b2d..55ad76d85 100644 --- a/tests/test_dbutils.py +++ b/tests/test_dbutils.py @@ -1,7 +1,7 @@ import pytest as pytest from databricks.sdk.databricks.dbutils import FileInfo as DBUtilsFileInfo -from databricks.sdk.service.files import FileInfo, ReadResponse +from databricks.sdk.files.v2.files import FileInfo, ReadResponse from .conftest import raises @@ -14,7 +14,7 @@ def dbutils(config): def test_fs_cp(dbutils, mocker): - inner = mocker.patch("databricks.sdk.mixins.files.DbfsExt.copy") + inner = mocker.patch("databricks.sdk.files.v2.mixin.DbfsExt.copy") dbutils.fs.cp("a", "b", recurse=True) @@ -23,11 +23,11 @@ def test_fs_cp(dbutils, mocker): def test_fs_head(dbutils, mocker): inner = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.read", + "databricks.sdk.files.v2.files.DbfsAPI.read", return_value=ReadResponse(data="aGVsbG8=", bytes_read=5), ) inner2 = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.get_status", + "databricks.sdk.files.v2.files.DbfsAPI.get_status", return_value=FileInfo(path="a", is_dir=False, file_size=5), ) @@ -40,14 +40,14 @@ def test_fs_head(dbutils, mocker): def test_fs_ls(dbutils, mocker): inner = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.list", + "databricks.sdk.files.v2.files.DbfsAPI.list", return_value=[ FileInfo(path="a/b", file_size=10, modification_time=20), FileInfo(path="a/c", file_size=30, modification_time=40), ], ) inner2 = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.get_status", + "databricks.sdk.files.v2.files.DbfsAPI.get_status", side_effect=[ FileInfo(path="a", is_dir=True, file_size=5), FileInfo(path="a/b", is_dir=False, file_size=5), @@ -64,7 +64,7 @@ def test_fs_ls(dbutils, mocker): def test_fs_mkdirs(dbutils, mocker): - inner = mocker.patch("databricks.sdk.service.files.DbfsAPI.mkdirs") + inner = mocker.patch("databricks.sdk.files.v2.files.DbfsAPI.mkdirs") dbutils.fs.mkdirs("a") @@ -72,7 +72,7 @@ def test_fs_mkdirs(dbutils, mocker): def test_fs_mv(dbutils, mocker): - inner = mocker.patch("databricks.sdk.mixins.files.DbfsExt.move_") + inner = mocker.patch("databricks.sdk.files.v2.mixin.DbfsExt.move_") dbutils.fs.mv("a", "b") @@ -94,7 +94,7 @@ def write(self, contents): self._written = contents mock_open = _MockOpen() - inner = mocker.patch("databricks.sdk.mixins.files.DbfsExt.open", return_value=mock_open) + inner = mocker.patch("databricks.sdk.files.v2.mixin.DbfsExt.open", return_value=mock_open) dbutils.fs.put("a", "b") @@ -103,9 +103,9 @@ def write(self, contents): def test_fs_rm(dbutils, mocker): - inner = mocker.patch("databricks.sdk.service.files.DbfsAPI.delete") + inner = mocker.patch("databricks.sdk.files.v2.files.DbfsAPI.delete") inner2 = mocker.patch( - "databricks.sdk.service.files.DbfsAPI.get_status", + "databricks.sdk.files.v2.files.DbfsAPI.get_status", return_value=FileInfo(path="a", is_dir=False, file_size=5), ) @@ -118,136 +118,136 @@ def test_fs_rm(dbutils, mocker): def test_fs_mount_without_cluster_fails(dbutils): dbutils.fs.mount("s3://foo", "bar") - -@pytest.fixture -def dbutils_proxy(mocker): - from databricks.sdk.databricks.core import Config - from databricks.sdk.databricks.dbutils import RemoteDbUtils - from databricks.sdk.service._internal import Wait - from databricks.sdk.service.compute import (ClusterDetails, CommandStatus, - CommandStatusResponse, Created, - Language, Results, State) - - from .conftest import noop_credentials - - cluster_get = mocker.patch( - "databricks.sdk.service.compute.ClustersAPI.get", - return_value=ClusterDetails(state=State.RUNNING), - ) - context_create = mocker.patch( - "databricks.sdk.service.compute.CommandExecutionAPI.create", - return_value=Wait(lambda **kwargs: Created("y")), - ) - - def inner(results_data: any, expect_command: str): - import json - - command_execute = mocker.patch( - "databricks.sdk.service.compute.CommandExecutionAPI.execute", - return_value=Wait( - lambda **kwargs: CommandStatusResponse( - results=Results(data=json.dumps(results_data)), - status=CommandStatus.FINISHED, - ) - ), - ) - - def assertions(): - cluster_get.assert_called_with("x") - context_create.assert_called_with(cluster_id="x", language=Language.PYTHON) - command_execute.assert_called_with( - cluster_id="x", - context_id="y", - language=Language.PYTHON, - command=expect_command, - ) - - dbutils = RemoteDbUtils( - Config( - host="http://localhost", - cluster_id="x", - credentials_strategy=noop_credentials, - ) - ) - return dbutils, assertions - - return inner - - -def test_fs_mount(dbutils_proxy): - command = ( - "\n" - " import json\n" - ' (args, kwargs) = json.loads(\'[["s3://foo", "bar"], {}]\')\n' - " result = dbutils.fs.mount(*args, **kwargs)\n" - " dbutils.notebook.exit(json.dumps(result))\n" - " " - ) - dbutils, assertions = dbutils_proxy({}, command) - - dbutils.fs.mount("s3://foo", "bar") - - assertions() - - -def test_fs_update_mount(dbutils_proxy): - command = ( - "\n" - " import json\n" - ' (args, kwargs) = json.loads(\'[["s3://foo2", "bar"], {}]\')\n' - " result = dbutils.fs.updateMount(*args, **kwargs)\n" - " dbutils.notebook.exit(json.dumps(result))\n" - " " - ) - dbutils, assertions = dbutils_proxy({}, command) - - dbutils.fs.updateMount("s3://foo2", "bar") - - assertions() - - -def test_fs_mounts(dbutils_proxy): - command = ( - "\n" - " import json\n" - " (args, kwargs) = json.loads('[[], {}]')\n" - " result = dbutils.fs.mounts(*args, **kwargs)\n" - " dbutils.notebook.exit(json.dumps(result))\n" - " " - ) - dbutils, assertions = dbutils_proxy( - [ - ("a", "b", "c"), - ("d", "e", "f"), - ], - command, - ) - - mounts = dbutils.fs.mounts() - - assert len(mounts) == 2 - assert mounts[0].mountPoint == "a" - assert mounts[0].source == "b" - - assertions() - - -def test_any_proxy(dbutils_proxy): - command = ( - "\n" - " import json\n" - " (args, kwargs) = json.loads('[[\"a\"], {}]')\n" - " result = dbutils.notebook.exit(*args, **kwargs)\n" - " dbutils.notebook.exit(json.dumps(result))\n" - " " - ) - dbutils, assertions = dbutils_proxy("a", command) - - param = dbutils.notebook.exit("a") - - assert param == "a" - - assertions() +# TODO: Re-enable this test after adding waiters to the SDK +# @pytest.fixture +# def dbutils_proxy(mocker): +# from databricks.sdk.databricks.core import Config +# from databricks.sdk.databricks.dbutils import RemoteDbUtils +# from databricks.sdk.service._internal import Wait +# from databricks.sdk.service.compute import (ClusterDetails, CommandStatus, +# CommandStatusResponse, Created, +# Language, Results, State) + +# from .conftest import noop_credentials + +# cluster_get = mocker.patch( +# "databricks.sdk.service.compute.ClustersAPI.get", +# return_value=ClusterDetails(state=State.RUNNING), +# ) +# context_create = mocker.patch( +# "databricks.sdk.service.compute.CommandExecutionAPI.create", +# return_value=Wait(lambda **kwargs: Created("y")), +# ) + +# def inner(results_data: any, expect_command: str): +# import json + +# command_execute = mocker.patch( +# "databricks.sdk.service.compute.CommandExecutionAPI.execute", +# return_value=Wait( +# lambda **kwargs: CommandStatusResponse( +# results=Results(data=json.dumps(results_data)), +# status=CommandStatus.FINISHED, +# ) +# ), +# ) + +# def assertions(): +# cluster_get.assert_called_with("x") +# context_create.assert_called_with(cluster_id="x", language=Language.PYTHON) +# command_execute.assert_called_with( +# cluster_id="x", +# context_id="y", +# language=Language.PYTHON, +# command=expect_command, +# ) + +# dbutils = RemoteDbUtils( +# Config( +# host="http://localhost", +# cluster_id="x", +# credentials_strategy=noop_credentials, +# ) +# ) +# return dbutils, assertions + +# return inner + + +# def test_fs_mount(dbutils_proxy): +# command = ( +# "\n" +# " import json\n" +# ' (args, kwargs) = json.loads(\'[["s3://foo", "bar"], {}]\')\n' +# " result = dbutils.fs.mount(*args, **kwargs)\n" +# " dbutils.notebook.exit(json.dumps(result))\n" +# " " +# ) +# dbutils, assertions = dbutils_proxy({}, command) + +# dbutils.fs.mount("s3://foo", "bar") + +# assertions() + + +# def test_fs_update_mount(dbutils_proxy): +# command = ( +# "\n" +# " import json\n" +# ' (args, kwargs) = json.loads(\'[["s3://foo2", "bar"], {}]\')\n' +# " result = dbutils.fs.updateMount(*args, **kwargs)\n" +# " dbutils.notebook.exit(json.dumps(result))\n" +# " " +# ) +# dbutils, assertions = dbutils_proxy({}, command) + +# dbutils.fs.updateMount("s3://foo2", "bar") + +# assertions() + + +# def test_fs_mounts(dbutils_proxy): +# command = ( +# "\n" +# " import json\n" +# " (args, kwargs) = json.loads('[[], {}]')\n" +# " result = dbutils.fs.mounts(*args, **kwargs)\n" +# " dbutils.notebook.exit(json.dumps(result))\n" +# " " +# ) +# dbutils, assertions = dbutils_proxy( +# [ +# ("a", "b", "c"), +# ("d", "e", "f"), +# ], +# command, +# ) + +# mounts = dbutils.fs.mounts() + +# assert len(mounts) == 2 +# assert mounts[0].mountPoint == "a" +# assert mounts[0].source == "b" + +# assertions() + + +# def test_any_proxy(dbutils_proxy): +# command = ( +# "\n" +# " import json\n" +# " (args, kwargs) = json.loads('[[\"a\"], {}]')\n" +# " result = dbutils.notebook.exit(*args, **kwargs)\n" +# " dbutils.notebook.exit(json.dumps(result))\n" +# " " +# ) +# dbutils, assertions = dbutils_proxy("a", command) + +# param = dbutils.notebook.exit("a") + +# assert param == "a" + +# assertions() def test_secrets_get_and_redacting_logs(dbutils, mocker): diff --git a/tests/test_files.py b/tests/test_files.py index fad7c2215..afcc3ca6d 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -18,7 +18,7 @@ import requests_mock from requests import RequestException -from databricks.sdk import WorkspaceClient +from databricks.sdk.files.v2.client import FilesClient from databricks.sdk.databricks.core import Config from databricks.sdk.databricks.errors.platform import (AlreadyExists, BadRequest, @@ -68,12 +68,12 @@ def run(self, config: Config): config.files_api_client_download_max_total_recovers = self.max_recovers_total config.files_api_client_download_max_total_recovers_without_progressing = self.max_recovers_without_progressing - w = WorkspaceClient(config=config) + fc = FilesClient(config=config) session = MockSession(self) - w.files._api._api_client._session = session + fc._api._api_client._session = session - response = w.files.download("/test").contents + response = fc.download("/test").contents if self.expected_success: actual_content = response.read() assert len(actual_content) == len(session.content) @@ -862,12 +862,12 @@ def run(self, config: Config): upload_state = MultipartUploadServerState() try: - w = WorkspaceClient(config=config) + fc = FilesClient(config=config) with requests_mock.Mocker() as session_mock: self.setup_session_mock(session_mock, upload_state) def upload(): - w.files.upload("/test.txt", io.BytesIO(file_content), overwrite=True) + fc.upload("/test.txt", io.BytesIO(file_content), overwrite=True) if self.expected_exception_type is not None: with pytest.raises(self.expected_exception_type): @@ -1321,11 +1321,11 @@ def custom_matcher(request): session_mock.add_matcher(matcher=custom_matcher) - w = WorkspaceClient(config=config) - w.files._api._api_client._session = session + fc = FilesClient(config=config) + fc._api._api_client._session = session def upload(): - w.files.upload("/test.txt", io.BytesIO(file_content), overwrite=True) + fc.upload("/test.txt", io.BytesIO(file_content), overwrite=True) if self.expected_single_shot: upload() @@ -1633,10 +1633,10 @@ def run(self, config: Config): try: with requests_mock.Mocker() as session_mock: self.setup_session_mock(session_mock, upload_state) - w = WorkspaceClient(config=config) + fc = FilesClient(config=config) def upload(): - w.files.upload("/test.txt", io.BytesIO(file_content), overwrite=self.overwrite) + fc.upload("/test.txt", io.BytesIO(file_content), overwrite=self.overwrite) if self.expected_exception_type is not None: with pytest.raises(self.expected_exception_type): diff --git a/tests/test_jobs_mixin.py b/tests/test_jobs_mixin.py index a9039146c..cc15239c7 100644 --- a/tests/test_jobs_mixin.py +++ b/tests/test_jobs_mixin.py @@ -2,7 +2,7 @@ import re from typing import Optional, Pattern -from databricks.sdk import WorkspaceClient +from databricks.sdk.jobs.v2.client import JobsClient def make_getrun_path_pattern(run_id: int, page_token: Optional[str] = None) -> Pattern[str]: @@ -40,9 +40,9 @@ def test_get_run_with_no_pagination(config, requests_mock): "tasks": [{"run_id": 0}, {"run_id": 1}], } requests_mock.get(make_getrun_path_pattern(1337, "initialToken"), text=json.dumps(run1)) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) - run = w.jobs.get_run(1337, page_token="initialToken") + run = jc.get_run(1337, page_token="initialToken") assert run.as_dict() == { "tasks": [{"run_id": 0}, {"run_id": 1}], @@ -50,9 +50,9 @@ def test_get_run_with_no_pagination(config, requests_mock): def test_get_run_pagination_with_tasks(config, requests_mock): - from databricks.sdk.service import compute, jobs + from databricks.sdk.jobs.v2 import jobs - cluster_spec = compute.ClusterSpec( + cluster_spec = jobs.JobsClusterSpec( spark_version="11.3.x-scala2.12", custom_tags={"ResourceClass": "SingleNode"}, num_workers=0, @@ -90,9 +90,9 @@ def test_get_run_pagination_with_tasks(config, requests_mock): make_getrun_path_pattern(1337, "tokenToThirdPage"), text=json.dumps(run3), ) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) - run = w.jobs.get_run(1337, page_token="initialToken") + run = jc.get_run(1337, page_token="initialToken") assert run.as_dict() == { "tasks": [ @@ -139,9 +139,9 @@ def test_get_run_pagination_with_iterations(config, requests_mock): make_getrun_path_pattern(1337, "tokenToThirdPage"), text=json.dumps(run3), ) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) - run = w.jobs.get_run(1337, page_token="initialToken") + run = jc.get_run(1337, page_token="initialToken") assert run.as_dict() == { "tasks": [{"run_id": 1337}], @@ -162,9 +162,9 @@ def test_get_job_with_no_pagination(config, requests_mock): } } requests_mock.get(make_getjob_path_pattern(1337, "initialToken"), text=json.dumps(job1)) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) - job = w.jobs.get(1337, page_token="initialToken") + job = jc.get(1337, page_token="initialToken") assert job.as_dict() == { "settings": { @@ -174,9 +174,9 @@ def test_get_job_with_no_pagination(config, requests_mock): def test_get_job_pagination_with_tasks(config, requests_mock): - from databricks.sdk.service import compute, jobs + from databricks.sdk.jobs.v2 import jobs - cluster_spec = compute.ClusterSpec( + cluster_spec = jobs.JobsClusterSpec( spark_version="11.3.x-scala2.12", custom_tags={"ResourceClass": "SingleNode"}, num_workers=0, @@ -223,9 +223,9 @@ def test_get_job_pagination_with_tasks(config, requests_mock): make_getjob_path_pattern(1337, "tokenToThirdPage"), text=json.dumps(job3), ) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) - job = w.jobs.get(1337, page_token="initialToken") + job = jc.get(1337, page_token="initialToken") assert job.as_dict() == { "settings": { @@ -305,10 +305,10 @@ def test_list_jobs_without_task_expansion(config, requests_mock): make_listjobs_path_pattern("tokenToSecondPage"), text=json.dumps(listjobs_page2), ) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) # Converts the iterator to a list in order to compare the results - jobs_list = list(w.jobs.list(expand_tasks=False, page_token="initialToken")) + jobs_list = list(jc.list(expand_tasks=False, page_token="initialToken")) jobs_dict = [job.as_dict() for job in jobs_list] assert jobs_dict == [ @@ -349,9 +349,9 @@ def test_list_jobs_without_task_expansion(config, requests_mock): def test_list_jobs_with_many_tasks(config, requests_mock): - from databricks.sdk.service import compute, jobs + from databricks.sdk.jobs.v2 import jobs - cluster_spec = compute.ClusterSpec( + cluster_spec = jobs.JobsClusterSpec( spark_version="11.3.x-scala2.12", custom_tags={"ResourceClass": "SingleNode"}, num_workers=0, @@ -512,10 +512,10 @@ def test_list_jobs_with_many_tasks(config, requests_mock): make_getjob_path_pattern(400, "tokenToSecondPage_400"), text=json.dumps(getjob_400_page2), ) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) # Converts the iterator to a list in order to compare the results - jobs_list = list(w.jobs.list(expand_tasks=True, page_token="initialToken")) + jobs_list = list(jc.list(expand_tasks=True, page_token="initialToken")) jobs_dict = [job.as_dict() for job in jobs_list] assert jobs_dict == [ @@ -627,9 +627,9 @@ def test_list_runs_without_task_expansion(config, requests_mock): make_listruns_path_pattern("tokenToSecondPage"), text=json.dumps(listruns_page2), ) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) - runs_list = list(w.jobs.list_runs(expand_tasks=False, page_token="initialToken")) + runs_list = list(jc.list_runs(expand_tasks=False, page_token="initialToken")) runs_dict = [run.as_dict() for run in runs_list] assert runs_dict == [ @@ -732,9 +732,9 @@ def test_list_runs(config, requests_mock): make_getrun_path_pattern(400, "tokenToSecondPage_400"), text=json.dumps(getrun_400_page2), ) - w = WorkspaceClient(config=config) + jc = JobsClient(config=config) - runs_list = list(w.jobs.list_runs(expand_tasks=True, page_token="initialToken")) + runs_list = list(jc.list_runs(expand_tasks=True, page_token="initialToken")) runs_dict = [run.as_dict() for run in runs_list] assert runs_dict == [ diff --git a/tests/test_misc.py b/tests/test_misc.py index e614da32b..e8424ea68 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1,13 +1,11 @@ -from databricks.sdk.service import catalog - +from databricks.sdk.catalog.v2 import catalog +from databricks.sdk.jobs.v2 import jobs # https://github.com/databricks/databricks-sdk-py/issues/135 def test_issue_135(): - from databricks.sdk.service.compute import Library, PythonPyPiLibrary - from databricks.sdk.service.jobs import Task - jts = Task( - libraries=[Library(pypi=PythonPyPiLibrary(package="databricks-sdk"))], + jts = jobs.Task( + libraries=[jobs.Library(pypi=jobs.PythonPyPiLibrary(package="databricks-sdk"))], task_key="abc", ) @@ -19,12 +17,9 @@ def test_issue_135(): # https://github.com/databricks/databricks-sdk-py/issues/103 def test_issue_103(): - from databricks.sdk.service.compute import ClusterSpec - from databricks.sdk.service.jobs import JobCluster - - jc = JobCluster( + jc = jobs.JobCluster( job_cluster_key="no_worker", - new_cluster=ClusterSpec( + new_cluster=jobs.JobsClusterSpec( spark_version="11.3.x-scala2.12", custom_tags={"ResourceClass": "SingleNode"}, num_workers=0, diff --git a/tests/test_open_ai_mixin.py b/tests/test_open_ai_mixin.py index 457479140..188a900c3 100644 --- a/tests/test_open_ai_mixin.py +++ b/tests/test_open_ai_mixin.py @@ -4,16 +4,15 @@ import pytest from databricks.sdk.databricks.core import Config -from databricks.sdk.service.serving import ExternalFunctionRequestHttpMethod +from databricks.sdk.serving.v2.serving import ExternalFunctionRequestHttpMethod +from databricks.sdk.serving.v2.client import ServingEndpointsClient def test_open_ai_client(monkeypatch): - from databricks.sdk import WorkspaceClient - monkeypatch.setenv("DATABRICKS_HOST", "test_host") monkeypatch.setenv("DATABRICKS_TOKEN", "test_token") - w = WorkspaceClient(config=Config()) - client = w.serving_endpoints.get_open_ai_client() + sec = ServingEndpointsClient(config=Config()) + client = sec.get_open_ai_client() assert client.base_url == "https://test_host/serving-endpoints/" assert client.api_key == "no-token" @@ -21,18 +20,17 @@ def test_open_ai_client(monkeypatch): @pytest.mark.skipif(sys.version_info < (3, 8), reason="Requires Python > 3.7") def test_langchain_open_ai_client(monkeypatch): - from databricks.sdk import WorkspaceClient - monkeypatch.setenv("DATABRICKS_HOST", "test_host") monkeypatch.setenv("DATABRICKS_TOKEN", "test_token") - w = WorkspaceClient(config=Config()) - client = w.serving_endpoints.get_langchain_chat_open_ai_client("databricks-meta-llama-3-1-70b-instruct") + sec = ServingEndpointsClient(config=Config()) + client = sec.get_langchain_chat_open_ai_client("databricks-meta-llama-3-1-70b-instruct") assert client.openai_api_base == "https://test_host/serving-endpoints" assert client.model_name == "databricks-meta-llama-3-1-70b-instruct" def test_http_request(w, requests_mock): + sec = ServingEndpointsClient(config=w) headers = { "Accept": "text/plain", "Content-Type": "application/json", @@ -46,7 +44,7 @@ def test_http_request(w, requests_mock): content=blob_response.getvalue(), status_code=200, ) - response = w.serving_endpoints.http_request( + response = sec.http_request( conn="test_conn", method=ExternalFunctionRequestHttpMethod.GET, path="test_path", From 5f63a8ecd508299de36104c7bc454423e6902d5c Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Mon, 31 Mar 2025 08:33:32 +0000 Subject: [PATCH 12/20] make fmt --- databricks/sdk/__init__.py | 2 +- databricks/sdk/files/v2/client.py | 1 - databricks/sdk/files/v2/mixin.py | 2 +- tests/integration/test_clusters.py | 10 +++--- tests/integration/test_commands.py | 1 + tests/integration/test_data_plane.py | 1 - tests/integration/test_deployment.py | 1 + tests/integration/test_external_browser.py | 3 ++ tests/integration/test_files.py | 36 +++++++++++++++------- tests/integration/test_iam.py | 5 ++- tests/integration/test_jobs.py | 13 ++++---- tests/integration/test_repos.py | 2 ++ tests/integration/test_settings.py | 1 + tests/integration/test_sql.py | 5 +-- tests/test_client.py | 2 -- tests/test_core.py | 5 +-- tests/test_dbfs_mixins.py | 2 +- tests/test_dbutils.py | 1 + tests/test_files.py | 2 +- tests/test_misc.py | 1 + tests/test_open_ai_mixin.py | 2 +- 21 files changed, 59 insertions(+), 39 deletions(-) diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index 9367e9487..45d441480 100755 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -9,8 +9,8 @@ from databricks.sdk.databricks import azure from databricks.sdk.databricks.credentials_provider import CredentialsStrategy from databricks.sdk.databricks.data_plane import DataPlaneTokenSource -from databricks.sdk.files.v2.mixin import DbfsExt, FilesExt from databricks.sdk.files.v2.files import FilesAPI +from databricks.sdk.files.v2.mixin import DbfsExt, FilesExt _LOG = logging.getLogger(__name__) diff --git a/databricks/sdk/files/v2/client.py b/databricks/sdk/files/v2/client.py index f8c15a843..7b6fd8a37 100755 --- a/databricks/sdk/files/v2/client.py +++ b/databricks/sdk/files/v2/client.py @@ -6,7 +6,6 @@ import databricks.sdk.databricks.core as client from databricks.sdk.databricks.credentials_provider import CredentialsStrategy -from .files import FilesAPI from .mixin import DbfsExt, FilesExt _LOG = logging.getLogger(__name__) diff --git a/databricks/sdk/files/v2/mixin.py b/databricks/sdk/files/v2/mixin.py index 597024a21..c45014765 100644 --- a/databricks/sdk/files/v2/mixin.py +++ b/databricks/sdk/files/v2/mixin.py @@ -721,7 +721,7 @@ def download(self, file_path: str) -> DownloadResponse: if not self._config.enable_experimental_files_api_client: # Use the new Files API client for downloads return super().download(file_path) - + initial_response: DownloadResponse = self._open_download_stream( file_path=file_path, start_byte_offset=0, diff --git a/tests/integration/test_clusters.py b/tests/integration/test_clusters.py index 0808752ff..a11c595a8 100644 --- a/tests/integration/test_clusters.py +++ b/tests/integration/test_clusters.py @@ -1,11 +1,10 @@ -import logging -from datetime import timedelta import pytest -from databricks.sdk.databricks.core import DatabricksError -from databricks.sdk.compute.v2.client import ClustersClient from databricks.sdk.compute.v2 import compute +from databricks.sdk.compute.v2.client import ClustersClient +from databricks.sdk.databricks.core import DatabricksError + # from databricks.sdk.service.compute import EventType @@ -40,7 +39,7 @@ def test_ensure_cluster_is_running(w, env_or_skip): # def test_create_cluster(w, env_or_skip, random): # from databricks.sdk.compute.v2.client import ClustersClient # cc = ClustersClient(config=w) - + # info = cc.create( # cluster_name=f"databricks-sdk-py-{random(8)}", # spark_version=cc.select_spark_version(long_term_support=True), @@ -53,6 +52,7 @@ def test_ensure_cluster_is_running(w, env_or_skip): def test_error_unmarshall(w, random): from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient(config=w) with pytest.raises(DatabricksError) as exc_info: cc.get("123__non_existing__") diff --git a/tests/integration/test_commands.py b/tests/integration/test_commands.py index 1b2c87062..bc8f023c7 100644 --- a/tests/integration/test_commands.py +++ b/tests/integration/test_commands.py @@ -5,6 +5,7 @@ def test_error_unmarshall(w, random): from databricks.sdk.compute.v2.client import CommandExecutionClient + cec = CommandExecutionClient(config=w) with pytest.raises(DatabricksError) as exc_info: cec.execute(cluster_id="__non_existing__") diff --git a/tests/integration/test_data_plane.py b/tests/integration/test_data_plane.py index c1538a8d3..cba28da8e 100644 --- a/tests/integration/test_data_plane.py +++ b/tests/integration/test_data_plane.py @@ -1,4 +1,3 @@ -from databricks.sdk.databricks.data_plane import DataPlaneTokenSource # TODO: Re-enable this after adding data plane services to the SDK # def test_data_plane_token_source(ucws, env_or_skip): diff --git a/tests/integration/test_deployment.py b/tests/integration/test_deployment.py index 2b168c828..9ec6e1c32 100644 --- a/tests/integration/test_deployment.py +++ b/tests/integration/test_deployment.py @@ -5,6 +5,7 @@ def test_workspaces(a): from databricks.sdk.provisioning.v2.client import WorkspacesClient + wc = WorkspacesClient(config=a) if a.is_azure: pytest.skip("not available on Azure") diff --git a/tests/integration/test_external_browser.py b/tests/integration/test_external_browser.py index 68f7b4778..acbc33cff 100644 --- a/tests/integration/test_external_browser.py +++ b/tests/integration/test_external_browser.py @@ -12,6 +12,7 @@ def env(env_or_skip): def test_pkce_app(env): from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient( host=env("DATABRICKS_HOST"), client_id=env("TEST_PKCE_APP_CLIENT_ID"), @@ -24,6 +25,7 @@ def test_pkce_app(env): def test_public_app(env): from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient( host=env("DATABRICKS_HOST"), client_id=env("TEST_PUBLIC_APP_CLIENT_ID"), @@ -36,6 +38,7 @@ def test_public_app(env): def test_private_app(env): from databricks.sdk.compute.v2.client import ClustersClient + cc = ClustersClient( host=env("DATABRICKS_HOST"), client_id=env("TEST_PRIVATE_APP_CLIENT_ID"), diff --git a/tests/integration/test_files.py b/tests/integration/test_files.py index 42e3b35e4..a52a12076 100644 --- a/tests/integration/test_files.py +++ b/tests/integration/test_files.py @@ -41,7 +41,9 @@ def test_dbfs_io(w, random): @pytest.fixture def junk(w, random): from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + def inner(path: str, size=256) -> bytes: to_write = random(size).encode() with dc.open(path, write=True) as f: @@ -55,7 +57,9 @@ def inner(path: str, size=256) -> bytes: @pytest.fixture def ls(w): from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) + def inner(root: str, recursive=False) -> List[str]: return [f.path.removeprefix(root) for f in dc.list(root, recursive=recursive)] @@ -72,6 +76,7 @@ def test_recursive_listing(w, random, junk, ls): assert ["/01", "/a/02", "/a/b/03"] == ls(root, recursive=True) from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) dc.delete(root, recursive=True) @@ -84,8 +89,9 @@ def test_cp_dbfs_folder_to_folder_non_recursive(w, random, junk, ls): new_root = f"/tmp/{random()}" from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) - + dc.copy(root, new_root) assert ["/01"] == ls(new_root, recursive=True) @@ -99,6 +105,7 @@ def test_cp_dbfs_folder_to_folder_recursive(w, random, junk, ls): new_root = f"/tmp/{random()}" from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) dc.copy(root, new_root, recursive=True, overwrite=True) @@ -114,8 +121,9 @@ def test_cp_dbfs_folder_to_existing_folder_recursive(w, random, junk, ls): new_root = f"/tmp/{random()}" from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) - + dc.mkdirs(new_root) dc.copy(root, new_root, recursive=True, overwrite=True) @@ -129,8 +137,9 @@ def test_cp_dbfs_file_to_non_existing_location(w, random, junk): copy_destination = f"{root}/{random()}" from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) - + dc.copy(f"{root}/01", copy_destination) with dc.open(copy_destination, read=True) as f: @@ -140,10 +149,11 @@ def test_cp_dbfs_file_to_non_existing_location(w, random, junk): def test_cp_dbfs_file_to_existing_folder(w, random, junk): root = f"/tmp/{random()}" payload = junk(f"{root}/01") - + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) - + dc.mkdirs(f"{root}/02") dc.copy(f"{root}/01", f"{root}/02") @@ -155,8 +165,9 @@ def test_cp_dbfs_file_to_existing_location(w, random, junk): root = f"/tmp/{random()}" junk(f"{root}/01") junk(f"{root}/02") - + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) with pytest.raises(DatabricksError) as ei: @@ -170,8 +181,9 @@ def test_cp_dbfs_file_to_existing_location_with_overwrite(w, random, junk): junk(f"{root}/02") from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) - + dc.copy(f"{root}/01", f"{root}/02", overwrite=True) with dc.open(f"{root}/02", read=True) as f: @@ -183,6 +195,7 @@ def test_move_within_dbfs(w, random, junk): payload = junk(f"{root}/01") from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) dc.move_(f"{root}/01", f"{root}/02") @@ -197,8 +210,9 @@ def test_move_from_dbfs_to_local(w, random, junk, tmp_path): payload_01 = junk(f"{root}/01") payload_02 = junk(f"{root}/a/02") payload_03 = junk(f"{root}/a/b/03") - + from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) dc.move_(root, f"file:{tmp_path}", recursive=True) @@ -217,8 +231,9 @@ def test_dbfs_upload_download(w, random, junk, tmp_path): f = io.BytesIO(b"some text data") from databricks.sdk.files.v2.client import DbfsClient + dc = DbfsClient(config=w) - + dc.upload(f"{root}/01", f) with dc.download(f"{root}/01") as f: @@ -242,11 +257,10 @@ def create_schema(w, catalog, schema): res = w.schemas.create(catalog_name=catalog, name=schema) return ResourceWithCleanup(lambda: w.schemas.delete(res.full_name)) - @staticmethod def create_volume(w, catalog, schema, volume): - from databricks.sdk.catalog.v2.client import VolumesClient from databricks.sdk.catalog.v2.catalog import VolumeType + from databricks.sdk.catalog.v2.client import VolumesClient vc = VolumesClient(config=w) res = vc.create( diff --git a/tests/integration/test_iam.py b/tests/integration/test_iam.py index 575e09db4..d2c875756 100644 --- a/tests/integration/test_iam.py +++ b/tests/integration/test_iam.py @@ -2,8 +2,7 @@ from databricks.sdk.databricks import errors from databricks.sdk.databricks.core import DatabricksError -from databricks.sdk.iam.v2.client import GroupsClient -from databricks.sdk.iam.v2.client import UsersClient +from databricks.sdk.iam.v2.client import GroupsClient, UsersClient def test_filtering_groups(w, random): @@ -25,7 +24,7 @@ def test_scim_error_unmarshall(w, random): def test_scim_get_user_as_dict(w): uc = UsersClient(config=w) - + first_user = next(uc.list()) user = uc.get(first_user.id) # should not throw diff --git a/tests/integration/test_jobs.py b/tests/integration/test_jobs.py index f1365b379..d6e835898 100644 --- a/tests/integration/test_jobs.py +++ b/tests/integration/test_jobs.py @@ -1,14 +1,13 @@ -import datetime import logging -from databricks.sdk.jobs.v2.client import JobsClient -from databricks.sdk.iam.v2.client import CurrentUserClient -from databricks.sdk.files.v2.client import DbfsClient + from databricks.sdk.compute.v2.client import ClustersClient +from databricks.sdk.jobs.v2.client import JobsClient + def test_jobs(w): found = 0 jc = JobsClient(config=w) - + for job in jc.list(): logging.info(f"Looking at {job.settings.name}") found += 1 @@ -23,7 +22,7 @@ def test_jobs(w): # cuc = CurrentUserClient(config=w) # jc = JobsClient(config=w) # dc = DbfsClient(config=w) - + # py_on_dbfs = f"/home/{cuc.me().user_name}/sample.py" # with dc.open(py_on_dbfs, write=True, overwrite=True) as f: # f.write(b'import time; time.sleep(10); print("Hello, World!")') @@ -95,7 +94,7 @@ def test_create_job(w): jc = JobsClient(config=w) cc = ClustersClient(config=w) - + cluster = jobs.JobCluster( job_cluster_key="cluster1", new_cluster=jobs.JobsClusterSpec( diff --git a/tests/integration/test_repos.py b/tests/integration/test_repos.py index ea56cd320..9c50995c5 100644 --- a/tests/integration/test_repos.py +++ b/tests/integration/test_repos.py @@ -1,6 +1,8 @@ import logging + from databricks.sdk.workspace.v2.client import ReposClient + def test_repos_list(w): rc = ReposClient(config=w) for repo in rc.list(): diff --git a/tests/integration/test_settings.py b/tests/integration/test_settings.py index 572a34a40..8b7c8fb97 100644 --- a/tests/integration/test_settings.py +++ b/tests/integration/test_settings.py @@ -1,5 +1,6 @@ from databricks.sdk.settings.v2.client import WorkspaceConfClient + def test_workspace_conf(w): wcc = WorkspaceConfClient(config=w) wcc.set_status({"enableResultsDownloading": "false"}) diff --git a/tests/integration/test_sql.py b/tests/integration/test_sql.py index 5636b0ff2..7a42d6a39 100644 --- a/tests/integration/test_sql.py +++ b/tests/integration/test_sql.py @@ -1,7 +1,8 @@ from datetime import datetime -from databricks.sdk.sql.v2.client import QueryHistoryClient from databricks.sdk.sql.v2 import sql +from databricks.sdk.sql.v2.client import QueryHistoryClient + def test_query_history_list_with_filter(w): @@ -9,7 +10,7 @@ def date_to_ms(date): return int(datetime.strptime(date, "%Y-%m-%d").timestamp() * 1000) qhc = QueryHistoryClient(config=w) - + filter = sql.QueryFilter( query_start_time_range=sql.TimeRange( start_time_ms=date_to_ms("2023-01-01"), diff --git a/tests/test_client.py b/tests/test_client.py index f5b0b35e1..1ae86717b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,6 +1,4 @@ -from unittest.mock import create_autospec -import pytest # from databricks.sdk import WorkspaceClient diff --git a/tests/test_core.py b/tests/test_core.py index b161a27d2..2db75fc4c 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -287,6 +287,7 @@ def test_access_control_list(config, requests_mock): from databricks.sdk.jobs.v2.client import JobsClient from databricks.sdk.jobs.v2.jobs import JobAccessControlRequest + jc = JobsClient(config=config) res = jc.create(access_control_list=[JobAccessControlRequest(group_name="group")]) @@ -302,7 +303,7 @@ def test_shares(config, requests_mock): ) from databricks.sdk.sharing.v2.client import SharesClient from databricks.sdk.sharing.v2.sharing import PermissionsChange - + sc = SharesClient(config=config) res = sc.update_permissions(name="jobId", changes=[PermissionsChange(principal="principal")]) @@ -318,7 +319,7 @@ def test_deletes(config, requests_mock): text="null", ) from databricks.sdk.sql.v2.client import AlertsClient - + ac = AlertsClient(config=config) res = ac.delete(id="alertId") diff --git a/tests/test_dbfs_mixins.py b/tests/test_dbfs_mixins.py index 38afc9177..b8fbea0b6 100644 --- a/tests/test_dbfs_mixins.py +++ b/tests/test_dbfs_mixins.py @@ -2,7 +2,7 @@ from databricks.sdk.databricks.errors import NotFound from databricks.sdk.files.v2.mixin import (DbfsExt, _DbfsPath, _LocalPath, - _VolumesPath) + _VolumesPath) def test_moving_dbfs_file_to_local_dir(config, tmp_path, mocker): diff --git a/tests/test_dbutils.py b/tests/test_dbutils.py index 55ad76d85..53faad3d4 100644 --- a/tests/test_dbutils.py +++ b/tests/test_dbutils.py @@ -118,6 +118,7 @@ def test_fs_rm(dbutils, mocker): def test_fs_mount_without_cluster_fails(dbutils): dbutils.fs.mount("s3://foo", "bar") + # TODO: Re-enable this test after adding waiters to the SDK # @pytest.fixture # def dbutils_proxy(mocker): diff --git a/tests/test_files.py b/tests/test_files.py index afcc3ca6d..3d60a7029 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -18,13 +18,13 @@ import requests_mock from requests import RequestException -from databricks.sdk.files.v2.client import FilesClient from databricks.sdk.databricks.core import Config from databricks.sdk.databricks.errors.platform import (AlreadyExists, BadRequest, InternalError, PermissionDenied, TooManyRequests) +from databricks.sdk.files.v2.client import FilesClient logger = logging.getLogger(__name__) diff --git a/tests/test_misc.py b/tests/test_misc.py index e8424ea68..47b2cb067 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1,6 +1,7 @@ from databricks.sdk.catalog.v2 import catalog from databricks.sdk.jobs.v2 import jobs + # https://github.com/databricks/databricks-sdk-py/issues/135 def test_issue_135(): diff --git a/tests/test_open_ai_mixin.py b/tests/test_open_ai_mixin.py index 188a900c3..c685c682d 100644 --- a/tests/test_open_ai_mixin.py +++ b/tests/test_open_ai_mixin.py @@ -4,8 +4,8 @@ import pytest from databricks.sdk.databricks.core import Config -from databricks.sdk.serving.v2.serving import ExternalFunctionRequestHttpMethod from databricks.sdk.serving.v2.client import ServingEndpointsClient +from databricks.sdk.serving.v2.serving import ExternalFunctionRequestHttpMethod def test_open_ai_client(monkeypatch): From ae88ab312ac7713cd311f68c0970c95853fcdfea Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Mon, 31 Mar 2025 10:02:44 +0000 Subject: [PATCH 13/20] fix tests --- tests/integration/test_clusters.py | 10 ++-- tests/integration/test_dbutils.py | 27 ++++++---- tests/integration/test_files.py | 31 ++--------- tests/integration/test_iam.py | 48 ++++++++--------- tests/integration/test_workspace.py | 80 ++++++++++++++++++----------- 5 files changed, 97 insertions(+), 99 deletions(-) diff --git a/tests/integration/test_clusters.py b/tests/integration/test_clusters.py index a11c595a8..73a02f369 100644 --- a/tests/integration/test_clusters.py +++ b/tests/integration/test_clusters.py @@ -28,11 +28,11 @@ def test_cluster_events(w, env_or_skip): count += 1 assert count > 0 - -def test_ensure_cluster_is_running(w, env_or_skip): - cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") - cc = ClustersClient(config=w) - cc.ensure_cluster_is_running(cluster_id) +# TODO: Re-enable this test after adding waiters to the SDK +# def test_ensure_cluster_is_running(w, env_or_skip): +# cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") +# cc = ClustersClient(config=w) +# cc.ensure_cluster_is_running(cluster_id) # TODO: Re-enable this test after adding LRO support to the SDK diff --git a/tests/integration/test_dbutils.py b/tests/integration/test_dbutils.py index 0bf5ab4f5..f7d92ba9b 100644 --- a/tests/integration/test_dbutils.py +++ b/tests/integration/test_dbutils.py @@ -6,6 +6,7 @@ from databricks.sdk.databricks.core import DatabricksError from databricks.sdk.databricks.errors import NotFound +from databricks.sdk.databricks.dbutils import RemoteDbUtils def test_rest_dbfs_ls(w, env_or_skip): @@ -15,13 +16,15 @@ def test_rest_dbfs_ls(w, env_or_skip): assert len(x) > 1 +# TODO: Re-enable this test after adding waiters to the SDK +# def test_proxy_dbfs_mounts(w, env_or_skip): + +# w.cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") -def test_proxy_dbfs_mounts(w, env_or_skip): - w.config.cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") +# dbu = RemoteDbUtils(config=w) +# x = dbu.fs.mounts() - x = w.dbutils.fs.mounts() - - assert len(x) > 1 +# assert len(x) > 1 @pytest.fixture(params=["dbfs", "volumes"]) @@ -54,8 +57,9 @@ def test_large_put(fs_and_base_path): def test_put_local_path(w, random, tmp_path): to_write = random(1024 * 1024 * 2) tmp_path = tmp_path / "tmp_file" - w.dbutils.fs.put(f"file:{tmp_path}", to_write, True) - assert w.dbutils.fs.head(f"file:{tmp_path}", 1024 * 1024 * 2) == to_write + dbu = RemoteDbUtils(config=w) + dbu.fs.put(f"file:{tmp_path}", to_write, True) + assert dbu.fs.head(f"file:{tmp_path}", 1024 * 1024 * 2) == to_write def test_cp_file(fs_and_base_path, random): @@ -184,9 +188,12 @@ def test_secrets(w, random): logger = logging.getLogger("foo") logger.info(f"Before loading secret: {random_value}") - w.secrets.create_scope(random_scope) - w.secrets.put_secret(random_scope, key_for_string, string_value=random_value) - w.secrets.put_secret( + from databricks.sdk.workspace.v2.client import SecretsClient + + sc = SecretsClient(config=w) + sc.create_scope(random_scope) + sc.put_secret(random_scope, key_for_string, string_value=random_value) + sc.put_secret( random_scope, key_for_bytes, bytes_value=base64.b64encode(random_value.encode()).decode(), diff --git a/tests/integration/test_files.py b/tests/integration/test_files.py index a52a12076..567ef1e57 100644 --- a/tests/integration/test_files.py +++ b/tests/integration/test_files.py @@ -8,7 +8,7 @@ import pytest from databricks.sdk.databricks.core import DatabricksError - +from databricks.sdk.files.v2.client import DbfsClient def test_local_io(random): if platform.system() == "Windows": @@ -28,11 +28,12 @@ def test_local_io(random): def test_dbfs_io(w, random): dummy_file = f"/tmp/{random()}" to_write = random(1024 * 1024 * 1.5).encode() - with w.dbfs.open(dummy_file, write=True) as f: + dc = DbfsClient(config=w) + with dc.open(dummy_file, write=True) as f: written = f.write(to_write) assert len(to_write) == written - f = w.dbfs.open(dummy_file, read=True) + f = dc.open(dummy_file, read=True) from_dbfs = f.read() assert from_dbfs == to_write f.close() @@ -40,8 +41,6 @@ def test_dbfs_io(w, random): @pytest.fixture def junk(w, random): - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) def inner(path: str, size=256) -> bytes: @@ -56,8 +55,6 @@ def inner(path: str, size=256) -> bytes: @pytest.fixture def ls(w): - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) def inner(root: str, recursive=False) -> List[str]: @@ -88,8 +85,6 @@ def test_cp_dbfs_folder_to_folder_non_recursive(w, random, junk, ls): junk(f"{root}/a/b/03") new_root = f"/tmp/{random()}" - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.copy(root, new_root) @@ -104,8 +99,6 @@ def test_cp_dbfs_folder_to_folder_recursive(w, random, junk, ls): junk(f"{root}/a/b/03") new_root = f"/tmp/{random()}" - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.copy(root, new_root, recursive=True, overwrite=True) @@ -120,8 +113,6 @@ def test_cp_dbfs_folder_to_existing_folder_recursive(w, random, junk, ls): junk(f"{root}/a/b/03") new_root = f"/tmp/{random()}" - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.mkdirs(new_root) @@ -136,8 +127,6 @@ def test_cp_dbfs_file_to_non_existing_location(w, random, junk): payload = junk(f"{root}/01") copy_destination = f"{root}/{random()}" - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.copy(f"{root}/01", copy_destination) @@ -150,8 +139,6 @@ def test_cp_dbfs_file_to_existing_folder(w, random, junk): root = f"/tmp/{random()}" payload = junk(f"{root}/01") - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.mkdirs(f"{root}/02") @@ -166,8 +153,6 @@ def test_cp_dbfs_file_to_existing_location(w, random, junk): junk(f"{root}/01") junk(f"{root}/02") - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) with pytest.raises(DatabricksError) as ei: @@ -180,8 +165,6 @@ def test_cp_dbfs_file_to_existing_location_with_overwrite(w, random, junk): payload = junk(f"{root}/01") junk(f"{root}/02") - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.copy(f"{root}/01", f"{root}/02", overwrite=True) @@ -194,8 +177,6 @@ def test_move_within_dbfs(w, random, junk): root = f"/tmp/{random()}" payload = junk(f"{root}/01") - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.move_(f"{root}/01", f"{root}/02") @@ -211,8 +192,6 @@ def test_move_from_dbfs_to_local(w, random, junk, tmp_path): payload_02 = junk(f"{root}/a/02") payload_03 = junk(f"{root}/a/b/03") - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.move_(root, f"file:{tmp_path}", recursive=True) @@ -230,8 +209,6 @@ def test_dbfs_upload_download(w, random, junk, tmp_path): root = pathlib.Path(f"/tmp/{random()}") f = io.BytesIO(b"some text data") - from databricks.sdk.files.v2.client import DbfsClient - dc = DbfsClient(config=w) dc.upload(f"{root}/01", f) diff --git a/tests/integration/test_iam.py b/tests/integration/test_iam.py index d2c875756..d0c60ec1c 100644 --- a/tests/integration/test_iam.py +++ b/tests/integration/test_iam.py @@ -2,7 +2,9 @@ from databricks.sdk.databricks import errors from databricks.sdk.databricks.core import DatabricksError -from databricks.sdk.iam.v2.client import GroupsClient, UsersClient +from databricks.sdk.iam.v2.client import AccountGroupsClient, AccountUsersClient, AccountServicePrincipalsClient +from databricks.sdk.iam.v2.client import GroupsClient, UsersClient, ServicePrincipalsClient +from databricks.sdk.databricks.core import ApiClient def test_filtering_groups(w, random): @@ -32,44 +34,36 @@ def test_scim_get_user_as_dict(w): @pytest.mark.parametrize( - "path,call", + "client_class,path,count", [ - ("/api/2.0/preview/scim/v2/Users", lambda w: w.users.list(count=10)), - ("/api/2.0/preview/scim/v2/Groups", lambda w: w.groups.list(count=4)), - ( - "/api/2.0/preview/scim/v2/ServicePrincipals", - lambda w: w.service_principals.list(count=1), - ), + (UsersClient, "/api/2.0/preview/scim/v2/Users", 10), + (GroupsClient, "/api/2.0/preview/scim/v2/Groups", 40), + (ServicePrincipalsClient, "/api/2.0/preview/scim/v2/ServicePrincipals", 10), ], ) -def test_workspace_users_list_pagination(w, path, call): - raw = w.api_client.do("GET", path) +def test_workspace_users_list_pagination(w, client_class, path, count): + client = client_class(config=w) + api_client = ApiClient(cfg=w) + raw = api_client.do("GET", path) total = raw["totalResults"] - all = call(w) + all = client.list(count=count) found = len(list(all)) assert found == total @pytest.mark.parametrize( - "path,call", + "client_class,path,count", [ - ( - "/api/2.0/accounts/%s/scim/v2/Users", - lambda a: a.users.list(count=3000), - ), - ( - "/api/2.0/accounts/%s/scim/v2/Groups", - lambda a: a.groups.list(count=5), - ), - ( - "/api/2.0/accounts/%s/scim/v2/ServicePrincipals", - lambda a: a.service_principals.list(count=1000), - ), + (AccountUsersClient, "/api/2.0/accounts/%s/scim/v2/Users", 3000), + (AccountGroupsClient, "/api/2.0/accounts/%s/scim/v2/Groups", 50), + (AccountServicePrincipalsClient, "/api/2.0/accounts/%s/scim/v2/ServicePrincipals", 1000), ], ) -def test_account_users_list_pagination(a, path, call): - raw = a.api_client.do("GET", path.replace("%s", a.config.account_id)) +def test_account_users_list_pagination(a, client_class, path, count): + client = client_class(config=a) + api_client = ApiClient(cfg=a) + raw = api_client.do("GET", path.replace("%s", a.account_id)) total = raw["totalResults"] - all = call(a) + all = client.list(count=count) found = len(list(all)) assert found == total diff --git a/tests/integration/test_workspace.py b/tests/integration/test_workspace.py index 8e6b26d20..8982598c8 100644 --- a/tests/integration/test_workspace.py +++ b/tests/integration/test_workspace.py @@ -1,98 +1,118 @@ import io from databricks.sdk.workspace.v2.workspace import ImportFormat, Language - +from databricks.sdk.workspace.v2.client import WorkspaceClient +from databricks.sdk.iam.v2.client import CurrentUserClient def test_workspace_recursive_list(w, workspace_dir, random): + wc = WorkspaceClient(config=w) # create a file in the directory file = f"{workspace_dir}/file-{random(12)}.py" - w.workspace.upload(file, io.BytesIO(b"print(1)")) + wc.upload(file, io.BytesIO(b"print(1)")) # create a subdirectory subdirectory = f"{workspace_dir}/subdir-{random(12)}" - w.workspace.mkdirs(subdirectory) + wc.mkdirs(subdirectory) # create a file in the subdirectory subfile = f"{subdirectory}/subfile-{random(12)}.py" - w.workspace.upload(subfile, io.BytesIO(b"print(2)")) + wc.upload(subfile, io.BytesIO(b"print(2)")) # list the directory recursively names = [] - for i in w.workspace.list(workspace_dir, recursive=True): + for i in wc.list(workspace_dir, recursive=True): names.append(i.path) assert len(names) == 2 def test_workspace_upload_download_notebooks(w, random): - notebook = f"/Users/{w.current_user.me().user_name}/notebook-{random(12)}.py" - - w.workspace.upload(notebook, io.BytesIO(b"print(1)")) - with w.workspace.download(notebook) as f: + wc = WorkspaceClient(config=w) + cuc = CurrentUserClient(config=w) + + notebook = f"/Users/{cuc.me().user_name}/notebook-{random(12)}.py" + + wc.upload(notebook, io.BytesIO(b"print(1)")) + with wc.download(notebook) as f: content = f.read() assert content == b"# Databricks notebook source\nprint(1)" - w.workspace.delete(notebook) + wc.delete(notebook) def test_workspace_unzip_notebooks(w, random): - notebook = f"/Users/{w.current_user.me().user_name}/notebook-{random(12)}.py" + wc = WorkspaceClient(config=w) + cuc = CurrentUserClient(config=w) + + notebook = f"/Users/{cuc.me().user_name}/notebook-{random(12)}.py" # Big notebooks can be gzipped during transfer by the API (out of our control) # Creating some large content to trigger this behaviour notebook_content = ("print(1)\n" * 1000).strip("\n") - w.workspace.upload(notebook, io.BytesIO(bytes(notebook_content, "utf-8"))) - with w.workspace.download(notebook) as f: + wc.upload(notebook, io.BytesIO(bytes(notebook_content, "utf-8"))) + with wc.download(notebook) as f: content = f.read() expected_content = bytes(f"# Databricks notebook source\n{notebook_content}", "utf-8") assert content == expected_content - w.workspace.delete(notebook) + wc.delete(notebook) def test_workspace_download_connection_closed(w, random): - notebook = f"/Users/{w.current_user.me().user_name}/notebook-{random(12)}.py" + wc = WorkspaceClient(config=w) + cuc = CurrentUserClient(config=w) + + notebook = f"/Users/{cuc.me().user_name}/notebook-{random(12)}.py" - w.workspace.upload(notebook, io.BytesIO(b"print(1)")) + wc.upload(notebook, io.BytesIO(b"print(1)")) for n in range(30): - with w.workspace.download(notebook) as f: + with wc.download(notebook) as f: content = f.read() assert content == b"# Databricks notebook source\nprint(1)" - w.workspace.delete(notebook) + wc.delete(notebook) def test_workspace_upload_download_files(w, random): - py_file = f"/Users/{w.current_user.me().user_name}/file-{random(12)}.py" + wc = WorkspaceClient(config=w) + cuc = CurrentUserClient(config=w) + + py_file = f"/Users/{cuc.me().user_name}/file-{random(12)}.py" - w.workspace.upload(py_file, io.BytesIO(b"print(1)"), format=ImportFormat.AUTO) - with w.workspace.download(py_file) as f: + wc.upload(py_file, io.BytesIO(b"print(1)"), format=ImportFormat.AUTO) + with wc.download(py_file) as f: content = f.read() assert content == b"print(1)" - w.workspace.delete(py_file) + wc.delete(py_file) def test_workspace_upload_download_txt_files(w, random): - txt_file = f"/Users/{w.current_user.me().user_name}/txt-{random(12)}.txt" + wc = WorkspaceClient(config=w) + cuc = CurrentUserClient(config=w) + + txt_file = f"/Users/{cuc.me().user_name}/txt-{random(12)}.txt" - w.workspace.upload(txt_file, io.BytesIO(b"print(1)"), format=ImportFormat.AUTO) - with w.workspace.download(txt_file) as f: + wc.upload(txt_file, io.BytesIO(b"print(1)"), format=ImportFormat.AUTO) + with wc.download(txt_file) as f: content = f.read() assert content == b"print(1)" - w.workspace.delete(txt_file) + wc.delete(txt_file) def test_workspace_upload_download_notebooks_no_extension(w, random): - nb = f"/Users/{w.current_user.me().user_name}/notebook-{random(12)}" + wc = WorkspaceClient(config=w) + cuc = CurrentUserClient(config=w) + + nb = f"/Users/{cuc.me().user_name}/notebook-{random(12)}" - w.workspace.upload( + wc.upload( nb, io.BytesIO(b"print(1)"), format=ImportFormat.SOURCE, language=Language.PYTHON, ) - with w.workspace.download(nb) as f: + with wc.download(nb) as f: content = f.read() assert content == b"# Databricks notebook source\nprint(1)" - w.workspace.delete(nb) + wc.delete(nb) From 00512b9ae05587130390390a101a98231a24d0f1 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Mon, 31 Mar 2025 20:35:21 +0000 Subject: [PATCH 14/20] update --- tests/integration/conftest.py | 42 +++++++++++++++++++++------- tests/integration/test_client.py | 7 +++-- tests/integration/test_clusters.py | 2 +- tests/integration/test_data_plane.py | 1 - tests/integration/test_dbutils.py | 12 ++++---- tests/integration/test_files.py | 7 +++-- tests/integration/test_iam.py | 9 +++--- tests/integration/test_workspace.py | 19 +++++++------ tests/test_client.py | 2 -- 9 files changed, 64 insertions(+), 37 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 0e5ce275a..e12c4f9ba 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -115,36 +115,58 @@ def inner(var: str) -> str: @pytest.fixture(scope="session") def schema(ucws, random): - schema = ucws.schemas.create("dbfs-" + random(), "main") + from databricks.sdk.catalog.v2.client import SchemasClient + + sc = SchemasClient(config=ucws) + schema = sc.create("dbfs-" + random(), "main") yield schema - ucws.schemas.delete(schema.full_name) + sc.delete(schema.full_name) @pytest.fixture(scope="session") def volume(ucws, schema): - volume = ucws.volumes.create("main", schema.name, "dbfs-test", VolumeType.MANAGED) + from databricks.sdk.catalog.v2.client import VolumesClient + + vc = VolumesClient(config=ucws) + volume = vc.create("main", schema.name, "dbfs-test", VolumeType.MANAGED) yield "/Volumes/" + volume.full_name.replace(".", "/") - ucws.volumes.delete(volume.full_name) + vc.delete(volume.full_name) @pytest.fixture(scope="session", params=[False, True]) def files_api(request, ucws) -> FilesAPI: + if request.param: # ensure new Files API client is used for files of any size - ucws.config.multipart_upload_min_stream_size = 0 + ucws.multipart_upload_min_stream_size = 0 # enable new Files API client - return FilesExt(ucws.api_client, ucws.config) + from databricks.sdk.databricks.core import ApiClient + + client = ApiClient(cfg=ucws) + + return FilesExt(client, ucws) else: # use the default client - return ucws.files + from databricks.sdk.databricks.core import ApiClient + from databricks.sdk.files.v2.files import FilesAPI + + client = ApiClient(cfg=ucws) + + api = FilesAPI(api_client=client) + return api @pytest.fixture() def workspace_dir(w, random): - directory = f"/Users/{w.current_user.me().user_name}/dir-{random(12)}" - w.workspace.mkdirs(directory) + from databricks.sdk.iam.v2.client import CurrentUserClient + from databricks.sdk.workspace.v2.client import WorkspaceClient + + cuc = CurrentUserClient(config=w) + wc = WorkspaceClient(config=w) + directory = f"/Users/{cuc.me().user_name}/dir-{random(12)}" + wc.mkdirs(directory) yield directory - w.workspace.delete(directory, recursive=True) + wc.delete(directory, recursive=True) def _load_debug_env_if_runs_from_ide(key) -> bool: diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index 4e13d6854..850309570 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -6,9 +6,10 @@ def test_get_workspace_client(ucacct, env_or_skip): assert w.current_user.me().active -def test_get_workspace_id(ucws, env_or_skip): - ws_id = int(env_or_skip("THIS_WORKSPACE_ID")) - assert ucws.get_workspace_id() == ws_id +# TODO: need to decide if we want get_workspace_id on every client +# def test_get_workspace_id(ucws, env_or_skip): +# ws_id = int(env_or_skip("THIS_WORKSPACE_ID")) +# assert ucws.get_workspace_id() == ws_id def test_creating_ws_client_from_ac_client_does_not_override_config(ucacct, env_or_skip): diff --git a/tests/integration/test_clusters.py b/tests/integration/test_clusters.py index 73a02f369..f42303bce 100644 --- a/tests/integration/test_clusters.py +++ b/tests/integration/test_clusters.py @@ -1,4 +1,3 @@ - import pytest from databricks.sdk.compute.v2 import compute @@ -28,6 +27,7 @@ def test_cluster_events(w, env_or_skip): count += 1 assert count > 0 + # TODO: Re-enable this test after adding waiters to the SDK # def test_ensure_cluster_is_running(w, env_or_skip): # cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") diff --git a/tests/integration/test_data_plane.py b/tests/integration/test_data_plane.py index cba28da8e..c40553dbf 100644 --- a/tests/integration/test_data_plane.py +++ b/tests/integration/test_data_plane.py @@ -1,4 +1,3 @@ - # TODO: Re-enable this after adding data plane services to the SDK # def test_data_plane_token_source(ucws, env_or_skip): # endpoint = env_or_skip("SERVING_ENDPOINT_NAME") diff --git a/tests/integration/test_dbutils.py b/tests/integration/test_dbutils.py index f7d92ba9b..eb33c57ac 100644 --- a/tests/integration/test_dbutils.py +++ b/tests/integration/test_dbutils.py @@ -5,8 +5,8 @@ import pytest from databricks.sdk.databricks.core import DatabricksError -from databricks.sdk.databricks.errors import NotFound from databricks.sdk.databricks.dbutils import RemoteDbUtils +from databricks.sdk.databricks.errors import NotFound def test_rest_dbfs_ls(w, env_or_skip): @@ -16,9 +16,10 @@ def test_rest_dbfs_ls(w, env_or_skip): assert len(x) > 1 + # TODO: Re-enable this test after adding waiters to the SDK # def test_proxy_dbfs_mounts(w, env_or_skip): - + # w.cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID") # dbu = RemoteDbUtils(config=w) @@ -29,11 +30,12 @@ def test_rest_dbfs_ls(w, env_or_skip): @pytest.fixture(params=["dbfs", "volumes"]) def fs_and_base_path(request, ucws, volume): + dbu = RemoteDbUtils(config=ucws) if request.param == "dbfs": - fs = ucws.dbutils.fs + fs = dbu.fs base_path = "/tmp" else: - fs = ucws.dbutils.fs + fs = dbu.fs base_path = volume return fs, base_path @@ -189,7 +191,7 @@ def test_secrets(w, random): logger.info(f"Before loading secret: {random_value}") from databricks.sdk.workspace.v2.client import SecretsClient - + sc = SecretsClient(config=w) sc.create_scope(random_scope) sc.put_secret(random_scope, key_for_string, string_value=random_value) diff --git a/tests/integration/test_files.py b/tests/integration/test_files.py index 567ef1e57..1cb44bcd2 100644 --- a/tests/integration/test_files.py +++ b/tests/integration/test_files.py @@ -7,9 +7,11 @@ import pytest +from databricks.sdk.catalog.v2.client import SchemasClient from databricks.sdk.databricks.core import DatabricksError from databricks.sdk.files.v2.client import DbfsClient + def test_local_io(random): if platform.system() == "Windows": dummy_file = f"C:\\Windows\\Temp\\{random()}" @@ -231,8 +233,9 @@ def __exit__(self, exc_type, exc_val, exc_tb): @staticmethod def create_schema(w, catalog, schema): - res = w.schemas.create(catalog_name=catalog, name=schema) - return ResourceWithCleanup(lambda: w.schemas.delete(res.full_name)) + sc = SchemasClient(config=w) + res = sc.create(catalog_name=catalog, name=schema) + return ResourceWithCleanup(lambda: sc.delete(res.full_name)) @staticmethod def create_volume(w, catalog, schema, volume): diff --git a/tests/integration/test_iam.py b/tests/integration/test_iam.py index d0c60ec1c..b290d31d3 100644 --- a/tests/integration/test_iam.py +++ b/tests/integration/test_iam.py @@ -1,10 +1,11 @@ import pytest from databricks.sdk.databricks import errors -from databricks.sdk.databricks.core import DatabricksError -from databricks.sdk.iam.v2.client import AccountGroupsClient, AccountUsersClient, AccountServicePrincipalsClient -from databricks.sdk.iam.v2.client import GroupsClient, UsersClient, ServicePrincipalsClient -from databricks.sdk.databricks.core import ApiClient +from databricks.sdk.databricks.core import ApiClient, DatabricksError +from databricks.sdk.iam.v2.client import (AccountGroupsClient, + AccountServicePrincipalsClient, + AccountUsersClient, GroupsClient, + ServicePrincipalsClient, UsersClient) def test_filtering_groups(w, random): diff --git a/tests/integration/test_workspace.py b/tests/integration/test_workspace.py index 8982598c8..de6cb071d 100644 --- a/tests/integration/test_workspace.py +++ b/tests/integration/test_workspace.py @@ -1,8 +1,9 @@ import io -from databricks.sdk.workspace.v2.workspace import ImportFormat, Language -from databricks.sdk.workspace.v2.client import WorkspaceClient from databricks.sdk.iam.v2.client import CurrentUserClient +from databricks.sdk.workspace.v2.client import WorkspaceClient +from databricks.sdk.workspace.v2.workspace import ImportFormat, Language + def test_workspace_recursive_list(w, workspace_dir, random): wc = WorkspaceClient(config=w) @@ -25,9 +26,9 @@ def test_workspace_recursive_list(w, workspace_dir, random): def test_workspace_upload_download_notebooks(w, random): wc = WorkspaceClient(config=w) cuc = CurrentUserClient(config=w) - + notebook = f"/Users/{cuc.me().user_name}/notebook-{random(12)}.py" - + wc.upload(notebook, io.BytesIO(b"print(1)")) with wc.download(notebook) as f: content = f.read() @@ -39,7 +40,7 @@ def test_workspace_upload_download_notebooks(w, random): def test_workspace_unzip_notebooks(w, random): wc = WorkspaceClient(config=w) cuc = CurrentUserClient(config=w) - + notebook = f"/Users/{cuc.me().user_name}/notebook-{random(12)}.py" # Big notebooks can be gzipped during transfer by the API (out of our control) @@ -58,7 +59,7 @@ def test_workspace_unzip_notebooks(w, random): def test_workspace_download_connection_closed(w, random): wc = WorkspaceClient(config=w) cuc = CurrentUserClient(config=w) - + notebook = f"/Users/{cuc.me().user_name}/notebook-{random(12)}.py" wc.upload(notebook, io.BytesIO(b"print(1)")) @@ -74,7 +75,7 @@ def test_workspace_download_connection_closed(w, random): def test_workspace_upload_download_files(w, random): wc = WorkspaceClient(config=w) cuc = CurrentUserClient(config=w) - + py_file = f"/Users/{cuc.me().user_name}/file-{random(12)}.py" wc.upload(py_file, io.BytesIO(b"print(1)"), format=ImportFormat.AUTO) @@ -88,7 +89,7 @@ def test_workspace_upload_download_files(w, random): def test_workspace_upload_download_txt_files(w, random): wc = WorkspaceClient(config=w) cuc = CurrentUserClient(config=w) - + txt_file = f"/Users/{cuc.me().user_name}/txt-{random(12)}.txt" wc.upload(txt_file, io.BytesIO(b"print(1)"), format=ImportFormat.AUTO) @@ -102,7 +103,7 @@ def test_workspace_upload_download_txt_files(w, random): def test_workspace_upload_download_notebooks_no_extension(w, random): wc = WorkspaceClient(config=w) cuc = CurrentUserClient(config=w) - + nb = f"/Users/{cuc.me().user_name}/notebook-{random(12)}" wc.upload( diff --git a/tests/test_client.py b/tests/test_client.py index 1ae86717b..2a1457955 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,5 +1,3 @@ - - # from databricks.sdk import WorkspaceClient From 7a569389782d9d1cd724021c5bda942dbe7389bd Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Mon, 31 Mar 2025 21:13:05 +0000 Subject: [PATCH 15/20] update --- tests/integration/test_client.py | 18 +----------------- tests/integration/test_files.py | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index 850309570..40d2319a8 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -1,20 +1,4 @@ -def test_get_workspace_client(ucacct, env_or_skip): - # Need to switch to ucacct - workspace_id = env_or_skip("TEST_WORKSPACE_ID") - ws = ucacct.workspaces.get(workspace_id) - w = ucacct.get_workspace_client(ws) - assert w.current_user.me().active - - -# TODO: need to decide if we want get_workspace_id on every client +#TODO: need to decide if we want get_workspace_id on every client # def test_get_workspace_id(ucws, env_or_skip): # ws_id = int(env_or_skip("THIS_WORKSPACE_ID")) # assert ucws.get_workspace_id() == ws_id - - -def test_creating_ws_client_from_ac_client_does_not_override_config(ucacct, env_or_skip): - ws_id = env_or_skip("TEST_WORKSPACE_ID") - ws = ucacct.workspaces.get(ws_id) - w = ucacct.get_workspace_client(ws) - me = w.current_user.me() - assert me.user_name is not None diff --git a/tests/integration/test_files.py b/tests/integration/test_files.py index 1cb44bcd2..3e4ba16f2 100644 --- a/tests/integration/test_files.py +++ b/tests/integration/test_files.py @@ -249,7 +249,7 @@ def create_volume(w, catalog, schema, volume): name=volume, volume_type=VolumeType.MANAGED, ) - return ResourceWithCleanup(lambda: w.volumes.delete(res.full_name)) + return ResourceWithCleanup(lambda: vc.delete(res.full_name)) def test_files_api_upload_download(ucws, files_api, random): From 66a752f47cc45768adccbc11b6c94a7661e458e7 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Wed, 9 Apr 2025 08:57:09 +0000 Subject: [PATCH 16/20] update --- tests/integration/test_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index 40d2319a8..a2999cfa3 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -1,4 +1,4 @@ -#TODO: need to decide if we want get_workspace_id on every client +# TODO: need to decide if we want get_workspace_id on every client # def test_get_workspace_id(ucws, env_or_skip): # ws_id = int(env_or_skip("THIS_WORKSPACE_ID")) # assert ucws.get_workspace_id() == ws_id From 4e23809613f76c1356845f35bdb836194e76dc9f Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Wed, 9 Apr 2025 19:30:27 +0000 Subject: [PATCH 17/20] update --- .codegen/_openapi_sha | 2 +- databricks/sdk/billing/v2/billing.py | 9 + databricks/sdk/catalog/v2/catalog.py | 2 + databricks/sdk/cleanrooms/v2/cleanrooms.py | 2 + databricks/sdk/compute/v2/compute.py | 4 + databricks/sdk/dashboards/v2/dashboards.py | 163 +++++++ databricks/sdk/jobs/v2/jobs.py | 504 +++++++++++++++++++-- databricks/sdk/ml/v2/ml.py | 237 ++++++++-- databricks/sdk/serving/v2/serving.py | 27 +- databricks/sdk/settings/v2/client.py | 86 +++- databricks/sdk/settings/v2/settings.py | 157 ++++++- databricks/sdk/sql/v2/sql.py | 10 + 12 files changed, 1111 insertions(+), 92 deletions(-) diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 347bf5ee5..f5d482394 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -universe:/home/parth.bansal/universetwo \ No newline at end of file +e6971360e2752b3513d44a25d25f6cc5448056c8 \ No newline at end of file diff --git a/databricks/sdk/billing/v2/billing.py b/databricks/sdk/billing/v2/billing.py index f715a66d0..7edf243d7 100755 --- a/databricks/sdk/billing/v2/billing.py +++ b/databricks/sdk/billing/v2/billing.py @@ -361,6 +361,10 @@ def from_dict(cls, d: Dict[str, Any]) -> BudgetConfigurationFilterWorkspaceIdCla class BudgetPolicy: """Contains the BudgetPolicy details.""" + binding_workspace_ids: Optional[List[int]] = None + """List of workspaces that this budget policy will be exclusively bound to. An empty binding + implies that this budget policy is open to any workspace in the account.""" + custom_tags: Optional[List[CustomPolicyTag]] = None """A list of tags defined by the customer. At most 20 entries are allowed per policy.""" @@ -375,6 +379,8 @@ class BudgetPolicy: def as_dict(self) -> dict: """Serializes the BudgetPolicy into a dictionary suitable for use as a JSON request body.""" body = {} + if self.binding_workspace_ids: + body["binding_workspace_ids"] = [v for v in self.binding_workspace_ids] if self.custom_tags: body["custom_tags"] = [v.as_dict() for v in self.custom_tags] if self.policy_id is not None: @@ -386,6 +392,8 @@ def as_dict(self) -> dict: def as_shallow_dict(self) -> dict: """Serializes the BudgetPolicy into a shallow dictionary of its immediate attributes.""" body = {} + if self.binding_workspace_ids: + body["binding_workspace_ids"] = self.binding_workspace_ids if self.custom_tags: body["custom_tags"] = self.custom_tags if self.policy_id is not None: @@ -398,6 +406,7 @@ def as_shallow_dict(self) -> dict: def from_dict(cls, d: Dict[str, Any]) -> BudgetPolicy: """Deserializes the BudgetPolicy from a dictionary.""" return cls( + binding_workspace_ids=d.get("binding_workspace_ids", None), custom_tags=_repeated_dict(d, "custom_tags", CustomPolicyTag), policy_id=d.get("policy_id", None), policy_name=d.get("policy_name", None), diff --git a/databricks/sdk/catalog/v2/catalog.py b/databricks/sdk/catalog/v2/catalog.py index 4b5959161..05c75356d 100755 --- a/databricks/sdk/catalog/v2/catalog.py +++ b/databricks/sdk/catalog/v2/catalog.py @@ -1267,6 +1267,8 @@ class ColumnTypeName(Enum): DECIMAL = "DECIMAL" DOUBLE = "DOUBLE" FLOAT = "FLOAT" + GEOGRAPHY = "GEOGRAPHY" + GEOMETRY = "GEOMETRY" INT = "INT" INTERVAL = "INTERVAL" LONG = "LONG" diff --git a/databricks/sdk/cleanrooms/v2/cleanrooms.py b/databricks/sdk/cleanrooms/v2/cleanrooms.py index 5814fddce..2e4bff8b9 100755 --- a/databricks/sdk/cleanrooms/v2/cleanrooms.py +++ b/databricks/sdk/cleanrooms/v2/cleanrooms.py @@ -1086,6 +1086,8 @@ class ColumnTypeName(Enum): DECIMAL = "DECIMAL" DOUBLE = "DOUBLE" FLOAT = "FLOAT" + GEOGRAPHY = "GEOGRAPHY" + GEOMETRY = "GEOMETRY" INT = "INT" INTERVAL = "INTERVAL" LONG = "LONG" diff --git a/databricks/sdk/compute/v2/compute.py b/databricks/sdk/compute/v2/compute.py index e18ca98a1..54b3da663 100755 --- a/databricks/sdk/compute/v2/compute.py +++ b/databricks/sdk/compute/v2/compute.py @@ -8851,6 +8851,7 @@ class TerminationReasonCode(Enum): ACCESS_TOKEN_FAILURE = "ACCESS_TOKEN_FAILURE" ALLOCATION_TIMEOUT = "ALLOCATION_TIMEOUT" ALLOCATION_TIMEOUT_NODE_DAEMON_NOT_READY = "ALLOCATION_TIMEOUT_NODE_DAEMON_NOT_READY" + ALLOCATION_TIMEOUT_NO_HEALTHY_AND_WARMED_UP_CLUSTERS = "ALLOCATION_TIMEOUT_NO_HEALTHY_AND_WARMED_UP_CLUSTERS" ALLOCATION_TIMEOUT_NO_HEALTHY_CLUSTERS = "ALLOCATION_TIMEOUT_NO_HEALTHY_CLUSTERS" ALLOCATION_TIMEOUT_NO_MATCHED_CLUSTERS = "ALLOCATION_TIMEOUT_NO_MATCHED_CLUSTERS" ALLOCATION_TIMEOUT_NO_READY_CLUSTERS = "ALLOCATION_TIMEOUT_NO_READY_CLUSTERS" @@ -8903,7 +8904,10 @@ class TerminationReasonCode(Enum): DATA_ACCESS_CONFIG_CHANGED = "DATA_ACCESS_CONFIG_CHANGED" DBFS_COMPONENT_UNHEALTHY = "DBFS_COMPONENT_UNHEALTHY" DISASTER_RECOVERY_REPLICATION = "DISASTER_RECOVERY_REPLICATION" + DOCKER_CONTAINER_CREATION_EXCEPTION = "DOCKER_CONTAINER_CREATION_EXCEPTION" DOCKER_IMAGE_PULL_FAILURE = "DOCKER_IMAGE_PULL_FAILURE" + DOCKER_IMAGE_TOO_LARGE_FOR_INSTANCE_EXCEPTION = "DOCKER_IMAGE_TOO_LARGE_FOR_INSTANCE_EXCEPTION" + DOCKER_INVALID_OS_EXCEPTION = "DOCKER_INVALID_OS_EXCEPTION" DRIVER_EVICTION = "DRIVER_EVICTION" DRIVER_LAUNCH_TIMEOUT = "DRIVER_LAUNCH_TIMEOUT" DRIVER_NODE_UNREACHABLE = "DRIVER_NODE_UNREACHABLE" diff --git a/databricks/sdk/dashboards/v2/dashboards.py b/databricks/sdk/dashboards/v2/dashboards.py index 6fbe88eca..c242458e1 100755 --- a/databricks/sdk/dashboards/v2/dashboards.py +++ b/databricks/sdk/dashboards/v2/dashboards.py @@ -14,6 +14,87 @@ # all definitions in this file are in alphabetical order +@dataclass +class AuthorizationDetails: + grant_rules: Optional[List[AuthorizationDetailsGrantRule]] = None + """Represents downscoped permission rules with specific access rights. This field is specific to + `workspace_rule_set` constraint.""" + + resource_legacy_acl_path: Optional[str] = None + """The acl path of the tree store resource resource.""" + + resource_name: Optional[str] = None + """The resource name to which the authorization rule applies. This field is specific to + `workspace_rule_set` constraint. Format: `workspaces/{workspace_id}/dashboards/{dashboard_id}`""" + + type: Optional[str] = None + """The type of authorization downscoping policy. Ex: `workspace_rule_set` defines access rules for + a specific workspace resource""" + + def as_dict(self) -> dict: + """Serializes the AuthorizationDetails into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.grant_rules: + body["grant_rules"] = [v.as_dict() for v in self.grant_rules] + if self.resource_legacy_acl_path is not None: + body["resource_legacy_acl_path"] = self.resource_legacy_acl_path + if self.resource_name is not None: + body["resource_name"] = self.resource_name + if self.type is not None: + body["type"] = self.type + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AuthorizationDetails into a shallow dictionary of its immediate attributes.""" + body = {} + if self.grant_rules: + body["grant_rules"] = self.grant_rules + if self.resource_legacy_acl_path is not None: + body["resource_legacy_acl_path"] = self.resource_legacy_acl_path + if self.resource_name is not None: + body["resource_name"] = self.resource_name + if self.type is not None: + body["type"] = self.type + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AuthorizationDetails: + """Deserializes the AuthorizationDetails from a dictionary.""" + return cls( + grant_rules=_repeated_dict(d, "grant_rules", AuthorizationDetailsGrantRule), + resource_legacy_acl_path=d.get("resource_legacy_acl_path", None), + resource_name=d.get("resource_name", None), + type=d.get("type", None), + ) + + +@dataclass +class AuthorizationDetailsGrantRule: + permission_set: Optional[str] = None + """Permission sets for dashboard are defined in + iam-common/rbac-common/permission-sets/definitions/TreeStoreBasePermissionSets Ex: + `permissionSets/dashboard.runner`""" + + def as_dict(self) -> dict: + """Serializes the AuthorizationDetailsGrantRule into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.permission_set is not None: + body["permission_set"] = self.permission_set + return body + + def as_shallow_dict(self) -> dict: + """Serializes the AuthorizationDetailsGrantRule into a shallow dictionary of its immediate attributes.""" + body = {} + if self.permission_set is not None: + body["permission_set"] = self.permission_set + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> AuthorizationDetailsGrantRule: + """Deserializes the AuthorizationDetailsGrantRule from a dictionary.""" + return cls(permission_set=d.get("permission_set", None)) + + @dataclass class BaseChunkInfo: """Describes metadata for a particular chunk, within a result set; this structure is used both @@ -1264,6 +1345,52 @@ def from_dict(cls, d: Dict[str, Any]) -> GetPublishedDashboardEmbeddedResponse: return cls() +@dataclass +class GetPublishedDashboardTokenInfoResponse: + authorization_details: Optional[List[AuthorizationDetails]] = None + """Authorization constraints for accessing the published dashboard. Currently includes + `workspace_rule_set` and could be enriched with `unity_catalog_privileges` before oAuth token + generation.""" + + custom_claim: Optional[str] = None + """Custom claim generated from external_value and external_viewer_id. Format: + `urn:aibi:external_data:::`""" + + scope: Optional[str] = None + """Scope defining access permissions.""" + + def as_dict(self) -> dict: + """Serializes the GetPublishedDashboardTokenInfoResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.authorization_details: + body["authorization_details"] = [v.as_dict() for v in self.authorization_details] + if self.custom_claim is not None: + body["custom_claim"] = self.custom_claim + if self.scope is not None: + body["scope"] = self.scope + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GetPublishedDashboardTokenInfoResponse into a shallow dictionary of its immediate attributes.""" + body = {} + if self.authorization_details: + body["authorization_details"] = self.authorization_details + if self.custom_claim is not None: + body["custom_claim"] = self.custom_claim + if self.scope is not None: + body["scope"] = self.scope + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GetPublishedDashboardTokenInfoResponse: + """Deserializes the GetPublishedDashboardTokenInfoResponse from a dictionary.""" + return cls( + authorization_details=_repeated_dict(d, "authorization_details", AuthorizationDetails), + custom_claim=d.get("custom_claim", None), + scope=d.get("scope", None), + ) + + class LifecycleState(Enum): ACTIVE = "ACTIVE" @@ -3370,6 +3497,42 @@ def get_published_dashboard_embedded(self, dashboard_id: str): self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published/embedded", headers=headers) + def get_published_dashboard_token_info( + self, dashboard_id: str, *, external_value: Optional[str] = None, external_viewer_id: Optional[str] = None + ) -> GetPublishedDashboardTokenInfoResponse: + """Read an information of a published dashboard to mint an OAuth token. + + Get a required authorization details and scopes of a published dashboard to mint an OAuth token. The + `authorization_details` can be enriched to apply additional restriction. + + Example: Adding the following `authorization_details` object to downscope the viewer permission to + specific table ``` { type: "unity_catalog_privileges", privileges: ["SELECT"], object_type: "TABLE", + object_full_path: "main.default.testdata" } ``` + + :param dashboard_id: str + UUID identifying the published dashboard. + :param external_value: str (optional) + Provided external value to be included in the custom claim. + :param external_viewer_id: str (optional) + Provided external viewer id to be included in the custom claim. + + :returns: :class:`GetPublishedDashboardTokenInfoResponse` + """ + + query = {} + if external_value is not None: + query["external_value"] = external_value + if external_viewer_id is not None: + query["external_viewer_id"] = external_viewer_id + headers = { + "Accept": "application/json", + } + + res = self._api.do( + "GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published/tokeninfo", query=query, headers=headers + ) + return GetPublishedDashboardTokenInfoResponse.from_dict(res) + class QueryExecutionAPI: """Query execution APIs for AI / BI Dashboards""" diff --git a/databricks/sdk/jobs/v2/jobs.py b/databricks/sdk/jobs/v2/jobs.py index ad3141e1a..76aeaac34 100755 --- a/databricks/sdk/jobs/v2/jobs.py +++ b/databricks/sdk/jobs/v2/jobs.py @@ -42,6 +42,12 @@ def from_dict(cls, d: Dict[str, Any]) -> Adlsgen2Info: return cls(destination=d.get("destination", None)) +class AuthenticationMethod(Enum): + + OAUTH = "OAUTH" + PAT = "PAT" + + @dataclass class AutoScale: max_workers: Optional[int] = None @@ -409,9 +415,9 @@ class BaseRun: """Description of the run""" effective_performance_target: Optional[PerformanceTarget] = None - """effective_performance_target is the actual performance target used by the run during execution. - effective_performance_target can differ from the client-set performance_target depending on if - the job was eligible to be cost-optimized.""" + """The actual performance target used by the serverless run during execution. This can differ from + the client-set performance target on the request depending on whether the performance mode is + supported by the job type.""" end_time: Optional[int] = None """The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This @@ -1159,8 +1165,6 @@ def from_dict(cls, d: Dict[str, Any]) -> ClusterSpec: @dataclass class ComputeConfig: - """Next field: 4""" - num_gpus: int """Number of GPUs.""" @@ -1382,8 +1386,8 @@ class CreateJob: """Job-level parameter definitions""" performance_target: Optional[PerformanceTarget] = None - """PerformanceTarget defines how performant or cost efficient the execution of run on serverless - should be.""" + """The performance mode on a serverless job. The performance target determines the level of compute + performance or cost-efficiency for the run.""" queue: Optional[QueueSettings] = None """The queue settings of the job.""" @@ -1637,6 +1641,107 @@ def from_dict(cls, d: Dict[str, Any]) -> CronSchedule: ) +@dataclass +class DashboardPageSnapshot: + page_display_name: Optional[str] = None + + widget_error_details: Optional[List[WidgetErrorDetail]] = None + + def as_dict(self) -> dict: + """Serializes the DashboardPageSnapshot into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.page_display_name is not None: + body["page_display_name"] = self.page_display_name + if self.widget_error_details: + body["widget_error_details"] = [v.as_dict() for v in self.widget_error_details] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DashboardPageSnapshot into a shallow dictionary of its immediate attributes.""" + body = {} + if self.page_display_name is not None: + body["page_display_name"] = self.page_display_name + if self.widget_error_details: + body["widget_error_details"] = self.widget_error_details + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DashboardPageSnapshot: + """Deserializes the DashboardPageSnapshot from a dictionary.""" + return cls( + page_display_name=d.get("page_display_name", None), + widget_error_details=_repeated_dict(d, "widget_error_details", WidgetErrorDetail), + ) + + +@dataclass +class DashboardTask: + """Configures the Lakeview Dashboard job task type.""" + + dashboard_id: Optional[str] = None + + subscription: Optional[Subscription] = None + + warehouse_id: Optional[str] = None + """The warehouse id to execute the dashboard with for the schedule""" + + def as_dict(self) -> dict: + """Serializes the DashboardTask into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.dashboard_id is not None: + body["dashboard_id"] = self.dashboard_id + if self.subscription: + body["subscription"] = self.subscription.as_dict() + if self.warehouse_id is not None: + body["warehouse_id"] = self.warehouse_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DashboardTask into a shallow dictionary of its immediate attributes.""" + body = {} + if self.dashboard_id is not None: + body["dashboard_id"] = self.dashboard_id + if self.subscription: + body["subscription"] = self.subscription + if self.warehouse_id is not None: + body["warehouse_id"] = self.warehouse_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DashboardTask: + """Deserializes the DashboardTask from a dictionary.""" + return cls( + dashboard_id=d.get("dashboard_id", None), + subscription=_from_dict(d, "subscription", Subscription), + warehouse_id=d.get("warehouse_id", None), + ) + + +@dataclass +class DashboardTaskOutput: + page_snapshots: Optional[List[DashboardPageSnapshot]] = None + """Should only be populated for manual PDF download jobs.""" + + def as_dict(self) -> dict: + """Serializes the DashboardTaskOutput into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.page_snapshots: + body["page_snapshots"] = [v.as_dict() for v in self.page_snapshots] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DashboardTaskOutput into a shallow dictionary of its immediate attributes.""" + body = {} + if self.page_snapshots: + body["page_snapshots"] = self.page_snapshots + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> DashboardTaskOutput: + """Deserializes the DashboardTaskOutput from a dictionary.""" + return cls(page_snapshots=_repeated_dict(d, "page_snapshots", DashboardPageSnapshot)) + + class DataSecurityMode(Enum): """Data security mode decides what data governance model to use when accessing data from a cluster. @@ -2130,6 +2235,10 @@ class Environment: Databricks), E.g. dependencies: ["foo==0.0.1", "-r /Workspace/test/requirements.txt"]""" + jar_dependencies: Optional[List[str]] = None + """List of jar dependencies, should be string representing volume paths. For example: + `/Volumes/path/to/test.jar`.""" + def as_dict(self) -> dict: """Serializes the Environment into a dictionary suitable for use as a JSON request body.""" body = {} @@ -2137,6 +2246,8 @@ def as_dict(self) -> dict: body["client"] = self.client if self.dependencies: body["dependencies"] = [v for v in self.dependencies] + if self.jar_dependencies: + body["jar_dependencies"] = [v for v in self.jar_dependencies] return body def as_shallow_dict(self) -> dict: @@ -2146,12 +2257,18 @@ def as_shallow_dict(self) -> dict: body["client"] = self.client if self.dependencies: body["dependencies"] = self.dependencies + if self.jar_dependencies: + body["jar_dependencies"] = self.jar_dependencies return body @classmethod def from_dict(cls, d: Dict[str, Any]) -> Environment: """Deserializes the Environment from a dictionary.""" - return cls(client=d.get("client", None), dependencies=d.get("dependencies", None)) + return cls( + client=d.get("client", None), + dependencies=d.get("dependencies", None), + jar_dependencies=d.get("jar_dependencies", None), + ) @dataclass @@ -2544,8 +2661,6 @@ def from_dict(cls, d: Dict[str, Any]) -> GcsStorageInfo: @dataclass class GenAiComputeTask: - """Next field: 9""" - dl_runtime_image: str """Runtime image""" @@ -2553,7 +2668,6 @@ class GenAiComputeTask: """Command launcher to run the actual script, e.g. bash, python etc.""" compute: Optional[ComputeConfig] = None - """Next field: 4""" mlflow_experiment_name: Optional[str] = None """Optional string containing the name of the MLflow experiment to log the run to. If name is not @@ -3747,8 +3861,8 @@ class JobSettings: """Job-level parameter definitions""" performance_target: Optional[PerformanceTarget] = None - """PerformanceTarget defines how performant or cost efficient the execution of run on serverless - should be.""" + """The performance mode on a serverless job. The performance target determines the level of compute + performance or cost-efficiency for the run.""" queue: Optional[QueueSettings] = None """The queue settings of the job.""" @@ -4976,9 +5090,9 @@ class PerformanceTarget(Enum): on serverless compute should be. The performance mode on the job or pipeline should map to a performance setting that is passed to Cluster Manager (see cluster-common PerformanceTarget).""" - BALANCED = "BALANCED" COST_OPTIMIZED = "COST_OPTIMIZED" PERFORMANCE_OPTIMIZED = "PERFORMANCE_OPTIMIZED" + STANDARD = "STANDARD" @dataclass @@ -5077,6 +5191,175 @@ def from_dict(cls, d: Dict[str, Any]) -> PipelineTask: return cls(full_refresh=d.get("full_refresh", None), pipeline_id=d.get("pipeline_id", None)) +@dataclass +class PowerBiModel: + authentication_method: Optional[AuthenticationMethod] = None + """How the published Power BI model authenticates to Databricks""" + + model_name: Optional[str] = None + """The name of the Power BI model""" + + overwrite_existing: Optional[bool] = None + """Whether to overwrite existing Power BI models""" + + storage_mode: Optional[StorageMode] = None + """The default storage mode of the Power BI model""" + + workspace_name: Optional[str] = None + """The name of the Power BI workspace of the model""" + + def as_dict(self) -> dict: + """Serializes the PowerBiModel into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.authentication_method is not None: + body["authentication_method"] = self.authentication_method.value + if self.model_name is not None: + body["model_name"] = self.model_name + if self.overwrite_existing is not None: + body["overwrite_existing"] = self.overwrite_existing + if self.storage_mode is not None: + body["storage_mode"] = self.storage_mode.value + if self.workspace_name is not None: + body["workspace_name"] = self.workspace_name + return body + + def as_shallow_dict(self) -> dict: + """Serializes the PowerBiModel into a shallow dictionary of its immediate attributes.""" + body = {} + if self.authentication_method is not None: + body["authentication_method"] = self.authentication_method + if self.model_name is not None: + body["model_name"] = self.model_name + if self.overwrite_existing is not None: + body["overwrite_existing"] = self.overwrite_existing + if self.storage_mode is not None: + body["storage_mode"] = self.storage_mode + if self.workspace_name is not None: + body["workspace_name"] = self.workspace_name + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> PowerBiModel: + """Deserializes the PowerBiModel from a dictionary.""" + return cls( + authentication_method=_enum(d, "authentication_method", AuthenticationMethod), + model_name=d.get("model_name", None), + overwrite_existing=d.get("overwrite_existing", None), + storage_mode=_enum(d, "storage_mode", StorageMode), + workspace_name=d.get("workspace_name", None), + ) + + +@dataclass +class PowerBiTable: + catalog: Optional[str] = None + """The catalog name in Databricks""" + + name: Optional[str] = None + """The table name in Databricks""" + + schema: Optional[str] = None + """The schema name in Databricks""" + + storage_mode: Optional[StorageMode] = None + """The Power BI storage mode of the table""" + + def as_dict(self) -> dict: + """Serializes the PowerBiTable into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.catalog is not None: + body["catalog"] = self.catalog + if self.name is not None: + body["name"] = self.name + if self.schema is not None: + body["schema"] = self.schema + if self.storage_mode is not None: + body["storage_mode"] = self.storage_mode.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the PowerBiTable into a shallow dictionary of its immediate attributes.""" + body = {} + if self.catalog is not None: + body["catalog"] = self.catalog + if self.name is not None: + body["name"] = self.name + if self.schema is not None: + body["schema"] = self.schema + if self.storage_mode is not None: + body["storage_mode"] = self.storage_mode + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> PowerBiTable: + """Deserializes the PowerBiTable from a dictionary.""" + return cls( + catalog=d.get("catalog", None), + name=d.get("name", None), + schema=d.get("schema", None), + storage_mode=_enum(d, "storage_mode", StorageMode), + ) + + +@dataclass +class PowerBiTask: + connection_resource_name: Optional[str] = None + """The resource name of the UC connection to authenticate from Databricks to Power BI""" + + power_bi_model: Optional[PowerBiModel] = None + """The semantic model to update""" + + refresh_after_update: Optional[bool] = None + """Whether the model should be refreshed after the update""" + + tables: Optional[List[PowerBiTable]] = None + """The tables to be exported to Power BI""" + + warehouse_id: Optional[str] = None + """The SQL warehouse ID to use as the Power BI data source""" + + def as_dict(self) -> dict: + """Serializes the PowerBiTask into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.connection_resource_name is not None: + body["connection_resource_name"] = self.connection_resource_name + if self.power_bi_model: + body["power_bi_model"] = self.power_bi_model.as_dict() + if self.refresh_after_update is not None: + body["refresh_after_update"] = self.refresh_after_update + if self.tables: + body["tables"] = [v.as_dict() for v in self.tables] + if self.warehouse_id is not None: + body["warehouse_id"] = self.warehouse_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the PowerBiTask into a shallow dictionary of its immediate attributes.""" + body = {} + if self.connection_resource_name is not None: + body["connection_resource_name"] = self.connection_resource_name + if self.power_bi_model: + body["power_bi_model"] = self.power_bi_model + if self.refresh_after_update is not None: + body["refresh_after_update"] = self.refresh_after_update + if self.tables: + body["tables"] = self.tables + if self.warehouse_id is not None: + body["warehouse_id"] = self.warehouse_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> PowerBiTask: + """Deserializes the PowerBiTask from a dictionary.""" + return cls( + connection_resource_name=d.get("connection_resource_name", None), + power_bi_model=_from_dict(d, "power_bi_model", PowerBiModel), + refresh_after_update=d.get("refresh_after_update", None), + tables=_repeated_dict(d, "tables", PowerBiTable), + warehouse_id=d.get("warehouse_id", None), + ) + + @dataclass class PythonPyPiLibrary: package: str @@ -5924,9 +6207,9 @@ class Run: """Description of the run""" effective_performance_target: Optional[PerformanceTarget] = None - """effective_performance_target is the actual performance target used by the run during execution. - effective_performance_target can differ from the client-set performance_target depending on if - the job was eligible to be cost-optimized.""" + """The actual performance target used by the serverless run during execution. This can differ from + the client-set performance target on the request depending on whether the performance mode is + supported by the job type.""" end_time: Optional[int] = None """The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This @@ -6648,9 +6931,9 @@ class RunNow: job will be run.""" performance_target: Optional[PerformanceTarget] = None - """PerformanceTarget defines how performant or cost efficient the execution of run on serverless - compute should be. For RunNow, this performance target will override the target defined on the - job-level.""" + """The performance mode on a serverless job. The performance target determines the level of compute + performance or cost-efficiency for the run. This field overrides the performance target defined + on the job-level.""" pipeline_params: Optional[PipelineParams] = None """Controls whether the pipeline should perform a full refresh""" @@ -6825,6 +7108,9 @@ class RunOutput: clean_rooms_notebook_output: Optional[CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput] = None """The output of a clean rooms notebook task, if available""" + dashboard_output: Optional[DashboardTaskOutput] = None + """The output of a dashboard task, if available""" + dbt_output: Optional[DbtOutput] = None """The output of a dbt task, if available.""" @@ -6871,6 +7157,8 @@ def as_dict(self) -> dict: body = {} if self.clean_rooms_notebook_output: body["clean_rooms_notebook_output"] = self.clean_rooms_notebook_output.as_dict() + if self.dashboard_output: + body["dashboard_output"] = self.dashboard_output.as_dict() if self.dbt_output: body["dbt_output"] = self.dbt_output.as_dict() if self.error is not None: @@ -6898,6 +7186,8 @@ def as_shallow_dict(self) -> dict: body = {} if self.clean_rooms_notebook_output: body["clean_rooms_notebook_output"] = self.clean_rooms_notebook_output + if self.dashboard_output: + body["dashboard_output"] = self.dashboard_output if self.dbt_output: body["dbt_output"] = self.dbt_output if self.error is not None: @@ -6927,6 +7217,7 @@ def from_dict(cls, d: Dict[str, Any]) -> RunOutput: clean_rooms_notebook_output=_from_dict( d, "clean_rooms_notebook_output", CleanRoomsNotebookTaskCleanRoomsNotebookTaskOutput ), + dashboard_output=_from_dict(d, "dashboard_output", DashboardTaskOutput), dbt_output=_from_dict(d, "dbt_output", DbtOutput), error=d.get("error", None), error_trace=d.get("error_trace", None), @@ -7242,6 +7533,9 @@ class RunTask: `condition_task` field is present. The condition task does not require a cluster to execute and does not support retries or notifications.""" + dashboard_task: Optional[DashboardTask] = None + """The task runs a DashboardTask when the `dashboard_task` field is present.""" + dbt_task: Optional[DbtTask] = None """The task runs one or more dbt commands when the `dbt_task` field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.""" @@ -7255,13 +7549,12 @@ class RunTask: """An optional description for this task.""" disabled: Optional[bool] = None - """Denotes whether or not the task was disabled by the user. Disabled tasks do not execute and are - immediately skipped as soon as they are unblocked.""" + """Deprecated, field was never used in production.""" effective_performance_target: Optional[PerformanceTarget] = None - """effective_performance_target is the actual performance target used by the run during execution. - effective_performance_target can differ from the client-set performance_target depending on if - the job was eligible to be cost-optimized.""" + """The actual performance target used by the serverless run during execution. This can differ from + the client-set performance target on the request depending on whether the performance mode is + supported by the job type.""" email_notifications: Optional[JobEmailNotifications] = None """An optional set of email addresses notified when the task run begins or completes. The default @@ -7292,7 +7585,6 @@ class RunTask: present.""" gen_ai_compute_task: Optional[GenAiComputeTask] = None - """Next field: 9""" git_source: Optional[GitSource] = None """An optional specification for a remote Git repository containing the source code used by tasks. @@ -7324,6 +7616,9 @@ class RunTask: """The task triggers a pipeline update when the `pipeline_task` field is present. Only pipelines configured to use triggered more are supported.""" + power_bi_task: Optional[PowerBiTask] = None + """The task triggers a Power BI semantic model update when the `power_bi_task` field is present.""" + python_wheel_task: Optional[PythonWheelTask] = None """The task runs a Python wheel when the `python_wheel_task` field is present.""" @@ -7415,6 +7710,8 @@ def as_dict(self) -> dict: body["cluster_instance"] = self.cluster_instance.as_dict() if self.condition_task: body["condition_task"] = self.condition_task.as_dict() + if self.dashboard_task: + body["dashboard_task"] = self.dashboard_task.as_dict() if self.dbt_task: body["dbt_task"] = self.dbt_task.as_dict() if self.depends_on: @@ -7453,6 +7750,8 @@ def as_dict(self) -> dict: body["notification_settings"] = self.notification_settings.as_dict() if self.pipeline_task: body["pipeline_task"] = self.pipeline_task.as_dict() + if self.power_bi_task: + body["power_bi_task"] = self.power_bi_task.as_dict() if self.python_wheel_task: body["python_wheel_task"] = self.python_wheel_task.as_dict() if self.queue_duration is not None: @@ -7506,6 +7805,8 @@ def as_shallow_dict(self) -> dict: body["cluster_instance"] = self.cluster_instance if self.condition_task: body["condition_task"] = self.condition_task + if self.dashboard_task: + body["dashboard_task"] = self.dashboard_task if self.dbt_task: body["dbt_task"] = self.dbt_task if self.depends_on: @@ -7544,6 +7845,8 @@ def as_shallow_dict(self) -> dict: body["notification_settings"] = self.notification_settings if self.pipeline_task: body["pipeline_task"] = self.pipeline_task + if self.power_bi_task: + body["power_bi_task"] = self.power_bi_task if self.python_wheel_task: body["python_wheel_task"] = self.python_wheel_task if self.queue_duration is not None: @@ -7593,6 +7896,7 @@ def from_dict(cls, d: Dict[str, Any]) -> RunTask: cleanup_duration=d.get("cleanup_duration", None), cluster_instance=_from_dict(d, "cluster_instance", ClusterInstance), condition_task=_from_dict(d, "condition_task", RunConditionTask), + dashboard_task=_from_dict(d, "dashboard_task", DashboardTask), dbt_task=_from_dict(d, "dbt_task", DbtTask), depends_on=_repeated_dict(d, "depends_on", TaskDependency), description=d.get("description", None), @@ -7612,6 +7916,7 @@ def from_dict(cls, d: Dict[str, Any]) -> RunTask: notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), + power_bi_task=_from_dict(d, "power_bi_task", PowerBiTask), python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), queue_duration=d.get("queue_duration", None), resolved_values=_from_dict(d, "resolved_values", ResolvedValues), @@ -8506,6 +8811,13 @@ def from_dict(cls, d: Dict[str, Any]) -> SqlTaskSubscription: return cls(destination_id=d.get("destination_id", None), user_name=d.get("user_name", None)) +class StorageMode(Enum): + + DIRECT_QUERY = "DIRECT_QUERY" + DUAL = "DUAL" + IMPORT = "IMPORT" + + @dataclass class SubmitRun: access_control_list: Optional[List[JobAccessControlRequest]] = None @@ -8701,6 +9013,9 @@ class SubmitTask: `condition_task` field is present. The condition task does not require a cluster to execute and does not support retries or notifications.""" + dashboard_task: Optional[DashboardTask] = None + """The task runs a DashboardTask when the `dashboard_task` field is present.""" + dbt_task: Optional[DbtTask] = None """The task runs one or more dbt commands when the `dbt_task` field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.""" @@ -8731,7 +9046,6 @@ class SubmitTask: present.""" gen_ai_compute_task: Optional[GenAiComputeTask] = None - """Next field: 9""" health: Optional[JobsHealthRules] = None """An optional set of health rules that can be defined for this job.""" @@ -8754,6 +9068,9 @@ class SubmitTask: """The task triggers a pipeline update when the `pipeline_task` field is present. Only pipelines configured to use triggered more are supported.""" + power_bi_task: Optional[PowerBiTask] = None + """The task triggers a Power BI semantic model update when the `power_bi_task` field is present.""" + python_wheel_task: Optional[PythonWheelTask] = None """The task runs a Python wheel when the `python_wheel_task` field is present.""" @@ -8807,6 +9124,8 @@ def as_dict(self) -> dict: body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() if self.condition_task: body["condition_task"] = self.condition_task.as_dict() + if self.dashboard_task: + body["dashboard_task"] = self.dashboard_task.as_dict() if self.dbt_task: body["dbt_task"] = self.dbt_task.as_dict() if self.depends_on: @@ -8835,6 +9154,8 @@ def as_dict(self) -> dict: body["notification_settings"] = self.notification_settings.as_dict() if self.pipeline_task: body["pipeline_task"] = self.pipeline_task.as_dict() + if self.power_bi_task: + body["power_bi_task"] = self.power_bi_task.as_dict() if self.python_wheel_task: body["python_wheel_task"] = self.python_wheel_task.as_dict() if self.run_if is not None: @@ -8864,6 +9185,8 @@ def as_shallow_dict(self) -> dict: body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task if self.condition_task: body["condition_task"] = self.condition_task + if self.dashboard_task: + body["dashboard_task"] = self.dashboard_task if self.dbt_task: body["dbt_task"] = self.dbt_task if self.depends_on: @@ -8892,6 +9215,8 @@ def as_shallow_dict(self) -> dict: body["notification_settings"] = self.notification_settings if self.pipeline_task: body["pipeline_task"] = self.pipeline_task + if self.power_bi_task: + body["power_bi_task"] = self.power_bi_task if self.python_wheel_task: body["python_wheel_task"] = self.python_wheel_task if self.run_if is not None: @@ -8920,6 +9245,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: return cls( clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), condition_task=_from_dict(d, "condition_task", ConditionTask), + dashboard_task=_from_dict(d, "dashboard_task", DashboardTask), dbt_task=_from_dict(d, "dbt_task", DbtTask), depends_on=_repeated_dict(d, "depends_on", TaskDependency), description=d.get("description", None), @@ -8934,6 +9260,7 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), + power_bi_task=_from_dict(d, "power_bi_task", PowerBiTask), python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), run_if=_enum(d, "run_if", RunIf), run_job_task=_from_dict(d, "run_job_task", RunJobTask), @@ -8947,6 +9274,78 @@ def from_dict(cls, d: Dict[str, Any]) -> SubmitTask: ) +@dataclass +class Subscription: + custom_subject: Optional[str] = None + """Optional: Allows users to specify a custom subject line on the email sent to subscribers.""" + + paused: Optional[bool] = None + """When true, the subscription will not send emails.""" + + subscribers: Optional[List[SubscriptionSubscriber]] = None + + def as_dict(self) -> dict: + """Serializes the Subscription into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.custom_subject is not None: + body["custom_subject"] = self.custom_subject + if self.paused is not None: + body["paused"] = self.paused + if self.subscribers: + body["subscribers"] = [v.as_dict() for v in self.subscribers] + return body + + def as_shallow_dict(self) -> dict: + """Serializes the Subscription into a shallow dictionary of its immediate attributes.""" + body = {} + if self.custom_subject is not None: + body["custom_subject"] = self.custom_subject + if self.paused is not None: + body["paused"] = self.paused + if self.subscribers: + body["subscribers"] = self.subscribers + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> Subscription: + """Deserializes the Subscription from a dictionary.""" + return cls( + custom_subject=d.get("custom_subject", None), + paused=d.get("paused", None), + subscribers=_repeated_dict(d, "subscribers", SubscriptionSubscriber), + ) + + +@dataclass +class SubscriptionSubscriber: + destination_id: Optional[str] = None + + user_name: Optional[str] = None + + def as_dict(self) -> dict: + """Serializes the SubscriptionSubscriber into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.destination_id is not None: + body["destination_id"] = self.destination_id + if self.user_name is not None: + body["user_name"] = self.user_name + return body + + def as_shallow_dict(self) -> dict: + """Serializes the SubscriptionSubscriber into a shallow dictionary of its immediate attributes.""" + body = {} + if self.destination_id is not None: + body["destination_id"] = self.destination_id + if self.user_name is not None: + body["user_name"] = self.user_name + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> SubscriptionSubscriber: + """Deserializes the SubscriptionSubscriber from a dictionary.""" + return cls(destination_id=d.get("destination_id", None), user_name=d.get("user_name", None)) + + @dataclass class TableUpdateTriggerConfiguration: condition: Optional[Condition] = None @@ -9019,6 +9418,9 @@ class Task: `condition_task` field is present. The condition task does not require a cluster to execute and does not support retries or notifications.""" + dashboard_task: Optional[DashboardTask] = None + """The task runs a DashboardTask when the `dashboard_task` field is present.""" + dbt_task: Optional[DbtTask] = None """The task runs one or more dbt commands when the `dbt_task` field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.""" @@ -9053,7 +9455,6 @@ class Task: present.""" gen_ai_compute_task: Optional[GenAiComputeTask] = None - """Next field: 9""" health: Optional[JobsHealthRules] = None """An optional set of health rules that can be defined for this job.""" @@ -9090,6 +9491,9 @@ class Task: """The task triggers a pipeline update when the `pipeline_task` field is present. Only pipelines configured to use triggered more are supported.""" + power_bi_task: Optional[PowerBiTask] = None + """The task triggers a Power BI semantic model update when the `power_bi_task` field is present.""" + python_wheel_task: Optional[PythonWheelTask] = None """The task runs a Python wheel when the `python_wheel_task` field is present.""" @@ -9150,6 +9554,8 @@ def as_dict(self) -> dict: body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task.as_dict() if self.condition_task: body["condition_task"] = self.condition_task.as_dict() + if self.dashboard_task: + body["dashboard_task"] = self.dashboard_task.as_dict() if self.dbt_task: body["dbt_task"] = self.dbt_task.as_dict() if self.depends_on: @@ -9186,6 +9592,8 @@ def as_dict(self) -> dict: body["notification_settings"] = self.notification_settings.as_dict() if self.pipeline_task: body["pipeline_task"] = self.pipeline_task.as_dict() + if self.power_bi_task: + body["power_bi_task"] = self.power_bi_task.as_dict() if self.python_wheel_task: body["python_wheel_task"] = self.python_wheel_task.as_dict() if self.retry_on_timeout is not None: @@ -9217,6 +9625,8 @@ def as_shallow_dict(self) -> dict: body["clean_rooms_notebook_task"] = self.clean_rooms_notebook_task if self.condition_task: body["condition_task"] = self.condition_task + if self.dashboard_task: + body["dashboard_task"] = self.dashboard_task if self.dbt_task: body["dbt_task"] = self.dbt_task if self.depends_on: @@ -9253,6 +9663,8 @@ def as_shallow_dict(self) -> dict: body["notification_settings"] = self.notification_settings if self.pipeline_task: body["pipeline_task"] = self.pipeline_task + if self.power_bi_task: + body["power_bi_task"] = self.power_bi_task if self.python_wheel_task: body["python_wheel_task"] = self.python_wheel_task if self.retry_on_timeout is not None: @@ -9283,6 +9695,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Task: return cls( clean_rooms_notebook_task=_from_dict(d, "clean_rooms_notebook_task", CleanRoomsNotebookTask), condition_task=_from_dict(d, "condition_task", ConditionTask), + dashboard_task=_from_dict(d, "dashboard_task", DashboardTask), dbt_task=_from_dict(d, "dbt_task", DbtTask), depends_on=_repeated_dict(d, "depends_on", TaskDependency), description=d.get("description", None), @@ -9301,6 +9714,7 @@ def from_dict(cls, d: Dict[str, Any]) -> Task: notebook_task=_from_dict(d, "notebook_task", NotebookTask), notification_settings=_from_dict(d, "notification_settings", TaskNotificationSettings), pipeline_task=_from_dict(d, "pipeline_task", PipelineTask), + power_bi_task=_from_dict(d, "power_bi_task", PowerBiTask), python_wheel_task=_from_dict(d, "python_wheel_task", PythonWheelTask), retry_on_timeout=d.get("retry_on_timeout", None), run_if=_enum(d, "run_if", RunIf), @@ -9993,6 +10407,30 @@ def from_dict(cls, d: Dict[str, Any]) -> WebhookNotifications: ) +@dataclass +class WidgetErrorDetail: + message: Optional[str] = None + + def as_dict(self) -> dict: + """Serializes the WidgetErrorDetail into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.message is not None: + body["message"] = self.message + return body + + def as_shallow_dict(self) -> dict: + """Serializes the WidgetErrorDetail into a shallow dictionary of its immediate attributes.""" + body = {} + if self.message is not None: + body["message"] = self.message + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> WidgetErrorDetail: + """Deserializes the WidgetErrorDetail from a dictionary.""" + return cls(message=d.get("message", None)) + + @dataclass class WorkloadType: """Cluster Attributes showing for clusters workload types.""" @@ -10208,8 +10646,8 @@ def create( :param parameters: List[:class:`JobParameterDefinition`] (optional) Job-level parameter definitions :param performance_target: :class:`PerformanceTarget` (optional) - PerformanceTarget defines how performant or cost efficient the execution of run on serverless should - be. + The performance mode on a serverless job. The performance target determines the level of compute + performance or cost-efficiency for the run. :param queue: :class:`QueueSettings` (optional) The queue settings of the job. :param run_as: :class:`JobRunAs` (optional) @@ -10890,9 +11328,9 @@ def run_now( A list of task keys to run inside of the job. If this field is not provided, all tasks in the job will be run. :param performance_target: :class:`PerformanceTarget` (optional) - PerformanceTarget defines how performant or cost efficient the execution of run on serverless - compute should be. For RunNow, this performance target will override the target defined on the - job-level. + The performance mode on a serverless job. The performance target determines the level of compute + performance or cost-efficiency for the run. This field overrides the performance target defined on + the job-level. :param pipeline_params: :class:`PipelineParams` (optional) Controls whether the pipeline should perform a full refresh :param python_named_params: Dict[str,str] (optional) diff --git a/databricks/sdk/ml/v2/ml.py b/databricks/sdk/ml/v2/ml.py index 98124a335..44f5f28c5 100755 --- a/databricks/sdk/ml/v2/ml.py +++ b/databricks/sdk/ml/v2/ml.py @@ -267,6 +267,109 @@ def from_dict(cls, d: Dict[str, Any]) -> ApproveTransitionRequestResponse: return cls(activity=_from_dict(d, "activity", Activity)) +@dataclass +class ArtifactCredentialInfo: + headers: Optional[List[ArtifactCredentialInfoHttpHeader]] = None + """A collection of HTTP headers that should be specified when uploading to or downloading from the + specified `signed_uri`.""" + + path: Optional[str] = None + """The path, relative to the Run's artifact root location, of the artifact that can be accessed + with the credential.""" + + run_id: Optional[str] = None + """The ID of the MLflow Run containing the artifact that can be accessed with the credential.""" + + signed_uri: Optional[str] = None + """The signed URI credential that provides access to the artifact.""" + + type: Optional[ArtifactCredentialType] = None + """The type of the signed credential URI (e.g., an AWS presigned URL or an Azure Shared Access + Signature URI).""" + + def as_dict(self) -> dict: + """Serializes the ArtifactCredentialInfo into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.headers: + body["headers"] = [v.as_dict() for v in self.headers] + if self.path is not None: + body["path"] = self.path + if self.run_id is not None: + body["run_id"] = self.run_id + if self.signed_uri is not None: + body["signed_uri"] = self.signed_uri + if self.type is not None: + body["type"] = self.type.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ArtifactCredentialInfo into a shallow dictionary of its immediate attributes.""" + body = {} + if self.headers: + body["headers"] = self.headers + if self.path is not None: + body["path"] = self.path + if self.run_id is not None: + body["run_id"] = self.run_id + if self.signed_uri is not None: + body["signed_uri"] = self.signed_uri + if self.type is not None: + body["type"] = self.type + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ArtifactCredentialInfo: + """Deserializes the ArtifactCredentialInfo from a dictionary.""" + return cls( + headers=_repeated_dict(d, "headers", ArtifactCredentialInfoHttpHeader), + path=d.get("path", None), + run_id=d.get("run_id", None), + signed_uri=d.get("signed_uri", None), + type=_enum(d, "type", ArtifactCredentialType), + ) + + +@dataclass +class ArtifactCredentialInfoHttpHeader: + name: Optional[str] = None + """The HTTP header name.""" + + value: Optional[str] = None + """The HTTP header value.""" + + def as_dict(self) -> dict: + """Serializes the ArtifactCredentialInfoHttpHeader into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.name is not None: + body["name"] = self.name + if self.value is not None: + body["value"] = self.value + return body + + def as_shallow_dict(self) -> dict: + """Serializes the ArtifactCredentialInfoHttpHeader into a shallow dictionary of its immediate attributes.""" + body = {} + if self.name is not None: + body["name"] = self.name + if self.value is not None: + body["value"] = self.value + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> ArtifactCredentialInfoHttpHeader: + """Deserializes the ArtifactCredentialInfoHttpHeader from a dictionary.""" + return cls(name=d.get("name", None), value=d.get("value", None)) + + +class ArtifactCredentialType(Enum): + """The type of a given artifact access credential""" + + AWS_PRESIGNED_URL = "AWS_PRESIGNED_URL" + AZURE_ADLS_GEN2_SAS_URI = "AZURE_ADLS_GEN2_SAS_URI" + AZURE_SAS_URI = "AZURE_SAS_URI" + GCP_SIGNED_URL = "GCP_SIGNED_URL" + + class CommentActivityAction(Enum): """An action that a user (with sufficient permissions) could take on a comment. Valid values are: * `EDIT_COMMENT`: Edit the comment @@ -513,6 +616,13 @@ class CreateForecastingExperimentRequest: holiday_regions: Optional[List[str]] = None """The region code(s) to automatically add holiday features. Currently supports only one region.""" + include_features: Optional[List[str]] = None + """Specifies the list of feature columns to include in model training. These columns must exist in + the training data and be of type string, numerical, or boolean. If not specified, no additional + features will be included. Note: Certain columns are automatically handled: - Automatically + excluded: split_column, target_column, custom_weights_column. - Automatically included: + time_column.""" + max_runtime: Optional[int] = None """The maximum duration for the experiment in minutes. The experiment stops automatically if it exceeds this limit.""" @@ -553,6 +663,8 @@ def as_dict(self) -> dict: body["forecast_horizon"] = self.forecast_horizon if self.holiday_regions: body["holiday_regions"] = [v for v in self.holiday_regions] + if self.include_features: + body["include_features"] = [v for v in self.include_features] if self.max_runtime is not None: body["max_runtime"] = self.max_runtime if self.prediction_data_path is not None: @@ -588,6 +700,8 @@ def as_shallow_dict(self) -> dict: body["forecast_horizon"] = self.forecast_horizon if self.holiday_regions: body["holiday_regions"] = self.holiday_regions + if self.include_features: + body["include_features"] = self.include_features if self.max_runtime is not None: body["max_runtime"] = self.max_runtime if self.prediction_data_path is not None: @@ -619,6 +733,7 @@ def from_dict(cls, d: Dict[str, Any]) -> CreateForecastingExperimentRequest: forecast_granularity=d.get("forecast_granularity", None), forecast_horizon=d.get("forecast_horizon", None), holiday_regions=d.get("holiday_regions", None), + include_features=d.get("include_features", None), max_runtime=d.get("max_runtime", None), prediction_data_path=d.get("prediction_data_path", None), primary_metric=d.get("primary_metric", None), @@ -2029,6 +2144,56 @@ class ForecastingExperimentState(Enum): SUCCEEDED = "SUCCEEDED" +@dataclass +class GetCredentialsForTraceDataDownloadResponse: + credential_info: Optional[ArtifactCredentialInfo] = None + """The artifact download credentials for the specified trace data.""" + + def as_dict(self) -> dict: + """Serializes the GetCredentialsForTraceDataDownloadResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.credential_info: + body["credential_info"] = self.credential_info.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GetCredentialsForTraceDataDownloadResponse into a shallow dictionary of its immediate attributes.""" + body = {} + if self.credential_info: + body["credential_info"] = self.credential_info + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GetCredentialsForTraceDataDownloadResponse: + """Deserializes the GetCredentialsForTraceDataDownloadResponse from a dictionary.""" + return cls(credential_info=_from_dict(d, "credential_info", ArtifactCredentialInfo)) + + +@dataclass +class GetCredentialsForTraceDataUploadResponse: + credential_info: Optional[ArtifactCredentialInfo] = None + """The artifact upload credentials for the specified trace data.""" + + def as_dict(self) -> dict: + """Serializes the GetCredentialsForTraceDataUploadResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.credential_info: + body["credential_info"] = self.credential_info.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the GetCredentialsForTraceDataUploadResponse into a shallow dictionary of its immediate attributes.""" + body = {} + if self.credential_info: + body["credential_info"] = self.credential_info + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> GetCredentialsForTraceDataUploadResponse: + """Deserializes the GetCredentialsForTraceDataUploadResponse from a dictionary.""" + return cls(credential_info=_from_dict(d, "credential_info", ArtifactCredentialInfo)) + + @dataclass class GetExperimentByNameResponse: experiment: Optional[Experiment] = None @@ -2992,38 +3157,6 @@ def from_dict(cls, d: Dict[str, Any]) -> LogModelResponse: return cls() -@dataclass -class LogOutputsRequest: - run_id: str - """The ID of the Run from which to log outputs.""" - - models: Optional[List[ModelOutput]] = None - """The model outputs from the Run.""" - - def as_dict(self) -> dict: - """Serializes the LogOutputsRequest into a dictionary suitable for use as a JSON request body.""" - body = {} - if self.models: - body["models"] = [v.as_dict() for v in self.models] - if self.run_id is not None: - body["run_id"] = self.run_id - return body - - def as_shallow_dict(self) -> dict: - """Serializes the LogOutputsRequest into a shallow dictionary of its immediate attributes.""" - body = {} - if self.models: - body["models"] = self.models - if self.run_id is not None: - body["run_id"] = self.run_id - return body - - @classmethod - def from_dict(cls, d: Dict[str, Any]) -> LogOutputsRequest: - """Deserializes the LogOutputsRequest from a dictionary.""" - return cls(models=_repeated_dict(d, "models", ModelOutput), run_id=d.get("run_id", None)) - - @dataclass class LogParam: key: str @@ -6238,6 +6371,38 @@ def get_by_name(self, experiment_name: str) -> GetExperimentByNameResponse: res = self._api.do("GET", "/api/2.0/mlflow/experiments/get-by-name", query=query, headers=headers) return GetExperimentByNameResponse.from_dict(res) + def get_credentials_for_trace_data_download(self, request_id: str) -> GetCredentialsForTraceDataDownloadResponse: + """Get credentials to download trace data. + + :param request_id: str + The ID of the trace to fetch artifact download credentials for. + + :returns: :class:`GetCredentialsForTraceDataDownloadResponse` + """ + + headers = { + "Accept": "application/json", + } + + res = self._api.do("GET", f"/api/2.0/mlflow/traces/{request_id}/credentials-for-data-download", headers=headers) + return GetCredentialsForTraceDataDownloadResponse.from_dict(res) + + def get_credentials_for_trace_data_upload(self, request_id: str) -> GetCredentialsForTraceDataUploadResponse: + """Get credentials to upload trace data. + + :param request_id: str + The ID of the trace to fetch artifact upload credentials for. + + :returns: :class:`GetCredentialsForTraceDataUploadResponse` + """ + + headers = { + "Accept": "application/json", + } + + res = self._api.do("GET", f"/api/2.0/mlflow/traces/{request_id}/credentials-for-data-upload", headers=headers) + return GetCredentialsForTraceDataUploadResponse.from_dict(res) + def get_experiment(self, experiment_id: str) -> GetExperimentResponse: """Get an experiment. @@ -7119,6 +7284,7 @@ def create_experiment( custom_weights_column: Optional[str] = None, experiment_path: Optional[str] = None, holiday_regions: Optional[List[str]] = None, + include_features: Optional[List[str]] = None, max_runtime: Optional[int] = None, prediction_data_path: Optional[str] = None, primary_metric: Optional[str] = None, @@ -7152,6 +7318,11 @@ def create_experiment( The path in the workspace to store the created experiment. :param holiday_regions: List[str] (optional) The region code(s) to automatically add holiday features. Currently supports only one region. + :param include_features: List[str] (optional) + Specifies the list of feature columns to include in model training. These columns must exist in the + training data and be of type string, numerical, or boolean. If not specified, no additional features + will be included. Note: Certain columns are automatically handled: - Automatically excluded: + split_column, target_column, custom_weights_column. - Automatically included: time_column. :param max_runtime: int (optional) The maximum duration for the experiment in minutes. The experiment stops automatically if it exceeds this limit. @@ -7187,6 +7358,8 @@ def create_experiment( body["forecast_horizon"] = forecast_horizon if holiday_regions is not None: body["holiday_regions"] = [v for v in holiday_regions] + if include_features is not None: + body["include_features"] = [v for v in include_features] if max_runtime is not None: body["max_runtime"] = max_runtime if prediction_data_path is not None: diff --git a/databricks/sdk/serving/v2/serving.py b/databricks/sdk/serving/v2/serving.py index bab0fcdbd..4ca074a96 100755 --- a/databricks/sdk/serving/v2/serving.py +++ b/databricks/sdk/serving/v2/serving.py @@ -841,8 +841,9 @@ class CreateServingEndpoint: workspace. An endpoint name can consist of alphanumeric characters, dashes, and underscores.""" ai_gateway: Optional[AiGatewayConfig] = None - """The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned - throughput endpoints are currently supported.""" + """The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned + throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only + support inference tables.""" budget_policy_id: Optional[str] = None """The budget policy to be applied to the serving endpoint.""" @@ -3523,8 +3524,9 @@ def from_dict(cls, d: Dict[str, Any]) -> ServerLogsResponse: @dataclass class ServingEndpoint: ai_gateway: Optional[AiGatewayConfig] = None - """The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned - throughput endpoints are currently supported.""" + """The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned + throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only + support inference tables.""" budget_policy_id: Optional[str] = None """The budget policy associated with the endpoint.""" @@ -3741,8 +3743,9 @@ def from_dict(cls, d: Dict[str, Any]) -> ServingEndpointAccessControlResponse: @dataclass class ServingEndpointDetailed: ai_gateway: Optional[AiGatewayConfig] = None - """The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned - throughput endpoints are currently supported.""" + """The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned + throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only + support inference tables.""" budget_policy_id: Optional[str] = None """The budget policy associated with the endpoint.""" @@ -4199,8 +4202,9 @@ def create( The name of the serving endpoint. This field is required and must be unique across a Databricks workspace. An endpoint name can consist of alphanumeric characters, dashes, and underscores. :param ai_gateway: :class:`AiGatewayConfig` (optional) - The AI Gateway configuration for the serving endpoint. NOTE: Only external model and provisioned - throughput endpoints are currently supported. + The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, + and pay-per-token endpoints are fully supported; agent endpoints currently only support inference + tables. :param budget_policy_id: str (optional) The budget policy to be applied to the serving endpoint. :param config: :class:`EndpointCoreConfigInput` (optional) @@ -4464,8 +4468,7 @@ def patch( def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> PutResponse: """Update rate limits of a serving endpoint. - Used to update the rate limits of a serving endpoint. NOTE: Only foundation model endpoints are - currently supported. For external models, use AI Gateway to manage rate limits. + Deprecated: Please use AI Gateway to manage rate limits instead. :param name: str The name of the serving endpoint whose rate limits are being updated. This field is required. @@ -4497,8 +4500,8 @@ def put_ai_gateway( ) -> PutAiGatewayResponse: """Update AI Gateway of a serving endpoint. - Used to update the AI Gateway of a serving endpoint. NOTE: Only external model and provisioned - throughput endpoints are currently supported. + Used to update the AI Gateway of a serving endpoint. NOTE: External model, provisioned throughput, and + pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. :param name: str The name of the serving endpoint whose AI Gateway is being updated. This field is required. diff --git a/databricks/sdk/settings/v2/client.py b/databricks/sdk/settings/v2/client.py index 45973adc5..8c1642bb8 100755 --- a/databricks/sdk/settings/v2/client.py +++ b/databricks/sdk/settings/v2/client.py @@ -13,12 +13,12 @@ CredentialsManagerAPI, CspEnablementAccountAPI, DefaultNamespaceAPI, DisableLegacyAccessAPI, DisableLegacyDbfsAPI, DisableLegacyFeaturesAPI, - EnableIpAccessListsAPI, EnhancedSecurityMonitoringAPI, - EsmEnablementAccountAPI, IpAccessListsAPI, - NetworkConnectivityAPI, NotificationDestinationsAPI, - PersonalComputeAPI, RestrictWorkspaceAdminsAPI, - SettingsAPI, TokenManagementAPI, TokensAPI, - WorkspaceConfAPI) + EnableIpAccessListsAPI, EnableResultsDownloadingAPI, + EnhancedSecurityMonitoringAPI, EsmEnablementAccountAPI, + IpAccessListsAPI, NetworkConnectivityAPI, + NotificationDestinationsAPI, PersonalComputeAPI, + RestrictWorkspaceAdminsAPI, SettingsAPI, + TokenManagementAPI, TokensAPI, WorkspaceConfAPI) _LOG = logging.getLogger(__name__) @@ -664,10 +664,9 @@ class DisableLegacyAccessClient(DisableLegacyAccessAPI): """ 'Disabling legacy access' has the following impacts: - 1. Disables direct access to the Hive Metastore. However, you can still access Hive Metastore - through HMS Federation. 2. Disables Fallback Mode (docs link) on any External Location access - from the workspace. 3. Alters DBFS path access to use External Location permissions in place of - legacy credentials. 4. Enforces Unity Catalog access on all path based access. + 1. Disables direct access to Hive Metastores from the workspace. However, you can still access a + Hive Metastore through Hive Metastore federation. 2. Disables fallback mode on external location + access from the workspace. 3. Disables Databricks Runtime versions prior to 13.3LTS. """ def __init__( @@ -935,6 +934,73 @@ def __init__( super().__init__(client.ApiClient(config)) +class EnableResultsDownloadingClient(EnableResultsDownloadingAPI): + """ + The Enable Results Downloading API controls the workspace level conf for the enablement of + downloading results. + """ + + def __init__( + self, + *, + host: Optional[str] = None, + account_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + token: Optional[str] = None, + profile: Optional[str] = None, + config_file: Optional[str] = None, + azure_workspace_resource_id: Optional[str] = None, + azure_client_secret: Optional[str] = None, + azure_client_id: Optional[str] = None, + azure_tenant_id: Optional[str] = None, + azure_environment: Optional[str] = None, + auth_type: Optional[str] = None, + cluster_id: Optional[str] = None, + google_credentials: Optional[str] = None, + google_service_account: Optional[str] = None, + debug_truncate_bytes: Optional[int] = None, + debug_headers: Optional[bool] = None, + product="unknown", + product_version="0.0.0", + credentials_strategy: Optional[CredentialsStrategy] = None, + credentials_provider: Optional[CredentialsStrategy] = None, + config: Optional[client.Config] = None, + ): + + if not config: + config = client.Config( + host=host, + account_id=account_id, + username=username, + password=password, + client_id=client_id, + client_secret=client_secret, + token=token, + profile=profile, + config_file=config_file, + azure_workspace_resource_id=azure_workspace_resource_id, + azure_client_secret=azure_client_secret, + azure_client_id=azure_client_id, + azure_tenant_id=azure_tenant_id, + azure_environment=azure_environment, + auth_type=auth_type, + cluster_id=cluster_id, + google_credentials=google_credentials, + google_service_account=google_service_account, + credentials_strategy=credentials_strategy, + credentials_provider=credentials_provider, + debug_truncate_bytes=debug_truncate_bytes, + debug_headers=debug_headers, + product=product, + product_version=product_version, + ) + self._config = config.copy() + super().__init__(client.ApiClient(config)) + + class EnhancedSecurityMonitoringClient(EnhancedSecurityMonitoringAPI): """ Controls whether enhanced security monitoring is enabled for the current workspace. If the diff --git a/databricks/sdk/settings/v2/settings.py b/databricks/sdk/settings/v2/settings.py index 2f17e7b23..67ae16b9b 100755 --- a/databricks/sdk/settings/v2/settings.py +++ b/databricks/sdk/settings/v2/settings.py @@ -1705,6 +1705,40 @@ def from_dict(cls, d: Dict[str, Any]) -> Empty: return cls() +@dataclass +class EnableResultsDownloading: + boolean_val: Optional[BooleanMessage] = None + + setting_name: Optional[str] = None + """Name of the corresponding setting. This field is populated in the response, but it will not be + respected even if it's set in the request body. The setting name in the path parameter will be + respected instead. Setting name is required to be 'default' if the setting only has one instance + per workspace.""" + + def as_dict(self) -> dict: + """Serializes the EnableResultsDownloading into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.boolean_val: + body["boolean_val"] = self.boolean_val.as_dict() + if self.setting_name is not None: + body["setting_name"] = self.setting_name + return body + + def as_shallow_dict(self) -> dict: + """Serializes the EnableResultsDownloading into a shallow dictionary of its immediate attributes.""" + body = {} + if self.boolean_val: + body["boolean_val"] = self.boolean_val + if self.setting_name is not None: + body["setting_name"] = self.setting_name + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> EnableResultsDownloading: + """Deserializes the EnableResultsDownloading from a dictionary.""" + return cls(boolean_val=_from_dict(d, "boolean_val", BooleanMessage), setting_name=d.get("setting_name", None)) + + @dataclass class EnhancedSecurityMonitoring: """SHIELD feature: ESM""" @@ -4381,6 +4415,58 @@ def from_dict(cls, d: Dict[str, Any]) -> UpdateDisableLegacyFeaturesRequest: ) +@dataclass +class UpdateEnableResultsDownloadingRequest: + """Details required to update a setting.""" + + allow_missing: bool + """This should always be set to true for Settings API. Added for AIP compliance.""" + + setting: EnableResultsDownloading + + field_mask: str + """The field mask must be a single string, with multiple fields separated by commas (no spaces). + The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields + (e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed, + as only the entire collection field can be specified. Field names must exactly match the + resource field names. + + A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the + fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the + API changes in the future.""" + + def as_dict(self) -> dict: + """Serializes the UpdateEnableResultsDownloadingRequest into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.allow_missing is not None: + body["allow_missing"] = self.allow_missing + if self.field_mask is not None: + body["field_mask"] = self.field_mask + if self.setting: + body["setting"] = self.setting.as_dict() + return body + + def as_shallow_dict(self) -> dict: + """Serializes the UpdateEnableResultsDownloadingRequest into a shallow dictionary of its immediate attributes.""" + body = {} + if self.allow_missing is not None: + body["allow_missing"] = self.allow_missing + if self.field_mask is not None: + body["field_mask"] = self.field_mask + if self.setting: + body["setting"] = self.setting + return body + + @classmethod + def from_dict(cls, d: Dict[str, Any]) -> UpdateEnableResultsDownloadingRequest: + """Deserializes the UpdateEnableResultsDownloadingRequest from a dictionary.""" + return cls( + allow_missing=d.get("allow_missing", None), + field_mask=d.get("field_mask", None), + setting=_from_dict(d, "setting", EnableResultsDownloading), + ) + + @dataclass class UpdateEnhancedSecurityMonitoringSettingRequest: """Details required to update a setting.""" @@ -5589,10 +5675,9 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma class DisableLegacyAccessAPI: """'Disabling legacy access' has the following impacts: - 1. Disables direct access to the Hive Metastore. However, you can still access Hive Metastore through HMS - Federation. 2. Disables Fallback Mode (docs link) on any External Location access from the workspace. 3. - Alters DBFS path access to use External Location permissions in place of legacy credentials. 4. Enforces - Unity Catalog access on all path based access.""" + 1. Disables direct access to Hive Metastores from the workspace. However, you can still access a Hive + Metastore through Hive Metastore federation. 2. Disables fallback mode on external location access from + the workspace. 3. Disables Databricks Runtime versions prior to 13.3LTS.""" def __init__(self, api_client): self._api = api_client @@ -6011,6 +6096,70 @@ def update(self, allow_missing: bool, setting: AccountIpAccessEnable, field_mask return AccountIpAccessEnable.from_dict(res) +class EnableResultsDownloadingAPI: + """The Enable Results Downloading API controls the workspace level conf for the enablement of downloading + results.""" + + def __init__(self, api_client): + self._api = api_client + + def get_enable_results_downloading(self) -> EnableResultsDownloading: + """Get the Enable Results Downloading setting. + + Gets the Enable Results Downloading setting. + + :returns: :class:`EnableResultsDownloading` + """ + + headers = { + "Accept": "application/json", + } + + res = self._api.do("GET", "/api/2.0/settings/types/enable-results-downloading/names/default", headers=headers) + return EnableResultsDownloading.from_dict(res) + + def patch_enable_results_downloading( + self, allow_missing: bool, setting: EnableResultsDownloading, field_mask: str + ) -> EnableResultsDownloading: + """Update the Enable Results Downloading setting. + + Updates the Enable Results Downloading setting. The model follows eventual consistency, which means + the get after the update operation might receive stale values for some time. + + :param allow_missing: bool + This should always be set to true for Settings API. Added for AIP compliance. + :param setting: :class:`EnableResultsDownloading` + :param field_mask: str + The field mask must be a single string, with multiple fields separated by commas (no spaces). The + field path is relative to the resource object, using a dot (`.`) to navigate sub-fields (e.g., + `author.given_name`). Specification of elements in sequence or map fields is not allowed, as only + the entire collection field can be specified. Field names must exactly match the resource field + names. + + A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the + fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the API + changes in the future. + + :returns: :class:`EnableResultsDownloading` + """ + body = {} + if allow_missing is not None: + body["allow_missing"] = allow_missing + if field_mask is not None: + body["field_mask"] = field_mask + if setting is not None: + body["setting"] = setting.as_dict() + headers = { + "Accept": "application/json", + "Content-Type": "application/json", + } + + res = self._api.do( + "PATCH", "/api/2.0/settings/types/enable-results-downloading/names/default", body=body, headers=headers + ) + return EnableResultsDownloading.from_dict(res) + + class EnhancedSecurityMonitoringAPI: """Controls whether enhanced security monitoring is enabled for the current workspace. If the compliance security profile is enabled, this is automatically enabled. By default, it is disabled. However, if the diff --git a/databricks/sdk/sql/v2/sql.py b/databricks/sdk/sql/v2/sql.py index 096df9d6c..89bfffd79 100755 --- a/databricks/sdk/sql/v2/sql.py +++ b/databricks/sdk/sql/v2/sql.py @@ -5190,6 +5190,11 @@ class QueryInfo: channel_used: Optional[ChannelInfo] = None """SQL Warehouse channel information at the time of query execution""" + client_application: Optional[str] = None + """Client application that ran the statement. For example: Databricks SQL Editor, Tableau, and + Power BI. This field is derived from information provided by client applications. While values + are expected to remain static over time, this cannot be guaranteed.""" + duration: Optional[int] = None """Total execution time of the statement ( excluding result fetch time ).""" @@ -5267,6 +5272,8 @@ def as_dict(self) -> dict: body = {} if self.channel_used: body["channel_used"] = self.channel_used.as_dict() + if self.client_application is not None: + body["client_application"] = self.client_application if self.duration is not None: body["duration"] = self.duration if self.endpoint_id is not None: @@ -5318,6 +5325,8 @@ def as_shallow_dict(self) -> dict: body = {} if self.channel_used: body["channel_used"] = self.channel_used + if self.client_application is not None: + body["client_application"] = self.client_application if self.duration is not None: body["duration"] = self.duration if self.endpoint_id is not None: @@ -5369,6 +5378,7 @@ def from_dict(cls, d: Dict[str, Any]) -> QueryInfo: """Deserializes the QueryInfo from a dictionary.""" return cls( channel_used=_from_dict(d, "channel_used", ChannelInfo), + client_application=d.get("client_application", None), duration=d.get("duration", None), endpoint_id=d.get("endpoint_id", None), error_message=d.get("error_message", None), From 56e4eb364834e118d026f047ef6ee02ef2599d8e Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Thu, 10 Apr 2025 08:02:51 +0000 Subject: [PATCH 18/20] address comments --- databricks/sdk/__init__.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index 45d441480..c885c5d3a 100755 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -9,8 +9,6 @@ from databricks.sdk.databricks import azure from databricks.sdk.databricks.credentials_provider import CredentialsStrategy from databricks.sdk.databricks.data_plane import DataPlaneTokenSource -from databricks.sdk.files.v2.files import FilesAPI -from databricks.sdk.files.v2.mixin import DbfsExt, FilesExt _LOG = logging.getLogger(__name__) @@ -30,11 +28,3 @@ def _make_dbutils(config: client.Config): from databricks.sdk.databricks.runtime import dbutils as runtime_dbutils return runtime_dbutils - - -def _make_files_client(apiClient: client.ApiClient, config: client.Config): - if config.enable_experimental_files_api_client: - _LOG.info("Experimental Files API client is enabled") - return FilesExt(apiClient, config) - else: - return FilesAPI(apiClient) From 91c1ed61ef38cf1b85b18816f8f305b71c51faf8 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Thu, 10 Apr 2025 08:11:41 +0000 Subject: [PATCH 19/20] update --- tests/integration/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index e12c4f9ba..fb25db9db 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -7,7 +7,7 @@ import pytest -from databricks.sdk import FilesExt +from databricks.sdk.files.v2.mixin import FilesExt from databricks.sdk.catalog.v2.catalog import VolumeType from databricks.sdk.databricks.config import Config from databricks.sdk.files.v2.files import FilesAPI From 2910d4dae0d733e3181de22a7bf1fc8711f1221d Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Thu, 10 Apr 2025 08:20:26 +0000 Subject: [PATCH 20/20] update --- tests/integration/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index fb25db9db..62f57089f 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -7,10 +7,10 @@ import pytest -from databricks.sdk.files.v2.mixin import FilesExt from databricks.sdk.catalog.v2.catalog import VolumeType from databricks.sdk.databricks.config import Config from databricks.sdk.files.v2.files import FilesAPI +from databricks.sdk.files.v2.mixin import FilesExt def pytest_addoption(parser):