diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index a2ba58aa5..68cd2f4be 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -f2385add116e3716c8a90a0b68e204deb40f996c \ No newline at end of file +7016dcbf2e011459416cf408ce21143bcc4b3a25 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index c8e5b2f0b..a0bfc0940 100755 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,7 @@ databricks/sdk/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 diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index 4f4689af2..beb3fd7bb 100755 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -28,6 +28,9 @@ TableConstraintsAPI, TablesAPI, TemporaryTableCredentialsAPI, VolumesAPI, WorkspaceBindingsAPI) +from databricks.sdk.service.cleanrooms import (CleanRoomAssetsAPI, + CleanRoomsAPI, + CleanRoomTaskRunsAPI) from databricks.sdk.service.compute import (ClusterPoliciesAPI, ClustersAPI, CommandExecutionAPI, GlobalInitScriptsAPI, @@ -176,6 +179,9 @@ def __init__(self, self._apps = AppsAPI(self._api_client) self._artifact_allowlists = ArtifactAllowlistsAPI(self._api_client) self._catalogs = CatalogsAPI(self._api_client) + self._clean_room_assets = CleanRoomAssetsAPI(self._api_client) + self._clean_room_task_runs = CleanRoomTaskRunsAPI(self._api_client) + self._clean_rooms = CleanRoomsAPI(self._api_client) self._cluster_policies = ClusterPoliciesAPI(self._api_client) self._clusters = ClustersExt(self._api_client) self._command_execution = CommandExecutionAPI(self._api_client) @@ -305,6 +311,21 @@ def catalogs(self) -> CatalogsAPI: """A catalog is the first layer of Unity Catalog’s three-level namespace.""" return self._catalogs + @property + def clean_room_assets(self) -> 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) -> 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) -> 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) -> ClusterPoliciesAPI: """You can use cluster policies to control users' ability to configure clusters based on a set of rules.""" diff --git a/databricks/sdk/service/apps.py b/databricks/sdk/service/apps.py index a08a7e66d..eee49a212 100755 --- a/databricks/sdk/service/apps.py +++ b/databricks/sdk/service/apps.py @@ -91,6 +91,30 @@ def as_dict(self) -> dict: if self.url is not None: body['url'] = self.url 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 + if self.app_status: body['app_status'] = self.app_status + if self.compute_status: body['compute_status'] = self.compute_status + if self.create_time is not None: body['create_time'] = self.create_time + if self.creator is not None: body['creator'] = self.creator + if self.default_source_code_path is not None: + body['default_source_code_path'] = self.default_source_code_path + if self.description is not None: body['description'] = self.description + if self.name is not None: body['name'] = self.name + if self.pending_deployment: body['pending_deployment'] = self.pending_deployment + if 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 + if self.service_principal_id is not None: body['service_principal_id'] = self.service_principal_id + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.update_time is not None: body['update_time'] = self.update_time + if self.updater is not None: body['updater'] = self.updater + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> App: """Deserializes the App from a dictionary.""" @@ -136,6 +160,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppAccessControlRequest: """Deserializes the AppAccessControlRequest from a dictionary.""" @@ -173,6 +207,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppAccessControlResponse: """Deserializes the AppAccessControlResponse from a dictionary.""" @@ -226,6 +271,19 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if self.creator is not None: body['creator'] = self.creator + if self.deployment_artifacts: body['deployment_artifacts'] = self.deployment_artifacts + if self.deployment_id is not None: body['deployment_id'] = self.deployment_id + if self.mode is not None: body['mode'] = self.mode + if self.source_code_path is not None: body['source_code_path'] = self.source_code_path + if self.status: body['status'] = self.status + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppDeployment: """Deserializes the AppDeployment from a dictionary.""" @@ -250,6 +308,12 @@ def as_dict(self) -> dict: if self.source_code_path is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppDeploymentArtifacts: """Deserializes the AppDeploymentArtifacts from a dictionary.""" @@ -285,6 +349,13 @@ def as_dict(self) -> dict: if self.state is not None: 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 + if self.state is not None: body['state'] = self.state + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppDeploymentStatus: """Deserializes the AppDeploymentStatus from a dictionary.""" @@ -308,6 +379,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppPermission: """Deserializes the AppPermission from a dictionary.""" @@ -340,6 +419,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppPermissions: """Deserializes the AppPermissions from a dictionary.""" @@ -362,6 +449,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppPermissionsDescription: """Deserializes the AppPermissionsDescription from a dictionary.""" @@ -384,6 +478,13 @@ def as_dict(self) -> dict: if self.app_name is not None: 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 + if self.app_name is not None: body['app_name'] = self.app_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppPermissionsRequest: """Deserializes the AppPermissionsRequest from a dictionary.""" @@ -418,6 +519,17 @@ def as_dict(self) -> dict: if self.sql_warehouse: 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 + if self.job: body['job'] = self.job + if self.name is not None: body['name'] = self.name + if self.secret: body['secret'] = self.secret + if self.serving_endpoint: body['serving_endpoint'] = self.serving_endpoint + if 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.""" @@ -445,6 +557,13 @@ def as_dict(self) -> dict: if self.permission is not None: 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 + if self.permission is not None: body['permission'] = self.permission + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppResourceJob: """Deserializes the AppResourceJob from a dictionary.""" @@ -479,6 +598,14 @@ def as_dict(self) -> dict: if self.scope is not None: 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 + if self.permission is not None: body['permission'] = self.permission + if self.scope is not None: body['scope'] = self.scope + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppResourceSecret: """Deserializes the AppResourceSecret from a dictionary.""" @@ -511,6 +638,13 @@ def as_dict(self) -> dict: if self.permission is not None: 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 + if self.permission is not None: body['permission'] = self.permission + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppResourceServingEndpoint: """Deserializes the AppResourceServingEndpoint from a dictionary.""" @@ -541,6 +675,13 @@ def as_dict(self) -> dict: if self.permission is not None: 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 + if self.permission is not None: body['permission'] = self.permission + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AppResourceSqlWarehouse: """Deserializes the AppResourceSqlWarehouse from a dictionary.""" @@ -578,6 +719,13 @@ def as_dict(self) -> dict: if self.state is not None: 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 + if self.state is not None: body['state'] = self.state + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ApplicationStatus: """Deserializes the ApplicationStatus from a dictionary.""" @@ -610,6 +758,13 @@ def as_dict(self) -> dict: if self.state is not None: 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 + if self.state is not None: body['state'] = self.state + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ComputeStatus: """Deserializes the ComputeStatus from a dictionary.""" @@ -627,6 +782,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetAppPermissionLevelsResponse: """Deserializes the GetAppPermissionLevelsResponse from a dictionary.""" @@ -648,6 +809,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -669,6 +837,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" diff --git a/databricks/sdk/service/billing.py b/databricks/sdk/service/billing.py index 8375a2629..62f596d0b 100755 --- a/databricks/sdk/service/billing.py +++ b/databricks/sdk/service/billing.py @@ -34,6 +34,15 @@ def as_dict(self) -> dict: if self.target is not None: 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 + if self.action_type is not None: body['action_type'] = self.action_type + if self.target is not None: body['target'] = self.target + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ActionConfiguration: """Deserializes the ActionConfiguration from a dictionary.""" @@ -83,6 +92,18 @@ def as_dict(self) -> dict: if self.trigger_type is not None: 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 + if self.alert_configuration_id is not None: + body['alert_configuration_id'] = self.alert_configuration_id + if self.quantity_threshold is not None: body['quantity_threshold'] = self.quantity_threshold + if self.quantity_type is not None: body['quantity_type'] = self.quantity_type + if self.time_period is not None: body['time_period'] = self.time_period + if self.trigger_type is not None: body['trigger_type'] = self.trigger_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertConfiguration: """Deserializes the AlertConfiguration from a dictionary.""" @@ -149,6 +170,19 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if 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 + if self.create_time is not None: body['create_time'] = self.create_time + if self.display_name is not None: body['display_name'] = self.display_name + if self.filter: body['filter'] = self.filter + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BudgetConfiguration: """Deserializes the BudgetConfiguration from a dictionary.""" @@ -178,6 +212,13 @@ def as_dict(self) -> dict: if self.workspace_id: 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 + if 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.""" @@ -198,6 +239,13 @@ def as_dict(self) -> dict: if 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 + if self.values: body['values'] = self.values + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BudgetConfigurationFilterClause: """Deserializes the BudgetConfigurationFilterClause from a dictionary.""" @@ -223,6 +271,13 @@ def as_dict(self) -> dict: if self.value: 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 + if self.value: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BudgetConfigurationFilterTagClause: """Deserializes the BudgetConfigurationFilterTagClause from a dictionary.""" @@ -242,6 +297,13 @@ def as_dict(self) -> dict: if 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 + if self.values: body['values'] = self.values + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BudgetConfigurationFilterWorkspaceIdClause: """Deserializes the BudgetConfigurationFilterWorkspaceIdClause from a dictionary.""" @@ -265,6 +327,13 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateBillingUsageDashboardRequest: """Deserializes the CreateBillingUsageDashboardRequest from a dictionary.""" @@ -283,6 +352,12 @@ def as_dict(self) -> dict: if self.dashboard_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateBillingUsageDashboardResponse: """Deserializes the CreateBillingUsageDashboardResponse from a dictionary.""" @@ -316,6 +391,15 @@ def as_dict(self) -> dict: if self.filter: 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 + if self.alert_configurations: body['alert_configurations'] = self.alert_configurations + if self.display_name is not None: body['display_name'] = self.display_name + if self.filter: body['filter'] = self.filter + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateBudgetConfigurationBudget: """Deserializes the CreateBudgetConfigurationBudget from a dictionary.""" @@ -341,6 +425,13 @@ def as_dict(self) -> dict: if self.target is not None: 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 + if self.target is not None: body['target'] = self.target + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateBudgetConfigurationBudgetActionConfigurations: """Deserializes the CreateBudgetConfigurationBudgetActionConfigurations from a dictionary.""" @@ -378,6 +469,16 @@ def as_dict(self) -> dict: if self.trigger_type is not None: 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 + if self.quantity_threshold is not None: body['quantity_threshold'] = self.quantity_threshold + if self.quantity_type is not None: body['quantity_type'] = self.quantity_type + if self.time_period is not None: body['time_period'] = self.time_period + if self.trigger_type is not None: body['trigger_type'] = self.trigger_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateBudgetConfigurationBudgetAlertConfigurations: """Deserializes the CreateBudgetConfigurationBudgetAlertConfigurations from a dictionary.""" @@ -400,6 +501,12 @@ def as_dict(self) -> dict: if self.budget: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateBudgetConfigurationRequest: """Deserializes the CreateBudgetConfigurationRequest from a dictionary.""" @@ -417,6 +524,12 @@ def as_dict(self) -> dict: if self.budget: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateBudgetConfigurationResponse: """Deserializes the CreateBudgetConfigurationResponse from a dictionary.""" @@ -509,6 +622,21 @@ def as_dict(self) -> dict: if 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 + if self.credentials_id is not None: body['credentials_id'] = self.credentials_id + if self.delivery_path_prefix is not None: body['delivery_path_prefix'] = self.delivery_path_prefix + if self.delivery_start_time is not None: body['delivery_start_time'] = self.delivery_start_time + if self.log_type is not None: body['log_type'] = self.log_type + if self.output_format is not None: body['output_format'] = self.output_format + if self.status is not None: body['status'] = self.status + if self.storage_configuration_id is not None: + body['storage_configuration_id'] = self.storage_configuration_id + if 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.""" @@ -531,6 +659,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteBudgetConfigurationResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteBudgetConfigurationResponse: """Deserializes the DeleteBudgetConfigurationResponse from a dictionary.""" @@ -563,6 +696,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DownloadResponse: """Deserializes the DownloadResponse from a dictionary.""" @@ -584,6 +723,13 @@ def as_dict(self) -> dict: if self.dashboard_url is not None: 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 + if self.dashboard_url is not None: body['dashboard_url'] = self.dashboard_url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetBillingUsageDashboardResponse: """Deserializes the GetBillingUsageDashboardResponse from a dictionary.""" @@ -600,6 +746,12 @@ def as_dict(self) -> dict: if self.budget: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetBudgetConfigurationResponse: """Deserializes the GetBudgetConfigurationResponse from a dictionary.""" @@ -621,6 +773,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -744,6 +903,26 @@ def as_dict(self) -> dict: if 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 + if self.config_id is not None: body['config_id'] = self.config_id + if self.config_name is not None: body['config_name'] = self.config_name + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.credentials_id is not None: body['credentials_id'] = self.credentials_id + if self.delivery_path_prefix is not None: body['delivery_path_prefix'] = self.delivery_path_prefix + if self.delivery_start_time is not None: body['delivery_start_time'] = self.delivery_start_time + if 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 + if self.output_format is not None: body['output_format'] = self.output_format + if self.status is not None: body['status'] = self.status + if self.storage_configuration_id is not None: + body['storage_configuration_id'] = self.storage_configuration_id + if self.update_time is not None: body['update_time'] = self.update_time + if 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.""" @@ -796,6 +975,16 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.last_successful_attempt_time is not None: + body['last_successful_attempt_time'] = self.last_successful_attempt_time + if self.message is not None: body['message'] = self.message + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogDeliveryStatus: """Deserializes the LogDeliveryStatus from a dictionary.""" @@ -846,6 +1035,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the PatchStatusResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PatchStatusResponse: """Deserializes the PatchStatusResponse from a dictionary.""" @@ -884,6 +1078,17 @@ def as_dict(self) -> dict: if self.filter: 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 + if 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.filter: body['filter'] = self.filter + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateBudgetConfigurationBudget: """Deserializes the UpdateBudgetConfigurationBudget from a dictionary.""" @@ -909,6 +1114,13 @@ def as_dict(self) -> dict: if self.budget_id is not None: 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 + if self.budget_id is not None: body['budget_id'] = self.budget_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateBudgetConfigurationRequest: """Deserializes the UpdateBudgetConfigurationRequest from a dictionary.""" @@ -927,6 +1139,12 @@ def as_dict(self) -> dict: if self.budget: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateBudgetConfigurationResponse: """Deserializes the UpdateBudgetConfigurationResponse from a dictionary.""" @@ -952,6 +1170,14 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateLogDeliveryConfigurationStatusRequest: """Deserializes the UpdateLogDeliveryConfigurationStatusRequest from a dictionary.""" @@ -976,6 +1202,13 @@ def as_dict(self) -> 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WrappedCreateLogDeliveryConfiguration: """Deserializes the WrappedCreateLogDeliveryConfiguration from a dictionary.""" @@ -994,6 +1227,13 @@ def as_dict(self) -> 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WrappedLogDeliveryConfiguration: """Deserializes the WrappedLogDeliveryConfiguration from a dictionary.""" @@ -1012,6 +1252,13 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WrappedLogDeliveryConfigurations: """Deserializes the WrappedLogDeliveryConfigurations from a dictionary.""" diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/service/catalog.py index d24ad54e6..0798bb5b6 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -28,6 +28,12 @@ def as_dict(self) -> dict: if self.metastore_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccountsCreateMetastore: """Deserializes the AccountsCreateMetastore from a dictionary.""" @@ -52,6 +58,14 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccountsCreateMetastoreAssignment: """Deserializes the AccountsCreateMetastoreAssignment from a dictionary.""" @@ -74,6 +88,13 @@ def as_dict(self) -> dict: if self.metastore_id is not None: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccountsCreateStorageCredential: """Deserializes the AccountsCreateStorageCredential from a dictionary.""" @@ -91,6 +112,12 @@ def as_dict(self) -> dict: if self.metastore_assignment: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccountsMetastoreAssignment: """Deserializes the AccountsMetastoreAssignment from a dictionary.""" @@ -107,6 +134,12 @@ def as_dict(self) -> dict: if self.metastore_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccountsMetastoreInfo: """Deserializes the AccountsMetastoreInfo from a dictionary.""" @@ -123,6 +156,12 @@ def as_dict(self) -> dict: if self.credential_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccountsStorageCredentialInfo: """Deserializes the AccountsStorageCredentialInfo from a dictionary.""" @@ -143,6 +182,13 @@ def as_dict(self) -> dict: if self.metastore_info: 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 + if 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.""" @@ -168,6 +214,14 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccountsUpdateMetastoreAssignment: """Deserializes the AccountsUpdateMetastoreAssignment from a dictionary.""" @@ -195,6 +249,15 @@ def as_dict(self) -> dict: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.storage_credential_name is not None: + 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.""" @@ -226,6 +289,15 @@ def as_dict(self) -> dict: if self.metastore_id is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ArtifactAllowlistInfo: """Deserializes the ArtifactAllowlistInfo from a dictionary.""" @@ -250,6 +322,13 @@ def as_dict(self) -> dict: if self.match_type is not None: 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 + if self.match_type is not None: body['match_type'] = self.match_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ArtifactMatcher: """Deserializes the ArtifactMatcher from a dictionary.""" @@ -272,6 +351,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the AssignResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AssignResponse: """Deserializes the AssignResponse from a dictionary.""" @@ -305,6 +389,15 @@ def as_dict(self) -> dict: if self.session_token is not None: 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 + if self.access_point is not None: body['access_point'] = self.access_point + if self.secret_access_key is not None: body['secret_access_key'] = self.secret_access_key + if self.session_token is not None: body['session_token'] = self.session_token + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AwsCredentials: """Deserializes the AwsCredentials from a dictionary.""" @@ -336,6 +429,14 @@ def as_dict(self) -> dict: if self.unity_catalog_iam_arn is not None: 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 + if self.role_arn is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AwsIamRole: """Deserializes the AwsIamRole from a dictionary.""" @@ -355,6 +456,12 @@ def as_dict(self) -> dict: if self.role_arn is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AwsIamRoleRequest: """Deserializes the AwsIamRoleRequest from a dictionary.""" @@ -381,6 +488,14 @@ def as_dict(self) -> dict: if self.unity_catalog_iam_arn is not None: 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 + if self.role_arn is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AwsIamRoleResponse: """Deserializes the AwsIamRoleResponse from a dictionary.""" @@ -405,6 +520,12 @@ def as_dict(self) -> dict: if self.aad_token is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AzureActiveDirectoryToken: """Deserializes the AzureActiveDirectoryToken from a dictionary.""" @@ -439,6 +560,14 @@ def as_dict(self) -> dict: if self.managed_identity_id is not None: 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 + if self.credential_id is not None: body['credential_id'] = self.credential_id + if self.managed_identity_id is not None: 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.""" @@ -467,6 +596,13 @@ def as_dict(self) -> dict: if self.managed_identity_id is not None: 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 + if self.managed_identity_id is not None: 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.""" @@ -498,6 +634,14 @@ def as_dict(self) -> dict: if self.managed_identity_id is not None: 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 + if self.credential_id is not None: body['credential_id'] = self.credential_id + if self.managed_identity_id is not None: 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.""" @@ -508,7 +652,7 @@ def from_dict(cls, d: Dict[str, any]) -> AzureManagedIdentityResponse: @dataclass class AzureServicePrincipal: - """The Azure service principal configuration.""" + """The Azure service principal configuration. Only applicable when purpose is **STORAGE**.""" directory_id: str """The directory ID corresponding to the Azure Active Directory (AAD) tenant of the application.""" @@ -527,6 +671,14 @@ def as_dict(self) -> dict: if self.directory_id is not None: 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 + if self.client_secret is not None: body['client_secret'] = self.client_secret + if self.directory_id is not None: body['directory_id'] = self.directory_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AzureServicePrincipal: """Deserializes the AzureServicePrincipal from a dictionary.""" @@ -549,6 +701,12 @@ def as_dict(self) -> dict: if self.sas_token is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AzureUserDelegationSas: """Deserializes the AzureUserDelegationSas from a dictionary.""" @@ -563,6 +721,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CancelRefreshResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelRefreshResponse: """Deserializes the CancelRefreshResponse from a dictionary.""" @@ -677,6 +840,37 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.catalog_type is not None: body['catalog_type'] = self.catalog_type + if self.comment is not None: body['comment'] = self.comment + if self.connection_name is not None: body['connection_name'] = self.connection_name + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if 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 + if self.full_name is not None: body['full_name'] = self.full_name + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.owner is not None: body['owner'] = self.owner + if self.properties: body['properties'] = self.properties + if self.provider_name is not None: body['provider_name'] = self.provider_name + if self.provisioning_info: body['provisioning_info'] = self.provisioning_info + if self.securable_kind is not None: body['securable_kind'] = self.securable_kind + if self.securable_type is not None: body['securable_type'] = self.securable_type + if self.share_name is not None: body['share_name'] = self.share_name + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.storage_root is not None: body['storage_root'] = self.storage_root + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CatalogInfo: """Deserializes the CatalogInfo from a dictionary.""" @@ -760,6 +954,14 @@ def as_dict(self) -> dict: if self.secret_access_key is not None: 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 + if self.account_id is not None: body['account_id'] = self.account_id + if self.secret_access_key is not None: 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.""" @@ -794,7 +996,6 @@ class ColumnInfo: """Full data type specification, JSON-serialized.""" type_name: Optional[ColumnTypeName] = None - """Name of type (INT, STRUCT, MAP, etc.).""" type_precision: Optional[int] = None """Digits of precision; required for DecimalTypes.""" @@ -822,6 +1023,23 @@ def as_dict(self) -> dict: 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.""" @@ -856,6 +1074,13 @@ def as_dict(self) -> dict: 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.""" @@ -864,7 +1089,6 @@ def from_dict(cls, d: Dict[str, any]) -> ColumnMask: class ColumnTypeName(Enum): - """Name of type (INT, STRUCT, MAP, etc.).""" ARRAY = 'ARRAY' BINARY = 'BINARY' @@ -972,6 +1196,30 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.connection_id is not None: body['connection_id'] = self.connection_id + if self.connection_type is not None: body['connection_type'] = self.connection_type + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.credential_type is not None: body['credential_type'] = self.credential_type + if self.full_name is not None: body['full_name'] = self.full_name + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.owner is not None: body['owner'] = self.owner + if self.properties: body['properties'] = self.properties + if self.provisioning_info: body['provisioning_info'] = self.provisioning_info + if self.read_only is not None: body['read_only'] = self.read_only + if self.securable_kind is not None: body['securable_kind'] = self.securable_kind + if self.securable_type is not None: body['securable_type'] = self.securable_type + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ConnectionInfo: """Deserializes the ConnectionInfo from a dictionary.""" @@ -1056,6 +1304,16 @@ def as_dict(self) -> dict: if self.timestamp is not None: 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 + if self.last_processed_commit_version is not None: + body['last_processed_commit_version'] = self.last_processed_commit_version + if self.timestamp is not None: body['timestamp'] = self.timestamp + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ContinuousUpdateStatus: """Deserializes the ContinuousUpdateStatus from a dictionary.""" @@ -1106,6 +1364,19 @@ def as_dict(self) -> dict: if self.storage_root is not None: 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 + if self.connection_name is not None: body['connection_name'] = self.connection_name + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.properties: body['properties'] = self.properties + if self.provider_name is not None: body['provider_name'] = self.provider_name + if self.share_name is not None: body['share_name'] = self.share_name + if self.storage_root is not None: body['storage_root'] = self.storage_root + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCatalog: """Deserializes the CreateCatalog from a dictionary.""" @@ -1150,6 +1421,17 @@ def as_dict(self) -> dict: if self.read_only is not None: 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 + if self.connection_type is not None: body['connection_type'] = self.connection_type + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.properties: body['properties'] = self.properties + if self.read_only is not None: body['read_only'] = self.read_only + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateConnection: """Deserializes the CreateConnection from a dictionary.""" @@ -1174,12 +1456,13 @@ class CreateCredentialRequest: """The Azure managed identity configuration.""" azure_service_principal: Optional[AzureServicePrincipal] = None - """The Azure service principal configuration.""" + """The Azure service principal configuration. Only applicable when purpose is **STORAGE**.""" comment: Optional[str] = None """Comment associated with the credential.""" - gcp_service_account_key: Optional[GcpServiceAccountKey] = None + databricks_gcp_service_account: Optional[DatabricksGcpServiceAccount] = None + """GCP long-lived credential. Databricks-created Google Cloud Storage service account.""" purpose: Optional[CredentialPurpose] = None """Indicates the purpose of the credential.""" @@ -1199,14 +1482,29 @@ def as_dict(self) -> dict: if self.azure_service_principal: body['azure_service_principal'] = self.azure_service_principal.as_dict() if self.comment is not None: body['comment'] = self.comment - if self.gcp_service_account_key: - body['gcp_service_account_key'] = self.gcp_service_account_key.as_dict() + if self.databricks_gcp_service_account: + body['databricks_gcp_service_account'] = self.databricks_gcp_service_account.as_dict() if self.name is not None: body['name'] = self.name if self.purpose is not None: body['purpose'] = self.purpose.value if self.read_only is not None: body['read_only'] = self.read_only if self.skip_validation is not None: 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 + if 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 + if self.comment is not None: body['comment'] = self.comment + if 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 + if self.purpose is not None: body['purpose'] = self.purpose + if self.read_only is not None: body['read_only'] = self.read_only + if self.skip_validation is not None: body['skip_validation'] = self.skip_validation + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCredentialRequest: """Deserializes the CreateCredentialRequest from a dictionary.""" @@ -1214,7 +1512,8 @@ def from_dict(cls, d: Dict[str, any]) -> CreateCredentialRequest: 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), - gcp_service_account_key=_from_dict(d, 'gcp_service_account_key', GcpServiceAccountKey), + 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), @@ -1266,6 +1565,20 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.credential_name is not None: body['credential_name'] = self.credential_name + if self.encryption_details: body['encryption_details'] = self.encryption_details + if self.fallback is not None: body['fallback'] = self.fallback + if self.name is not None: body['name'] = self.name + if self.read_only is not None: body['read_only'] = self.read_only + if self.skip_validation is not None: body['skip_validation'] = self.skip_validation + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateExternalLocation: """Deserializes the CreateExternalLocation from a dictionary.""" @@ -1373,6 +1686,32 @@ def as_dict(self) -> dict: if self.sql_path is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.data_type is not None: body['data_type'] = self.data_type + if self.external_language is not None: body['external_language'] = self.external_language + if self.external_name is not None: body['external_name'] = self.external_name + if self.full_data_type is not None: body['full_data_type'] = self.full_data_type + if self.input_params: body['input_params'] = self.input_params + if self.is_deterministic is not None: body['is_deterministic'] = self.is_deterministic + if self.is_null_call is not None: body['is_null_call'] = self.is_null_call + if self.name is not None: body['name'] = self.name + if self.parameter_style is not None: body['parameter_style'] = self.parameter_style + if self.properties is not None: body['properties'] = self.properties + if self.return_params: body['return_params'] = self.return_params + if self.routine_body is not None: body['routine_body'] = self.routine_body + if self.routine_definition is not None: body['routine_definition'] = self.routine_definition + if self.routine_dependencies: body['routine_dependencies'] = self.routine_dependencies + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.security_type is not None: body['security_type'] = self.security_type + if self.specific_name is not None: body['specific_name'] = self.specific_name + if self.sql_data_access is not None: body['sql_data_access'] = self.sql_data_access + if self.sql_path is not None: body['sql_path'] = self.sql_path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateFunction: """Deserializes the CreateFunction from a dictionary.""" @@ -1416,6 +1755,12 @@ def as_dict(self) -> dict: if self.function_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateFunctionRequest: """Deserializes the CreateFunctionRequest from a dictionary.""" @@ -1467,6 +1812,14 @@ def as_dict(self) -> dict: if self.storage_root is not None: 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 + if self.region is not None: body['region'] = self.region + if self.storage_root is not None: body['storage_root'] = self.storage_root + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateMetastore: """Deserializes the CreateMetastore from a dictionary.""" @@ -1495,6 +1848,14 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateMetastoreAssignment: """Deserializes the CreateMetastoreAssignment from a dictionary.""" @@ -1574,10 +1935,31 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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), + 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 + if self.baseline_table_name is not None: body['baseline_table_name'] = self.baseline_table_name + if self.custom_metrics: body['custom_metrics'] = self.custom_metrics + if self.data_classification_config: + body['data_classification_config'] = self.data_classification_config + if self.inference_log: body['inference_log'] = self.inference_log + if self.notifications: body['notifications'] = self.notifications + if self.output_schema_name is not None: body['output_schema_name'] = self.output_schema_name + if self.schedule: body['schedule'] = self.schedule + if self.skip_builtin_dashboard is not None: + body['skip_builtin_dashboard'] = self.skip_builtin_dashboard + if self.slicing_exprs: body['slicing_exprs'] = self.slicing_exprs + if self.snapshot: body['snapshot'] = self.snapshot + if self.table_name is not None: body['table_name'] = self.table_name + if self.time_series: body['time_series'] = self.time_series + if self.warehouse_id is not None: 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', @@ -1621,6 +2003,16 @@ def as_dict(self) -> dict: if self.storage_location is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.name is not None: body['name'] = self.name + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.storage_location is not None: body['storage_location'] = self.storage_location + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateRegisteredModelRequest: """Deserializes the CreateRegisteredModelRequest from a dictionary.""" @@ -1639,6 +2031,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CreateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" @@ -1672,6 +2069,16 @@ def as_dict(self) -> dict: if self.storage_root is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.name is not None: body['name'] = self.name + if self.properties: body['properties'] = self.properties + if self.storage_root is not None: body['storage_root'] = self.storage_root + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateSchema: """Deserializes the CreateSchema from a dictionary.""" @@ -1727,6 +2134,21 @@ def as_dict(self) -> dict: if self.skip_validation is not None: 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 + if 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 + if self.cloudflare_api_token: body['cloudflare_api_token'] = self.cloudflare_api_token + if self.comment is not None: body['comment'] = self.comment + if 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 + if self.read_only is not None: body['read_only'] = self.read_only + if self.skip_validation is not None: body['skip_validation'] = self.skip_validation + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateStorageCredential: """Deserializes the CreateStorageCredential from a dictionary.""" @@ -1759,6 +2181,13 @@ def as_dict(self) -> dict: if self.full_name_arg is not None: 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 + if self.full_name_arg is not None: 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.""" @@ -1796,6 +2225,17 @@ def as_dict(self) -> dict: if self.volume_type is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.name is not None: body['name'] = self.name + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.volume_type is not None: body['volume_type'] = self.volume_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateVolumeRequestContent: """Deserializes the CreateVolumeRequestContent from a dictionary.""" @@ -1816,7 +2256,7 @@ class CredentialInfo: """The Azure managed identity configuration.""" azure_service_principal: Optional[AzureServicePrincipal] = None - """The Azure service principal configuration.""" + """The Azure service principal configuration. Only applicable when purpose is **STORAGE**.""" comment: Optional[str] = None """Comment associated with the credential.""" @@ -1827,6 +2267,9 @@ class CredentialInfo: created_by: Optional[str] = None """Username of credential creator.""" + databricks_gcp_service_account: Optional[DatabricksGcpServiceAccount] = None + """GCP long-lived credential. Databricks-created Google Cloud Storage service account.""" + full_name: Optional[str] = None """The full name of the credential.""" @@ -1873,6 +2316,8 @@ def as_dict(self) -> dict: if self.comment is not None: body['comment'] = self.comment if self.created_at is not None: body['created_at'] = self.created_at if self.created_by is not None: body['created_by'] = self.created_by + if self.databricks_gcp_service_account: + 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 if self.id is not None: body['id'] = self.id if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value @@ -1887,6 +2332,31 @@ def as_dict(self) -> dict: 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 + if 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 + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if 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 + if self.id is not None: body['id'] = self.id + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.purpose is not None: body['purpose'] = self.purpose + if self.read_only is not None: body['read_only'] = self.read_only + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CredentialInfo: """Deserializes the CredentialInfo from a dictionary.""" @@ -1896,6 +2366,8 @@ def from_dict(cls, d: Dict[str, any]) -> CredentialInfo: 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), @@ -1937,6 +2409,13 @@ def as_dict(self) -> dict: if self.result is not None: 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 + if self.result is not None: body['result'] = self.result + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CredentialValidationResult: """Deserializes the CredentialValidationResult from a dictionary.""" @@ -1956,6 +2435,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CurrentWorkspaceBindings: """Deserializes the CurrentWorkspaceBindings from a dictionary.""" @@ -1990,6 +2475,45 @@ class DataSourceFormat(Enum): WORKDAY_RAAS_FORMAT = 'WORKDAY_RAAS_FORMAT' +@dataclass +class DatabricksGcpServiceAccount: + """GCP long-lived credential. Databricks-created Google Cloud Storage service account.""" + + credential_id: Optional[str] = None + """The Databricks internal ID that represents this managed identity. This field is only used to + persist the credential_id once it is fetched from the credentials manager - as we only use the + protobuf serializer to store credentials, this ID gets persisted to the database""" + + email: Optional[str] = None + """The email of the service account.""" + + private_key_id: Optional[str] = None + """The ID that represents the private key for this Service Account""" + + 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 + if self.email is not None: body['email'] = self.email + if self.private_key_id is not None: 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 + if self.email is not None: body['email'] = self.email + if self.private_key_id is not None: 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)) + + @dataclass class DatabricksGcpServiceAccountRequest: @@ -1998,6 +2522,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DatabricksGcpServiceAccountRequest into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DatabricksGcpServiceAccountRequest: """Deserializes the DatabricksGcpServiceAccountRequest from a dictionary.""" @@ -2019,6 +2548,13 @@ def as_dict(self) -> dict: if self.email is not None: 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 + if self.email is not None: body['email'] = self.email + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DatabricksGcpServiceAccountResponse: """Deserializes the DatabricksGcpServiceAccountResponse from a dictionary.""" @@ -2033,6 +2569,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteAliasResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteAliasResponse: """Deserializes the DeleteAliasResponse from a dictionary.""" @@ -2047,6 +2588,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteCredentialResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteCredentialResponse: """Deserializes the DeleteCredentialResponse from a dictionary.""" @@ -2061,6 +2607,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -2081,6 +2632,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeltaRuntimePropertiesKvPairs: """Deserializes the DeltaRuntimePropertiesKvPairs from a dictionary.""" @@ -2105,6 +2662,13 @@ def as_dict(self) -> dict: if self.table: 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 + if self.table: body['table'] = self.table + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Dependency: """Deserializes the Dependency from a dictionary.""" @@ -2125,6 +2689,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DependencyList: """Deserializes the DependencyList from a dictionary.""" @@ -2139,6 +2709,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DisableResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DisableResponse: """Deserializes the DisableResponse from a dictionary.""" @@ -2157,6 +2732,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EffectivePermissionsList: """Deserializes the EffectivePermissionsList from a dictionary.""" @@ -2185,6 +2766,14 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.inherited_from_type is not None: body['inherited_from_type'] = self.inherited_from_type + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EffectivePredictiveOptimizationFlag: """Deserializes the EffectivePredictiveOptimizationFlag from a dictionary.""" @@ -2223,6 +2812,14 @@ def as_dict(self) -> dict: if self.privilege is not None: 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 + if self.inherited_from_type is not None: body['inherited_from_type'] = self.inherited_from_type + if self.privilege is not None: body['privilege'] = self.privilege + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EffectivePrivilege: """Deserializes the EffectivePrivilege from a dictionary.""" @@ -2246,6 +2843,13 @@ def as_dict(self) -> dict: if 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 + if self.privileges: body['privileges'] = self.privileges + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EffectivePrivilegeAssignment: """Deserializes the EffectivePrivilegeAssignment from a dictionary.""" @@ -2269,6 +2873,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the EnableResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnableResponse: """Deserializes the EnableResponse from a dictionary.""" @@ -2288,6 +2897,12 @@ def as_dict(self) -> dict: if self.sse_encryption_details: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EncryptionDetails: """Deserializes the EncryptionDetails from a dictionary.""" @@ -2371,6 +2986,28 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.browse_only is not None: body['browse_only'] = self.browse_only + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.credential_id is not None: body['credential_id'] = self.credential_id + if self.credential_name is not None: body['credential_name'] = self.credential_name + if self.encryption_details: body['encryption_details'] = self.encryption_details + if self.fallback is not None: body['fallback'] = self.fallback + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.read_only is not None: body['read_only'] = self.read_only + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExternalLocationInfo: """Deserializes the ExternalLocationInfo from a dictionary.""" @@ -2415,6 +3052,14 @@ def as_dict(self) -> dict: if self.timestamp is not None: 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 + if self.timestamp is not None: body['timestamp'] = self.timestamp + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FailedStatus: """Deserializes the FailedStatus from a dictionary.""" @@ -2445,6 +3090,15 @@ def as_dict(self) -> dict: if self.parent_table is not None: 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 + if self.name is not None: body['name'] = self.name + if self.parent_columns: body['parent_columns'] = self.parent_columns + if self.parent_table is not None: body['parent_table'] = self.parent_table + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ForeignKeyConstraint: """Deserializes the ForeignKeyConstraint from a dictionary.""" @@ -2468,6 +3122,12 @@ def as_dict(self) -> dict: if self.function_full_name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FunctionDependency: """Deserializes the FunctionDependency from a dictionary.""" @@ -2604,6 +3264,41 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.data_type is not None: body['data_type'] = self.data_type + if self.external_language is not None: body['external_language'] = self.external_language + if self.external_name is not None: body['external_name'] = self.external_name + if self.full_data_type is not None: body['full_data_type'] = self.full_data_type + if self.full_name is not None: body['full_name'] = self.full_name + if self.function_id is not None: body['function_id'] = self.function_id + if self.input_params: body['input_params'] = self.input_params + if self.is_deterministic is not None: body['is_deterministic'] = self.is_deterministic + if self.is_null_call is not None: body['is_null_call'] = self.is_null_call + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.parameter_style is not None: body['parameter_style'] = self.parameter_style + if self.properties is not None: body['properties'] = self.properties + if self.return_params: body['return_params'] = self.return_params + if self.routine_body is not None: body['routine_body'] = self.routine_body + if self.routine_definition is not None: body['routine_definition'] = self.routine_definition + if self.routine_dependencies: body['routine_dependencies'] = self.routine_dependencies + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.security_type is not None: body['security_type'] = self.security_type + if self.specific_name is not None: body['specific_name'] = self.specific_name + if self.sql_data_access is not None: body['sql_data_access'] = self.sql_data_access + if self.sql_path is not None: body['sql_path'] = self.sql_path + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FunctionInfo: """Deserializes the FunctionInfo from a dictionary.""" @@ -2678,7 +3373,6 @@ class FunctionParameterInfo: """Full data type spec, SQL/catalogString text.""" type_name: ColumnTypeName - """Name of type (INT, STRUCT, MAP, etc.).""" position: int """Ordinal position of column (starting at position 0).""" @@ -2724,6 +3418,23 @@ def as_dict(self) -> dict: if self.type_text is not None: 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 + if self.name is not None: body['name'] = self.name + if self.parameter_default is not None: body['parameter_default'] = self.parameter_default + if self.parameter_mode is not None: body['parameter_mode'] = self.parameter_mode + if self.parameter_type is not None: body['parameter_type'] = self.parameter_type + 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]) -> FunctionParameterInfo: """Deserializes the FunctionParameterInfo from a dictionary.""" @@ -2752,6 +3463,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FunctionParameterInfos: """Deserializes the FunctionParameterInfos from a dictionary.""" @@ -2784,44 +3501,21 @@ def as_dict(self) -> dict: if self.oauth_token is not None: 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)) - - -@dataclass -class GcpServiceAccountKey: - """GCP long-lived credential. GCP Service Account.""" - - email: Optional[str] = None - """The email of the service account.""" - - private_key: Optional[str] = None - """The service account's RSA private key.""" - - private_key_id: Optional[str] = None - """The ID of the service account's private key.""" - - def as_dict(self) -> dict: - """Serializes the GcpServiceAccountKey into a dictionary suitable for use as a JSON request body.""" + def as_shallow_dict(self) -> dict: + """Serializes the GcpOauthToken into a shallow dictionary of its immediate attributes.""" body = {} - if self.email is not None: body['email'] = self.email - if self.private_key is not None: body['private_key'] = self.private_key - if self.private_key_id is not None: body['private_key_id'] = self.private_key_id + if self.oauth_token is not None: body['oauth_token'] = self.oauth_token return body @classmethod - def from_dict(cls, d: Dict[str, any]) -> GcpServiceAccountKey: - """Deserializes the GcpServiceAccountKey from a dictionary.""" - return cls(email=d.get('email', None), - private_key=d.get('private_key', None), - private_key_id=d.get('private_key_id', None)) + def from_dict(cls, d: Dict[str, any]) -> GcpOauthToken: + """Deserializes the GcpOauthToken from a dictionary.""" + return cls(oauth_token=d.get('oauth_token', None)) @dataclass class GenerateTemporaryServiceCredentialAzureOptions: - """Options to customize the requested temporary credential""" + """The Azure cloud options to customize the requested temporary credential""" resources: Optional[List[str]] = None """The resources to which the temporary Azure credential should apply. These resources are the @@ -2834,25 +3528,70 @@ def as_dict(self) -> dict: if 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 + 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)) +@dataclass +class GenerateTemporaryServiceCredentialGcpOptions: + """The GCP cloud options to customize the requested temporary credential""" + + scopes: Optional[List[str]] = None + """The scopes to which the temporary GCP credential should apply. These resources are the scopes + that are passed to the token provider (see + https://google-auth.readthedocs.io/en/latest/reference/google.auth.html#google.auth.credentials.Credentials)""" + + 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] + 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 + 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)) + + @dataclass class GenerateTemporaryServiceCredentialRequest: credential_name: str """The name of the service credential used to generate a temporary credential""" azure_options: Optional[GenerateTemporaryServiceCredentialAzureOptions] = None - """Options to customize the requested temporary credential""" + """The Azure cloud options to customize the requested temporary credential""" + + gcp_options: Optional[GenerateTemporaryServiceCredentialGcpOptions] = None + """The GCP cloud options to customize the requested temporary credential""" 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() if self.credential_name is not None: body['credential_name'] = self.credential_name + if self.gcp_options: 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 + if self.credential_name is not None: body['credential_name'] = self.credential_name + if self.gcp_options: body['gcp_options'] = self.gcp_options return body @classmethod @@ -2860,7 +3599,8 @@ def from_dict(cls, d: Dict[str, any]) -> GenerateTemporaryServiceCredentialReque """Deserializes the GenerateTemporaryServiceCredentialRequest from a dictionary.""" return cls(azure_options=_from_dict(d, 'azure_options', GenerateTemporaryServiceCredentialAzureOptions), - credential_name=d.get('credential_name', None)) + credential_name=d.get('credential_name', None), + gcp_options=_from_dict(d, 'gcp_options', GenerateTemporaryServiceCredentialGcpOptions)) @dataclass @@ -2880,6 +3620,13 @@ def as_dict(self) -> dict: if self.table_id is not None: 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 + if self.table_id is not None: body['table_id'] = self.table_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenerateTemporaryTableCredentialRequest: """Deserializes the GenerateTemporaryTableCredentialRequest from a dictionary.""" @@ -2929,6 +3676,18 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if 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 + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + if 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 + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenerateTemporaryTableCredentialResponse: """Deserializes the GenerateTemporaryTableCredentialResponse from a dictionary.""" @@ -3042,6 +3801,38 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: 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 + if self.delta_sharing_organization_name is not None: + 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'] = self.delta_sharing_recipient_token_lifetime_in_seconds + if self.delta_sharing_scope is not None: body['delta_sharing_scope'] = self.delta_sharing_scope + if self.external_access_enabled is not None: + body['external_access_enabled'] = self.external_access_enabled + if self.global_metastore_id is not None: body['global_metastore_id'] = self.global_metastore_id + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.privilege_model_version is not None: + body['privilege_model_version'] = self.privilege_model_version + if self.region is not None: body['region'] = self.region + if self.storage_root is not None: 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 + if self.storage_root_credential_name is not None: + body['storage_root_credential_name'] = self.storage_root_credential_name + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetMetastoreSummaryResponse: """Deserializes the GetMetastoreSummaryResponse from a dictionary.""" @@ -3086,6 +3877,12 @@ def as_dict(self) -> dict: if self.quota_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetQuotaResponse: """Deserializes the GetQuotaResponse from a dictionary.""" @@ -3110,6 +3907,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListAccountMetastoreAssignmentsResponse: """Deserializes the ListAccountMetastoreAssignmentsResponse from a dictionary.""" @@ -3128,6 +3931,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListAccountStorageCredentialsResponse: """Deserializes the ListAccountStorageCredentialsResponse from a dictionary.""" @@ -3150,6 +3959,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3173,6 +3989,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3195,6 +4018,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3219,6 +4049,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3242,6 +4079,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3260,6 +4104,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListMetastoresResponse: """Deserializes the ListMetastoresResponse from a dictionary.""" @@ -3281,6 +4131,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3304,6 +4161,13 @@ def as_dict(self) -> dict: if 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 + if self.quotas: body['quotas'] = self.quotas + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListQuotasResponse: """Deserializes the ListQuotasResponse from a dictionary.""" @@ -3326,6 +4190,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -3349,6 +4220,13 @@ def as_dict(self) -> dict: if 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 + if self.schemas: body['schemas'] = self.schemas + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListSchemasResponse: """Deserializes the ListSchemasResponse from a dictionary.""" @@ -3372,6 +4250,13 @@ def as_dict(self) -> dict: 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 + if 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.""" @@ -3395,6 +4280,13 @@ def as_dict(self) -> dict: if 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 + if self.schemas: body['schemas'] = self.schemas + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListSystemSchemasResponse: """Deserializes the ListSystemSchemasResponse from a dictionary.""" @@ -3418,6 +4310,13 @@ def as_dict(self) -> dict: if 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 + if self.tables: body['tables'] = self.tables + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListTableSummariesResponse: """Deserializes the ListTableSummariesResponse from a dictionary.""" @@ -3441,6 +4340,13 @@ def as_dict(self) -> dict: if 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 + if self.tables: body['tables'] = self.tables + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListTablesResponse: """Deserializes the ListTablesResponse from a dictionary.""" @@ -3464,6 +4370,13 @@ def as_dict(self) -> dict: if 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 + if self.volumes: body['volumes'] = self.volumes + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListVolumesResponseContent: """Deserializes the ListVolumesResponseContent from a dictionary.""" @@ -3496,6 +4409,14 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MetastoreAssignment: """Deserializes the MetastoreAssignment from a dictionary.""" @@ -3577,7 +4498,39 @@ def as_dict(self) -> dict: if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: 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 + if self.delta_sharing_scope is not None: 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 + if self.global_metastore_id is not None: body['global_metastore_id'] = self.global_metastore_id + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.privilege_model_version is not None: + body['privilege_model_version'] = self.privilege_model_version + if self.region is not None: body['region'] = self.region + if self.storage_root is not None: 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 + if self.storage_root_credential_name is not None: + body['storage_root_credential_name'] = self.storage_root_credential_name + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: 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 + if self.delta_sharing_organization_name is not None: + 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'] = self.delta_sharing_recipient_token_lifetime_in_seconds + if self.delta_sharing_scope is not None: body['delta_sharing_scope'] = self.delta_sharing_scope if self.external_access_enabled is not None: body['external_access_enabled'] = self.external_access_enabled if self.global_metastore_id is not None: body['global_metastore_id'] = self.global_metastore_id @@ -3715,6 +4668,31 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.browse_only is not None: body['browse_only'] = self.browse_only + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.id is not None: body['id'] = self.id + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.model_name is not None: body['model_name'] = self.model_name + if 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 + if self.run_workspace_id is not None: body['run_workspace_id'] = self.run_workspace_id + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.source is not None: body['source'] = self.source + if self.status is not None: body['status'] = self.status + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelVersionInfo: """Deserializes the ModelVersionInfo from a dictionary.""" @@ -3771,6 +4749,15 @@ def as_dict(self) -> dict: if self.timezone_id is not None: 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 + if self.quartz_cron_expression is not None: + body['quartz_cron_expression'] = self.quartz_cron_expression + if self.timezone_id is not None: body['timezone_id'] = self.timezone_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorCronSchedule: """Deserializes the MonitorCronSchedule from a dictionary.""" @@ -3797,6 +4784,12 @@ def as_dict(self) -> dict: if self.enabled is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorDataClassificationConfig: """Deserializes the MonitorDataClassificationConfig from a dictionary.""" @@ -3815,6 +4808,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorDestination: """Deserializes the MonitorDestination from a dictionary.""" @@ -3866,6 +4865,18 @@ def as_dict(self) -> dict: if self.timestamp_col is not None: 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 + if self.label_col is not None: body['label_col'] = self.label_col + if self.model_id_col is not None: body['model_id_col'] = self.model_id_col + if self.prediction_col is not None: body['prediction_col'] = self.prediction_col + if self.prediction_proba_col is not None: body['prediction_proba_col'] = self.prediction_proba_col + if self.problem_type is not None: body['problem_type'] = self.problem_type + if self.timestamp_col is not None: body['timestamp_col'] = self.timestamp_col + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorInferenceLog: """Deserializes the MonitorInferenceLog from a dictionary.""" @@ -3977,6 +4988,33 @@ def as_dict(self) -> dict: if self.time_series: 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 + if self.baseline_table_name is not None: body['baseline_table_name'] = self.baseline_table_name + if self.custom_metrics: body['custom_metrics'] = self.custom_metrics + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if 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 + if 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 + if self.monitor_version is not None: body['monitor_version'] = self.monitor_version + if self.notifications: body['notifications'] = self.notifications + if self.output_schema_name is not None: 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 + if self.schedule: body['schedule'] = self.schedule + if self.slicing_exprs: body['slicing_exprs'] = self.slicing_exprs + if self.snapshot: body['snapshot'] = self.snapshot + if self.status is not None: body['status'] = self.status + if self.table_name is not None: body['table_name'] = self.table_name + if 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.""" @@ -4048,6 +5086,16 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.input_columns: body['input_columns'] = self.input_columns + if self.name is not None: body['name'] = self.name + if self.output_data_type is not None: body['output_data_type'] = self.output_data_type + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorMetric: """Deserializes the MonitorMetric from a dictionary.""" @@ -4088,6 +5136,14 @@ def as_dict(self) -> 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 + if 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.""" @@ -4127,6 +5183,17 @@ def as_dict(self) -> dict: if self.trigger is not None: 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 + if self.message is not None: body['message'] = self.message + if self.refresh_id is not None: body['refresh_id'] = self.refresh_id + if self.start_time_ms is not None: body['start_time_ms'] = self.start_time_ms + if self.state is not None: body['state'] = self.state + if self.trigger is not None: body['trigger'] = self.trigger + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorRefreshInfo: """Deserializes the MonitorRefreshInfo from a dictionary.""" @@ -4166,6 +5233,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorRefreshListResponse: """Deserializes the MonitorRefreshListResponse from a dictionary.""" @@ -4180,6 +5253,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the MonitorSnapshot into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorSnapshot: """Deserializes the MonitorSnapshot from a dictionary.""" @@ -4207,6 +5285,13 @@ def as_dict(self) -> dict: if self.timestamp_col is not None: 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 + if self.timestamp_col is not None: body['timestamp_col'] = self.timestamp_col + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MonitorTimeSeries: """Deserializes the MonitorTimeSeries from a dictionary.""" @@ -4224,6 +5309,12 @@ def as_dict(self) -> dict: if self.name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NamedTableConstraint: """Deserializes the NamedTableConstraint from a dictionary.""" @@ -4262,6 +5353,17 @@ def as_dict(self) -> dict: 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 + if self.spec: body['spec'] = self.spec + if self.status: body['status'] = self.status + if self.table_serving_url is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> OnlineTable: """Deserializes the OnlineTable from a dictionary.""" @@ -4317,6 +5419,19 @@ def as_dict(self) -> dict: if self.timeseries_key is not None: 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 + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + if self.primary_key_columns: body['primary_key_columns'] = self.primary_key_columns + if self.run_continuously: body['run_continuously'] = self.run_continuously + if 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 + if self.timeseries_key is not None: body['timeseries_key'] = self.timeseries_key + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> OnlineTableSpec: """Deserializes the OnlineTableSpec from a dictionary.""" @@ -4338,6 +5453,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the OnlineTableSpecContinuousSchedulingPolicy into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> OnlineTableSpecContinuousSchedulingPolicy: """Deserializes the OnlineTableSpecContinuousSchedulingPolicy from a dictionary.""" @@ -4352,6 +5472,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the OnlineTableSpecTriggeredSchedulingPolicy into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> OnlineTableSpecTriggeredSchedulingPolicy: """Deserializes the OnlineTableSpecTriggeredSchedulingPolicy from a dictionary.""" @@ -4413,6 +5538,17 @@ def as_dict(self) -> 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 + if self.detailed_state is not None: body['detailed_state'] = self.detailed_state + if self.failed_status: body['failed_status'] = self.failed_status + if self.message is not None: body['message'] = self.message + if self.provisioning_status: body['provisioning_status'] = self.provisioning_status + if 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.""" @@ -4443,6 +5579,14 @@ def as_dict(self) -> dict: if 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 + if self.principal is not None: body['principal'] = self.principal + if self.remove: body['remove'] = self.remove + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermissionsChange: """Deserializes the PermissionsChange from a dictionary.""" @@ -4463,6 +5607,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermissionsList: """Deserializes the PermissionsList from a dictionary.""" @@ -4502,6 +5652,19 @@ def as_dict(self) -> dict: if self.total_row_count is not None: 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 + if self.latest_version_currently_processing is not None: + 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 + if self.synced_row_count is not None: body['synced_row_count'] = self.synced_row_count + if self.total_row_count is not None: 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.""" @@ -4527,6 +5690,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PrimaryKeyConstraint: """Deserializes the PrimaryKeyConstraint from a dictionary.""" @@ -4545,6 +5715,7 @@ class Privilege(Enum): CREATE_EXTERNAL_TABLE = 'CREATE_EXTERNAL_TABLE' CREATE_EXTERNAL_VOLUME = 'CREATE_EXTERNAL_VOLUME' CREATE_FOREIGN_CATALOG = 'CREATE_FOREIGN_CATALOG' + CREATE_FOREIGN_SECURABLE = 'CREATE_FOREIGN_SECURABLE' CREATE_FUNCTION = 'CREATE_FUNCTION' CREATE_MANAGED_STORAGE = 'CREATE_MANAGED_STORAGE' CREATE_MATERIALIZED_VIEW = 'CREATE_MATERIALIZED_VIEW' @@ -4596,6 +5767,13 @@ def as_dict(self) -> dict: if 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 + if self.privileges: body['privileges'] = self.privileges + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PrivilegeAssignment: """Deserializes the PrivilegeAssignment from a dictionary.""" @@ -4617,6 +5795,12 @@ def as_dict(self) -> dict: if self.state is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ProvisioningInfo: """Deserializes the ProvisioningInfo from a dictionary.""" @@ -4648,6 +5832,13 @@ def as_dict(self) -> 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ProvisioningStatus: """Deserializes the ProvisioningStatus from a dictionary.""" @@ -4687,6 +5878,17 @@ def as_dict(self) -> dict: if self.quota_name is not None: 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 + if self.parent_full_name is not None: body['parent_full_name'] = self.parent_full_name + if self.parent_securable_type is not None: body['parent_securable_type'] = self.parent_securable_type + if self.quota_count is not None: body['quota_count'] = self.quota_count + if self.quota_limit is not None: body['quota_limit'] = self.quota_limit + if self.quota_name is not None: body['quota_name'] = self.quota_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QuotaInfo: """Deserializes the QuotaInfo from a dictionary.""" @@ -4720,6 +5922,14 @@ def as_dict(self) -> dict: if self.session_token is not None: 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 + if self.secret_access_key is not None: body['secret_access_key'] = self.secret_access_key + if self.session_token is not None: body['session_token'] = self.session_token + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> R2Credentials: """Deserializes the R2Credentials from a dictionary.""" @@ -4744,6 +5954,13 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegenerateDashboardRequest: """Deserializes the RegenerateDashboardRequest from a dictionary.""" @@ -4765,6 +5982,13 @@ def as_dict(self) -> dict: if self.parent_folder is not None: 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 + if self.parent_folder is not None: body['parent_folder'] = self.parent_folder + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegenerateDashboardResponse: """Deserializes the RegenerateDashboardResponse from a dictionary.""" @@ -4788,6 +6012,13 @@ def as_dict(self) -> dict: if self.version_num is not None: 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 + if self.version_num is not None: body['version_num'] = self.version_num + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegisteredModelAlias: """Deserializes the RegisteredModelAlias from a dictionary.""" @@ -4858,6 +6089,25 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.browse_only is not None: body['browse_only'] = self.browse_only + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.full_name is not None: body['full_name'] = self.full_name + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegisteredModelInfo: """Deserializes the RegisteredModelInfo from a dictionary.""" @@ -4960,6 +6210,31 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.catalog_type is not None: body['catalog_type'] = self.catalog_type + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if 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 + if self.full_name is not None: body['full_name'] = self.full_name + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.properties: body['properties'] = self.properties + if self.schema_id is not None: body['schema_id'] = self.schema_id + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.storage_root is not None: body['storage_root'] = self.storage_root + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SchemaInfo: """Deserializes the SchemaInfo from a dictionary.""" @@ -5024,6 +6299,13 @@ def as_dict(self) -> dict: if self.artifact_type is not None: 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 + if self.artifact_type is not None: body['artifact_type'] = self.artifact_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetArtifactAllowlist: """Deserializes the SetArtifactAllowlist from a dictionary.""" @@ -5050,6 +6332,14 @@ def as_dict(self) -> dict: if self.version_num is not None: 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 + if self.full_name is not None: body['full_name'] = self.full_name + if self.version_num is not None: body['version_num'] = self.version_num + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetRegisteredModelAliasRequest: """Deserializes the SetRegisteredModelAliasRequest from a dictionary.""" @@ -5075,6 +6365,13 @@ def as_dict(self) -> dict: if self.aws_kms_key_arn is not None: 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 + if self.aws_kms_key_arn is not None: 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.""" @@ -5170,6 +6467,31 @@ def as_dict(self) -> dict: 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 + if 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 + if self.cloudflare_api_token: body['cloudflare_api_token'] = self.cloudflare_api_token + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if 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 + if self.id is not None: body['id'] = self.id + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.read_only is not None: body['read_only'] = self.read_only + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StorageCredentialInfo: """Deserializes the StorageCredentialInfo from a dictionary.""" @@ -5211,6 +6533,13 @@ def as_dict(self) -> dict: if self.state is not None: 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 + if self.state is not None: body['state'] = self.state + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SystemSchemaInfo: """Deserializes the SystemSchemaInfo from a dictionary.""" @@ -5247,6 +6576,14 @@ def as_dict(self) -> dict: if self.primary_key_constraint: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TableConstraint: """Deserializes the TableConstraint from a dictionary.""" @@ -5269,6 +6606,12 @@ def as_dict(self) -> dict: if self.table_full_name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TableDependency: """Deserializes the TableDependency from a dictionary.""" @@ -5286,6 +6629,12 @@ def as_dict(self) -> dict: if self.table_exists is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TableExistsResponse: """Deserializes the TableExistsResponse from a dictionary.""" @@ -5438,6 +6787,48 @@ def as_dict(self) -> dict: if self.view_dependencies: 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 + if self.browse_only is not None: body['browse_only'] = self.browse_only + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.columns: body['columns'] = self.columns + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: 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 + if self.data_source_format is not None: body['data_source_format'] = self.data_source_format + if self.deleted_at is not None: body['deleted_at'] = self.deleted_at + if 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 + if self.enable_predictive_optimization is not None: + body['enable_predictive_optimization'] = self.enable_predictive_optimization + if self.encryption_details: body['encryption_details'] = self.encryption_details + if self.full_name is not None: body['full_name'] = self.full_name + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + if self.properties: body['properties'] = self.properties + if self.row_filter: body['row_filter'] = self.row_filter + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.sql_path is not None: body['sql_path'] = self.sql_path + if self.storage_credential_name is not None: + body['storage_credential_name'] = self.storage_credential_name + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.table_constraints: body['table_constraints'] = self.table_constraints + if self.table_id is not None: body['table_id'] = self.table_id + if self.table_type is not None: body['table_type'] = self.table_type + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + if self.view_definition is not None: body['view_definition'] = self.view_definition + if 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.""" @@ -5500,6 +6891,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -5521,6 +6919,13 @@ def as_dict(self) -> dict: if self.table_type is not None: 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 + if self.table_type is not None: body['table_type'] = self.table_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TableSummary: """Deserializes the TableSummary from a dictionary.""" @@ -5562,6 +6967,14 @@ def as_dict(self) -> dict: if self.expiration_time is not None: body['expiration_time'] = self.expiration_time 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 + if self.azure_aad: body['azure_aad'] = self.azure_aad + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TemporaryCredentials: """Deserializes the TemporaryCredentials from a dictionary.""" @@ -5596,6 +7009,15 @@ def as_dict(self) -> 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 + if self.timestamp is not None: body['timestamp'] = self.timestamp + if 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.""" @@ -5612,6 +7034,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UnassignResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UnassignResponse: """Deserializes the UnassignResponse from a dictionary.""" @@ -5626,6 +7053,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateAssignmentResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateAssignmentResponse: """Deserializes the UpdateAssignmentResponse from a dictionary.""" @@ -5676,6 +7108,19 @@ def as_dict(self) -> dict: if 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 + if self.enable_predictive_optimization is not None: + body['enable_predictive_optimization'] = self.enable_predictive_optimization + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.name is not None: body['name'] = self.name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.properties: body['properties'] = self.properties + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateCatalog: """Deserializes the UpdateCatalog from a dictionary.""" @@ -5712,6 +7157,15 @@ def as_dict(self) -> dict: if self.owner is not None: 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 + if self.new_name is not None: body['new_name'] = self.new_name + if self.options: body['options'] = self.options + if self.owner is not None: body['owner'] = self.owner + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateConnection: """Deserializes the UpdateConnection from a dictionary.""" @@ -5730,11 +7184,14 @@ class UpdateCredentialRequest: """The Azure managed identity configuration.""" azure_service_principal: Optional[AzureServicePrincipal] = None - """The Azure service principal configuration.""" + """The Azure service principal configuration. Only applicable when purpose is **STORAGE**.""" comment: Optional[str] = None """Comment associated with the credential.""" + databricks_gcp_service_account: Optional[DatabricksGcpServiceAccount] = None + """GCP long-lived credential. Databricks-created Google Cloud Storage service account.""" + force: Optional[bool] = None """Force an update even if there are dependent services (when purpose is **SERVICE**) or dependent external locations and external tables (when purpose is **STORAGE**).""" @@ -5766,6 +7223,8 @@ def as_dict(self) -> dict: if self.azure_service_principal: body['azure_service_principal'] = self.azure_service_principal.as_dict() if self.comment is not None: body['comment'] = self.comment + if self.databricks_gcp_service_account: + body['databricks_gcp_service_account'] = self.databricks_gcp_service_account.as_dict() if self.force is not None: body['force'] = self.force if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value if self.name_arg is not None: body['name_arg'] = self.name_arg @@ -5775,6 +7234,24 @@ def as_dict(self) -> dict: if self.skip_validation is not None: 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 + if 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 + if self.comment is not None: body['comment'] = self.comment + if 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 + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.name_arg is not None: body['name_arg'] = self.name_arg + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.read_only is not None: body['read_only'] = self.read_only + if self.skip_validation is not None: body['skip_validation'] = self.skip_validation + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateCredentialRequest: """Deserializes the UpdateCredentialRequest from a dictionary.""" @@ -5782,6 +7259,8 @@ def from_dict(cls, d: Dict[str, any]) -> UpdateCredentialRequest: 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), @@ -5851,6 +7330,24 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.credential_name is not None: body['credential_name'] = self.credential_name + if self.encryption_details: body['encryption_details'] = self.encryption_details + if self.fallback is not None: body['fallback'] = self.fallback + if self.force is not None: body['force'] = self.force + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.name is not None: body['name'] = self.name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.read_only is not None: body['read_only'] = self.read_only + if self.skip_validation is not None: body['skip_validation'] = self.skip_validation + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateExternalLocation: """Deserializes the UpdateExternalLocation from a dictionary.""" @@ -5885,6 +7382,13 @@ def as_dict(self) -> dict: if self.owner is not None: 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 + if self.owner is not None: body['owner'] = self.owner + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateFunction: """Deserializes the UpdateFunction from a dictionary.""" @@ -5936,6 +7440,24 @@ def as_dict(self) -> dict: 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 + if self.delta_sharing_recipient_token_lifetime_in_seconds is not None: + 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 + if self.id is not None: body['id'] = self.id + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.privilege_model_version is not None: + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateMetastore: """Deserializes the UpdateMetastore from a dictionary.""" @@ -5970,6 +7492,14 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateMetastoreAssignment: """Deserializes the UpdateMetastoreAssignment from a dictionary.""" @@ -6004,6 +7534,14 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.full_name is not None: body['full_name'] = self.full_name + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateModelVersionRequest: """Deserializes the UpdateModelVersionRequest from a dictionary.""" @@ -6074,6 +7612,24 @@ def as_dict(self) -> dict: if self.time_series: 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 + if self.custom_metrics: body['custom_metrics'] = self.custom_metrics + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if self.data_classification_config: + body['data_classification_config'] = self.data_classification_config + if self.inference_log: body['inference_log'] = self.inference_log + if self.notifications: body['notifications'] = self.notifications + if self.output_schema_name is not None: body['output_schema_name'] = self.output_schema_name + if self.schedule: body['schedule'] = self.schedule + if self.slicing_exprs: body['slicing_exprs'] = self.slicing_exprs + if self.snapshot: body['snapshot'] = self.snapshot + if self.table_name is not None: body['table_name'] = self.table_name + if 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.""" @@ -6111,6 +7667,14 @@ def as_dict(self) -> dict: if self.securable_type is not None: 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 + if self.full_name is not None: body['full_name'] = self.full_name + if self.securable_type is not None: body['securable_type'] = self.securable_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdatePermissions: """Deserializes the UpdatePermissions from a dictionary.""" @@ -6142,6 +7706,15 @@ def as_dict(self) -> dict: if self.owner is not None: 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 + if self.full_name is not None: body['full_name'] = self.full_name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateRegisteredModelRequest: """Deserializes the UpdateRegisteredModelRequest from a dictionary.""" @@ -6159,6 +7732,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -6197,6 +7775,18 @@ def as_dict(self) -> dict: if 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 + if self.enable_predictive_optimization is not None: + body['enable_predictive_optimization'] = self.enable_predictive_optimization + if self.full_name is not None: body['full_name'] = self.full_name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.properties: body['properties'] = self.properties + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateSchema: """Deserializes the UpdateSchema from a dictionary.""" @@ -6269,6 +7859,25 @@ def as_dict(self) -> dict: if self.skip_validation is not None: 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 + if 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 + if self.cloudflare_api_token: body['cloudflare_api_token'] = self.cloudflare_api_token + if self.comment is not None: body['comment'] = self.comment + if 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 + if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode + if self.name is not None: body['name'] = self.name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.read_only is not None: body['read_only'] = self.read_only + if self.skip_validation is not None: body['skip_validation'] = self.skip_validation + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateStorageCredential: """Deserializes the UpdateStorageCredential from a dictionary.""" @@ -6312,6 +7921,15 @@ def as_dict(self) -> dict: if self.owner is not None: 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 + if self.name is not None: body['name'] = self.name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateVolumeRequestContent: """Deserializes the UpdateVolumeRequestContent from a dictionary.""" @@ -6340,6 +7958,14 @@ def as_dict(self) -> dict: if 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 + if self.name is not None: body['name'] = self.name + if 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.""" @@ -6371,6 +7997,15 @@ def as_dict(self) -> dict: if self.securable_type is not None: 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 + if self.remove: body['remove'] = self.remove + if self.securable_name is not None: body['securable_name'] = self.securable_name + if self.securable_type is not None: body['securable_type'] = self.securable_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateWorkspaceBindingsParameters: """Deserializes the UpdateWorkspaceBindingsParameters from a dictionary.""" @@ -6418,6 +8053,19 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if 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 + if self.external_location_name is not None: + body['external_location_name'] = self.external_location_name + if self.purpose is not None: body['purpose'] = self.purpose + if self.read_only is not None: body['read_only'] = self.read_only + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ValidateCredentialRequest: """Deserializes the ValidateCredentialRequest from a dictionary.""" @@ -6446,6 +8094,13 @@ def as_dict(self) -> dict: if 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 + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ValidateCredentialResponse: """Deserializes the ValidateCredentialResponse from a dictionary.""" @@ -6508,6 +8163,23 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if 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 + if 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 + if self.external_location_name is not None: + body['external_location_name'] = self.external_location_name + if self.read_only is not None: body['read_only'] = self.read_only + if self.storage_credential_name is not None: + body['storage_credential_name'] = self.storage_credential_name + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ValidateStorageCredential: """Deserializes the ValidateStorageCredential from a dictionary.""" @@ -6539,6 +8211,13 @@ def as_dict(self) -> dict: if 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 + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ValidateStorageCredentialResponse: """Deserializes the ValidateStorageCredentialResponse from a dictionary.""" @@ -6564,6 +8243,14 @@ def as_dict(self) -> dict: if self.result is not None: 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 + if self.operation is not None: body['operation'] = self.operation + if self.result is not None: body['result'] = self.result + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ValidationResult: """Deserializes the ValidationResult from a dictionary.""" @@ -6663,6 +8350,28 @@ def as_dict(self) -> dict: if self.volume_type is not None: 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 + if self.browse_only is not None: body['browse_only'] = self.browse_only + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.encryption_details: body['encryption_details'] = self.encryption_details + if self.full_name is not None: body['full_name'] = self.full_name + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + if self.volume_id is not None: body['volume_id'] = self.volume_id + if self.volume_type is not None: body['volume_type'] = self.volume_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> VolumeInfo: """Deserializes the VolumeInfo from a dictionary.""" @@ -6704,6 +8413,13 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WorkspaceBinding: """Deserializes the WorkspaceBinding from a dictionary.""" @@ -6735,6 +8451,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -7502,9 +9225,9 @@ class CredentialsAPI: 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 + 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""" + permissions on it.""" def __init__(self, api_client): self._api = api_client @@ -7516,7 +9239,7 @@ def create_credential(self, azure_managed_identity: Optional[AzureManagedIdentity] = None, azure_service_principal: Optional[AzureServicePrincipal] = None, comment: Optional[str] = None, - gcp_service_account_key: Optional[GcpServiceAccountKey] = None, + databricks_gcp_service_account: Optional[DatabricksGcpServiceAccount] = None, purpose: Optional[CredentialPurpose] = None, read_only: Optional[bool] = None, skip_validation: Optional[bool] = None) -> CredentialInfo: @@ -7536,10 +9259,11 @@ def create_credential(self, :param azure_managed_identity: :class:`AzureManagedIdentity` (optional) The Azure managed identity configuration. :param azure_service_principal: :class:`AzureServicePrincipal` (optional) - The Azure service principal configuration. + The Azure service principal configuration. Only applicable when purpose is **STORAGE**. :param comment: str (optional) Comment associated with the credential. - :param gcp_service_account_key: :class:`GcpServiceAccountKey` (optional) + :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccount` (optional) + GCP long-lived credential. Databricks-created Google Cloud Storage service account. :param purpose: :class:`CredentialPurpose` (optional) Indicates the purpose of the credential. :param read_only: bool (optional) @@ -7557,8 +9281,8 @@ def create_credential(self, if azure_service_principal is not None: body['azure_service_principal'] = azure_service_principal.as_dict() if comment is not None: body['comment'] = comment - if gcp_service_account_key is not None: - body['gcp_service_account_key'] = gcp_service_account_key.as_dict() + if databricks_gcp_service_account is not None: + body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict() if name is not None: body['name'] = name if purpose is not None: body['purpose'] = purpose.value if read_only is not None: body['read_only'] = read_only @@ -7590,10 +9314,11 @@ def delete_credential(self, name_arg: str, *, force: Optional[bool] = None): self._api.do('DELETE', f'/api/2.1/unity-catalog/credentials/{name_arg}', query=query, headers=headers) def generate_temporary_service_credential( - self, - credential_name: str, - *, - azure_options: Optional[GenerateTemporaryServiceCredentialAzureOptions] = None + self, + credential_name: str, + *, + azure_options: Optional[GenerateTemporaryServiceCredentialAzureOptions] = None, + gcp_options: Optional[GenerateTemporaryServiceCredentialGcpOptions] = None ) -> TemporaryCredentials: """Generate a temporary service credential. @@ -7603,13 +9328,16 @@ def generate_temporary_service_credential( :param credential_name: str The name of the service credential used to generate a temporary credential :param azure_options: :class:`GenerateTemporaryServiceCredentialAzureOptions` (optional) - Options to customize the requested temporary credential + The Azure cloud options to customize the requested temporary credential + :param gcp_options: :class:`GenerateTemporaryServiceCredentialGcpOptions` (optional) + The GCP cloud options to customize the requested temporary credential :returns: :class:`TemporaryCredentials` """ body = {} if azure_options is not None: body['azure_options'] = azure_options.as_dict() if credential_name is not None: body['credential_name'] = credential_name + if gcp_options is not None: body['gcp_options'] = gcp_options.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } res = self._api.do('POST', @@ -7683,6 +9411,7 @@ def update_credential(self, azure_managed_identity: Optional[AzureManagedIdentity] = None, azure_service_principal: Optional[AzureServicePrincipal] = None, comment: Optional[str] = None, + databricks_gcp_service_account: Optional[DatabricksGcpServiceAccount] = None, force: Optional[bool] = None, isolation_mode: Optional[IsolationMode] = None, new_name: Optional[str] = None, @@ -7703,9 +9432,11 @@ def update_credential(self, :param azure_managed_identity: :class:`AzureManagedIdentity` (optional) The Azure managed identity configuration. :param azure_service_principal: :class:`AzureServicePrincipal` (optional) - The Azure service principal configuration. + The Azure service principal configuration. Only applicable when purpose is **STORAGE**. :param comment: str (optional) Comment associated with the credential. + :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccount` (optional) + GCP long-lived credential. Databricks-created Google Cloud Storage service account. :param force: bool (optional) Force an update even if there are dependent services (when purpose is **SERVICE**) or dependent external locations and external tables (when purpose is **STORAGE**). @@ -7730,6 +9461,8 @@ def update_credential(self, if azure_service_principal is not None: body['azure_service_principal'] = azure_service_principal.as_dict() if comment is not None: body['comment'] = comment + if databricks_gcp_service_account is not None: + body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict() if force is not None: body['force'] = force if isolation_mode is not None: body['isolation_mode'] = isolation_mode.value if new_name is not None: body['new_name'] = new_name diff --git a/databricks/sdk/service/cleanrooms.py b/databricks/sdk/service/cleanrooms.py new file mode 100755 index 000000000..393c68a0b --- /dev/null +++ b/databricks/sdk/service/cleanrooms.py @@ -0,0 +1,1281 @@ +# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +from __future__ import annotations + +import logging +from dataclasses import dataclass +from enum import Enum +from typing import Dict, Iterator, List, Optional + +from ._internal import _enum, _from_dict, _repeated_dict + +_LOG = logging.getLogger('databricks.sdk') + +from databricks.sdk.service import catalog, jobs, settings, sharing + +# all definitions in this file are in alphabetical order + + +@dataclass +class CleanRoom: + access_restricted: Optional[CleanRoomAccessRestricted] = None + """Whether clean room access is restricted due to [CSP] + + [CSP]: https://docs.databricks.com/en/security/privacy/security-profile.html""" + + comment: Optional[str] = None + + created_at: Optional[int] = None + """When the clean room was created, in epoch milliseconds.""" + + local_collaborator_alias: Optional[str] = None + """The alias of the collaborator tied to the local clean room.""" + + name: Optional[str] = None + """The name of the clean room. It should follow [UC securable naming requirements]. + + [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements""" + + output_catalog: Optional[CleanRoomOutputCatalog] = None + """Output catalog of the clean room. It is an output only field. Output catalog is manipulated + using the separate CreateCleanRoomOutputCatalog API.""" + + owner: Optional[str] = None + """This is Databricks username of the owner of the local clean room securable for permission + management.""" + + remote_detailed_info: Optional[CleanRoomRemoteDetail] = None + """Central clean room details. During creation, users need to specify cloud_vendor, region, and + collaborators.global_metastore_id. This field will not be filled in the ListCleanRooms call.""" + + status: Optional[CleanRoomStatusEnum] = None + """Clean room status.""" + + updated_at: Optional[int] = None + """When the clean room was last updated, in epoch milliseconds.""" + + 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 + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.local_collaborator_alias is not None: + body['local_collaborator_alias'] = self.local_collaborator_alias + if self.name is not None: body['name'] = self.name + if self.output_catalog: body['output_catalog'] = self.output_catalog.as_dict() + if self.owner is not None: body['owner'] = self.owner + if self.remote_detailed_info: body['remote_detailed_info'] = self.remote_detailed_info.as_dict() + if self.status is not None: body['status'] = self.status.value + if self.updated_at is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.local_collaborator_alias is not None: + body['local_collaborator_alias'] = self.local_collaborator_alias + if self.name is not None: body['name'] = self.name + if self.output_catalog: body['output_catalog'] = self.output_catalog + if self.owner is not None: body['owner'] = self.owner + if self.remote_detailed_info: body['remote_detailed_info'] = self.remote_detailed_info + if self.status is not None: body['status'] = self.status + if self.updated_at is not None: 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)) + + +class CleanRoomAccessRestricted(Enum): + + CSP_MISMATCH = 'CSP_MISMATCH' + NO_RESTRICTION = 'NO_RESTRICTION' + + +@dataclass +class CleanRoomAsset: + """Metadata of the clean room asset""" + + added_at: Optional[int] = None + """When the asset is added to the clean room, in epoch milliseconds.""" + + asset_type: Optional[CleanRoomAssetAssetType] = None + """The type of the asset.""" + + foreign_table: Optional[CleanRoomAssetForeignTable] = None + """Foreign table details available to all collaborators of the clean room. Present if and only if + **asset_type** is **FOREIGN_TABLE**""" + + foreign_table_local_details: Optional[CleanRoomAssetForeignTableLocalDetails] = None + """Local details for a foreign that are only available to its owner. Present if and only if + **asset_type** is **FOREIGN_TABLE**""" + + name: Optional[str] = None + """A fully qualified name that uniquely identifies the asset within the clean room. This is also + the name displayed in the clean room UI. + + For UC securable assets (tables, volumes, etc.), the format is + *shared_catalog*.*shared_schema*.*asset_name* + + For notebooks, the name is the notebook file name.""" + + notebook: Optional[CleanRoomAssetNotebook] = None + """Notebook details available to all collaborators of the clean room. Present if and only if + **asset_type** is **NOTEBOOK_FILE**""" + + owner_collaborator_alias: Optional[str] = None + """The alias of the collaborator who owns this asset""" + + status: Optional[CleanRoomAssetStatusEnum] = None + """Status of the asset""" + + table: Optional[CleanRoomAssetTable] = None + """Table details available to all collaborators of the clean room. Present if and only if + **asset_type** is **TABLE**""" + + table_local_details: Optional[CleanRoomAssetTableLocalDetails] = None + """Local details for a table that are only available to its owner. Present if and only if + **asset_type** is **TABLE**""" + + view: Optional[CleanRoomAssetView] = None + """View details available to all collaborators of the clean room. Present if and only if + **asset_type** is **VIEW**""" + + view_local_details: Optional[CleanRoomAssetViewLocalDetails] = None + """Local details for a view that are only available to its owner. Present if and only if + **asset_type** is **VIEW**""" + + volume_local_details: Optional[CleanRoomAssetVolumeLocalDetails] = None + """Local details for a volume that are only available to its owner. Present if and only if + **asset_type** is **VOLUME**""" + + 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 + if self.asset_type is not None: body['asset_type'] = self.asset_type.value + if self.foreign_table: 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() + if self.name is not None: body['name'] = self.name + if self.notebook: body['notebook'] = self.notebook.as_dict() + if self.owner_collaborator_alias is not None: + body['owner_collaborator_alias'] = self.owner_collaborator_alias + if self.status is not None: body['status'] = self.status.value + if self.table: body['table'] = self.table.as_dict() + if self.table_local_details: body['table_local_details'] = self.table_local_details.as_dict() + if self.view: body['view'] = self.view.as_dict() + if self.view_local_details: 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() + 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 + if self.asset_type is not None: body['asset_type'] = self.asset_type + if 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 + if self.name is not None: body['name'] = self.name + if self.notebook: body['notebook'] = self.notebook + if self.owner_collaborator_alias is not None: + body['owner_collaborator_alias'] = self.owner_collaborator_alias + if self.status is not None: body['status'] = self.status + if self.table: body['table'] = self.table + if self.table_local_details: body['table_local_details'] = self.table_local_details + if self.view: body['view'] = self.view + if 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 + 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), + foreign_table_local_details=_from_dict(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)) + + +class CleanRoomAssetAssetType(Enum): + + FOREIGN_TABLE = 'FOREIGN_TABLE' + NOTEBOOK_FILE = 'NOTEBOOK_FILE' + TABLE = 'TABLE' + VIEW = 'VIEW' + VOLUME = 'VOLUME' + + +@dataclass +class CleanRoomAssetForeignTable: + columns: Optional[List[catalog.ColumnInfo]] = None + """The metadata information of the columns in the foreign table""" + + 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] + 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 + 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', catalog.ColumnInfo)) + + +@dataclass +class CleanRoomAssetForeignTableLocalDetails: + local_name: Optional[str] = None + """The fully qualified name of the foreign table in its owner's local metastore, in the format of + *catalog*.*schema*.*foreign_table_name*""" + + 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 + 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 + 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)) + + +@dataclass +class CleanRoomAssetNotebook: + etag: Optional[str] = None + """Server generated checksum that represents the notebook version.""" + + notebook_content: Optional[str] = None + """Base 64 representation of the notebook contents. This is the same format as returned by + :method:workspace/export with the format of **HTML**.""" + + 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 + if self.notebook_content is not None: 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 + if self.notebook_content is not None: 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)) + + +class CleanRoomAssetStatusEnum(Enum): + + ACTIVE = 'ACTIVE' + PERMISSION_DENIED = 'PERMISSION_DENIED' + + +@dataclass +class CleanRoomAssetTable: + columns: Optional[List[catalog.ColumnInfo]] = None + """The metadata information of the columns in the table""" + + 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] + 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 + 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', catalog.ColumnInfo)) + + +@dataclass +class CleanRoomAssetTableLocalDetails: + local_name: Optional[str] = None + """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.PartitionSpecificationPartition]] = None + """Partition filtering specification for a shared table.""" + + 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 + if 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 + if 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', sharing.PartitionSpecificationPartition)) + + +@dataclass +class CleanRoomAssetView: + columns: Optional[List[catalog.ColumnInfo]] = None + """The metadata information of the columns in the view""" + + 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] + 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 + 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', catalog.ColumnInfo)) + + +@dataclass +class CleanRoomAssetViewLocalDetails: + local_name: Optional[str] = None + """The fully qualified name of the view in its owner's local metastore, in the format of + *catalog*.*schema*.*view_name*""" + + 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 + 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 + 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)) + + +@dataclass +class CleanRoomAssetVolumeLocalDetails: + local_name: Optional[str] = None + """The fully qualified name of the volume in its owner's local metastore, in the format of + *catalog*.*schema*.*volume_name*""" + + 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 + 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 + 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)) + + +@dataclass +class CleanRoomCollaborator: + """Publicly visible clean room collaborator.""" + + collaborator_alias: Optional[str] = None + """Collaborator alias specified by the clean room creator. It is unique across all collaborators of + this clean room, and used to derive multiple values internally such as catalog alias and clean + room name for single metastore clean rooms. It should follow [UC securable naming requirements]. + + [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements""" + + display_name: Optional[str] = None + """Generated display name for the collaborator. In the case of a single metastore clean room, it is + the clean room name. For x-metastore clean rooms, it is the organization name of the metastore. + It is not restricted to these values and could change in the future""" + + global_metastore_id: Optional[str] = None + """The global Unity Catalog metastore id of the collaborator. The identifier is of format + cloud:region:metastore-uuid.""" + + invite_recipient_email: Optional[str] = None + """Email of the user who is receiving the clean room "invitation". It should be empty for the + creator of the clean room, and non-empty for the invitees of the clean room. It is only returned + in the output when clean room creator calls GET""" + + invite_recipient_workspace_id: Optional[int] = None + """Workspace ID of the user who is receiving the clean room "invitation". Must be specified if + invite_recipient_email is specified. It should be empty when the collaborator is the creator of + the clean room.""" + + organization_name: Optional[str] = None + """[Organization name](:method:metastores/list#metastores-delta_sharing_organization_name) + configured in the metastore""" + + 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.global_metastore_id is not None: body['global_metastore_id'] = self.global_metastore_id + if self.invite_recipient_email is not None: + 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 + if self.organization_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.global_metastore_id is not None: body['global_metastore_id'] = self.global_metastore_id + if self.invite_recipient_email is not None: + 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 + if self.organization_name is not None: 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)) + + +@dataclass +class CleanRoomNotebookTaskRun: + """Stores information about a single task run.""" + + collaborator_job_run_info: Optional[CollaboratorJobRunInfo] = None + """Job run info of the task in the runner's local workspace. This field is only included in the + 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 + """State of the task run.""" + + notebook_name: Optional[str] = None + """Asset name of the notebook executed in this task run.""" + + output_schema_expiration_time: Optional[int] = None + """Expiration time of the output schema of the task run (if any), in epoch milliseconds.""" + + output_schema_name: Optional[str] = None + """Name of the output schema associated with the clean rooms notebook task run.""" + + run_duration: Optional[int] = None + """Duration of the task run, in milliseconds.""" + + start_time: Optional[int] = None + """When the task run started, in epoch milliseconds.""" + + 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() + if self.notebook_job_run_state: 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 + if self.output_schema_expiration_time is not None: + 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 + if self.run_duration is not None: body['run_duration'] = self.run_duration + if self.start_time is not None: 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 + if 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 + if self.output_schema_expiration_time is not None: + 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 + if self.run_duration is not None: body['run_duration'] = self.run_duration + if self.start_time is not None: 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', jobs.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)) + + +@dataclass +class CleanRoomOutputCatalog: + catalog_name: Optional[str] = None + """The name of the output catalog in UC. It should follow [UC securable naming requirements]. The + field will always exist if status is CREATED. + + [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements""" + + status: Optional[CleanRoomOutputCatalogOutputCatalogStatus] = None + + 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 + if self.status is not None: 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 + if self.status is not None: 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)) + + +class CleanRoomOutputCatalogOutputCatalogStatus(Enum): + + CREATED = 'CREATED' + NOT_CREATED = 'NOT_CREATED' + NOT_ELIGIBLE = 'NOT_ELIGIBLE' + + +@dataclass +class CleanRoomRemoteDetail: + """Publicly visible central clean room details.""" + + central_clean_room_id: Optional[str] = None + """Central clean room ID.""" + + cloud_vendor: Optional[str] = None + """Cloud vendor (aws,azure,gcp) of the central clean room.""" + + collaborators: Optional[List[CleanRoomCollaborator]] = None + """Collaborators in the central clean room. There should one and only one collaborator in the list + that satisfies the owner condition: + + 1. It has the creator's global_metastore_id (determined by caller of CreateCleanRoom). + + 2. Its invite_recipient_email is empty.""" + + compliance_security_profile: Optional[ComplianceSecurityProfile] = None + """The compliance security profile used to process regulated data following compliance standards.""" + + creator: Optional[CleanRoomCollaborator] = None + """Collaborator who creates the clean room.""" + + egress_network_policy: Optional[settings.EgressNetworkPolicy] = None + """Egress network policy to apply to the central clean room workspace.""" + + region: Optional[str] = None + """Region of the central clean room.""" + + 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 + if self.cloud_vendor is not None: body['cloud_vendor'] = self.cloud_vendor + if 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() + if self.creator: body['creator'] = self.creator.as_dict() + if self.egress_network_policy: body['egress_network_policy'] = self.egress_network_policy.as_dict() + if self.region is not None: 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 + if self.cloud_vendor is not None: body['cloud_vendor'] = self.cloud_vendor + if self.collaborators: body['collaborators'] = self.collaborators + if self.compliance_security_profile: + body['compliance_security_profile'] = self.compliance_security_profile + if self.creator: body['creator'] = self.creator + if self.egress_network_policy: body['egress_network_policy'] = self.egress_network_policy + if self.region is not None: 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', settings.EgressNetworkPolicy), + region=d.get('region', None)) + + +class CleanRoomStatusEnum(Enum): + + ACTIVE = 'ACTIVE' + DELETED = 'DELETED' + FAILED = 'FAILED' + PROVISIONING = 'PROVISIONING' + + +@dataclass +class CollaboratorJobRunInfo: + collaborator_alias: Optional[str] = None + """Alias of the collaborator that triggered the task run.""" + + collaborator_job_id: Optional[int] = None + """Job ID of the task run in the collaborator's workspace.""" + + collaborator_job_run_id: Optional[int] = None + """Job run ID of the task run in the collaborator's workspace.""" + + collaborator_task_run_id: Optional[int] = None + """Task run ID of the task run in the collaborator's workspace.""" + + collaborator_workspace_id: Optional[int] = None + """ID of the collaborator's workspace that triggered the task run.""" + + 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 + if self.collaborator_job_id is not None: 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 + if self.collaborator_task_run_id is not None: + 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 + 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 + if self.collaborator_job_id is not None: 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 + if self.collaborator_task_run_id is not None: + 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 + 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)) + + +@dataclass +class ComplianceSecurityProfile: + """The compliance security profile used to process regulated data following compliance standards.""" + + compliance_standards: Optional[List[settings.ComplianceStandard]] = None + """The list of compliance standards that the compliance security profile is configured to enforce.""" + + is_enabled: Optional[bool] = None + """Whether the compliance security profile is enabled.""" + + 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] + if self.is_enabled is not None: 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 + if self.is_enabled is not None: 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_dict(d, 'compliance_standards', + settings.ComplianceStandard), + is_enabled=d.get('is_enabled', None)) + + +@dataclass +class CreateCleanRoomOutputCatalogResponse: + output_catalog: Optional[CleanRoomOutputCatalog] = None + + 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() + 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 + 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)) + + +@dataclass +class DeleteCleanRoomAssetResponse: + """Response for delete clean room request. Using an empty message since the generic Empty proto + does not externd UnshadedMessageMarker.""" + + def as_dict(self) -> dict: + """Serializes the DeleteCleanRoomAssetResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DeleteCleanRoomAssetResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> DeleteCleanRoomAssetResponse: + """Deserializes the DeleteCleanRoomAssetResponse from a dictionary.""" + return cls() + + +@dataclass +class DeleteResponse: + + def as_dict(self) -> dict: + """Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + return body + + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: + """Deserializes the DeleteResponse from a dictionary.""" + return cls() + + +@dataclass +class ListCleanRoomAssetsResponse: + assets: Optional[List[CleanRoomAsset]] = None + """Assets in the clean room.""" + + next_page_token: Optional[str] = None + """Opaque token to retrieve the next page of results. Absent if there are no more pages. page_token + should be set to this value for the next request (for the next page of results).""" + + 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] + if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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)) + + +@dataclass +class ListCleanRoomNotebookTaskRunsResponse: + next_page_token: Optional[str] = None + """Opaque token to retrieve the next page of results. Absent if there are no more pages. page_token + should be set to this value for the next request (for the next page of results).""" + + runs: Optional[List[CleanRoomNotebookTaskRun]] = None + """Name of the clean room.""" + + 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 + if 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 + if 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)) + + +@dataclass +class ListCleanRoomsResponse: + clean_rooms: Optional[List[CleanRoom]] = None + + next_page_token: Optional[str] = None + """Opaque token to retrieve the next page of results. Absent if there are no more pages. page_token + should be set to this value for the next request (for the next page of results).""" + + 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] + if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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)) + + +@dataclass +class UpdateCleanRoomRequest: + clean_room: Optional[CleanRoom] = None + + name: Optional[str] = None + """Name of the clean room.""" + + 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() + if self.name is not None: 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 + if self.name is not None: 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)) + + +class CleanRoomAssetsAPI: + """Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the + clean room.""" + + def __init__(self, api_client): + self._api = api_client + + def create(self, clean_room_name: str, *, asset: Optional[CleanRoomAsset] = None) -> CleanRoomAsset: + """Create an asset. + + Create a clean room asset —share an asset like a notebook or table into the clean room. For each UC + asset that is added through this method, the clean room owner must also have enough privilege on the + asset to consume it. The privilege must be maintained indefinitely for the clean room to be able to + access the asset. Typically, you should use a group as the clean room owner. + + :param clean_room_name: str + Name of the clean room. + :param asset: :class:`CleanRoomAsset` (optional) + Metadata of the clean room asset + + :returns: :class:`CleanRoomAsset` + """ + body = asset.as_dict() + headers = {'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) + return CleanRoomAsset.from_dict(res) + + def delete(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, asset_full_name: str): + """Delete an asset. + + Delete a clean room asset - unshare/remove the asset from the clean room + + :param clean_room_name: str + Name of the clean room. + :param asset_type: :class:`CleanRoomAssetAssetType` + The type of the asset. + :param asset_full_name: str + The fully qualified name of the asset, it is same as the name field in CleanRoomAsset. + + + """ + + headers = {'Accept': 'application/json', } + + self._api.do('DELETE', + f'/api/2.0/clean-rooms/{clean_room_name}/assets/{asset_type.value}/{asset_full_name}', + headers=headers) + + def get(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, + asset_full_name: str) -> CleanRoomAsset: + """Get an asset. + + Get the details of a clean room asset by its type and full name. + + :param clean_room_name: str + Name of the clean room. + :param asset_type: :class:`CleanRoomAssetAssetType` + The type of the asset. + :param asset_full_name: str + The fully qualified name of the asset, it is same as the name field in CleanRoomAsset. + + :returns: :class:`CleanRoomAsset` + """ + + headers = {'Accept': 'application/json', } + + res = self._api.do( + 'GET', + f'/api/2.0/clean-rooms/{clean_room_name}/assets/{asset_type.value}/{asset_full_name}', + headers=headers) + return CleanRoomAsset.from_dict(res) + + def list(self, clean_room_name: str, *, page_token: Optional[str] = None) -> Iterator[CleanRoomAsset]: + """List assets. + + :param clean_room_name: str + Name of the clean room. + :param page_token: str (optional) + Opaque pagination token to go to next page based on previous query. + + :returns: Iterator over :class:`CleanRoomAsset` + """ + + query = {} + if page_token is not None: query['page_token'] = page_token + headers = {'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']: + yield CleanRoomAsset.from_dict(v) + if 'next_page_token' not in json or not json['next_page_token']: + return + query['page_token'] = json['next_page_token'] + + def update(self, + clean_room_name: str, + asset_type: CleanRoomAssetAssetType, + name: str, + *, + asset: Optional[CleanRoomAsset] = None) -> CleanRoomAsset: + """Update an asset. + + Update a clean room asset. For example, updating the content of a notebook; changing the shared + partitions of a table; etc. + + :param clean_room_name: str + Name of the clean room. + :param asset_type: :class:`CleanRoomAssetAssetType` + The type of the asset. + :param name: str + A fully qualified name that uniquely identifies the asset within the clean room. This is also the + name displayed in the clean room UI. + + For UC securable assets (tables, volumes, etc.), the format is + *shared_catalog*.*shared_schema*.*asset_name* + + For notebooks, the name is the notebook file name. + :param asset: :class:`CleanRoomAsset` (optional) + Metadata of the clean room asset + + :returns: :class:`CleanRoomAsset` + """ + body = asset.as_dict() + headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + + res = self._api.do('PATCH', + f'/api/2.0/clean-rooms/{clean_room_name}/assets/{asset_type.value}/{name}', + body=body, + headers=headers) + return CleanRoomAsset.from_dict(res) + + +class CleanRoomTaskRunsAPI: + """Clean room task runs are the executions of notebooks in a clean room.""" + + def __init__(self, api_client): + self._api = api_client + + def list(self, + clean_room_name: str, + *, + notebook_name: Optional[str] = None, + page_size: Optional[int] = None, + page_token: Optional[str] = None) -> Iterator[CleanRoomNotebookTaskRun]: + """List notebook task runs. + + List all the historical notebook task runs in a clean room. + + :param clean_room_name: str + Name of the clean room. + :param notebook_name: str (optional) + Notebook name + :param page_size: int (optional) + The maximum number of task runs to return + :param page_token: str (optional) + Opaque pagination token to go to next page based on previous query. + + :returns: Iterator over :class:`CleanRoomNotebookTaskRun` + """ + + query = {} + if notebook_name is not None: query['notebook_name'] = notebook_name + if page_size is not None: query['page_size'] = page_size + if page_token is not None: query['page_token'] = page_token + headers = {'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']: + yield CleanRoomNotebookTaskRun.from_dict(v) + if 'next_page_token' not in json or not json['next_page_token']: + return + query['page_token'] = json['next_page_token'] + + +class 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, api_client): + self._api = api_client + + def create(self, *, clean_room: Optional[CleanRoom] = None) -> CleanRoom: + """Create a clean room. + + Create a new clean room with the specified collaborators. This method is asynchronous; the returned + name field inside the clean_room field can be used to poll the clean room status, using the + :method:cleanrooms/get method. When this method returns, the cluster will be in a PROVISIONING state. + The cluster will be usable once it enters an ACTIVE state. + + The caller must be a metastore admin or have the **CREATE_CLEAN_ROOM** privilege on the metastore. + + :param clean_room: :class:`CleanRoom` (optional) + + :returns: :class:`CleanRoom` + """ + body = clean_room.as_dict() + headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + + res = self._api.do('POST', '/api/2.0/clean-rooms', body=body, headers=headers) + return CleanRoom.from_dict(res) + + def create_output_catalog( + self, + clean_room_name: str, + *, + output_catalog: Optional[CleanRoomOutputCatalog] = None) -> CreateCleanRoomOutputCatalogResponse: + """Create an output catalog. + + Create the output catalog of the clean room. + + :param clean_room_name: str + Name of the clean room. + :param output_catalog: :class:`CleanRoomOutputCatalog` (optional) + + :returns: :class:`CreateCleanRoomOutputCatalogResponse` + """ + body = output_catalog.as_dict() + headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + + res = self._api.do('POST', + f'/api/2.0/clean-rooms/{clean_room_name}/output-catalogs', + body=body, + headers=headers) + return CreateCleanRoomOutputCatalogResponse.from_dict(res) + + def delete(self, name: str): + """Delete a clean room. + + Delete a clean room. After deletion, the clean room will be removed from the metastore. If the other + collaborators have not deleted the clean room, they will still have the clean room in their metastore, + but it will be in a DELETED state and no operations other than deletion can be performed on it. + + :param name: str + Name of the clean room. + + + """ + + headers = {'Accept': 'application/json', } + + self._api.do('DELETE', f'/api/2.0/clean-rooms/{name}', headers=headers) + + def get(self, name: str) -> CleanRoom: + """Get a clean room. + + Get the details of a clean room given its name. + + :param name: str + + :returns: :class:`CleanRoom` + """ + + headers = {'Accept': 'application/json', } + + res = self._api.do('GET', f'/api/2.0/clean-rooms/{name}', headers=headers) + return CleanRoom.from_dict(res) + + def list(self, + *, + page_size: Optional[int] = None, + page_token: Optional[str] = None) -> Iterator[CleanRoom]: + """List clean rooms. + + Get a list of all clean rooms of the metastore. Only clean rooms the caller has access to are + returned. + + :param page_size: int (optional) + Maximum number of clean rooms to return (i.e., the page length). Defaults to 100. + :param page_token: str (optional) + Opaque pagination token to go to next page based on previous query. + + :returns: Iterator over :class:`CleanRoom` + """ + + query = {} + if page_size is not None: query['page_size'] = page_size + if page_token is not None: query['page_token'] = page_token + headers = {'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']: + yield CleanRoom.from_dict(v) + if 'next_page_token' not in json or not json['next_page_token']: + return + query['page_token'] = json['next_page_token'] + + def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanRoom: + """Update a clean room. + + Update a clean room. The caller must be the owner of the clean room, have **MODIFY_CLEAN_ROOM** + privilege, or be metastore admin. + + When the caller is a metastore admin, only the __owner__ field can be updated. + + :param name: str + Name of the clean room. + :param clean_room: :class:`CleanRoom` (optional) + + :returns: :class:`CleanRoom` + """ + body = {} + if clean_room is not None: body['clean_room'] = clean_room.as_dict() + headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + + res = self._api.do('PATCH', f'/api/2.0/clean-rooms/{name}', body=body, headers=headers) + return CleanRoom.from_dict(res) diff --git a/databricks/sdk/service/compute.py b/databricks/sdk/service/compute.py index 17567ab62..d8be32003 100755 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/service/compute.py @@ -55,6 +55,16 @@ def as_dict(self) -> dict: if self.skip_validation is not None: 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 + if self.instance_profile_arn is not None: 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 + if self.skip_validation is not None: body['skip_validation'] = self.skip_validation + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AddInstanceProfile: """Deserializes the AddInstanceProfile from a dictionary.""" @@ -72,6 +82,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the AddResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AddResponse: """Deserializes the AddResponse from a dictionary.""" @@ -90,6 +105,12 @@ def as_dict(self) -> dict: 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.""" @@ -113,6 +134,13 @@ def as_dict(self) -> dict: 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.""" @@ -216,6 +244,22 @@ def as_dict(self) -> dict: 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.""" @@ -275,6 +319,15 @@ def as_dict(self) -> 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.""" @@ -310,6 +363,14 @@ def as_dict(self) -> dict: if self.context_id is not None: body['contextId'] = 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 + if self.command_id is not None: body['commandId'] = self.command_id + if self.context_id is not None: body['contextId'] = self.context_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelCommand: """Deserializes the CancelCommand from a dictionary.""" @@ -326,6 +387,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CancelResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelResponse: """Deserializes the CancelResponse from a dictionary.""" @@ -347,6 +413,13 @@ def as_dict(self) -> dict: if self.owner_username is not None: 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 + if self.owner_username is not None: body['owner_username'] = self.owner_username + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ChangeClusterOwner: """Deserializes the ChangeClusterOwner from a dictionary.""" @@ -361,6 +434,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the ChangeClusterOwnerResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ChangeClusterOwnerResponse: """Deserializes the ChangeClusterOwnerResponse from a dictionary.""" @@ -382,6 +460,13 @@ def as_dict(self) -> dict: 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.""" @@ -399,6 +484,12 @@ def as_dict(self) -> dict: if self.source_cluster_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CloneCluster: """Deserializes the CloneCluster from a dictionary.""" @@ -415,6 +506,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CloudProviderNodeInfo: """Deserializes the CloudProviderNodeInfo from a dictionary.""" @@ -451,6 +548,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterAccessControlRequest: """Deserializes the ClusterAccessControlRequest from a dictionary.""" @@ -488,6 +595,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterAccessControlResponse: """Deserializes the ClusterAccessControlResponse from a dictionary.""" @@ -666,6 +784,38 @@ def as_dict(self) -> dict: if self.workload_type: 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 + 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.node_type_id is not None: body['node_type_id'] = self.node_type_id + 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.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.""" @@ -716,6 +866,14 @@ def as_dict(self) -> dict: if 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 + if self.is_compliant is not None: body['is_compliant'] = self.is_compliant + if self.violations: body['violations'] = self.violations + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterCompliance: """Deserializes the ClusterCompliance from a dictionary.""" @@ -1008,6 +1166,59 @@ def as_dict(self) -> dict: if self.workload_type: 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 + 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_cores is not None: body['cluster_cores'] = self.cluster_cores + if self.cluster_id is not None: body['cluster_id'] = self.cluster_id + if 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 + if self.cluster_memory_mb is not None: body['cluster_memory_mb'] = self.cluster_memory_mb + if self.cluster_name is not None: body['cluster_name'] = self.cluster_name + if self.cluster_source is not None: body['cluster_source'] = self.cluster_source + if self.creator_user_name is not None: body['creator_user_name'] = self.creator_user_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.default_tags: body['default_tags'] = self.default_tags + if self.docker_image: body['docker_image'] = self.docker_image + if 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 + 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.executors: body['executors'] = self.executors + 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.jdbc_port is not None: body['jdbc_port'] = self.jdbc_port + if self.last_restarted_time is not None: 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 + 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_context_id is not None: body['spark_context_id'] = self.spark_context_id + 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.spec: body['spec'] = self.spec + if 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 + if self.state is not None: body['state'] = self.state + if self.state_message is not None: body['state_message'] = self.state_message + if self.terminated_time is not None: body['terminated_time'] = self.terminated_time + if self.termination_reason: body['termination_reason'] = self.termination_reason + if 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.""" @@ -1086,6 +1297,16 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.data_plane_event_details: body['data_plane_event_details'] = self.data_plane_event_details + if self.details: body['details'] = self.details + if self.timestamp is not None: body['timestamp'] = self.timestamp + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterEvent: """Deserializes the ClusterEvent from a dictionary.""" @@ -1111,6 +1332,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -1137,6 +1365,13 @@ def as_dict(self) -> dict: if self.s3: body['s3'] = self.s3.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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterLogConf: """Deserializes the ClusterLogConf from a dictionary.""" @@ -1160,6 +1395,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPermission: """Deserializes the ClusterPermission from a dictionary.""" @@ -1193,6 +1436,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPermissions: """Deserializes the ClusterPermissions from a dictionary.""" @@ -1215,6 +1466,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPermissionsDescription: """Deserializes the ClusterPermissionsDescription from a dictionary.""" @@ -1237,6 +1495,13 @@ def as_dict(self) -> dict: if self.cluster_id is not None: 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 + if self.cluster_id is not None: body['cluster_id'] = self.cluster_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPermissionsRequest: """Deserializes the ClusterPermissionsRequest from a dictionary.""" @@ -1268,6 +1533,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPolicyAccessControlRequest: """Deserializes the ClusterPolicyAccessControlRequest from a dictionary.""" @@ -1305,6 +1580,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPolicyAccessControlResponse: """Deserializes the ClusterPolicyAccessControlResponse from a dictionary.""" @@ -1332,6 +1618,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPolicyPermission: """Deserializes the ClusterPolicyPermission from a dictionary.""" @@ -1363,6 +1657,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPolicyPermissions: """Deserializes the ClusterPolicyPermissions from a dictionary.""" @@ -1386,6 +1688,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterPolicyPermissionsDescription: """Deserializes the ClusterPolicyPermissionsDescription from a dictionary.""" @@ -1408,6 +1717,13 @@ def as_dict(self) -> dict: if self.cluster_policy_id is not None: 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 + if self.cluster_policy_id is not None: 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.""" @@ -1442,6 +1758,14 @@ def as_dict(self) -> dict: if self.previous_value is not None: 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 + if self.new_value is not None: body['new_value'] = self.new_value + if self.previous_value is not None: body['previous_value'] = self.previous_value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterSettingsChange: """Deserializes the ClusterSettingsChange from a dictionary.""" @@ -1473,6 +1797,13 @@ def as_dict(self) -> dict: if self.num_workers is not None: 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 + if self.num_workers is not None: body['num_workers'] = self.num_workers + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterSize: """Deserializes the ClusterSize from a dictionary.""" @@ -1682,6 +2013,42 @@ def as_dict(self) -> dict: if self.workload_type: 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 + 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.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.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.""" @@ -1736,6 +2103,15 @@ def as_dict(self) -> dict: if self.language is not None: 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 + if self.command is not None: body['command'] = self.command + if self.context_id is not None: body['contextId'] = self.context_id + if self.language is not None: body['language'] = self.language + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Command: """Deserializes the Command from a dictionary.""" @@ -1771,6 +2147,14 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.results: body['results'] = self.results + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CommandStatusResponse: """Deserializes the CommandStatusResponse from a dictionary.""" @@ -1799,6 +2183,13 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ContextStatusResponse: """Deserializes the ContextStatusResponse from a dictionary.""" @@ -2000,14 +2391,51 @@ def as_dict(self) -> dict: if self.workload_type: body['workload_type'] = self.workload_type.as_dict() 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), + 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 + 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.clone_from: body['clone_from'] = self.clone_from + 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.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.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), @@ -2043,6 +2471,12 @@ def as_dict(self) -> dict: if self.cluster_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateClusterResponse: """Deserializes the CreateClusterResponse from a dictionary.""" @@ -2063,6 +2497,13 @@ def as_dict(self) -> dict: if self.language is not None: 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 + if self.language is not None: body['language'] = self.language + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateContext: """Deserializes the CreateContext from a dictionary.""" @@ -2152,6 +2593,25 @@ def as_dict(self) -> dict: 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 + if self.azure_attributes: body['azure_attributes'] = self.azure_attributes + if self.custom_tags: body['custom_tags'] = self.custom_tags + if 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 + if 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 + if self.instance_pool_name is not None: body['instance_pool_name'] = self.instance_pool_name + if self.max_capacity is not None: body['max_capacity'] = self.max_capacity + if self.min_idle_instances is not None: body['min_idle_instances'] = self.min_idle_instances + if self.node_type_id is not None: body['node_type_id'] = self.node_type_id + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateInstancePool: """Deserializes the CreateInstancePool from a dictionary.""" @@ -2181,6 +2641,12 @@ def as_dict(self) -> dict: if self.instance_pool_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateInstancePoolResponse: """Deserializes the CreateInstancePoolResponse from a dictionary.""" @@ -2238,6 +2704,19 @@ def as_dict(self) -> dict: if self.policy_family_id is not None: 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 + if self.description is not None: body['description'] = self.description + if 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 + if self.name is not None: body['name'] = self.name + if self.policy_family_definition_overrides is not None: + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePolicy: """Deserializes the CreatePolicy from a dictionary.""" @@ -2261,6 +2740,12 @@ def as_dict(self) -> dict: if self.policy_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePolicyResponse: """Deserializes the CreatePolicyResponse from a dictionary.""" @@ -2278,6 +2763,12 @@ def as_dict(self) -> dict: if self.script_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" @@ -2294,6 +2785,12 @@ def as_dict(self) -> dict: if self.id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Created: """Deserializes the Created from a dictionary.""" @@ -2323,6 +2820,15 @@ def as_dict(self) -> dict: if self.timestamp is not None: 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 + if self.executor_failures is not None: body['executor_failures'] = self.executor_failures + if self.host_id is not None: body['host_id'] = self.host_id + if self.timestamp is not None: body['timestamp'] = self.timestamp + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DataPlaneEventDetails: """Deserializes the DataPlaneEventDetails from a dictionary.""" @@ -2379,6 +2885,12 @@ def as_dict(self) -> dict: 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.""" @@ -2396,6 +2908,12 @@ def as_dict(self) -> dict: if self.cluster_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteCluster: """Deserializes the DeleteCluster from a dictionary.""" @@ -2410,6 +2928,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteClusterResponse: """Deserializes the DeleteClusterResponse from a dictionary.""" @@ -2427,6 +2950,12 @@ def as_dict(self) -> dict: if self.instance_pool_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteInstancePool: """Deserializes the DeleteInstancePool from a dictionary.""" @@ -2441,6 +2970,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteInstancePoolResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteInstancePoolResponse: """Deserializes the DeleteInstancePoolResponse from a dictionary.""" @@ -2458,6 +2992,12 @@ def as_dict(self) -> dict: if self.policy_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeletePolicy: """Deserializes the DeletePolicy from a dictionary.""" @@ -2472,6 +3012,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeletePolicyResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeletePolicyResponse: """Deserializes the DeletePolicyResponse from a dictionary.""" @@ -2486,6 +3031,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -2505,6 +3055,13 @@ def as_dict(self) -> dict: if self.context_id is not None: body['contextId'] = 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 + if self.context_id is not None: body['contextId'] = self.context_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DestroyContext: """Deserializes the DestroyContext from a dictionary.""" @@ -2519,6 +3076,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DestroyResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DestroyResponse: """Deserializes the DestroyResponse from a dictionary.""" @@ -2567,6 +3129,16 @@ def as_dict(self) -> dict: if self.disk_type: 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 + if self.disk_iops is not None: body['disk_iops'] = self.disk_iops + if self.disk_size is not None: body['disk_size'] = self.disk_size + if self.disk_throughput is not None: body['disk_throughput'] = self.disk_throughput + if 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.""" @@ -2591,6 +3163,14 @@ def as_dict(self) -> dict: if self.ebs_volume_type is not None: 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 + if self.ebs_volume_type is not None: 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.""" @@ -2625,6 +3205,13 @@ def as_dict(self) -> dict: 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.""" @@ -2645,6 +3232,13 @@ def as_dict(self) -> 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.""" @@ -2852,6 +3446,43 @@ def as_dict(self) -> dict: if self.workload_type: 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 + 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_id is not None: body['cluster_id'] = self.cluster_id + 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.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.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.""" @@ -2893,6 +3524,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the EditClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditClusterResponse: """Deserializes the EditClusterResponse from a dictionary.""" @@ -2948,6 +3584,19 @@ def as_dict(self) -> dict: if self.node_type_id is not None: 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 + if self.idle_instance_autotermination_minutes is not None: + 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 + if self.instance_pool_name is not None: body['instance_pool_name'] = self.instance_pool_name + if self.max_capacity is not None: body['max_capacity'] = self.max_capacity + if self.min_idle_instances is not None: body['min_idle_instances'] = self.min_idle_instances + if self.node_type_id is not None: 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.""" @@ -2968,6 +3617,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the EditInstancePoolResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditInstancePoolResponse: """Deserializes the EditInstancePoolResponse from a dictionary.""" @@ -3029,6 +3683,20 @@ def as_dict(self) -> dict: if self.policy_id is not None: 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 + if self.description is not None: body['description'] = self.description + if 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 + if self.name is not None: body['name'] = self.name + if self.policy_family_definition_overrides is not None: + 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 + if self.policy_id is not None: body['policy_id'] = self.policy_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditPolicy: """Deserializes the EditPolicy from a dictionary.""" @@ -3050,6 +3718,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the EditPolicyResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditPolicyResponse: """Deserializes the EditPolicyResponse from a dictionary.""" @@ -3064,6 +3737,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the EditResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditResponse: """Deserializes the EditResponse from a dictionary.""" @@ -3086,6 +3764,13 @@ def as_dict(self) -> dict: if self.validate_only is not None: 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 + if self.validate_only is not None: body['validate_only'] = self.validate_only + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnforceClusterComplianceRequest: """Deserializes the EnforceClusterComplianceRequest from a dictionary.""" @@ -3109,6 +3794,13 @@ def as_dict(self) -> dict: if self.has_changes is not None: 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 + if self.has_changes is not None: body['has_changes'] = self.has_changes + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnforceClusterComplianceResponse: """Deserializes the EnforceClusterComplianceResponse from a dictionary.""" @@ -3141,6 +3833,13 @@ def as_dict(self) -> dict: 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.""" @@ -3238,6 +3937,32 @@ def as_dict(self) -> dict: if self.user is not None: 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 + if self.cause is not None: body['cause'] = self.cause + if 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 + if self.current_num_workers is not None: 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 + if self.disk_size is not None: body['disk_size'] = self.disk_size + if self.driver_state_message is not None: 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 + if self.free_space is not None: body['free_space'] = self.free_space + if self.init_scripts: body['init_scripts'] = self.init_scripts + if self.instance_id is not None: body['instance_id'] = self.instance_id + if self.job_run_name is not None: body['job_run_name'] = self.job_run_name + if self.previous_attributes: body['previous_attributes'] = self.previous_attributes + if 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 + if self.reason: body['reason'] = self.reason + if self.target_num_vcpus is not None: body['target_num_vcpus'] = self.target_num_vcpus + if self.target_num_workers is not None: body['target_num_workers'] = self.target_num_workers + if self.user is not None: body['user'] = self.user + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EventDetails: """Deserializes the EventDetails from a dictionary.""" @@ -3348,6 +4073,19 @@ def as_dict(self) -> dict: 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.""" @@ -3379,6 +4117,12 @@ def as_dict(self) -> dict: 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.""" @@ -3403,6 +4147,13 @@ def as_dict(self) -> dict: if 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 + if self.violations: body['violations'] = self.violations + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetClusterComplianceResponse: """Deserializes the GetClusterComplianceResponse from a dictionary.""" @@ -3420,6 +4171,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetClusterPermissionLevelsResponse: """Deserializes the GetClusterPermissionLevelsResponse from a dictionary.""" @@ -3437,6 +4194,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetClusterPolicyPermissionLevelsResponse: """Deserializes the GetClusterPolicyPermissionLevelsResponse from a dictionary.""" @@ -3482,6 +4245,18 @@ def as_dict(self) -> dict: if self.start_time is not None: 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 + if self.end_time is not None: body['end_time'] = self.end_time + if self.event_types: body['event_types'] = self.event_types + if self.limit is not None: body['limit'] = self.limit + if self.offset is not None: body['offset'] = self.offset + if self.order is not None: body['order'] = self.order + if self.start_time is not None: body['start_time'] = self.start_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetEvents: """Deserializes the GetEvents from a dictionary.""" @@ -3521,6 +4296,14 @@ def as_dict(self) -> dict: if self.total_count is not None: 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 + if self.next_page: body['next_page'] = self.next_page + if self.total_count is not None: body['total_count'] = self.total_count + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetEventsResponse: """Deserializes the GetEventsResponse from a dictionary.""" @@ -3640,6 +4423,30 @@ def as_dict(self) -> dict: if self.status: 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 + if self.azure_attributes: body['azure_attributes'] = self.azure_attributes + if self.custom_tags: body['custom_tags'] = self.custom_tags + if self.default_tags: body['default_tags'] = self.default_tags + if 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 + if 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 + if self.instance_pool_id is not None: body['instance_pool_id'] = self.instance_pool_id + if self.instance_pool_name is not None: body['instance_pool_name'] = self.instance_pool_name + if self.max_capacity is not None: body['max_capacity'] = self.max_capacity + if self.min_idle_instances is not None: body['min_idle_instances'] = self.min_idle_instances + if self.node_type_id is not None: body['node_type_id'] = self.node_type_id + if 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 + if self.state is not None: body['state'] = self.state + if self.stats: body['stats'] = self.stats + if self.status: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetInstancePool: """Deserializes the GetInstancePool from a dictionary.""" @@ -3674,6 +4481,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetInstancePoolPermissionLevelsResponse: """Deserializes the GetInstancePoolPermissionLevelsResponse from a dictionary.""" @@ -3692,6 +4505,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetSparkVersionsResponse: """Deserializes the GetSparkVersionsResponse from a dictionary.""" @@ -3729,6 +4548,15 @@ def as_dict(self) -> dict: if self.script is not None: 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 + if self.name is not None: body['name'] = self.name + if self.position is not None: body['position'] = self.position + if self.script is not None: body['script'] = self.script + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GlobalInitScriptCreateRequest: """Deserializes the GlobalInitScriptCreateRequest from a dictionary.""" @@ -3778,6 +4606,19 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_by is not None: body['created_by'] = self.created_by + if self.enabled is not None: body['enabled'] = self.enabled + if self.name is not None: body['name'] = self.name + if self.position is not None: body['position'] = self.position + if self.script_id is not None: body['script_id'] = self.script_id + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GlobalInitScriptDetails: """Deserializes the GlobalInitScriptDetails from a dictionary.""" @@ -3835,6 +4676,20 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_by is not None: body['created_by'] = self.created_by + if self.enabled is not None: body['enabled'] = self.enabled + if self.name is not None: body['name'] = self.name + if self.position is not None: body['position'] = self.position + if self.script is not None: body['script'] = self.script + if self.script_id is not None: body['script_id'] = self.script_id + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GlobalInitScriptDetailsWithContent: """Deserializes the GlobalInitScriptDetailsWithContent from a dictionary.""" @@ -3884,6 +4739,16 @@ def as_dict(self) -> dict: if self.script_id is not None: 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 + if self.name is not None: body['name'] = self.name + if self.position is not None: body['position'] = self.position + if self.script is not None: body['script'] = self.script + if self.script_id is not None: body['script_id'] = self.script_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GlobalInitScriptUpdateRequest: """Deserializes the GlobalInitScriptUpdateRequest from a dictionary.""" @@ -3913,6 +4778,14 @@ def as_dict(self) -> dict: if self.reported_for_node is not None: 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 + if self.global_: body['global'] = self.global_ + if self.reported_for_node is not None: 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.""" @@ -3941,6 +4814,15 @@ def as_dict(self) -> dict: if self.status is not None: body['status'] = self.status.value return body + def as_shallow_dict(self) -> dict: + """Serializes the InitScriptExecutionDetails into a shallow dictionary of its immediate attributes.""" + body = {} + if self.error_message is not None: body['error_message'] = self.error_message + if self.execution_duration_seconds is not None: + body['execution_duration_seconds'] = self.execution_duration_seconds + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InitScriptExecutionDetails: """Deserializes the InitScriptExecutionDetails from a dictionary.""" @@ -4003,6 +4885,18 @@ def as_dict(self) -> 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.""" @@ -4030,6 +4924,13 @@ def as_dict(self) -> dict: if self.script: body['script'] = self.script.as_dict() return body + def as_shallow_dict(self) -> dict: + """Serializes the InitScriptInfoAndExecutionDetails into a shallow dictionary of its immediate attributes.""" + body = {} + if self.execution_details: body['execution_details'] = self.execution_details + if self.script: body['script'] = self.script + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InitScriptInfoAndExecutionDetails: """Deserializes the InitScriptInfoAndExecutionDetails from a dictionary.""" @@ -4052,6 +4953,13 @@ def as_dict(self) -> dict: if 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 + if self.libraries: body['libraries'] = self.libraries + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstallLibraries: """Deserializes the InstallLibraries from a dictionary.""" @@ -4066,6 +4974,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the InstallLibrariesResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstallLibrariesResponse: """Deserializes the InstallLibrariesResponse from a dictionary.""" @@ -4096,6 +5009,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolAccessControlRequest: """Deserializes the InstancePoolAccessControlRequest from a dictionary.""" @@ -4133,6 +5056,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolAccessControlResponse: """Deserializes the InstancePoolAccessControlResponse from a dictionary.""" @@ -4254,6 +5188,30 @@ def as_dict(self) -> dict: if self.status: 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 + if self.azure_attributes: body['azure_attributes'] = self.azure_attributes + if self.custom_tags: body['custom_tags'] = self.custom_tags + if self.default_tags: body['default_tags'] = self.default_tags + if 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 + if 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 + if self.instance_pool_id is not None: body['instance_pool_id'] = self.instance_pool_id + if self.instance_pool_name is not None: body['instance_pool_name'] = self.instance_pool_name + if self.max_capacity is not None: body['max_capacity'] = self.max_capacity + if self.min_idle_instances is not None: body['min_idle_instances'] = self.min_idle_instances + if self.node_type_id is not None: body['node_type_id'] = self.node_type_id + if 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 + if self.state is not None: body['state'] = self.state + if self.stats: body['stats'] = self.stats + if self.status: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolAndStats: """Deserializes the InstancePoolAndStats from a dictionary.""" @@ -4313,6 +5271,15 @@ def as_dict(self) -> dict: if self.zone_id is not None: 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 + 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]) -> InstancePoolAwsAttributes: """Deserializes the InstancePoolAwsAttributes from a dictionary.""" @@ -4348,6 +5315,13 @@ def as_dict(self) -> 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 InstancePoolAzureAttributes into a shallow dictionary of its immediate attributes.""" + body = {} + if self.availability is not None: body['availability'] = self.availability + 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]) -> InstancePoolAzureAttributes: """Deserializes the InstancePoolAzureAttributes from a dictionary.""" @@ -4399,6 +5373,14 @@ def as_dict(self) -> dict: if self.zone_id is not None: 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 + if self.local_ssd_count is not None: body['local_ssd_count'] = self.local_ssd_count + if self.zone_id is not None: body['zone_id'] = self.zone_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolGcpAttributes: """Deserializes the InstancePoolGcpAttributes from a dictionary.""" @@ -4424,6 +5406,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolPermission: """Deserializes the InstancePoolPermission from a dictionary.""" @@ -4456,6 +5446,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolPermissions: """Deserializes the InstancePoolPermissions from a dictionary.""" @@ -4479,6 +5477,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolPermissionsDescription: """Deserializes the InstancePoolPermissionsDescription from a dictionary.""" @@ -4501,6 +5506,13 @@ def as_dict(self) -> dict: if self.instance_pool_id is not None: 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 + if self.instance_pool_id is not None: 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.""" @@ -4540,6 +5552,15 @@ def as_dict(self) -> dict: if self.used_count is not None: 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 + if self.pending_idle_count is not None: body['pending_idle_count'] = self.pending_idle_count + if self.pending_used_count is not None: body['pending_used_count'] = self.pending_used_count + if self.used_count is not None: body['used_count'] = self.used_count + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolStats: """Deserializes the InstancePoolStats from a dictionary.""" @@ -4563,6 +5584,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstancePoolStatus: """Deserializes the InstancePoolStatus from a dictionary.""" @@ -4598,6 +5625,15 @@ def as_dict(self) -> dict: 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 + if self.instance_profile_arn is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstanceProfile: """Deserializes the InstanceProfile from a dictionary.""" @@ -4660,6 +5696,18 @@ def as_dict(self) -> dict: 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.""" @@ -4698,6 +5746,16 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.library: body['library'] = self.library + if self.messages: body['messages'] = self.messages + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LibraryFullStatus: """Deserializes the LibraryFullStatus from a dictionary.""" @@ -4731,6 +5789,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListAllClusterLibraryStatusesResponse: """Deserializes the ListAllClusterLibraryStatusesResponse from a dictionary.""" @@ -4752,6 +5816,13 @@ def as_dict(self) -> dict: if 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 + if self.zones: body['zones'] = self.zones + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListAvailableZonesResponse: """Deserializes the ListAvailableZonesResponse from a dictionary.""" @@ -4779,6 +5850,14 @@ def as_dict(self) -> dict: if self.prev_page_token is not None: 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 + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListClusterCompliancesResponse: """Deserializes the ListClusterCompliancesResponse from a dictionary.""" @@ -4810,6 +5889,15 @@ def as_dict(self) -> dict: if self.policy_id is not None: 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 + if self.cluster_states: body['cluster_states'] = self.cluster_states + if self.is_pinned is not None: body['is_pinned'] = self.is_pinned + if self.policy_id is not None: body['policy_id'] = self.policy_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListClustersFilterBy: """Deserializes the ListClustersFilterBy from a dictionary.""" @@ -4840,6 +5928,14 @@ def as_dict(self) -> dict: if self.prev_page_token is not None: 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 + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListClustersResponse: """Deserializes the ListClustersResponse from a dictionary.""" @@ -4864,6 +5960,13 @@ def as_dict(self) -> dict: if self.field is not None: 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 + if self.field is not None: body['field'] = self.field + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListClustersSortBy: """Deserializes the ListClustersSortBy from a dictionary.""" @@ -4896,6 +5999,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListGlobalInitScriptsResponse: """Deserializes the ListGlobalInitScriptsResponse from a dictionary.""" @@ -4912,6 +6021,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListInstancePools: """Deserializes the ListInstancePools from a dictionary.""" @@ -4929,6 +6044,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListInstanceProfilesResponse: """Deserializes the ListInstanceProfilesResponse from a dictionary.""" @@ -4946,6 +6067,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListNodeTypesResponse: """Deserializes the ListNodeTypesResponse from a dictionary.""" @@ -4963,6 +6090,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListPoliciesResponse: """Deserializes the ListPoliciesResponse from a dictionary.""" @@ -4985,6 +6118,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -5016,6 +6156,12 @@ def as_dict(self) -> dict: 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.""" @@ -5039,6 +6185,15 @@ def as_dict(self) -> dict: 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.""" @@ -5063,6 +6218,13 @@ def as_dict(self) -> dict: if self.last_exception is not None: 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 + if self.last_exception is not None: body['last_exception'] = self.last_exception + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogSyncStatus: """Deserializes the LogSyncStatus from a dictionary.""" @@ -5092,6 +6254,14 @@ def as_dict(self) -> dict: 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.""" @@ -5123,6 +6293,17 @@ def as_dict(self) -> dict: if self.local_nvme_disks is not None: 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 + if self.local_disk_size_gb is not None: body['local_disk_size_gb'] = self.local_disk_size_gb + if self.local_disks is not None: 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 + if self.local_nvme_disks is not None: 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.""" @@ -5217,6 +6398,34 @@ def as_dict(self) -> dict: if self.supports_elastic_disk is not None: body['supports_elastic_disk'] = self.supports_elastic_disk 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 + if self.description is not None: body['description'] = self.description + if self.display_order is not None: body['display_order'] = self.display_order + if self.instance_type_id is not None: body['instance_type_id'] = self.instance_type_id + if self.is_deprecated is not None: 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 + if self.is_graviton is not None: body['is_graviton'] = self.is_graviton + if self.is_hidden is not None: 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 + if self.memory_mb is not None: body['memory_mb'] = self.memory_mb + if self.node_info: body['node_info'] = self.node_info + if 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 + if self.num_cores is not None: body['num_cores'] = self.num_cores + if self.num_gpus is not None: body['num_gpus'] = self.num_gpus + if self.photon_driver_capable is not None: body['photon_driver_capable'] = self.photon_driver_capable + if self.photon_worker_capable is not None: body['photon_worker_capable'] = self.photon_worker_capable + if self.support_cluster_tags is not None: body['support_cluster_tags'] = self.support_cluster_tags + if self.support_ebs_volumes is not None: body['support_ebs_volumes'] = self.support_ebs_volumes + if self.support_port_forwarding is not None: + body['support_port_forwarding'] = self.support_port_forwarding + if self.supports_elastic_disk is not None: body['supports_elastic_disk'] = self.supports_elastic_disk + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NodeType: """Deserializes the NodeType from a dictionary.""" @@ -5256,6 +6465,13 @@ def as_dict(self) -> dict: if self.message is not None: 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 + if self.message is not None: body['message'] = self.message + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PendingInstanceError: """Deserializes the PendingInstanceError from a dictionary.""" @@ -5273,6 +6489,12 @@ def as_dict(self) -> dict: if self.cluster_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermanentDeleteCluster: """Deserializes the PermanentDeleteCluster from a dictionary.""" @@ -5287,6 +6509,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the PermanentDeleteClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermanentDeleteClusterResponse: """Deserializes the PermanentDeleteClusterResponse from a dictionary.""" @@ -5304,6 +6531,12 @@ def as_dict(self) -> dict: if self.cluster_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PinCluster: """Deserializes the PinCluster from a dictionary.""" @@ -5318,6 +6551,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the PinClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PinClusterResponse: """Deserializes the PinClusterResponse from a dictionary.""" @@ -5395,6 +6633,23 @@ def as_dict(self) -> dict: if self.policy_id is not None: 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 + if self.creator_user_name is not None: body['creator_user_name'] = self.creator_user_name + if self.definition is not None: body['definition'] = self.definition + if self.description is not None: body['description'] = self.description + if self.is_default is not None: body['is_default'] = self.is_default + if 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 + if self.name is not None: body['name'] = self.name + if self.policy_family_definition_overrides is not None: + 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 + if self.policy_id is not None: body['policy_id'] = self.policy_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Policy: """Deserializes the Policy from a dictionary.""" @@ -5436,6 +6691,15 @@ def as_dict(self) -> dict: if self.policy_family_id is not None: 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 + if self.description is not None: body['description'] = self.description + if self.name is not None: body['name'] = self.name + if self.policy_family_id is not None: 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.""" @@ -5461,6 +6725,13 @@ def as_dict(self) -> dict: 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.""" @@ -5482,6 +6753,13 @@ def as_dict(self) -> dict: 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.""" @@ -5499,6 +6777,12 @@ def as_dict(self) -> dict: if self.instance_profile_arn is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RemoveInstanceProfile: """Deserializes the RemoveInstanceProfile from a dictionary.""" @@ -5513,6 +6797,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the RemoveResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RemoveResponse: """Deserializes the RemoveResponse from a dictionary.""" @@ -5546,6 +6835,14 @@ def as_dict(self) -> dict: if self.num_workers is not None: 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 + if self.cluster_id is not None: body['cluster_id'] = self.cluster_id + if self.num_workers is not None: body['num_workers'] = self.num_workers + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResizeCluster: """Deserializes the ResizeCluster from a dictionary.""" @@ -5562,6 +6859,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the ResizeClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResizeClusterResponse: """Deserializes the ResizeClusterResponse from a dictionary.""" @@ -5583,6 +6885,13 @@ def as_dict(self) -> dict: if self.restart_user is not None: 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 + if self.restart_user is not None: body['restart_user'] = self.restart_user + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestartCluster: """Deserializes the RestartCluster from a dictionary.""" @@ -5597,6 +6906,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the RestartClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestartClusterResponse: """Deserializes the RestartClusterResponse from a dictionary.""" @@ -5656,6 +6970,21 @@ def as_dict(self) -> dict: if self.truncated is not None: 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 + if self.data: body['data'] = self.data + if self.file_name is not None: body['fileName'] = self.file_name + if self.file_names: body['fileNames'] = self.file_names + if self.is_json_schema is not None: body['isJsonSchema'] = self.is_json_schema + if self.pos is not None: body['pos'] = self.pos + if self.result_type is not None: body['resultType'] = self.result_type + if self.schema: body['schema'] = self.schema + if self.summary is not None: body['summary'] = self.summary + if self.truncated is not None: body['truncated'] = self.truncated + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Results: """Deserializes the Results from a dictionary.""" @@ -5732,6 +7061,18 @@ def as_dict(self) -> dict: 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.""" @@ -5788,6 +7129,18 @@ def as_dict(self) -> dict: if self.start_timestamp is not None: 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 + if self.instance_id is not None: body['instance_id'] = self.instance_id + if 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 + if self.private_ip is not None: body['private_ip'] = self.private_ip + if self.public_dns is not None: body['public_dns'] = self.public_dns + if self.start_timestamp is not None: body['start_timestamp'] = self.start_timestamp + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparkNode: """Deserializes the SparkNode from a dictionary.""" @@ -5811,6 +7164,12 @@ def as_dict(self) -> dict: if self.is_spot is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparkNodeAwsAttributes: """Deserializes the SparkNodeAwsAttributes from a dictionary.""" @@ -5835,6 +7194,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparkVersion: """Deserializes the SparkVersion from a dictionary.""" @@ -5852,6 +7218,12 @@ def as_dict(self) -> dict: if self.cluster_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StartCluster: """Deserializes the StartCluster from a dictionary.""" @@ -5866,6 +7238,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the StartClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StartClusterResponse: """Deserializes the StartClusterResponse from a dictionary.""" @@ -5904,6 +7281,14 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.parameters: body['parameters'] = self.parameters + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TerminationReason: """Deserializes the TerminationReason from a dictionary.""" @@ -6020,6 +7405,13 @@ def as_dict(self) -> dict: if 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 + if self.libraries: body['libraries'] = self.libraries + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UninstallLibraries: """Deserializes the UninstallLibraries from a dictionary.""" @@ -6034,6 +7426,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UninstallLibrariesResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UninstallLibrariesResponse: """Deserializes the UninstallLibrariesResponse from a dictionary.""" @@ -6051,6 +7448,12 @@ def as_dict(self) -> dict: if self.cluster_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UnpinCluster: """Deserializes the UnpinCluster from a dictionary.""" @@ -6065,6 +7468,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UnpinClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UnpinClusterResponse: """Deserializes the UnpinClusterResponse from a dictionary.""" @@ -6093,6 +7501,14 @@ def as_dict(self) -> dict: if self.update_mask is not None: 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 + if self.cluster_id is not None: body['cluster_id'] = self.cluster_id + if self.update_mask is not None: body['update_mask'] = self.update_mask + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateCluster: """Deserializes the UpdateCluster from a dictionary.""" @@ -6285,6 +7701,40 @@ def as_dict(self) -> dict: if self.workload_type: 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 + 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.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.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.""" @@ -6324,6 +7774,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateClusterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateClusterResponse: """Deserializes the UpdateClusterResponse from a dictionary.""" @@ -6338,6 +7793,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -6355,6 +7815,12 @@ def as_dict(self) -> dict: 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.""" @@ -6372,6 +7838,12 @@ def as_dict(self) -> dict: 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.""" @@ -6389,6 +7861,12 @@ def as_dict(self) -> dict: 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.""" diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/service/dashboards.py index 5f9fe2c2c..da908cb2d 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -42,6 +42,14 @@ def as_dict(self) -> dict: if self.timezone_id is not None: 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 + if self.timezone_id is not None: body['timezone_id'] = self.timezone_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CronSchedule: """Deserializes the CronSchedule from a dictionary.""" @@ -105,6 +113,21 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if self.display_name is not None: body['display_name'] = self.display_name + if self.etag is not None: body['etag'] = self.etag + if self.lifecycle_state is not None: body['lifecycle_state'] = self.lifecycle_state + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.path is not None: body['path'] = self.path + if self.serialized_dashboard is not None: body['serialized_dashboard'] = self.serialized_dashboard + if self.update_time is not None: body['update_time'] = self.update_time + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Dashboard: """Deserializes the Dashboard from a dictionary.""" @@ -125,6 +148,27 @@ class DashboardView(Enum): DASHBOARD_VIEW_BASIC = 'DASHBOARD_VIEW_BASIC' +class DataType(Enum): + + DATA_TYPE_ARRAY = 'DATA_TYPE_ARRAY' + DATA_TYPE_BIG_INT = 'DATA_TYPE_BIG_INT' + DATA_TYPE_BINARY = 'DATA_TYPE_BINARY' + DATA_TYPE_BOOLEAN = 'DATA_TYPE_BOOLEAN' + DATA_TYPE_DATE = 'DATA_TYPE_DATE' + DATA_TYPE_DECIMAL = 'DATA_TYPE_DECIMAL' + DATA_TYPE_DOUBLE = 'DATA_TYPE_DOUBLE' + DATA_TYPE_FLOAT = 'DATA_TYPE_FLOAT' + DATA_TYPE_INT = 'DATA_TYPE_INT' + DATA_TYPE_INTERVAL = 'DATA_TYPE_INTERVAL' + DATA_TYPE_MAP = 'DATA_TYPE_MAP' + DATA_TYPE_SMALL_INT = 'DATA_TYPE_SMALL_INT' + DATA_TYPE_STRING = 'DATA_TYPE_STRING' + DATA_TYPE_STRUCT = 'DATA_TYPE_STRUCT' + DATA_TYPE_TIMESTAMP = 'DATA_TYPE_TIMESTAMP' + DATA_TYPE_TINY_INT = 'DATA_TYPE_TINY_INT' + DATA_TYPE_VOID = 'DATA_TYPE_VOID' + + @dataclass class DeleteScheduleResponse: @@ -133,6 +177,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteScheduleResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteScheduleResponse: """Deserializes the DeleteScheduleResponse from a dictionary.""" @@ -147,6 +196,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteSubscriptionResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteSubscriptionResponse: """Deserializes the DeleteSubscriptionResponse from a dictionary.""" @@ -168,6 +222,13 @@ def as_dict(self) -> dict: if self.text: 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.query: body['query'] = self.query + if self.text: body['text'] = self.text + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenieAttachment: """Deserializes the GenieAttachment from a dictionary.""" @@ -206,6 +267,18 @@ def as_dict(self) -> dict: if self.user_id is not None: 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.created_timestamp is not None: body['created_timestamp'] = self.created_timestamp + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.space_id is not None: body['space_id'] = self.space_id + if self.title is not None: body['title'] = self.title + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenieConversation: """Deserializes the GenieConversation from a dictionary.""" @@ -236,6 +309,14 @@ def as_dict(self) -> dict: if self.space_id is not None: 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 + if self.conversation_id is not None: body['conversation_id'] = self.conversation_id + if self.space_id is not None: body['space_id'] = self.space_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenieCreateConversationMessageRequest: """Deserializes the GenieCreateConversationMessageRequest from a dictionary.""" @@ -256,6 +337,12 @@ def as_dict(self) -> dict: if self.statement_response: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenieGetMessageQueryResultResponse: """Deserializes the GenieGetMessageQueryResultResponse from a dictionary.""" @@ -325,6 +412,23 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.content is not None: body['content'] = self.content + if self.conversation_id is not None: body['conversation_id'] = self.conversation_id + if self.created_timestamp is not None: body['created_timestamp'] = self.created_timestamp + if self.error: body['error'] = self.error + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.query_result: body['query_result'] = self.query_result + if self.space_id is not None: body['space_id'] = self.space_id + if self.status is not None: body['status'] = self.status + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenieMessage: """Deserializes the GenieMessage from a dictionary.""" @@ -356,6 +460,13 @@ def as_dict(self) -> dict: if self.space_id is not None: 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 + if self.space_id is not None: body['space_id'] = self.space_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenieStartConversationMessageRequest: """Deserializes the GenieStartConversationMessageRequest from a dictionary.""" @@ -383,6 +494,15 @@ def as_dict(self) -> dict: if self.message_id is not None: 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 + if self.conversation_id is not None: body['conversation_id'] = self.conversation_id + if self.message: body['message'] = self.message + if self.message_id is not None: body['message_id'] = self.message_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenieStartConversationResponse: """Deserializes the GenieStartConversationResponse from a dictionary.""" @@ -413,6 +533,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -435,6 +562,13 @@ def as_dict(self) -> dict: if 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 + if self.schedules: body['schedules'] = self.schedules + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListSchedulesResponse: """Deserializes the ListSchedulesResponse from a dictionary.""" @@ -457,6 +591,13 @@ def as_dict(self) -> dict: if 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 + if self.subscriptions: body['subscriptions'] = self.subscriptions + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListSubscriptionsResponse: """Deserializes the ListSubscriptionsResponse from a dictionary.""" @@ -477,6 +618,13 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MessageError: """Deserializes the MessageError from a dictionary.""" @@ -571,6 +719,14 @@ def as_dict(self) -> dict: if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id 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 + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MigrateDashboardRequest: """Deserializes the MigrateDashboardRequest from a dictionary.""" @@ -599,6 +755,14 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.embed_credentials is not None: body['embed_credentials'] = self.embed_credentials + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PublishRequest: """Deserializes the PublishRequest from a dictionary.""" @@ -630,6 +794,15 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.embed_credentials is not None: body['embed_credentials'] = self.embed_credentials + if self.revision_create_time is not None: body['revision_create_time'] = self.revision_create_time + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PublishedDashboard: """Deserializes the PublishedDashboard from a dictionary.""" @@ -641,6 +814,8 @@ def from_dict(cls, d: Dict[str, any]) -> PublishedDashboard: @dataclass class QueryAttachment: + cached_query_schema: Optional[QuerySchema] = None + description: Optional[str] = None """Description of the query""" @@ -665,6 +840,21 @@ class QueryAttachment: def as_dict(self) -> dict: """Serializes the QueryAttachment into a dictionary suitable for use as a JSON request body.""" body = {} + if self.cached_query_schema: body['cached_query_schema'] = self.cached_query_schema.as_dict() + if self.description is not None: body['description'] = self.description + if self.id is not None: body['id'] = self.id + if self.instruction_id is not None: body['instruction_id'] = self.instruction_id + if self.instruction_title is not None: body['instruction_title'] = self.instruction_title + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.query is not None: body['query'] = self.query + if self.title is not None: body['title'] = self.title + return body + + def as_shallow_dict(self) -> dict: + """Serializes the QueryAttachment into a shallow dictionary of its immediate attributes.""" + body = {} + if self.cached_query_schema: body['cached_query_schema'] = self.cached_query_schema if self.description is not None: body['description'] = self.description if self.id is not None: body['id'] = self.id if self.instruction_id is not None: body['instruction_id'] = self.instruction_id @@ -678,7 +868,8 @@ def as_dict(self) -> dict: @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryAttachment: """Deserializes the QueryAttachment from a dictionary.""" - return cls(description=d.get('description', None), + return cls(cached_query_schema=_from_dict(d, 'cached_query_schema', QuerySchema), + description=d.get('description', None), id=d.get('id', None), instruction_id=d.get('instruction_id', None), instruction_title=d.get('instruction_title', None), @@ -687,6 +878,69 @@ def from_dict(cls, d: Dict[str, any]) -> QueryAttachment: title=d.get('title', None)) +@dataclass +class QuerySchema: + columns: Optional[List[QuerySchemaColumn]] = None + + statement_id: Optional[str] = None + """Used to determine if the stored query schema is compatible with the latest run. The service + should always clear the schema when the query is re-executed.""" + + def as_dict(self) -> dict: + """Serializes the QuerySchema 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] + if self.statement_id is not None: body['statement_id'] = self.statement_id + return body + + def as_shallow_dict(self) -> dict: + """Serializes the QuerySchema into a shallow dictionary of its immediate attributes.""" + body = {} + if self.columns: body['columns'] = self.columns + if self.statement_id is not None: body['statement_id'] = self.statement_id + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> QuerySchema: + """Deserializes the QuerySchema from a dictionary.""" + return cls(columns=_repeated_dict(d, 'columns', QuerySchemaColumn), + statement_id=d.get('statement_id', None)) + + +@dataclass +class QuerySchemaColumn: + name: str + + type_text: str + """Corresponds to type desc""" + + data_type: DataType + """Populated from https://docs.databricks.com/sql/language-manual/sql-ref-datatypes.html""" + + def as_dict(self) -> dict: + """Serializes the QuerySchemaColumn into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.data_type is not None: body['data_type'] = self.data_type.value + if self.name is not None: body['name'] = self.name + if self.type_text is not None: body['type_text'] = self.type_text + return body + + def as_shallow_dict(self) -> dict: + """Serializes the QuerySchemaColumn into a shallow dictionary of its immediate attributes.""" + body = {} + if self.data_type is not None: body['data_type'] = self.data_type + if self.name is not None: body['name'] = self.name + if self.type_text is not None: body['type_text'] = self.type_text + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> QuerySchemaColumn: + """Deserializes the QuerySchemaColumn from a dictionary.""" + return cls(data_type=_enum(d, 'data_type', DataType), + name=d.get('name', None), + type_text=d.get('type_text', None)) + + @dataclass class Result: is_truncated: Optional[bool] = None @@ -707,6 +961,14 @@ def as_dict(self) -> dict: if self.statement_id is not None: 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 + if self.row_count is not None: body['row_count'] = self.row_count + if self.statement_id is not None: body['statement_id'] = self.statement_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Result: """Deserializes the Result from a dictionary.""" @@ -760,6 +1022,20 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.cron_schedule: body['cron_schedule'] = self.cron_schedule + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if self.display_name is not None: body['display_name'] = self.display_name + if self.etag is not None: body['etag'] = self.etag + if self.pause_status is not None: body['pause_status'] = self.pause_status + if self.schedule_id is not None: body['schedule_id'] = self.schedule_id + if self.update_time is not None: body['update_time'] = self.update_time + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Schedule: """Deserializes the Schedule from a dictionary.""" @@ -797,6 +1073,13 @@ def as_dict(self) -> dict: if self.user_subscriber: 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 + if 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.""" @@ -846,6 +1129,19 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if self.created_by_user_id is not None: body['created_by_user_id'] = self.created_by_user_id + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if self.etag is not None: body['etag'] = self.etag + if self.schedule_id is not None: body['schedule_id'] = self.schedule_id + if self.subscriber: body['subscriber'] = self.subscriber + if self.subscription_id is not None: body['subscription_id'] = self.subscription_id + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Subscription: """Deserializes the Subscription from a dictionary.""" @@ -870,6 +1166,12 @@ def as_dict(self) -> dict: if self.destination_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SubscriptionSubscriberDestination: """Deserializes the SubscriptionSubscriberDestination from a dictionary.""" @@ -887,6 +1189,12 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SubscriptionSubscriberUser: """Deserializes the SubscriptionSubscriberUser from a dictionary.""" @@ -907,6 +1215,13 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TextAttachment: """Deserializes the TextAttachment from a dictionary.""" @@ -921,6 +1236,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the TrashDashboardResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TrashDashboardResponse: """Deserializes the TrashDashboardResponse from a dictionary.""" @@ -935,6 +1255,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UnpublishDashboardResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UnpublishDashboardResponse: """Deserializes the UnpublishDashboardResponse from a dictionary.""" diff --git a/databricks/sdk/service/files.py b/databricks/sdk/service/files.py index 255e1c1a0..07cdaea54 100755 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/service/files.py @@ -28,6 +28,13 @@ def as_dict(self) -> dict: if self.handle is not None: 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 + if self.handle is not None: body['handle'] = self.handle + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AddBlock: """Deserializes the AddBlock from a dictionary.""" @@ -42,6 +49,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the AddBlockResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AddBlockResponse: """Deserializes the AddBlockResponse from a dictionary.""" @@ -59,6 +71,12 @@ def as_dict(self) -> dict: if self.handle is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Close: """Deserializes the Close from a dictionary.""" @@ -73,6 +91,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CloseResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CloseResponse: """Deserializes the CloseResponse from a dictionary.""" @@ -94,6 +117,13 @@ def as_dict(self) -> dict: if self.path is not None: 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 + if self.path is not None: body['path'] = self.path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Create: """Deserializes the Create from a dictionary.""" @@ -108,6 +138,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CreateDirectoryResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateDirectoryResponse: """Deserializes the CreateDirectoryResponse from a dictionary.""" @@ -126,6 +161,12 @@ def as_dict(self) -> dict: if self.handle is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" @@ -148,6 +189,13 @@ def as_dict(self) -> dict: if self.recursive is not None: 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 + if self.recursive is not None: body['recursive'] = self.recursive + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Delete: """Deserializes the Delete from a dictionary.""" @@ -162,6 +210,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteDirectoryResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteDirectoryResponse: """Deserializes the DeleteDirectoryResponse from a dictionary.""" @@ -176,6 +229,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -209,6 +267,16 @@ def as_dict(self) -> dict: if self.path is not None: 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 + if self.is_directory is not None: body['is_directory'] = self.is_directory + if self.last_modified is not None: body['last_modified'] = self.last_modified + if self.name is not None: body['name'] = self.name + if self.path is not None: body['path'] = self.path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DirectoryEntry: """Deserializes the DirectoryEntry from a dictionary.""" @@ -238,6 +306,15 @@ def as_dict(self) -> dict: if self.last_modified is not None: 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 + if self.content_type is not None: body['content-type'] = self.content_type + if self.contents: body['contents'] = self.contents + if self.last_modified is not None: body['last-modified'] = self.last_modified + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DownloadResponse: """Deserializes the DownloadResponse from a dictionary.""" @@ -270,6 +347,15 @@ def as_dict(self) -> dict: if self.path is not None: 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 + if self.is_dir is not None: body['is_dir'] = self.is_dir + if self.modification_time is not None: body['modification_time'] = self.modification_time + if self.path is not None: body['path'] = self.path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" @@ -287,6 +373,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the GetDirectoryMetadataResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetDirectoryMetadataResponse: """Deserializes the GetDirectoryMetadataResponse from a dictionary.""" @@ -309,6 +400,14 @@ def as_dict(self) -> dict: if self.last_modified is not None: 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 + if self.content_type is not None: body['content-type'] = self.content_type + if self.last_modified is not None: body['last-modified'] = self.last_modified + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetMetadataResponse: """Deserializes the GetMetadataResponse from a dictionary.""" @@ -332,6 +431,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -350,6 +456,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListStatusResponse: """Deserializes the ListStatusResponse from a dictionary.""" @@ -367,6 +479,12 @@ def as_dict(self) -> dict: if self.path is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MkDirs: """Deserializes the MkDirs from a dictionary.""" @@ -381,6 +499,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the MkDirsResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MkDirsResponse: """Deserializes the MkDirsResponse from a dictionary.""" @@ -402,6 +525,13 @@ def as_dict(self) -> dict: if self.source_path is not None: 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 + if self.source_path is not None: body['source_path'] = self.source_path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Move: """Deserializes the Move from a dictionary.""" @@ -416,6 +546,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the MoveResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MoveResponse: """Deserializes the MoveResponse from a dictionary.""" @@ -441,6 +576,14 @@ def as_dict(self) -> dict: if self.path is not None: 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 + if self.overwrite is not None: body['overwrite'] = self.overwrite + if self.path is not None: body['path'] = self.path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Put: """Deserializes the Put from a dictionary.""" @@ -457,6 +600,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the PutResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PutResponse: """Deserializes the PutResponse from a dictionary.""" @@ -479,6 +627,13 @@ def as_dict(self) -> dict: if self.data is not None: 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 + if self.data is not None: body['data'] = self.data + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ReadResponse: """Deserializes the ReadResponse from a dictionary.""" @@ -493,6 +648,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UploadResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UploadResponse: """Deserializes the UploadResponse from a dictionary.""" @@ -833,8 +993,8 @@ def delete_directory(self, directory_path: str): def download(self, file_path: str) -> DownloadResponse: """Download a file. - Downloads a file of up to 5 GiB. The file contents are the response body. This is a standard HTTP file - download, not a JSON RPC. + Downloads a file. The file contents are the response body. This is a standard HTTP file download, not + a JSON RPC. It supports the Range and If-Unmodified-Since HTTP headers. :param file_path: str The absolute path of the file. diff --git a/databricks/sdk/service/iam.py b/databricks/sdk/service/iam.py index fc0122b2b..28e5247a6 100755 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/service/iam.py @@ -38,6 +38,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccessControlRequest: """Deserializes the AccessControlRequest from a dictionary.""" @@ -75,6 +85,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccessControlResponse: """Deserializes the AccessControlResponse from a dictionary.""" @@ -107,6 +128,16 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.primary is not None: body['primary'] = self.primary + if self.ref is not None: body['$ref'] = self.ref + if self.type is not None: body['type'] = self.type + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ComplexValue: """Deserializes the ComplexValue from a dictionary.""" @@ -125,6 +156,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -139,6 +175,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteWorkspacePermissionAssignmentResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteWorkspacePermissionAssignmentResponse: """Deserializes the DeleteWorkspacePermissionAssignmentResponse from a dictionary.""" @@ -155,6 +196,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetAssignableRolesForResourceResponse: """Deserializes the GetAssignableRolesForResourceResponse from a dictionary.""" @@ -172,6 +219,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetPasswordPermissionLevelsResponse: """Deserializes the GetPasswordPermissionLevelsResponse from a dictionary.""" @@ -189,6 +242,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetPermissionLevelsResponse: """Deserializes the GetPermissionLevelsResponse from a dictionary.""" @@ -216,6 +275,13 @@ def as_dict(self) -> dict: if self.role is not None: 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 + if self.role is not None: body['role'] = self.role + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GrantRule: """Deserializes the GrantRule from a dictionary.""" @@ -265,6 +331,20 @@ def as_dict(self) -> dict: if 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 + if self.entitlements: body['entitlements'] = self.entitlements + if self.external_id is not None: body['externalId'] = self.external_id + if self.groups: body['groups'] = self.groups + if self.id is not None: body['id'] = self.id + if self.members: body['members'] = self.members + if self.meta: body['meta'] = self.meta + if self.roles: body['roles'] = self.roles + if self.schemas: body['schemas'] = self.schemas + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Group: """Deserializes the Group from a dictionary.""" @@ -311,6 +391,16 @@ def as_dict(self) -> dict: if self.total_results is not None: body['totalResults'] = 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 + if self.resources: body['Resources'] = self.resources + if self.schemas: body['schemas'] = self.schemas + if self.start_index is not None: body['startIndex'] = self.start_index + if self.total_results is not None: body['totalResults'] = self.total_results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListGroupsResponse: """Deserializes the ListGroupsResponse from a dictionary.""" @@ -353,6 +443,16 @@ def as_dict(self) -> dict: if self.total_results is not None: body['totalResults'] = 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 + if self.resources: body['Resources'] = self.resources + if self.schemas: body['schemas'] = self.schemas + if self.start_index is not None: body['startIndex'] = self.start_index + if self.total_results is not None: body['totalResults'] = self.total_results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListServicePrincipalResponse: """Deserializes the ListServicePrincipalResponse from a dictionary.""" @@ -396,6 +496,16 @@ def as_dict(self) -> dict: if self.total_results is not None: body['totalResults'] = 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 + if self.resources: body['Resources'] = self.resources + if self.schemas: body['schemas'] = self.schemas + if self.start_index is not None: body['startIndex'] = self.start_index + if self.total_results is not None: body['totalResults'] = self.total_results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListUsersResponse: """Deserializes the ListUsersResponse from a dictionary.""" @@ -430,6 +540,16 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.size is not None: body['size'] = self.size + if self.to_account_group_name is not None: body['to_account_group_name'] = self.to_account_group_name + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MigratePermissionsRequest: """Deserializes the MigratePermissionsRequest from a dictionary.""" @@ -450,6 +570,12 @@ def as_dict(self) -> dict: if self.permissions_migrated is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MigratePermissionsResponse: """Deserializes the MigratePermissionsResponse from a dictionary.""" @@ -471,6 +597,13 @@ def as_dict(self) -> dict: if self.given_name is not None: body['givenName'] = 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 + if self.given_name is not None: body['givenName'] = self.given_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Name: """Deserializes the Name from a dictionary.""" @@ -494,6 +627,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ObjectPermissions: """Deserializes the ObjectPermissions from a dictionary.""" @@ -520,6 +661,14 @@ def as_dict(self) -> dict: if 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 + if self.operations: body['Operations'] = self.operations + if self.schemas: body['schemas'] = self.schemas + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PartialUpdate: """Deserializes the PartialUpdate from a dictionary.""" @@ -552,6 +701,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PasswordAccessControlRequest: """Deserializes the PasswordAccessControlRequest from a dictionary.""" @@ -589,6 +748,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PasswordAccessControlResponse: """Deserializes the PasswordAccessControlResponse from a dictionary.""" @@ -616,6 +786,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PasswordPermission: """Deserializes the PasswordPermission from a dictionary.""" @@ -647,6 +825,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PasswordPermissions: """Deserializes the PasswordPermissions from a dictionary.""" @@ -670,6 +856,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PasswordPermissionsDescription: """Deserializes the PasswordPermissionsDescription from a dictionary.""" @@ -688,6 +881,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PasswordPermissionsRequest: """Deserializes the PasswordPermissionsRequest from a dictionary.""" @@ -713,6 +912,14 @@ def as_dict(self) -> dict: if 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 + if self.path is not None: body['path'] = self.path + if self.value: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Patch: """Deserializes the Patch from a dictionary.""" @@ -735,6 +942,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the PatchResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PatchResponse: """Deserializes the PatchResponse from a dictionary.""" @@ -763,6 +975,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Permission: """Deserializes the Permission from a dictionary.""" @@ -793,6 +1013,14 @@ def as_dict(self) -> dict: if self.principal: 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 + if self.permissions: body['permissions'] = self.permissions + if self.principal: body['principal'] = self.principal + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermissionAssignment: """Deserializes the PermissionAssignment from a dictionary.""" @@ -813,6 +1041,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermissionAssignments: """Deserializes the PermissionAssignments from a dictionary.""" @@ -855,6 +1089,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermissionOutput: """Deserializes the PermissionOutput from a dictionary.""" @@ -876,6 +1117,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PermissionsDescription: """Deserializes the PermissionsDescription from a dictionary.""" @@ -904,6 +1152,14 @@ def as_dict(self) -> dict: if self.request_object_type is not None: 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 + if self.request_object_id is not None: body['request_object_id'] = self.request_object_id + if self.request_object_type is not None: 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.""" @@ -942,6 +1198,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.group_name is not None: body['group_name'] = self.group_name + if self.principal_id is not None: body['principal_id'] = self.principal_id + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PrincipalOutput: """Deserializes the PrincipalOutput from a dictionary.""" @@ -964,6 +1231,12 @@ def as_dict(self) -> dict: if self.resource_type is not None: body['resourceType'] = 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResourceMeta: """Deserializes the ResourceMeta from a dictionary.""" @@ -981,6 +1254,12 @@ def as_dict(self) -> dict: if self.name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Role: """Deserializes the Role from a dictionary.""" @@ -1005,6 +1284,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.grant_rules: body['grant_rules'] = self.grant_rules + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RuleSetResponse: """Deserializes the RuleSetResponse from a dictionary.""" @@ -1032,6 +1319,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.grant_rules: body['grant_rules'] = self.grant_rules + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RuleSetUpdateRequest: """Deserializes the RuleSetUpdateRequest from a dictionary.""" @@ -1084,6 +1379,20 @@ def as_dict(self) -> dict: if 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 + if self.application_id is not None: body['applicationId'] = self.application_id + if self.display_name is not None: body['displayName'] = self.display_name + if self.entitlements: body['entitlements'] = self.entitlements + if self.external_id is not None: body['externalId'] = self.external_id + if self.groups: body['groups'] = self.groups + if self.id is not None: body['id'] = self.id + if self.roles: body['roles'] = self.roles + if self.schemas: body['schemas'] = self.schemas + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServicePrincipal: """Deserializes the ServicePrincipal from a dictionary.""" @@ -1111,6 +1420,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -1131,6 +1445,13 @@ def as_dict(self) -> dict: if self.rule_set: 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 + if 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.""" @@ -1160,6 +1481,14 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.principal_id is not None: body['principal_id'] = self.principal_id + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateWorkspaceAssignments: """Deserializes the UpdateWorkspaceAssignments from a dictionary.""" @@ -1225,6 +1554,22 @@ def as_dict(self) -> dict: if self.user_name is not None: body['userName'] = 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 + if self.display_name is not None: body['displayName'] = self.display_name + if self.emails: body['emails'] = self.emails + if self.entitlements: body['entitlements'] = self.entitlements + if self.external_id is not None: body['externalId'] = self.external_id + if self.groups: body['groups'] = self.groups + if self.id is not None: body['id'] = self.id + if self.name: body['name'] = self.name + if self.roles: body['roles'] = self.roles + if self.schemas: body['schemas'] = self.schemas + if self.user_name is not None: body['userName'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> User: """Deserializes the User from a dictionary.""" @@ -1265,6 +1610,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WorkspacePermissions: """Deserializes the WorkspacePermissions from a dictionary.""" diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/service/jobs.py index ab485b33c..a991c7c50 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -53,6 +53,17 @@ def as_dict(self) -> dict: if self.settings: 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 + if self.creator_user_name is not None: 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 + if self.job_id is not None: body['job_id'] = self.job_id + if self.settings: body['settings'] = self.settings + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BaseJob: """Deserializes the BaseJob from a dictionary.""" @@ -240,6 +251,43 @@ def as_dict(self) -> dict: if self.trigger_info: 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 + if self.cleanup_duration is not None: body['cleanup_duration'] = self.cleanup_duration + if self.cluster_instance: body['cluster_instance'] = self.cluster_instance + if 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 + if self.description is not None: body['description'] = self.description + if self.end_time is not None: body['end_time'] = self.end_time + if self.execution_duration is not None: body['execution_duration'] = self.execution_duration + if self.git_source: body['git_source'] = self.git_source + if self.job_clusters: body['job_clusters'] = self.job_clusters + if self.job_id is not None: body['job_id'] = self.job_id + if 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 + if self.number_in_job is not None: 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 + if self.overriding_parameters: body['overriding_parameters'] = self.overriding_parameters + if self.queue_duration is not None: body['queue_duration'] = self.queue_duration + if self.repair_history: body['repair_history'] = self.repair_history + if self.run_duration is not None: body['run_duration'] = self.run_duration + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_name is not None: body['run_name'] = self.run_name + if self.run_page_url is not None: body['run_page_url'] = self.run_page_url + if self.run_type is not None: body['run_type'] = self.run_type + if self.schedule: body['schedule'] = self.schedule + if self.setup_duration is not None: body['setup_duration'] = self.setup_duration + if self.start_time is not None: body['start_time'] = self.start_time + if self.state: body['state'] = self.state + if self.status: body['status'] = self.status + if self.tasks: body['tasks'] = self.tasks + if self.trigger is not None: body['trigger'] = self.trigger + if 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.""" @@ -292,6 +340,13 @@ def as_dict(self) -> dict: if self.job_id is not None: 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 + if self.job_id is not None: body['job_id'] = self.job_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelAllRuns: """Deserializes the CancelAllRuns from a dictionary.""" @@ -306,6 +361,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CancelAllRunsResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelAllRunsResponse: """Deserializes the CancelAllRunsResponse from a dictionary.""" @@ -323,6 +383,12 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelRun: """Deserializes the CancelRun from a dictionary.""" @@ -337,12 +403,82 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CancelRunResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelRunResponse: """Deserializes the CancelRunResponse from a dictionary.""" return cls() +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' + 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' + 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 room notebook V1 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 ClusterInstance: cluster_id: Optional[str] = None @@ -369,6 +505,13 @@ def as_dict(self) -> dict: if self.spark_context_id is not None: 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 + if self.spark_context_id is not None: 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.""" @@ -402,6 +545,15 @@ def as_dict(self) -> dict: if self.new_cluster: 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 + if self.job_cluster_key is not None: body['job_cluster_key'] = self.job_cluster_key + if self.libraries: body['libraries'] = self.libraries + if 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.""" @@ -446,6 +598,14 @@ def as_dict(self) -> dict: if self.right is not None: 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 + if self.op is not None: body['op'] = self.op + if self.right is not None: body['right'] = self.right + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ConditionTask: """Deserializes the ConditionTask from a dictionary.""" @@ -482,6 +642,12 @@ def as_dict(self) -> dict: if self.pause_status is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Continuous: """Deserializes the Continuous from a dictionary.""" @@ -571,8 +737,8 @@ class CreateJob: """The queue settings of the job.""" run_as: Optional[JobRunAs] = None - """Write-only setting. Specifies the user, service principal or group that the job/pipeline runs - as. If not specified, the job/pipeline runs as the user who created the job/pipeline. + """Write-only setting. Specifies the user or service principal that the job runs as. If not + specified, the job runs as the user who created the job. Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown.""" @@ -629,6 +795,35 @@ def as_dict(self) -> dict: if self.webhook_notifications: 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 + if self.budget_policy_id is not None: body['budget_policy_id'] = self.budget_policy_id + if self.continuous: body['continuous'] = self.continuous + if self.deployment: body['deployment'] = self.deployment + if self.description is not None: body['description'] = self.description + if self.edit_mode is not None: body['edit_mode'] = self.edit_mode + if self.email_notifications: body['email_notifications'] = self.email_notifications + if self.environments: body['environments'] = self.environments + if self.format is not None: body['format'] = self.format + if self.git_source: body['git_source'] = self.git_source + if self.health: body['health'] = self.health + if 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 + if self.name is not None: body['name'] = self.name + if self.notification_settings: body['notification_settings'] = self.notification_settings + if self.parameters: body['parameters'] = self.parameters + if self.queue: body['queue'] = self.queue + if self.run_as: body['run_as'] = self.run_as + if self.schedule: body['schedule'] = self.schedule + if self.tags: body['tags'] = self.tags + if self.tasks: body['tasks'] = self.tasks + if self.timeout_seconds is not None: body['timeout_seconds'] = self.timeout_seconds + if self.trigger: body['trigger'] = self.trigger + if 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.""" @@ -671,6 +866,12 @@ def as_dict(self) -> dict: if self.job_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateResponse: """Deserializes the CreateResponse from a dictionary.""" @@ -703,6 +904,15 @@ def as_dict(self) -> dict: if self.timezone_id is not None: 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 + if self.quartz_cron_expression is not None: + body['quartz_cron_expression'] = self.quartz_cron_expression + if self.timezone_id is not None: body['timezone_id'] = self.timezone_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CronSchedule: """Deserializes the CronSchedule from a dictionary.""" @@ -727,6 +937,13 @@ def as_dict(self) -> dict: if self.artifacts_link is not None: 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 + if self.artifacts_link is not None: body['artifacts_link'] = self.artifacts_link + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DbtOutput: """Deserializes the DbtOutput from a dictionary.""" @@ -783,6 +1000,18 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.commands: body['commands'] = self.commands + if self.profiles_directory is not None: body['profiles_directory'] = self.profiles_directory + if self.project_directory is not None: body['project_directory'] = self.project_directory + if self.schema is not None: body['schema'] = self.schema + if self.source is not None: body['source'] = self.source + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DbtTask: """Deserializes the DbtTask from a dictionary.""" @@ -806,6 +1035,12 @@ def as_dict(self) -> dict: if self.job_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteJob: """Deserializes the DeleteJob from a dictionary.""" @@ -820,6 +1055,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -837,6 +1077,12 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteRun: """Deserializes the DeleteRun from a dictionary.""" @@ -851,6 +1097,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteRunResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteRunResponse: """Deserializes the DeleteRunResponse from a dictionary.""" @@ -883,6 +1134,14 @@ def as_dict(self) -> dict: if self.previous_value is not None: 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 + if self.new_value is not None: body['new_value'] = self.new_value + if self.previous_value is not None: body['previous_value'] = self.previous_value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnforcePolicyComplianceForJobResponseJobClusterSettingsChange: """Deserializes the EnforcePolicyComplianceForJobResponseJobClusterSettingsChange from a dictionary.""" @@ -906,6 +1165,13 @@ def as_dict(self) -> dict: if self.validate_only is not None: 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 + if self.validate_only is not None: body['validate_only'] = self.validate_only + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnforcePolicyComplianceRequest: """Deserializes the EnforcePolicyComplianceRequest from a dictionary.""" @@ -937,6 +1203,14 @@ def as_dict(self) -> dict: if self.settings: 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 + if self.job_cluster_changes: body['job_cluster_changes'] = self.job_cluster_changes + if self.settings: body['settings'] = self.settings + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnforcePolicyComplianceResponse: """Deserializes the EnforcePolicyComplianceResponse from a dictionary.""" @@ -963,6 +1237,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExportRunOutput: """Deserializes the ExportRunOutput from a dictionary.""" @@ -994,6 +1274,16 @@ def as_dict(self) -> dict: 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 + if self.url is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FileArrivalTriggerConfiguration: """Deserializes the FileArrivalTriggerConfiguration from a dictionary.""" @@ -1018,6 +1308,13 @@ def as_dict(self) -> dict: if self.task_run_stats: 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 + if 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.""" @@ -1045,6 +1342,14 @@ def as_dict(self) -> dict: if self.task: 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 + if self.inputs is not None: body['inputs'] = self.inputs + if self.task: body['task'] = self.task + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ForEachTask: """Deserializes the ForEachTask from a dictionary.""" @@ -1072,6 +1377,14 @@ def as_dict(self) -> dict: if self.termination_category is not None: 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 + if self.error_message is not None: body['error_message'] = self.error_message + if self.termination_category is not None: body['termination_category'] = self.termination_category + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ForEachTaskErrorMessageStats: """Deserializes the ForEachTaskErrorMessageStats from a dictionary.""" @@ -1111,6 +1424,17 @@ def as_dict(self) -> dict: if self.total_iterations is not None: 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 + if self.completed_iterations is not None: body['completed_iterations'] = self.completed_iterations + if self.failed_iterations is not None: body['failed_iterations'] = self.failed_iterations + if self.scheduled_iterations is not None: body['scheduled_iterations'] = self.scheduled_iterations + if self.succeeded_iterations is not None: body['succeeded_iterations'] = self.succeeded_iterations + if self.total_iterations is not None: body['total_iterations'] = self.total_iterations + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ForEachTaskTaskRunStats: """Deserializes the ForEachTaskTaskRunStats from a dictionary.""" @@ -1139,6 +1463,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetJobPermissionLevelsResponse: """Deserializes the GetJobPermissionLevelsResponse from a dictionary.""" @@ -1165,6 +1495,13 @@ def as_dict(self) -> dict: if 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 + if self.violations: body['violations'] = self.violations + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetPolicyComplianceResponse: """Deserializes the GetPolicyComplianceResponse from a dictionary.""" @@ -1199,6 +1536,12 @@ def as_dict(self) -> dict: if self.used_commit is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GitSnapshot: """Deserializes the GitSnapshot from a dictionary.""" @@ -1253,6 +1596,18 @@ def as_dict(self) -> dict: if self.job_source: 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 + if self.git_commit is not None: body['git_commit'] = self.git_commit + if self.git_provider is not None: body['git_provider'] = self.git_provider + if self.git_snapshot: body['git_snapshot'] = self.git_snapshot + if self.git_tag is not None: body['git_tag'] = self.git_tag + if self.git_url is not None: body['git_url'] = self.git_url + if 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.""" @@ -1310,6 +1665,18 @@ def as_dict(self) -> dict: if self.settings: 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 + if self.creator_user_name is not None: 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 + if self.job_id is not None: body['job_id'] = self.job_id + if self.run_as_user_name is not None: body['run_as_user_name'] = self.run_as_user_name + if self.settings: body['settings'] = self.settings + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Job: """Deserializes the Job from a dictionary.""" @@ -1345,6 +1712,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobAccessControlRequest: """Deserializes the JobAccessControlRequest from a dictionary.""" @@ -1382,6 +1759,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobAccessControlResponse: """Deserializes the JobAccessControlResponse from a dictionary.""" @@ -1409,6 +1797,13 @@ def as_dict(self) -> dict: if self.new_cluster: 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 + if 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.""" @@ -1438,6 +1833,14 @@ def as_dict(self) -> dict: if 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 + if self.job_id is not None: body['job_id'] = self.job_id + if self.violations: body['violations'] = self.violations + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobCompliance: """Deserializes the JobCompliance from a dictionary.""" @@ -1463,6 +1866,13 @@ def as_dict(self) -> dict: if self.metadata_file_path is not None: 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 + if self.metadata_file_path is not None: 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.""" @@ -1537,6 +1947,20 @@ def as_dict(self) -> dict: if 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 + if 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 + if 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 + if 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.""" @@ -1565,6 +1989,13 @@ def as_dict(self) -> dict: if self.spec: 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 + if self.spec: body['spec'] = self.spec + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobEnvironment: """Deserializes the JobEnvironment from a dictionary.""" @@ -1591,6 +2022,15 @@ def as_dict(self) -> dict: 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 + if self.no_alert_for_skipped_runs is not None: + 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.""" @@ -1617,6 +2057,14 @@ def as_dict(self) -> dict: if self.value is not None: 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 + 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]) -> JobParameter: """Deserializes the JobParameter from a dictionary.""" @@ -1638,6 +2086,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobParameterDefinition: """Deserializes the JobParameterDefinition from a dictionary.""" @@ -1661,6 +2116,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobPermission: """Deserializes the JobPermission from a dictionary.""" @@ -1695,6 +2158,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobPermissions: """Deserializes the JobPermissions from a dictionary.""" @@ -1717,6 +2188,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobPermissionsDescription: """Deserializes the JobPermissionsDescription from a dictionary.""" @@ -1739,6 +2217,13 @@ def as_dict(self) -> dict: if self.job_id is not None: 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 + if self.job_id is not None: body['job_id'] = self.job_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobPermissionsRequest: """Deserializes the JobPermissionsRequest from a dictionary.""" @@ -1748,8 +2233,8 @@ def from_dict(cls, d: Dict[str, any]) -> JobPermissionsRequest: @dataclass class JobRunAs: - """Write-only setting. Specifies the user, service principal or group that the job/pipeline runs - as. If not specified, the job/pipeline runs as the user who created the job/pipeline. + """Write-only setting. Specifies the user or service principal that the job runs as. If not + specified, the job runs as the user who created the job. Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown.""" @@ -1769,6 +2254,14 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobRunAs: """Deserializes the JobRunAs from a dictionary.""" @@ -1856,8 +2349,8 @@ class JobSettings: """The queue settings of the job.""" run_as: Optional[JobRunAs] = None - """Write-only setting. Specifies the user, service principal or group that the job/pipeline runs - as. If not specified, the job/pipeline runs as the user who created the job/pipeline. + """Write-only setting. Specifies the user or service principal that the job runs as. If not + specified, the job runs as the user who created the job. Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown.""" @@ -1912,6 +2405,34 @@ def as_dict(self) -> dict: if self.webhook_notifications: 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 + if self.continuous: body['continuous'] = self.continuous + if self.deployment: body['deployment'] = self.deployment + if self.description is not None: body['description'] = self.description + if self.edit_mode is not None: body['edit_mode'] = self.edit_mode + if self.email_notifications: body['email_notifications'] = self.email_notifications + if self.environments: body['environments'] = self.environments + if self.format is not None: body['format'] = self.format + if self.git_source: body['git_source'] = self.git_source + if self.health: body['health'] = self.health + if 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 + if self.name is not None: body['name'] = self.name + if self.notification_settings: body['notification_settings'] = self.notification_settings + if self.parameters: body['parameters'] = self.parameters + if self.queue: body['queue'] = self.queue + if self.run_as: body['run_as'] = self.run_as + if self.schedule: body['schedule'] = self.schedule + if self.tags: body['tags'] = self.tags + if self.tasks: body['tasks'] = self.tasks + if self.timeout_seconds is not None: body['timeout_seconds'] = self.timeout_seconds + if self.trigger: body['trigger'] = self.trigger + if 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.""" @@ -1969,6 +2490,15 @@ def as_dict(self) -> dict: if self.job_config_path is not None: 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 + if self.import_from_git_branch is not None: + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobSource: """Deserializes the JobSource from a dictionary.""" @@ -2042,6 +2572,14 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.op is not None: body['op'] = self.op + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobsHealthRule: """Deserializes the JobsHealthRule from a dictionary.""" @@ -2062,6 +2600,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobsHealthRules: """Deserializes the JobsHealthRules from a dictionary.""" @@ -2089,6 +2633,14 @@ def as_dict(self) -> dict: if self.prev_page_token is not None: 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 + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListJobComplianceForPolicyResponse: """Deserializes the ListJobComplianceForPolicyResponse from a dictionary.""" @@ -2122,6 +2674,15 @@ def as_dict(self) -> dict: if self.prev_page_token is not None: 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 + if self.jobs: body['jobs'] = self.jobs + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListJobsResponse: """Deserializes the ListJobsResponse from a dictionary.""" @@ -2157,6 +2718,15 @@ def as_dict(self) -> dict: if 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.""" @@ -2185,6 +2755,13 @@ def as_dict(self) -> dict: if self.truncated is not None: 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 + if self.truncated is not None: body['truncated'] = self.truncated + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NotebookOutput: """Deserializes the NotebookOutput from a dictionary.""" @@ -2237,6 +2814,15 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.notebook_path is not None: body['notebook_path'] = self.notebook_path + if self.source is not None: body['source'] = self.source + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NotebookTask: """Deserializes the NotebookTask from a dictionary.""" @@ -2267,6 +2853,13 @@ def as_dict(self) -> dict: if self.unit is not None: 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 + if self.unit is not None: body['unit'] = self.unit + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PeriodicTriggerConfiguration: """Deserializes the PeriodicTriggerConfiguration from a dictionary.""" @@ -2292,6 +2885,12 @@ def as_dict(self) -> dict: if self.full_refresh is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineParams: """Deserializes the PipelineParams from a dictionary.""" @@ -2313,6 +2912,13 @@ def as_dict(self) -> dict: if self.pipeline_id is not None: 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 + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineTask: """Deserializes the PipelineTask from a dictionary.""" @@ -2345,6 +2951,15 @@ def as_dict(self) -> dict: if 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 + if self.named_parameters: body['named_parameters'] = self.named_parameters + if self.package_name is not None: body['package_name'] = self.package_name + if self.parameters: body['parameters'] = self.parameters + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PythonWheelTask: """Deserializes the PythonWheelTask from a dictionary.""" @@ -2374,6 +2989,13 @@ def as_dict(self) -> dict: if self.message is not None: 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 + if self.message is not None: body['message'] = self.message + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueueDetails: """Deserializes the QueueDetails from a dictionary.""" @@ -2403,6 +3025,12 @@ def as_dict(self) -> dict: if self.enabled is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueueSettings: """Deserializes the QueueSettings from a dictionary.""" @@ -2444,6 +3072,18 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.id is not None: body['id'] = self.id + if self.start_time is not None: body['start_time'] = self.start_time + if self.state: body['state'] = self.state + if self.status: body['status'] = self.status + if self.task_run_ids: body['task_run_ids'] = self.task_run_ids + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepairHistoryItem: """Deserializes the RepairHistoryItem from a dictionary.""" @@ -2580,6 +3220,26 @@ def as_dict(self) -> dict: if 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 + if self.jar_params: body['jar_params'] = self.jar_params + if 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 + if self.notebook_params: body['notebook_params'] = self.notebook_params + if self.pipeline_params: body['pipeline_params'] = self.pipeline_params + if self.python_named_params: body['python_named_params'] = self.python_named_params + if 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 + if self.rerun_dependent_tasks is not None: body['rerun_dependent_tasks'] = self.rerun_dependent_tasks + if self.rerun_tasks: body['rerun_tasks'] = self.rerun_tasks + if self.run_id is not None: body['run_id'] = self.run_id + if self.spark_submit_params: body['spark_submit_params'] = self.spark_submit_params + if 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.""" @@ -2613,6 +3273,12 @@ def as_dict(self) -> dict: if self.repair_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepairRunResponse: """Deserializes the RepairRunResponse from a dictionary.""" @@ -2637,6 +3303,13 @@ def as_dict(self) -> dict: if self.new_settings: 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 + if 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.""" @@ -2651,6 +3324,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the ResetResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResetResponse: """Deserializes the ResetResponse from a dictionary.""" @@ -2670,6 +3348,13 @@ def as_dict(self) -> dict: if self.right is not None: 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 + if self.right is not None: body['right'] = self.right + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResolvedConditionTaskValues: """Deserializes the ResolvedConditionTaskValues from a dictionary.""" @@ -2686,6 +3371,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResolvedDbtTaskValues: """Deserializes the ResolvedDbtTaskValues from a dictionary.""" @@ -2702,6 +3393,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResolvedNotebookTaskValues: """Deserializes the ResolvedNotebookTaskValues from a dictionary.""" @@ -2718,6 +3415,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResolvedParamPairValues: """Deserializes the ResolvedParamPairValues from a dictionary.""" @@ -2737,6 +3440,13 @@ def as_dict(self) -> dict: if 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 + if self.parameters: body['parameters'] = self.parameters + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResolvedPythonWheelTaskValues: """Deserializes the ResolvedPythonWheelTaskValues from a dictionary.""" @@ -2756,6 +3466,13 @@ def as_dict(self) -> dict: if 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 + if self.parameters: body['parameters'] = self.parameters + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResolvedRunJobTaskValues: """Deserializes the ResolvedRunJobTaskValues from a dictionary.""" @@ -2772,6 +3489,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResolvedStringParamsValues: """Deserializes the ResolvedStringParamsValues from a dictionary.""" @@ -2815,6 +3538,21 @@ def as_dict(self) -> dict: if self.sql_task: 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 + if self.dbt_task: body['dbt_task'] = self.dbt_task + if self.notebook_task: body['notebook_task'] = self.notebook_task + if 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 + if self.simulation_task: body['simulation_task'] = self.simulation_task + if 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 + if self.spark_submit_task: body['spark_submit_task'] = self.spark_submit_task + if 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.""" @@ -3017,6 +3755,45 @@ def as_dict(self) -> dict: if self.trigger_info: 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 + if self.cleanup_duration is not None: body['cleanup_duration'] = self.cleanup_duration + if self.cluster_instance: body['cluster_instance'] = self.cluster_instance + if 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 + if self.description is not None: body['description'] = self.description + if self.end_time is not None: body['end_time'] = self.end_time + if self.execution_duration is not None: body['execution_duration'] = self.execution_duration + if self.git_source: body['git_source'] = self.git_source + if self.iterations: body['iterations'] = self.iterations + if self.job_clusters: body['job_clusters'] = self.job_clusters + if self.job_id is not None: body['job_id'] = self.job_id + if 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 + if self.next_page_token is not None: body['next_page_token'] = self.next_page_token + if self.number_in_job is not None: 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 + if self.overriding_parameters: body['overriding_parameters'] = self.overriding_parameters + if self.queue_duration is not None: body['queue_duration'] = self.queue_duration + if self.repair_history: body['repair_history'] = self.repair_history + if self.run_duration is not None: body['run_duration'] = self.run_duration + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_name is not None: body['run_name'] = self.run_name + if self.run_page_url is not None: body['run_page_url'] = self.run_page_url + if self.run_type is not None: body['run_type'] = self.run_type + if self.schedule: body['schedule'] = self.schedule + if self.setup_duration is not None: body['setup_duration'] = self.setup_duration + if self.start_time is not None: body['start_time'] = self.start_time + if self.state: body['state'] = self.state + if self.status: body['status'] = self.status + if self.tasks: body['tasks'] = self.tasks + if self.trigger is not None: body['trigger'] = self.trigger + if 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.""" @@ -3089,6 +3866,15 @@ def as_dict(self) -> dict: if self.right is not None: 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 + if self.op is not None: body['op'] = self.op + if self.outcome is not None: body['outcome'] = self.outcome + if self.right is not None: body['right'] = self.right + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunConditionTask: """Deserializes the RunConditionTask from a dictionary.""" @@ -3123,6 +3909,15 @@ def as_dict(self) -> dict: if self.task: 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 + if self.inputs is not None: body['inputs'] = self.inputs + if self.stats: body['stats'] = self.stats + if self.task: body['task'] = self.task + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunForEachTask: """Deserializes the RunForEachTask from a dictionary.""" @@ -3161,6 +3956,12 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunJobOutput: """Deserializes the RunJobOutput from a dictionary.""" @@ -3264,6 +4065,21 @@ def as_dict(self) -> dict: if 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 + if self.jar_params: body['jar_params'] = self.jar_params + if self.job_id is not None: body['job_id'] = self.job_id + if self.job_parameters: body['job_parameters'] = self.job_parameters + if self.notebook_params: body['notebook_params'] = self.notebook_params + if self.pipeline_params: body['pipeline_params'] = self.pipeline_params + if self.python_named_params: body['python_named_params'] = self.python_named_params + if self.python_params: body['python_params'] = self.python_params + if self.spark_submit_params: body['spark_submit_params'] = self.spark_submit_params + if 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.""" @@ -3435,6 +4251,24 @@ def as_dict(self) -> dict: if 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 + if self.idempotency_token is not None: body['idempotency_token'] = self.idempotency_token + if self.jar_params: body['jar_params'] = self.jar_params + if self.job_id is not None: body['job_id'] = self.job_id + if self.job_parameters: body['job_parameters'] = self.job_parameters + if self.notebook_params: body['notebook_params'] = self.notebook_params + if self.only: body['only'] = self.only + if self.pipeline_params: body['pipeline_params'] = self.pipeline_params + if self.python_named_params: body['python_named_params'] = self.python_named_params + if self.python_params: body['python_params'] = self.python_params + if self.queue: body['queue'] = self.queue + if self.spark_submit_params: body['spark_submit_params'] = self.spark_submit_params + if 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.""" @@ -3470,6 +4304,13 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + if self.run_id is not None: body['run_id'] = self.run_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunNowResponse: """Deserializes the RunNowResponse from a dictionary.""" @@ -3536,6 +4377,21 @@ def as_dict(self) -> dict: if self.sql_output: 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.dbt_output: body['dbt_output'] = self.dbt_output + if self.error is not None: body['error'] = self.error + if self.error_trace is not None: body['error_trace'] = self.error_trace + if self.info is not None: body['info'] = self.info + if self.logs is not None: body['logs'] = self.logs + if self.logs_truncated is not None: body['logs_truncated'] = self.logs_truncated + if self.metadata: body['metadata'] = self.metadata + if self.notebook_output: body['notebook_output'] = self.notebook_output + if self.run_job_output: body['run_job_output'] = self.run_job_output + if self.sql_output: body['sql_output'] = self.sql_output + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunOutput: """Deserializes the RunOutput from a dictionary.""" @@ -3640,6 +4496,19 @@ def as_dict(self) -> dict: if 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 + if self.jar_params: body['jar_params'] = self.jar_params + if self.notebook_params: body['notebook_params'] = self.notebook_params + if self.pipeline_params: body['pipeline_params'] = self.pipeline_params + if self.python_named_params: body['python_named_params'] = self.python_named_params + if self.python_params: body['python_params'] = self.python_params + if self.spark_submit_params: body['spark_submit_params'] = self.spark_submit_params + if 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.""" @@ -3709,6 +4578,17 @@ def as_dict(self) -> dict: 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 + if self.queue_reason is not None: body['queue_reason'] = self.queue_reason + if self.result_state is not None: body['result_state'] = self.result_state + if self.state_message is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunState: """Deserializes the RunState from a dictionary.""" @@ -3741,6 +4621,14 @@ def as_dict(self) -> dict: if self.termination_details: 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 + if self.state is not None: body['state'] = self.state + if 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.""" @@ -3972,6 +4860,50 @@ def as_dict(self) -> dict: if self.webhook_notifications: 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 + if self.cleanup_duration is not None: body['cleanup_duration'] = self.cleanup_duration + if self.cluster_instance: body['cluster_instance'] = self.cluster_instance + if self.condition_task: body['condition_task'] = self.condition_task + if self.dbt_task: body['dbt_task'] = self.dbt_task + if self.depends_on: body['depends_on'] = self.depends_on + if self.description is not None: body['description'] = self.description + if self.email_notifications: body['email_notifications'] = self.email_notifications + if self.end_time is not None: body['end_time'] = self.end_time + if self.environment_key is not None: body['environment_key'] = self.environment_key + if self.execution_duration is not None: body['execution_duration'] = self.execution_duration + if self.existing_cluster_id is not None: body['existing_cluster_id'] = self.existing_cluster_id + if self.for_each_task: body['for_each_task'] = self.for_each_task + if 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 + if self.libraries: body['libraries'] = self.libraries + if self.new_cluster: body['new_cluster'] = self.new_cluster + if self.notebook_task: body['notebook_task'] = self.notebook_task + if self.notification_settings: body['notification_settings'] = self.notification_settings + if self.pipeline_task: body['pipeline_task'] = self.pipeline_task + if 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 + if self.resolved_values: body['resolved_values'] = self.resolved_values + if self.run_duration is not None: body['run_duration'] = self.run_duration + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_if is not None: body['run_if'] = self.run_if + if 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 + if self.setup_duration is not None: body['setup_duration'] = self.setup_duration + if 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 + if self.spark_submit_task: body['spark_submit_task'] = self.spark_submit_task + if self.sql_task: body['sql_task'] = self.sql_task + if self.start_time is not None: body['start_time'] = self.start_time + if self.state: body['state'] = self.state + if self.status: body['status'] = self.status + if self.task_key is not None: body['task_key'] = self.task_key + if self.timeout_seconds is not None: body['timeout_seconds'] = self.timeout_seconds + if 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.""" @@ -4069,6 +5001,14 @@ def as_dict(self) -> dict: if self.parameters: body['parameters'] = [v for v in self.parameters] 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 + if self.main_class_name is not None: body['main_class_name'] = self.main_class_name + if self.parameters: body['parameters'] = self.parameters + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparkJarTask: """Deserializes the SparkJarTask from a dictionary.""" @@ -4109,6 +5049,14 @@ def as_dict(self) -> dict: if self.source is not None: 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 + if self.python_file is not None: body['python_file'] = self.python_file + if self.source is not None: body['source'] = self.source + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparkPythonTask: """Deserializes the SparkPythonTask from a dictionary.""" @@ -4132,6 +5080,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparkSubmitTask: """Deserializes the SparkSubmitTask from a dictionary.""" @@ -4169,6 +5123,16 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.output_link is not None: body['output_link'] = self.output_link + if self.query_text is not None: body['query_text'] = self.query_text + if self.sql_statements: body['sql_statements'] = self.sql_statements + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlAlertOutput: """Deserializes the SqlAlertOutput from a dictionary.""" @@ -4205,6 +5169,13 @@ def as_dict(self) -> dict: if 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 + if self.widgets: body['widgets'] = self.widgets + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlDashboardOutput: """Deserializes the SqlDashboardOutput from a dictionary.""" @@ -4247,6 +5218,18 @@ def as_dict(self) -> dict: if self.widget_title is not None: 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 + if self.error: body['error'] = self.error + if self.output_link is not None: body['output_link'] = self.output_link + if self.start_time is not None: body['start_time'] = self.start_time + if self.status is not None: body['status'] = self.status + if self.widget_id is not None: body['widget_id'] = self.widget_id + if self.widget_title is not None: body['widget_title'] = self.widget_title + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlDashboardWidgetOutput: """Deserializes the SqlDashboardWidgetOutput from a dictionary.""" @@ -4287,6 +5270,14 @@ def as_dict(self) -> dict: if self.query_output: 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 + if self.dashboard_output: body['dashboard_output'] = self.dashboard_output + if 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.""" @@ -4306,6 +5297,12 @@ def as_dict(self) -> dict: if self.message is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlOutputError: """Deserializes the SqlOutputError from a dictionary.""" @@ -4338,6 +5335,16 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.output_link is not None: body['output_link'] = self.output_link + if self.query_text is not None: body['query_text'] = self.query_text + if self.sql_statements: body['sql_statements'] = self.sql_statements + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlQueryOutput: """Deserializes the SqlQueryOutput from a dictionary.""" @@ -4359,6 +5366,12 @@ def as_dict(self) -> dict: if self.lookup_key is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlStatementOutput: """Deserializes the SqlStatementOutput from a dictionary.""" @@ -4399,6 +5412,17 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.dashboard: body['dashboard'] = self.dashboard + if self.file: body['file'] = self.file + if self.parameters: body['parameters'] = self.parameters + if self.query: body['query'] = self.query + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlTask: """Deserializes the SqlTask from a dictionary.""" @@ -4429,6 +5453,14 @@ def as_dict(self) -> dict: if 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 + if self.pause_subscriptions is not None: body['pause_subscriptions'] = self.pause_subscriptions + if self.subscriptions: body['subscriptions'] = self.subscriptions + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlTaskAlert: """Deserializes the SqlTaskAlert from a dictionary.""" @@ -4460,6 +5492,15 @@ def as_dict(self) -> dict: if 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 + if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id + if self.pause_subscriptions is not None: body['pause_subscriptions'] = self.pause_subscriptions + if self.subscriptions: body['subscriptions'] = self.subscriptions + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlTaskDashboard: """Deserializes the SqlTaskDashboard from a dictionary.""" @@ -4491,6 +5532,13 @@ def as_dict(self) -> dict: if self.source is not None: 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 + if self.source is not None: body['source'] = self.source + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlTaskFile: """Deserializes the SqlTaskFile from a dictionary.""" @@ -4508,6 +5556,12 @@ def as_dict(self) -> dict: if self.query_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlTaskQuery: """Deserializes the SqlTaskQuery from a dictionary.""" @@ -4532,6 +5586,13 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SqlTaskSubscription: """Deserializes the SqlTaskSubscription from a dictionary.""" @@ -4622,6 +5683,25 @@ def as_dict(self) -> dict: if self.webhook_notifications: 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 + if self.budget_policy_id is not None: body['budget_policy_id'] = self.budget_policy_id + if self.email_notifications: body['email_notifications'] = self.email_notifications + if self.environments: body['environments'] = self.environments + if self.git_source: body['git_source'] = self.git_source + if self.health: body['health'] = self.health + if self.idempotency_token is not None: body['idempotency_token'] = self.idempotency_token + if self.notification_settings: body['notification_settings'] = self.notification_settings + if self.queue: body['queue'] = self.queue + if self.run_as: body['run_as'] = self.run_as + if self.run_name is not None: body['run_name'] = self.run_name + if self.tasks: body['tasks'] = self.tasks + if self.timeout_seconds is not None: body['timeout_seconds'] = self.timeout_seconds + if 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.""" @@ -4654,6 +5734,12 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SubmitRunResponse: """Deserializes the SubmitRunResponse from a dictionary.""" @@ -4797,6 +5883,35 @@ def as_dict(self) -> dict: if self.webhook_notifications: 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.condition_task: body['condition_task'] = self.condition_task + if self.dbt_task: body['dbt_task'] = self.dbt_task + if self.depends_on: body['depends_on'] = self.depends_on + if self.description is not None: body['description'] = self.description + if self.email_notifications: body['email_notifications'] = self.email_notifications + if self.environment_key is not None: body['environment_key'] = self.environment_key + if self.existing_cluster_id is not None: body['existing_cluster_id'] = self.existing_cluster_id + if self.for_each_task: body['for_each_task'] = self.for_each_task + if self.health: body['health'] = self.health + if self.libraries: body['libraries'] = self.libraries + if self.new_cluster: body['new_cluster'] = self.new_cluster + if self.notebook_task: body['notebook_task'] = self.notebook_task + if self.notification_settings: body['notification_settings'] = self.notification_settings + if self.pipeline_task: body['pipeline_task'] = self.pipeline_task + if 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 + if 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 + if 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 + if self.sql_task: body['sql_task'] = self.sql_task + if self.task_key is not None: body['task_key'] = self.task_key + if self.timeout_seconds is not None: body['timeout_seconds'] = self.timeout_seconds + if 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.""" @@ -4855,6 +5970,17 @@ def as_dict(self) -> dict: 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 + if self.min_time_between_triggers_seconds is not None: + body['min_time_between_triggers_seconds'] = self.min_time_between_triggers_seconds + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TableUpdateTriggerConfiguration: """Deserializes the TableUpdateTriggerConfiguration from a dictionary.""" @@ -5033,6 +6159,42 @@ def as_dict(self) -> dict: if self.webhook_notifications: 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.condition_task: body['condition_task'] = self.condition_task + if self.dbt_task: body['dbt_task'] = self.dbt_task + if self.depends_on: body['depends_on'] = self.depends_on + if self.description is not None: body['description'] = self.description + if self.disable_auto_optimization is not None: + body['disable_auto_optimization'] = self.disable_auto_optimization + if self.email_notifications: body['email_notifications'] = self.email_notifications + if self.environment_key is not None: body['environment_key'] = self.environment_key + if self.existing_cluster_id is not None: body['existing_cluster_id'] = self.existing_cluster_id + if self.for_each_task: body['for_each_task'] = self.for_each_task + if self.health: body['health'] = self.health + if self.job_cluster_key is not None: body['job_cluster_key'] = self.job_cluster_key + if self.libraries: body['libraries'] = self.libraries + if self.max_retries is not None: 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 + if self.new_cluster: body['new_cluster'] = self.new_cluster + if self.notebook_task: body['notebook_task'] = self.notebook_task + if self.notification_settings: body['notification_settings'] = self.notification_settings + if self.pipeline_task: body['pipeline_task'] = self.pipeline_task + if 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 + if self.run_if is not None: body['run_if'] = self.run_if + if 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 + if 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 + if self.sql_task: body['sql_task'] = self.sql_task + if self.task_key is not None: body['task_key'] = self.task_key + if self.timeout_seconds is not None: body['timeout_seconds'] = self.timeout_seconds + if 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.""" @@ -5083,6 +6245,13 @@ def as_dict(self) -> dict: if self.task_key is not None: 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 + if self.task_key is not None: body['task_key'] = self.task_key + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TaskDependency: """Deserializes the TaskDependency from a dictionary.""" @@ -5140,6 +6309,20 @@ def as_dict(self) -> dict: if 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 + if 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 + if 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 + if 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.""" @@ -5177,6 +6360,16 @@ def as_dict(self) -> dict: 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 + if self.no_alert_for_canceled_runs is not None: + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TaskNotificationSettings: """Deserializes the TaskNotificationSettings from a dictionary.""" @@ -5306,6 +6499,14 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.message is not None: body['message'] = self.message + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TerminationDetails: """Deserializes the TerminationDetails from a dictionary.""" @@ -5342,6 +6543,12 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TriggerInfo: """Deserializes the TriggerInfo from a dictionary.""" @@ -5374,6 +6581,16 @@ def as_dict(self) -> dict: if self.table_update: 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 + if self.pause_status is not None: body['pause_status'] = self.pause_status + if self.periodic: body['periodic'] = self.periodic + if self.table: body['table'] = self.table + if 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.""" @@ -5432,6 +6649,14 @@ def as_dict(self) -> dict: if self.new_settings: 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 + if self.job_id is not None: body['job_id'] = self.job_id + if 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.""" @@ -5448,6 +6673,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -5474,6 +6704,14 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.name is not None: body['name'] = self.name + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ViewItem: """Deserializes the ViewItem from a dictionary.""" @@ -5506,6 +6744,12 @@ def as_dict(self) -> dict: if self.id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Webhook: """Deserializes the Webhook from a dictionary.""" @@ -5553,6 +6797,18 @@ def as_dict(self) -> dict: if 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 + if self.on_failure: body['on_failure'] = self.on_failure + if 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 + if 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.""" @@ -5754,8 +7010,8 @@ def create(self, :param queue: :class:`QueueSettings` (optional) The queue settings of the job. :param run_as: :class:`JobRunAs` (optional) - Write-only setting. Specifies the user, service principal or group that the job/pipeline runs as. If - not specified, the job/pipeline runs as the user who created the job/pipeline. + Write-only setting. Specifies the user or service principal that the job runs as. If not specified, + the job runs as the user who created the job. Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown. :param schedule: :class:`CronSchedule` (optional) diff --git a/databricks/sdk/service/marketplace.py b/databricks/sdk/service/marketplace.py index 242e3bf0c..239cd2eaf 100755 --- a/databricks/sdk/service/marketplace.py +++ b/databricks/sdk/service/marketplace.py @@ -27,6 +27,13 @@ def as_dict(self) -> dict: if self.listing_id is not None: 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 + if self.listing_id is not None: body['listing_id'] = self.listing_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AddExchangeForListingRequest: """Deserializes the AddExchangeForListingRequest from a dictionary.""" @@ -43,6 +50,12 @@ def as_dict(self) -> dict: if self.exchange_for_listing: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AddExchangeForListingResponse: """Deserializes the AddExchangeForListingResponse from a dictionary.""" @@ -69,6 +82,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BatchGetListingsResponse: """Deserializes the BatchGetListingsResponse from a dictionary.""" @@ -85,6 +104,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BatchGetProvidersResponse: """Deserializes the BatchGetProvidersResponse from a dictionary.""" @@ -127,6 +152,12 @@ def as_dict(self) -> dict: if self.version is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ConsumerTerms: """Deserializes the ConsumerTerms from a dictionary.""" @@ -154,6 +185,15 @@ def as_dict(self) -> dict: if self.last_name is not None: 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 + if self.email is not None: body['email'] = self.email + if self.first_name is not None: body['first_name'] = self.first_name + if self.last_name is not None: body['last_name'] = self.last_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ContactInfo: """Deserializes the ContactInfo from a dictionary.""" @@ -179,6 +219,12 @@ def as_dict(self) -> dict: if self.filter: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateExchangeFilterRequest: """Deserializes the CreateExchangeFilterRequest from a dictionary.""" @@ -195,6 +241,12 @@ def as_dict(self) -> dict: if self.filter_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateExchangeFilterResponse: """Deserializes the CreateExchangeFilterResponse from a dictionary.""" @@ -211,6 +263,12 @@ def as_dict(self) -> dict: if self.exchange: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateExchangeRequest: """Deserializes the CreateExchangeRequest from a dictionary.""" @@ -227,6 +285,12 @@ def as_dict(self) -> dict: if self.exchange_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateExchangeResponse: """Deserializes the CreateExchangeResponse from a dictionary.""" @@ -253,6 +317,15 @@ def as_dict(self) -> dict: if self.mime_type is not None: 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 + if 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 + if self.mime_type is not None: body['mime_type'] = self.mime_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateFileRequest: """Deserializes the CreateFileRequest from a dictionary.""" @@ -276,6 +349,13 @@ def as_dict(self) -> dict: if self.upload_url is not None: 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 + if self.upload_url is not None: body['upload_url'] = self.upload_url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateFileResponse: """Deserializes the CreateFileResponse from a dictionary.""" @@ -309,6 +389,17 @@ def as_dict(self) -> dict: if self.share_name is not None: 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 + if self.catalog_name is not None: body['catalog_name'] = self.catalog_name + if self.listing_id is not None: body['listing_id'] = self.listing_id + if self.recipient_type is not None: body['recipient_type'] = self.recipient_type + if self.repo_detail: body['repo_detail'] = self.repo_detail + if self.share_name is not None: body['share_name'] = self.share_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateInstallationRequest: """Deserializes the CreateInstallationRequest from a dictionary.""" @@ -330,6 +421,12 @@ def as_dict(self) -> dict: if self.listing: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateListingRequest: """Deserializes the CreateListingRequest from a dictionary.""" @@ -346,6 +443,12 @@ def as_dict(self) -> dict: if self.listing_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateListingResponse: """Deserializes the CreateListingResponse from a dictionary.""" @@ -389,6 +492,20 @@ def as_dict(self) -> dict: if self.recipient_type is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.company is not None: body['company'] = self.company + if self.first_name is not None: body['first_name'] = self.first_name + if self.intended_use is not None: body['intended_use'] = self.intended_use + if self.is_from_lighthouse is not None: body['is_from_lighthouse'] = self.is_from_lighthouse + if self.last_name is not None: body['last_name'] = self.last_name + if self.listing_id is not None: body['listing_id'] = self.listing_id + if self.recipient_type is not None: body['recipient_type'] = self.recipient_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePersonalizationRequest: """Deserializes the CreatePersonalizationRequest from a dictionary.""" @@ -413,6 +530,12 @@ def as_dict(self) -> dict: if self.id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePersonalizationRequestResponse: """Deserializes the CreatePersonalizationRequestResponse from a dictionary.""" @@ -429,6 +552,12 @@ def as_dict(self) -> dict: if self.provider: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateProviderRequest: """Deserializes the CreateProviderRequest from a dictionary.""" @@ -445,6 +574,12 @@ def as_dict(self) -> dict: if self.id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateProviderResponse: """Deserializes the CreateProviderResponse from a dictionary.""" @@ -477,6 +612,13 @@ def as_dict(self) -> dict: if self.unit is not None: 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 + if self.unit is not None: body['unit'] = self.unit + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DataRefreshInfo: """Deserializes the DataRefreshInfo from a dictionary.""" @@ -491,6 +633,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteExchangeFilterResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteExchangeFilterResponse: """Deserializes the DeleteExchangeFilterResponse from a dictionary.""" @@ -505,6 +652,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteExchangeResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteExchangeResponse: """Deserializes the DeleteExchangeResponse from a dictionary.""" @@ -519,6 +671,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteFileResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteFileResponse: """Deserializes the DeleteFileResponse from a dictionary.""" @@ -533,6 +690,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteInstallationResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteInstallationResponse: """Deserializes the DeleteInstallationResponse from a dictionary.""" @@ -547,6 +709,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteListingResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteListingResponse: """Deserializes the DeleteListingResponse from a dictionary.""" @@ -561,6 +728,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteProviderResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteProviderResponse: """Deserializes the DeleteProviderResponse from a dictionary.""" @@ -607,6 +779,20 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.filters: body['filters'] = self.filters + if self.id is not None: body['id'] = self.id + if self.linked_listings: body['linked_listings'] = self.linked_listings + if self.name is not None: body['name'] = self.name + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Exchange: """Deserializes the Exchange from a dictionary.""" @@ -655,6 +841,20 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_by is not None: body['created_by'] = self.created_by + if self.exchange_id is not None: body['exchange_id'] = self.exchange_id + if self.filter_type is not None: body['filter_type'] = self.filter_type + if self.filter_value is not None: body['filter_value'] = self.filter_value + if self.id is not None: body['id'] = self.id + if self.name is not None: body['name'] = self.name + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExchangeFilter: """Deserializes the ExchangeFilter from a dictionary.""" @@ -702,6 +902,18 @@ def as_dict(self) -> dict: if self.listing_name is not None: 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 + if self.created_by is not None: body['created_by'] = self.created_by + if self.exchange_id is not None: body['exchange_id'] = self.exchange_id + if self.exchange_name is not None: body['exchange_name'] = self.exchange_name + if self.id is not None: body['id'] = self.id + if self.listing_id is not None: body['listing_id'] = self.listing_id + if self.listing_name is not None: body['listing_name'] = self.listing_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExchangeListing: """Deserializes the ExchangeListing from a dictionary.""" @@ -754,6 +966,21 @@ def as_dict(self) -> dict: if self.updated_at is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.download_link is not None: body['download_link'] = self.download_link + if self.file_parent: body['file_parent'] = self.file_parent + if self.id is not None: body['id'] = self.id + if self.marketplace_file_type is not None: body['marketplace_file_type'] = self.marketplace_file_type + if self.mime_type is not None: body['mime_type'] = self.mime_type + if self.status is not None: body['status'] = self.status + if self.status_message is not None: body['status_message'] = self.status_message + if self.updated_at is not None: body['updated_at'] = self.updated_at + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" @@ -783,6 +1010,13 @@ def as_dict(self) -> dict: if self.parent_id is not None: 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 + if self.parent_id is not None: body['parent_id'] = self.parent_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FileParent: """Deserializes the FileParent from a dictionary.""" @@ -820,6 +1054,12 @@ def as_dict(self) -> dict: if self.exchange: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetExchangeResponse: """Deserializes the GetExchangeResponse from a dictionary.""" @@ -836,6 +1076,12 @@ def as_dict(self) -> dict: if self.file_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetFileResponse: """Deserializes the GetFileResponse from a dictionary.""" @@ -853,6 +1099,12 @@ def as_dict(self) -> dict: if self.version is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetLatestVersionProviderAnalyticsDashboardResponse: """Deserializes the GetLatestVersionProviderAnalyticsDashboardResponse from a dictionary.""" @@ -873,6 +1125,13 @@ def as_dict(self) -> dict: 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 + if 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.""" @@ -890,6 +1149,12 @@ def as_dict(self) -> dict: if self.listing: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetListingResponse: """Deserializes the GetListingResponse from a dictionary.""" @@ -909,6 +1174,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -927,6 +1199,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetPersonalizationRequestResponse: """Deserializes the GetPersonalizationRequestResponse from a dictionary.""" @@ -944,6 +1222,12 @@ def as_dict(self) -> dict: if self.provider: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetProviderResponse: """Deserializes the GetProviderResponse from a dictionary.""" @@ -960,6 +1244,12 @@ def as_dict(self) -> dict: if self.installation: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Installation: """Deserializes the Installation from a dictionary.""" @@ -1012,6 +1302,24 @@ def as_dict(self) -> dict: if 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 + if self.error_message is not None: body['error_message'] = self.error_message + if self.id is not None: body['id'] = self.id + if self.installed_on is not None: body['installed_on'] = self.installed_on + if self.listing_id is not None: body['listing_id'] = self.listing_id + if self.listing_name is not None: body['listing_name'] = self.listing_name + if self.recipient_type is not None: body['recipient_type'] = self.recipient_type + if self.repo_name is not None: body['repo_name'] = self.repo_name + if self.repo_path is not None: body['repo_path'] = self.repo_path + if self.share_name is not None: body['share_name'] = self.share_name + if self.status is not None: body['status'] = self.status + if self.token_detail: body['token_detail'] = self.token_detail + if self.tokens: body['tokens'] = self.tokens + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InstallationDetail: """Deserializes the InstallationDetail from a dictionary.""" @@ -1049,6 +1357,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1070,6 +1385,13 @@ def as_dict(self) -> dict: 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 + if 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.""" @@ -1091,6 +1413,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1111,6 +1440,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1131,6 +1467,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1151,6 +1494,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1171,6 +1521,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1191,6 +1548,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1211,6 +1575,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1231,6 +1602,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1255,6 +1633,14 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.id is not None: body['id'] = self.id + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListProviderAnalyticsDashboardResponse: """Deserializes the ListProviderAnalyticsDashboardResponse from a dictionary.""" @@ -1276,6 +1662,13 @@ def as_dict(self) -> dict: if 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 + if self.providers: body['providers'] = self.providers + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListProvidersResponse: """Deserializes the ListProvidersResponse from a dictionary.""" @@ -1300,6 +1693,14 @@ def as_dict(self) -> dict: if self.summary: 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 + if self.id is not None: body['id'] = self.id + if self.summary: body['summary'] = self.summary + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Listing: """Deserializes the Listing from a dictionary.""" @@ -1392,6 +1793,31 @@ def as_dict(self) -> dict: if self.update_frequency: 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 + if self.collection_date_end is not None: body['collection_date_end'] = self.collection_date_end + if self.collection_date_start is not None: body['collection_date_start'] = self.collection_date_start + if self.collection_granularity: body['collection_granularity'] = self.collection_granularity + if self.cost is not None: body['cost'] = self.cost + if self.data_source is not None: body['data_source'] = self.data_source + if self.description is not None: body['description'] = self.description + if self.documentation_link is not None: body['documentation_link'] = self.documentation_link + if 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 + if self.geographical_coverage is not None: body['geographical_coverage'] = self.geographical_coverage + if self.license is not None: body['license'] = self.license + if self.pricing_model is not None: body['pricing_model'] = self.pricing_model + if self.privacy_policy_link is not None: body['privacy_policy_link'] = self.privacy_policy_link + if self.size is not None: body['size'] = self.size + if self.support_link is not None: body['support_link'] = self.support_link + if self.tags: body['tags'] = self.tags + if self.terms_of_service is not None: body['terms_of_service'] = self.terms_of_service + if 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.""" @@ -1438,6 +1864,16 @@ def as_dict(self) -> dict: if self.share_info: 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 + if self.listing_id is not None: body['listing_id'] = self.listing_id + if self.recipient_type is not None: body['recipient_type'] = self.recipient_type + if self.repo_info: body['repo_info'] = self.repo_info + if 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.""" @@ -1458,6 +1894,12 @@ def as_dict(self) -> dict: if self.visibility is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListingSetting: """Deserializes the ListingSetting from a dictionary.""" @@ -1548,6 +1990,30 @@ def as_dict(self) -> dict: if self.updated_by_id is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.created_by_id is not None: body['created_by_id'] = self.created_by_id + if self.exchange_ids: body['exchange_ids'] = self.exchange_ids + if self.git_repo: body['git_repo'] = self.git_repo + if self.listing_type is not None: body['listingType'] = self.listing_type + if self.name is not None: body['name'] = self.name + if self.provider_id is not None: body['provider_id'] = self.provider_id + if self.provider_region: body['provider_region'] = self.provider_region + if self.published_at is not None: body['published_at'] = self.published_at + if self.published_by is not None: body['published_by'] = self.published_by + if self.setting: body['setting'] = self.setting + if self.share: body['share'] = self.share + if self.status is not None: body['status'] = self.status + if self.subtitle is not None: body['subtitle'] = self.subtitle + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + if self.updated_by_id is not None: 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.""" @@ -1587,6 +2053,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -1667,6 +2140,27 @@ def as_dict(self) -> dict: if self.updated_at is not None: 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 + if self.consumer_region: body['consumer_region'] = self.consumer_region + if self.contact_info: body['contact_info'] = self.contact_info + if self.created_at is not None: body['created_at'] = self.created_at + if self.id is not None: body['id'] = self.id + if self.intended_use is not None: body['intended_use'] = self.intended_use + if self.is_from_lighthouse is not None: body['is_from_lighthouse'] = self.is_from_lighthouse + if self.listing_id is not None: body['listing_id'] = self.listing_id + if self.listing_name is not None: body['listing_name'] = self.listing_name + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.provider_id is not None: body['provider_id'] = self.provider_id + if self.recipient_type is not None: body['recipient_type'] = self.recipient_type + if self.share: body['share'] = self.share + if self.status is not None: body['status'] = self.status + if self.status_message is not None: body['status_message'] = self.status_message + if self.updated_at is not None: body['updated_at'] = self.updated_at + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PersonalizationRequest: """Deserializes the PersonalizationRequest from a dictionary.""" @@ -1706,6 +2200,12 @@ def as_dict(self) -> dict: if self.id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ProviderAnalyticsDashboard: """Deserializes the ProviderAnalyticsDashboard from a dictionary.""" @@ -1766,6 +2266,28 @@ def as_dict(self) -> dict: if self.term_of_service_link is not None: 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 + if self.company_website_link is not None: 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 + if self.dark_mode_icon_file_path is not None: + body['dark_mode_icon_file_path'] = self.dark_mode_icon_file_path + if self.description is not None: body['description'] = self.description + if self.icon_file_id is not None: body['icon_file_id'] = self.icon_file_id + if self.icon_file_path is not None: body['icon_file_path'] = self.icon_file_path + if self.id is not None: body['id'] = self.id + if self.is_featured is not None: body['is_featured'] = self.is_featured + if self.name is not None: body['name'] = self.name + if self.privacy_policy_link is not None: body['privacy_policy_link'] = self.privacy_policy_link + if self.published_by is not None: body['published_by'] = self.published_by + if self.support_contact_email is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ProviderInfo: """Deserializes the ProviderInfo from a dictionary.""" @@ -1798,6 +2320,13 @@ def as_dict(self) -> dict: if self.region is not None: 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 + if self.region is not None: body['region'] = self.region + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegionInfo: """Deserializes the RegionInfo from a dictionary.""" @@ -1812,6 +2341,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the RemoveExchangeForListingResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RemoveExchangeForListingResponse: """Deserializes the RemoveExchangeForListingResponse from a dictionary.""" @@ -1829,6 +2363,12 @@ def as_dict(self) -> dict: if self.git_repo_url is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoInfo: """Deserializes the RepoInfo from a dictionary.""" @@ -1851,6 +2391,13 @@ def as_dict(self) -> dict: if self.repo_path is not None: 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 + if self.repo_path is not None: body['repo_path'] = self.repo_path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoInstallation: """Deserializes the RepoInstallation from a dictionary.""" @@ -1870,6 +2417,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1890,6 +2444,13 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ShareInfo: """Deserializes the ShareInfo from a dictionary.""" @@ -1911,6 +2472,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SharedDataObject: """Deserializes the SharedDataObject from a dictionary.""" @@ -1939,6 +2507,16 @@ def as_dict(self) -> dict: body['shareCredentialsVersion'] = 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 + if self.endpoint is not None: body['endpoint'] = self.endpoint + if self.expiration_time is not None: body['expirationTime'] = self.expiration_time + if self.share_credentials_version is not None: + body['shareCredentialsVersion'] = self.share_credentials_version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenDetail: """Deserializes the TokenDetail from a dictionary.""" @@ -1984,6 +2562,18 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + if self.id is not None: body['id'] = self.id + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenInfo: """Deserializes the TokenInfo from a dictionary.""" @@ -2009,6 +2599,13 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeFilterRequest: """Deserializes the UpdateExchangeFilterRequest from a dictionary.""" @@ -2025,6 +2622,12 @@ def as_dict(self) -> dict: if self.filter: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeFilterResponse: """Deserializes the UpdateExchangeFilterResponse from a dictionary.""" @@ -2044,6 +2647,13 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeRequest: """Deserializes the UpdateExchangeRequest from a dictionary.""" @@ -2060,6 +2670,12 @@ def as_dict(self) -> dict: if self.exchange: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeResponse: """Deserializes the UpdateExchangeResponse from a dictionary.""" @@ -2085,6 +2701,15 @@ def as_dict(self) -> dict: if self.rotate_token is not None: 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 + if self.installation_id is not None: body['installation_id'] = self.installation_id + if self.listing_id is not None: body['listing_id'] = self.listing_id + if self.rotate_token is not None: body['rotate_token'] = self.rotate_token + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateInstallationRequest: """Deserializes the UpdateInstallationRequest from a dictionary.""" @@ -2104,6 +2729,12 @@ def as_dict(self) -> dict: if self.installation: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateInstallationResponse: """Deserializes the UpdateInstallationResponse from a dictionary.""" @@ -2123,6 +2754,13 @@ def as_dict(self) -> dict: if self.listing: 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 + if self.listing: body['listing'] = self.listing + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateListingRequest: """Deserializes the UpdateListingRequest from a dictionary.""" @@ -2139,6 +2777,12 @@ def as_dict(self) -> dict: if self.listing: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateListingResponse: """Deserializes the UpdateListingResponse from a dictionary.""" @@ -2167,6 +2811,16 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.reason is not None: body['reason'] = self.reason + if self.request_id is not None: body['request_id'] = self.request_id + if self.share: body['share'] = self.share + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdatePersonalizationRequestRequest: """Deserializes the UpdatePersonalizationRequestRequest from a dictionary.""" @@ -2187,6 +2841,12 @@ def as_dict(self) -> dict: if self.request: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdatePersonalizationRequestResponse: """Deserializes the UpdatePersonalizationRequestResponse from a dictionary.""" @@ -2209,6 +2869,13 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateProviderAnalyticsDashboardRequest: """Deserializes the UpdateProviderAnalyticsDashboardRequest from a dictionary.""" @@ -2233,6 +2900,14 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.id is not None: body['id'] = self.id + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateProviderAnalyticsDashboardResponse: """Deserializes the UpdateProviderAnalyticsDashboardResponse from a dictionary.""" @@ -2254,6 +2929,13 @@ def as_dict(self) -> dict: if self.provider: 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 + if self.provider: body['provider'] = self.provider + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateProviderRequest: """Deserializes the UpdateProviderRequest from a dictionary.""" @@ -2270,6 +2952,12 @@ def as_dict(self) -> dict: if self.provider: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateProviderResponse: """Deserializes the UpdateProviderResponse from a dictionary.""" diff --git a/databricks/sdk/service/ml.py b/databricks/sdk/service/ml.py index c44edbe48..e551c72ca 100755 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/service/ml.py @@ -90,6 +90,21 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp + if self.from_stage is not None: body['from_stage'] = self.from_stage + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.system_comment is not None: body['system_comment'] = self.system_comment + if self.to_stage is not None: body['to_stage'] = self.to_stage + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Activity: """Deserializes the Activity from a dictionary.""" @@ -177,6 +192,17 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.name is not None: body['name'] = self.name + if self.stage is not None: body['stage'] = self.stage + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ApproveTransitionRequest: """Deserializes the ApproveTransitionRequest from a dictionary.""" @@ -198,6 +224,12 @@ def as_dict(self) -> dict: if self.activity: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ApproveTransitionRequestResponse: """Deserializes the ApproveTransitionRequestResponse from a dictionary.""" @@ -248,6 +280,18 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CommentObject: """Deserializes the CommentObject from a dictionary.""" @@ -278,6 +322,14 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.name is not None: body['name'] = self.name + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateComment: """Deserializes the CreateComment from a dictionary.""" @@ -295,6 +347,12 @@ def as_dict(self) -> dict: if self.comment: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCommentResponse: """Deserializes the CreateCommentResponse from a dictionary.""" @@ -324,6 +382,14 @@ def as_dict(self) -> dict: if 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 + if self.name is not None: body['name'] = self.name + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateExperiment: """Deserializes the CreateExperiment from a dictionary.""" @@ -343,6 +409,12 @@ def as_dict(self) -> dict: if self.experiment_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateExperimentResponse: """Deserializes the CreateExperimentResponse from a dictionary.""" @@ -368,6 +440,14 @@ def as_dict(self) -> dict: if 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 + if self.name is not None: body['name'] = self.name + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateModelRequest: """Deserializes the CreateModelRequest from a dictionary.""" @@ -386,6 +466,12 @@ def as_dict(self) -> dict: if self.registered_model: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateModelResponse: """Deserializes the CreateModelResponse from a dictionary.""" @@ -425,6 +511,17 @@ def as_dict(self) -> dict: if 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 + if self.name is not None: body['name'] = self.name + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_link is not None: body['run_link'] = self.run_link + if self.source is not None: body['source'] = self.source + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateModelVersionRequest: """Deserializes the CreateModelVersionRequest from a dictionary.""" @@ -447,6 +544,12 @@ def as_dict(self) -> dict: if self.model_version: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateModelVersionResponse: """Deserializes the CreateModelVersionResponse from a dictionary.""" @@ -515,6 +618,17 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.events: body['events'] = self.events + if self.http_url_spec: body['http_url_spec'] = self.http_url_spec + if self.job_spec: body['job_spec'] = self.job_spec + if self.model_name is not None: body['model_name'] = self.model_name + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateRegistryWebhook: """Deserializes the CreateRegistryWebhook from a dictionary.""" @@ -550,6 +664,15 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.start_time is not None: body['start_time'] = self.start_time + if self.tags: body['tags'] = self.tags + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateRun: """Deserializes the CreateRun from a dictionary.""" @@ -570,6 +693,12 @@ def as_dict(self) -> dict: if self.run: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateRunResponse: """Deserializes the CreateRunResponse from a dictionary.""" @@ -607,6 +736,15 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.name is not None: body['name'] = self.name + if self.stage is not None: body['stage'] = self.stage + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateTransitionRequest: """Deserializes the CreateTransitionRequest from a dictionary.""" @@ -627,6 +765,12 @@ def as_dict(self) -> dict: if self.request: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateTransitionRequestResponse: """Deserializes the CreateTransitionRequestResponse from a dictionary.""" @@ -643,6 +787,12 @@ def as_dict(self) -> dict: if self.webhook: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateWebhookResponse: """Deserializes the CreateWebhookResponse from a dictionary.""" @@ -684,6 +834,17 @@ def as_dict(self) -> dict: if self.source_type is not None: 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 + if self.name is not None: body['name'] = self.name + if self.profile is not None: body['profile'] = self.profile + if self.schema is not None: body['schema'] = self.schema + if self.source is not None: body['source'] = self.source + if self.source_type is not None: body['source_type'] = self.source_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Dataset: """Deserializes the Dataset from a dictionary.""" @@ -710,6 +871,13 @@ def as_dict(self) -> dict: if 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 + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DatasetInput: """Deserializes the DatasetInput from a dictionary.""" @@ -724,6 +892,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteCommentResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteCommentResponse: """Deserializes the DeleteCommentResponse from a dictionary.""" @@ -741,6 +914,12 @@ def as_dict(self) -> dict: if self.experiment_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteExperiment: """Deserializes the DeleteExperiment from a dictionary.""" @@ -755,6 +934,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteExperimentResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteExperimentResponse: """Deserializes the DeleteExperimentResponse from a dictionary.""" @@ -769,6 +953,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteModelResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteModelResponse: """Deserializes the DeleteModelResponse from a dictionary.""" @@ -783,6 +972,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteModelTagResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteModelTagResponse: """Deserializes the DeleteModelTagResponse from a dictionary.""" @@ -797,6 +991,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteModelVersionResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteModelVersionResponse: """Deserializes the DeleteModelVersionResponse from a dictionary.""" @@ -811,6 +1010,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteModelVersionTagResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteModelVersionTagResponse: """Deserializes the DeleteModelVersionTagResponse from a dictionary.""" @@ -828,6 +1032,12 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteRun: """Deserializes the DeleteRun from a dictionary.""" @@ -842,6 +1052,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteRunResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteRunResponse: """Deserializes the DeleteRunResponse from a dictionary.""" @@ -869,6 +1084,14 @@ def as_dict(self) -> dict: if self.max_timestamp_millis is not None: 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 + if self.max_runs is not None: body['max_runs'] = self.max_runs + if self.max_timestamp_millis is not None: 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.""" @@ -888,6 +1111,12 @@ def as_dict(self) -> dict: if self.runs_deleted is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteRunsResponse: """Deserializes the DeleteRunsResponse from a dictionary.""" @@ -909,6 +1138,13 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + if self.run_id is not None: body['run_id'] = self.run_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteTag: """Deserializes the DeleteTag from a dictionary.""" @@ -923,6 +1159,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteTagResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteTagResponse: """Deserializes the DeleteTagResponse from a dictionary.""" @@ -937,6 +1178,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteTransitionRequestResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteTransitionRequestResponse: """Deserializes the DeleteTransitionRequestResponse from a dictionary.""" @@ -959,6 +1205,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteWebhookResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteWebhookResponse: """Deserializes the DeleteWebhookResponse from a dictionary.""" @@ -1001,6 +1252,18 @@ def as_dict(self) -> dict: if 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 + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.experiment_id is not None: body['experiment_id'] = self.experiment_id + if self.last_update_time is not None: body['last_update_time'] = self.last_update_time + if self.lifecycle_stage is not None: body['lifecycle_stage'] = self.lifecycle_stage + if self.name is not None: body['name'] = self.name + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Experiment: """Deserializes the Experiment from a dictionary.""" @@ -1037,6 +1300,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExperimentAccessControlRequest: """Deserializes the ExperimentAccessControlRequest from a dictionary.""" @@ -1074,6 +1347,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExperimentAccessControlResponse: """Deserializes the ExperimentAccessControlResponse from a dictionary.""" @@ -1101,6 +1385,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExperimentPermission: """Deserializes the ExperimentPermission from a dictionary.""" @@ -1134,6 +1426,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExperimentPermissions: """Deserializes the ExperimentPermissions from a dictionary.""" @@ -1157,6 +1457,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExperimentPermissionsDescription: """Deserializes the ExperimentPermissionsDescription from a dictionary.""" @@ -1179,6 +1486,13 @@ def as_dict(self) -> dict: if self.experiment_id is not None: 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 + if self.experiment_id is not None: body['experiment_id'] = self.experiment_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExperimentPermissionsRequest: """Deserializes the ExperimentPermissionsRequest from a dictionary.""" @@ -1202,6 +1516,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExperimentTag: """Deserializes the ExperimentTag from a dictionary.""" @@ -1227,6 +1548,14 @@ def as_dict(self) -> dict: if self.path is not None: 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 + if self.is_dir is not None: body['is_dir'] = self.is_dir + if self.path is not None: body['path'] = self.path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FileInfo: """Deserializes the FileInfo from a dictionary.""" @@ -1244,6 +1573,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetExperimentPermissionLevelsResponse: """Deserializes the GetExperimentPermissionLevelsResponse from a dictionary.""" @@ -1261,6 +1596,12 @@ def as_dict(self) -> dict: if self.experiment: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetExperimentResponse: """Deserializes the GetExperimentResponse from a dictionary.""" @@ -1282,6 +1623,13 @@ def as_dict(self) -> dict: if 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 + if self.stages: body['stages'] = self.stages + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetLatestVersionsRequest: """Deserializes the GetLatestVersionsRequest from a dictionary.""" @@ -1300,6 +1648,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetLatestVersionsResponse: """Deserializes the GetLatestVersionsResponse from a dictionary.""" @@ -1321,6 +1675,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1339,6 +1700,13 @@ def as_dict(self) -> 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetModelResponse: """Deserializes the GetModelResponse from a dictionary.""" @@ -1356,6 +1724,12 @@ def as_dict(self) -> dict: if self.artifact_uri is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetModelVersionDownloadUriResponse: """Deserializes the GetModelVersionDownloadUriResponse from a dictionary.""" @@ -1372,6 +1746,12 @@ def as_dict(self) -> dict: if self.model_version: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetModelVersionResponse: """Deserializes the GetModelVersionResponse from a dictionary.""" @@ -1389,6 +1769,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetRegisteredModelPermissionLevelsResponse: """Deserializes the GetRegisteredModelPermissionLevelsResponse from a dictionary.""" @@ -1407,6 +1793,12 @@ def as_dict(self) -> dict: if self.run: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetRunResponse: """Deserializes the GetRunResponse from a dictionary.""" @@ -1444,6 +1836,16 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.enable_ssl_verification is not None: + body['enable_ssl_verification'] = self.enable_ssl_verification + if self.secret is not None: body['secret'] = self.secret + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> HttpUrlSpec: """Deserializes the HttpUrlSpec from a dictionary.""" @@ -1473,6 +1875,14 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> HttpUrlSpecWithoutSecret: """Deserializes the HttpUrlSpecWithoutSecret from a dictionary.""" @@ -1494,6 +1904,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> InputTag: """Deserializes the InputTag from a dictionary.""" @@ -1520,6 +1937,14 @@ def as_dict(self) -> dict: if self.workspace_url is not None: 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 + if self.job_id is not None: body['job_id'] = self.job_id + if self.workspace_url is not None: body['workspace_url'] = self.workspace_url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobSpec: """Deserializes the JobSpec from a dictionary.""" @@ -1545,6 +1970,13 @@ def as_dict(self) -> dict: if self.workspace_url is not None: 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 + if self.workspace_url is not None: body['workspace_url'] = self.workspace_url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> JobSpecWithoutSecret: """Deserializes the JobSpecWithoutSecret from a dictionary.""" @@ -1570,6 +2002,14 @@ def as_dict(self) -> dict: if self.root_uri is not None: 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 + if self.next_page_token is not None: body['next_page_token'] = self.next_page_token + if self.root_uri is not None: body['root_uri'] = self.root_uri + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListArtifactsResponse: """Deserializes the ListArtifactsResponse from a dictionary.""" @@ -1594,6 +2034,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1615,6 +2062,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -1637,6 +2091,13 @@ def as_dict(self) -> dict: if 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 + if self.webhooks: body['webhooks'] = self.webhooks + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListRegistryWebhooks: """Deserializes the ListRegistryWebhooks from a dictionary.""" @@ -1655,6 +2116,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListTransitionRequestsResponse: """Deserializes the ListTransitionRequestsResponse from a dictionary.""" @@ -1687,6 +2154,15 @@ def as_dict(self) -> dict: if 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 + if self.params: body['params'] = self.params + if self.run_id is not None: body['run_id'] = self.run_id + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogBatch: """Deserializes the LogBatch from a dictionary.""" @@ -1704,6 +2180,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the LogBatchResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogBatchResponse: """Deserializes the LogBatchResponse from a dictionary.""" @@ -1725,6 +2206,13 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + if self.run_id is not None: body['run_id'] = self.run_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogInputs: """Deserializes the LogInputs from a dictionary.""" @@ -1739,6 +2227,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the LogInputsResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogInputsResponse: """Deserializes the LogInputsResponse from a dictionary.""" @@ -1777,6 +2270,17 @@ def as_dict(self) -> dict: if self.value is not None: 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.key is not None: body['key'] = self.key + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_uuid is not None: body['run_uuid'] = self.run_uuid + if self.step is not None: body['step'] = self.step + if self.timestamp is not None: body['timestamp'] = self.timestamp + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogMetric: """Deserializes the LogMetric from a dictionary.""" @@ -1796,6 +2300,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the LogMetricResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogMetricResponse: """Deserializes the LogMetricResponse from a dictionary.""" @@ -1817,6 +2326,13 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + if self.run_id is not None: body['run_id'] = self.run_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogModel: """Deserializes the LogModel from a dictionary.""" @@ -1831,6 +2347,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the LogModelResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogModelResponse: """Deserializes the LogModelResponse from a dictionary.""" @@ -1861,6 +2382,15 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_uuid is not None: body['run_uuid'] = self.run_uuid + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogParam: """Deserializes the LogParam from a dictionary.""" @@ -1878,6 +2408,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the LogParamResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LogParamResponse: """Deserializes the LogParamResponse from a dictionary.""" @@ -1907,6 +2442,15 @@ def as_dict(self) -> dict: if self.value is not None: 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.key is not None: body['key'] = self.key + if self.step is not None: body['step'] = self.step + if self.timestamp is not None: body['timestamp'] = self.timestamp + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Metric: """Deserializes the Metric from a dictionary.""" @@ -1953,6 +2497,19 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.description is not None: body['description'] = self.description + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.latest_versions: body['latest_versions'] = self.latest_versions + if self.name is not None: body['name'] = self.name + if self.tags: body['tags'] = self.tags + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Model: """Deserializes the Model from a dictionary.""" @@ -2010,6 +2567,21 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.description is not None: body['description'] = self.description + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.latest_versions: body['latest_versions'] = self.latest_versions + if self.name is not None: body['name'] = self.name + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.tags: body['tags'] = self.tags + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelDatabricks: """Deserializes the ModelDatabricks from a dictionary.""" @@ -2039,6 +2611,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelTag: """Deserializes the ModelTag from a dictionary.""" @@ -2106,6 +2685,25 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.current_stage is not None: body['current_stage'] = self.current_stage + if self.description is not None: body['description'] = self.description + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.name is not None: body['name'] = self.name + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_link is not None: body['run_link'] = self.run_link + if self.source is not None: body['source'] = self.source + if self.status is not None: body['status'] = self.status + if self.status_message is not None: body['status_message'] = self.status_message + if self.tags: body['tags'] = self.tags + if self.user_id is not None: body['user_id'] = self.user_id + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelVersion: """Deserializes the ModelVersion from a dictionary.""" @@ -2205,6 +2803,26 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.current_stage is not None: body['current_stage'] = self.current_stage + if self.description is not None: body['description'] = self.description + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.name is not None: body['name'] = self.name + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_link is not None: body['run_link'] = self.run_link + if self.source is not None: body['source'] = self.source + if self.status is not None: body['status'] = self.status + if self.status_message is not None: body['status_message'] = self.status_message + if self.tags: body['tags'] = self.tags + if self.user_id is not None: body['user_id'] = self.user_id + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelVersionDatabricks: """Deserializes the ModelVersionDatabricks from a dictionary.""" @@ -2247,6 +2865,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelVersionTag: """Deserializes the ModelVersionTag from a dictionary.""" @@ -2261,8 +2886,15 @@ class Param: value: Optional[str] = None """Value associated with this param.""" - def as_dict(self) -> dict: - """Serializes the Param into a dictionary suitable for use as a JSON request body.""" + 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 + if self.value is not None: 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 if self.value is not None: body['value'] = self.value @@ -2309,6 +2941,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegisteredModelAccessControlRequest: """Deserializes the RegisteredModelAccessControlRequest from a dictionary.""" @@ -2346,6 +2988,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegisteredModelAccessControlResponse: """Deserializes the RegisteredModelAccessControlResponse from a dictionary.""" @@ -2373,6 +3026,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegisteredModelPermission: """Deserializes the RegisteredModelPermission from a dictionary.""" @@ -2408,6 +3069,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegisteredModelPermissions: """Deserializes the RegisteredModelPermissions from a dictionary.""" @@ -2431,6 +3100,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegisteredModelPermissionsDescription: """Deserializes the RegisteredModelPermissionsDescription from a dictionary.""" @@ -2453,6 +3129,13 @@ def as_dict(self) -> dict: if self.registered_model_id is not None: 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 + if self.registered_model_id is not None: 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.""" @@ -2536,6 +3219,21 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.description is not None: body['description'] = self.description + if self.events: body['events'] = self.events + if self.http_url_spec: body['http_url_spec'] = self.http_url_spec + if self.id is not None: body['id'] = self.id + if 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 + if self.model_name is not None: body['model_name'] = self.model_name + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RegistryWebhook: """Deserializes the RegistryWebhook from a dictionary.""" @@ -2611,6 +3309,15 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.name is not None: body['name'] = self.name + if self.stage is not None: body['stage'] = self.stage + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RejectTransitionRequest: """Deserializes the RejectTransitionRequest from a dictionary.""" @@ -2631,6 +3338,12 @@ def as_dict(self) -> dict: if self.activity: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RejectTransitionRequestResponse: """Deserializes the RejectTransitionRequestResponse from a dictionary.""" @@ -2652,6 +3365,13 @@ def as_dict(self) -> dict: if self.new_name is not None: 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 + if self.new_name is not None: body['new_name'] = self.new_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RenameModelRequest: """Deserializes the RenameModelRequest from a dictionary.""" @@ -2668,6 +3388,12 @@ def as_dict(self) -> dict: if self.registered_model: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RenameModelResponse: """Deserializes the RenameModelResponse from a dictionary.""" @@ -2685,6 +3411,12 @@ def as_dict(self) -> dict: if self.experiment_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestoreExperiment: """Deserializes the RestoreExperiment from a dictionary.""" @@ -2699,6 +3431,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the RestoreExperimentResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestoreExperimentResponse: """Deserializes the RestoreExperimentResponse from a dictionary.""" @@ -2716,6 +3453,12 @@ def as_dict(self) -> dict: if self.run_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestoreRun: """Deserializes the RestoreRun from a dictionary.""" @@ -2730,6 +3473,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the RestoreRunResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestoreRunResponse: """Deserializes the RestoreRunResponse from a dictionary.""" @@ -2757,6 +3505,14 @@ def as_dict(self) -> dict: if self.min_timestamp_millis is not None: 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 + if self.max_runs is not None: body['max_runs'] = self.max_runs + if self.min_timestamp_millis is not None: 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.""" @@ -2776,6 +3532,12 @@ def as_dict(self) -> dict: if self.runs_restored is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestoreRunsResponse: """Deserializes the RestoreRunsResponse from a dictionary.""" @@ -2801,6 +3563,14 @@ def as_dict(self) -> dict: if self.inputs: 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 + if self.info: body['info'] = self.info + if self.inputs: body['inputs'] = self.inputs + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Run: """Deserializes the Run from a dictionary.""" @@ -2828,6 +3598,14 @@ def as_dict(self) -> dict: if 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 + if self.params: body['params'] = self.params + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunData: """Deserializes the RunData from a dictionary.""" @@ -2883,6 +3661,20 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.end_time is not None: body['end_time'] = self.end_time + if self.experiment_id is not None: body['experiment_id'] = self.experiment_id + if self.lifecycle_stage is not None: body['lifecycle_stage'] = self.lifecycle_stage + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_uuid is not None: body['run_uuid'] = self.run_uuid + if self.start_time is not None: body['start_time'] = self.start_time + if self.status is not None: body['status'] = self.status + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunInfo: """Deserializes the RunInfo from a dictionary.""" @@ -2918,6 +3710,12 @@ def as_dict(self) -> dict: if self.dataset_inputs: body['dataset_inputs'] = [v.as_dict() for v in self.dataset_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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunInputs: """Deserializes the RunInputs from a dictionary.""" @@ -2939,6 +3737,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RunTag: """Deserializes the RunTag from a dictionary.""" @@ -2975,6 +3780,16 @@ def as_dict(self) -> dict: if self.view_type is not None: 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 + if self.max_results is not None: body['max_results'] = self.max_results + if self.order_by: body['order_by'] = self.order_by + if self.page_token is not None: body['page_token'] = self.page_token + if self.view_type is not None: body['view_type'] = self.view_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SearchExperiments: """Deserializes the SearchExperiments from a dictionary.""" @@ -3001,6 +3816,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3032,6 +3854,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -3054,6 +3883,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -3105,6 +3941,17 @@ def as_dict(self) -> dict: if self.run_view_type is not None: 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 + if self.filter is not None: body['filter'] = self.filter + if self.max_results is not None: body['max_results'] = self.max_results + if self.order_by: body['order_by'] = self.order_by + if self.page_token is not None: body['page_token'] = self.page_token + if self.run_view_type is not None: 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.""" @@ -3131,6 +3978,13 @@ def as_dict(self) -> dict: if 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 + if self.runs: body['runs'] = self.runs + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SearchRunsResponse: """Deserializes the SearchRunsResponse from a dictionary.""" @@ -3166,6 +4020,14 @@ def as_dict(self) -> dict: if self.value is not None: 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 + 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]) -> SetExperimentTag: """Deserializes the SetExperimentTag from a dictionary.""" @@ -3182,6 +4044,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the SetExperimentTagResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetExperimentTagResponse: """Deserializes the SetExperimentTagResponse from a dictionary.""" @@ -3210,6 +4077,14 @@ def as_dict(self) -> dict: if self.value is not None: 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 + 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]) -> SetModelTagRequest: """Deserializes the SetModelTagRequest from a dictionary.""" @@ -3224,6 +4099,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the SetModelTagResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetModelTagResponse: """Deserializes the SetModelTagResponse from a dictionary.""" @@ -3256,6 +4136,15 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.name is not None: body['name'] = self.name + if self.value is not None: body['value'] = self.value + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetModelVersionTagRequest: """Deserializes the SetModelVersionTagRequest from a dictionary.""" @@ -3273,6 +4162,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the SetModelVersionTagResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetModelVersionTagResponse: """Deserializes the SetModelVersionTagResponse from a dictionary.""" @@ -3305,6 +4199,15 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_uuid is not None: body['run_uuid'] = self.run_uuid + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetTag: """Deserializes the SetTag from a dictionary.""" @@ -3322,6 +4225,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the SetTagResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetTagResponse: """Deserializes the SetTagResponse from a dictionary.""" @@ -3375,6 +4283,13 @@ def as_dict(self) -> dict: if self.status_code is not None: 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 + if self.status_code is not None: body['status_code'] = self.status_code + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TestRegistryWebhook: """Deserializes the TestRegistryWebhook from a dictionary.""" @@ -3397,6 +4312,13 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TestRegistryWebhookRequest: """Deserializes the TestRegistryWebhookRequest from a dictionary.""" @@ -3414,6 +4336,12 @@ def as_dict(self) -> dict: if self.webhook: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TestRegistryWebhookResponse: """Deserializes the TestRegistryWebhookResponse from a dictionary.""" @@ -3456,6 +4384,17 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.name is not None: body['name'] = self.name + if self.stage is not None: body['stage'] = self.stage + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TransitionModelVersionStageDatabricks: """Deserializes the TransitionModelVersionStageDatabricks from a dictionary.""" @@ -3503,6 +4442,16 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp + if self.to_stage is not None: body['to_stage'] = self.to_stage + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TransitionRequest: """Deserializes the TransitionRequest from a dictionary.""" @@ -3523,6 +4472,12 @@ def as_dict(self) -> dict: if self.model_version: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TransitionStageResponse: """Deserializes the TransitionStageResponse from a dictionary.""" @@ -3544,6 +4499,13 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateComment: """Deserializes the UpdateComment from a dictionary.""" @@ -3561,6 +4523,12 @@ def as_dict(self) -> dict: if self.comment: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateCommentResponse: """Deserializes the UpdateCommentResponse from a dictionary.""" @@ -3582,6 +4550,13 @@ def as_dict(self) -> dict: if self.new_name is not None: 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 + if self.new_name is not None: body['new_name'] = self.new_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateExperiment: """Deserializes the UpdateExperiment from a dictionary.""" @@ -3596,6 +4571,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateExperimentResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateExperimentResponse: """Deserializes the UpdateExperimentResponse from a dictionary.""" @@ -3617,6 +4597,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateModelRequest: """Deserializes the UpdateModelRequest from a dictionary.""" @@ -3631,6 +4618,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateModelResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateModelResponse: """Deserializes the UpdateModelResponse from a dictionary.""" @@ -3656,6 +4648,14 @@ def as_dict(self) -> dict: if self.version is not None: 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 + if self.name is not None: body['name'] = self.name + if self.version is not None: body['version'] = self.version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateModelVersionRequest: """Deserializes the UpdateModelVersionRequest from a dictionary.""" @@ -3672,6 +4672,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateModelVersionResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateModelVersionResponse: """Deserializes the UpdateModelVersionResponse from a dictionary.""" @@ -3740,6 +4745,17 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.events: body['events'] = self.events + if self.http_url_spec: body['http_url_spec'] = self.http_url_spec + if self.id is not None: body['id'] = self.id + if self.job_spec: body['job_spec'] = self.job_spec + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateRegistryWebhook: """Deserializes the UpdateRegistryWebhook from a dictionary.""" @@ -3775,6 +4791,15 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.run_id is not None: body['run_id'] = self.run_id + if self.run_uuid is not None: body['run_uuid'] = self.run_uuid + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateRun: """Deserializes the UpdateRun from a dictionary.""" @@ -3795,6 +4820,12 @@ def as_dict(self) -> dict: if self.run_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateRunResponse: """Deserializes the UpdateRunResponse from a dictionary.""" @@ -3819,6 +4850,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateWebhookResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateWebhookResponse: """Deserializes the UpdateWebhookResponse from a dictionary.""" diff --git a/databricks/sdk/service/oauth2.py b/databricks/sdk/service/oauth2.py index 7bfc8fe1a..11a83b3ab 100755 --- a/databricks/sdk/service/oauth2.py +++ b/databricks/sdk/service/oauth2.py @@ -41,6 +41,16 @@ def as_dict(self) -> dict: if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict() 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 + if self.name is not None: body['name'] = self.name + if self.redirect_urls: body['redirect_urls'] = self.redirect_urls + if self.scopes: body['scopes'] = self.scopes + if self.token_access_policy: body['token_access_policy'] = self.token_access_policy + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCustomAppIntegration: """Deserializes the CreateCustomAppIntegration from a dictionary.""" @@ -71,6 +81,14 @@ def as_dict(self) -> dict: if self.integration_id is not None: 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 + if self.client_secret is not None: body['client_secret'] = self.client_secret + if self.integration_id is not None: body['integration_id'] = self.integration_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCustomAppIntegrationOutput: """Deserializes the CreateCustomAppIntegrationOutput from a dictionary.""" @@ -94,6 +112,13 @@ def as_dict(self) -> dict: if self.token_access_policy: 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 + if 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.""" @@ -112,6 +137,12 @@ def as_dict(self) -> dict: if self.integration_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePublishedAppIntegrationOutput: """Deserializes the CreatePublishedAppIntegrationOutput from a dictionary.""" @@ -149,6 +180,17 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if self.id is not None: body['id'] = self.id + if self.secret is not None: body['secret'] = self.secret + if self.secret_hash is not None: body['secret_hash'] = self.secret_hash + if self.status is not None: body['status'] = self.status + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateServicePrincipalSecretResponse: """Deserializes the CreateServicePrincipalSecretResponse from a dictionary.""" @@ -175,6 +217,13 @@ def as_dict(self) -> dict: if self.endpoint_url is not None: 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 + if self.endpoint_url is not None: body['endpoint_url'] = self.endpoint_url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DataPlaneInfo: """Deserializes the DataPlaneInfo from a dictionary.""" @@ -190,6 +239,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteCustomAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteCustomAppIntegrationOutput: """Deserializes the DeleteCustomAppIntegrationOutput from a dictionary.""" @@ -204,6 +258,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeletePublishedAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeletePublishedAppIntegrationOutput: """Deserializes the DeletePublishedAppIntegrationOutput from a dictionary.""" @@ -218,6 +277,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -267,6 +331,21 @@ def as_dict(self) -> dict: if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict() 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 + if self.confidential is not None: body['confidential'] = self.confidential + if self.create_time is not None: body['create_time'] = self.create_time + if self.created_by is not None: body['created_by'] = self.created_by + if self.creator_username is not None: body['creator_username'] = self.creator_username + if self.integration_id is not None: body['integration_id'] = self.integration_id + if self.name is not None: body['name'] = self.name + if self.redirect_urls: body['redirect_urls'] = self.redirect_urls + if self.scopes: body['scopes'] = self.scopes + if self.token_access_policy: body['token_access_policy'] = self.token_access_policy + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetCustomAppIntegrationOutput: """Deserializes the GetCustomAppIntegrationOutput from a dictionary.""" @@ -296,6 +375,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -332,6 +418,17 @@ def as_dict(self) -> dict: if self.token_access_policy: 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 + if self.create_time is not None: body['create_time'] = self.create_time + if self.created_by is not None: body['created_by'] = self.created_by + if self.integration_id is not None: body['integration_id'] = self.integration_id + if self.name is not None: body['name'] = self.name + if 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.""" @@ -357,6 +454,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -380,6 +484,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -402,6 +513,13 @@ def as_dict(self) -> dict: if 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 + if self.secrets: body['secrets'] = self.secrets + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListServicePrincipalSecretsResponse: """Deserializes the ListServicePrincipalSecretsResponse from a dictionary.""" @@ -446,6 +564,19 @@ def as_dict(self) -> dict: if 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 + if self.client_id is not None: body['client_id'] = self.client_id + if self.description is not None: body['description'] = self.description + if self.is_confidential_client is not None: + body['is_confidential_client'] = self.is_confidential_client + if self.name is not None: body['name'] = self.name + if self.redirect_urls: body['redirect_urls'] = self.redirect_urls + if self.scopes: body['scopes'] = self.scopes + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PublishedAppOutput: """Deserializes the PublishedAppOutput from a dictionary.""" @@ -485,6 +616,16 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if self.id is not None: body['id'] = self.id + if self.secret_hash is not None: body['secret_hash'] = self.secret_hash + if self.status is not None: body['status'] = self.status + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SecretInfo: """Deserializes the SecretInfo from a dictionary.""" @@ -512,6 +653,15 @@ def as_dict(self) -> dict: 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 + if self.refresh_token_ttl_in_minutes is not None: + 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.""" @@ -537,6 +687,14 @@ def as_dict(self) -> dict: if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict() 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 + if self.redirect_urls: body['redirect_urls'] = self.redirect_urls + if self.token_access_policy: body['token_access_policy'] = self.token_access_policy + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateCustomAppIntegration: """Deserializes the UpdateCustomAppIntegration from a dictionary.""" @@ -553,6 +711,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateCustomAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateCustomAppIntegrationOutput: """Deserializes the UpdateCustomAppIntegrationOutput from a dictionary.""" @@ -573,6 +736,13 @@ def as_dict(self) -> dict: if self.token_access_policy: 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 + if 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.""" @@ -588,6 +758,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdatePublishedAppIntegrationOutput into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdatePublishedAppIntegrationOutput: """Deserializes the UpdatePublishedAppIntegrationOutput from a dictionary.""" diff --git a/databricks/sdk/service/pipelines.py b/databricks/sdk/service/pipelines.py index 137ab3c21..0ded4a83b 100755 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/service/pipelines.py @@ -133,6 +133,36 @@ def as_dict(self) -> dict: if self.trigger: 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 + if self.budget_policy_id is not None: body['budget_policy_id'] = self.budget_policy_id + if self.catalog is not None: body['catalog'] = self.catalog + if self.channel is not None: body['channel'] = self.channel + if self.clusters: body['clusters'] = self.clusters + if self.configuration: body['configuration'] = self.configuration + if self.continuous is not None: body['continuous'] = self.continuous + if self.deployment: body['deployment'] = self.deployment + if self.development is not None: body['development'] = self.development + if self.dry_run is not None: body['dry_run'] = self.dry_run + if self.edition is not None: body['edition'] = self.edition + if self.filters: body['filters'] = self.filters + if self.gateway_definition: body['gateway_definition'] = self.gateway_definition + if self.id is not None: body['id'] = self.id + if self.ingestion_definition: body['ingestion_definition'] = self.ingestion_definition + if self.libraries: body['libraries'] = self.libraries + if self.name is not None: body['name'] = self.name + if self.notifications: body['notifications'] = self.notifications + if self.photon is not None: body['photon'] = self.photon + if self.restart_window: body['restart_window'] = self.restart_window + if self.schema is not None: body['schema'] = self.schema + if self.serverless is not None: body['serverless'] = self.serverless + if self.storage is not None: body['storage'] = self.storage + if self.target is not None: body['target'] = self.target + if self.trigger: body['trigger'] = self.trigger + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePipeline: """Deserializes the CreatePipeline from a dictionary.""" @@ -178,6 +208,13 @@ def as_dict(self) -> dict: if self.pipeline_id is not None: 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 + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePipelineResponse: """Deserializes the CreatePipelineResponse from a dictionary.""" @@ -198,6 +235,13 @@ def as_dict(self) -> dict: if self.timezone_id is not None: 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 + if self.timezone_id is not None: body['timezone_id'] = self.timezone_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CronTrigger: """Deserializes the CronTrigger from a dictionary.""" @@ -220,6 +264,13 @@ def as_dict(self) -> dict: if self.seq_no is not None: 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 + if self.seq_no is not None: body['seq_no'] = self.seq_no + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DataPlaneId: """Deserializes the DataPlaneId from a dictionary.""" @@ -234,6 +285,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeletePipelineResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeletePipelineResponse: """Deserializes the DeletePipelineResponse from a dictionary.""" @@ -367,6 +423,38 @@ def as_dict(self) -> dict: if self.trigger: 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 + if self.budget_policy_id is not None: body['budget_policy_id'] = self.budget_policy_id + if self.catalog is not None: body['catalog'] = self.catalog + if self.channel is not None: body['channel'] = self.channel + if self.clusters: body['clusters'] = self.clusters + if self.configuration: body['configuration'] = self.configuration + if self.continuous is not None: body['continuous'] = self.continuous + if self.deployment: body['deployment'] = self.deployment + if self.development is not None: body['development'] = self.development + if self.edition is not None: body['edition'] = self.edition + if self.expected_last_modified is not None: + body['expected_last_modified'] = self.expected_last_modified + if self.filters: body['filters'] = self.filters + if self.gateway_definition: body['gateway_definition'] = self.gateway_definition + if self.id is not None: body['id'] = self.id + if self.ingestion_definition: body['ingestion_definition'] = self.ingestion_definition + if self.libraries: body['libraries'] = self.libraries + if self.name is not None: body['name'] = self.name + if self.notifications: body['notifications'] = self.notifications + if self.photon is not None: body['photon'] = self.photon + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + if self.restart_window: body['restart_window'] = self.restart_window + if self.schema is not None: body['schema'] = self.schema + if self.serverless is not None: body['serverless'] = self.serverless + if self.storage is not None: body['storage'] = self.storage + if self.target is not None: body['target'] = self.target + if self.trigger: body['trigger'] = self.trigger + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditPipeline: """Deserializes the EditPipeline from a dictionary.""" @@ -406,6 +494,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the EditPipelineResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditPipelineResponse: """Deserializes the EditPipelineResponse from a dictionary.""" @@ -427,6 +520,13 @@ def as_dict(self) -> dict: if self.fatal is not None: 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 + if self.fatal is not None: body['fatal'] = self.fatal + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ErrorDetail: """Deserializes the ErrorDetail from a dictionary.""" @@ -454,6 +554,12 @@ def as_dict(self) -> dict: if self.path is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FileLibrary: """Deserializes the FileLibrary from a dictionary.""" @@ -475,6 +581,13 @@ def as_dict(self) -> dict: if 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 + if self.include: body['include'] = self.include + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Filters: """Deserializes the Filters from a dictionary.""" @@ -492,6 +605,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetPipelinePermissionLevelsResponse: """Deserializes the GetPipelinePermissionLevelsResponse from a dictionary.""" @@ -554,6 +673,24 @@ def as_dict(self) -> dict: if self.state is not None: 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 + if self.cluster_id is not None: body['cluster_id'] = self.cluster_id + if self.creator_user_name is not None: 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 + if self.health is not None: body['health'] = self.health + if self.last_modified is not None: body['last_modified'] = self.last_modified + if self.latest_updates: body['latest_updates'] = self.latest_updates + if self.name is not None: body['name'] = self.name + if self.pipeline_id is not None: 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 + if self.spec: body['spec'] = self.spec + if self.state is not None: body['state'] = self.state + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetPipelineResponse: """Deserializes the GetPipelineResponse from a dictionary.""" @@ -589,6 +726,12 @@ def as_dict(self) -> dict: if self.update: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetUpdateResponse: """Deserializes the GetUpdateResponse from a dictionary.""" @@ -614,6 +757,14 @@ def as_dict(self) -> dict: if self.table: 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 + if self.schema: body['schema'] = self.schema + if self.table: body['table'] = self.table + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> IngestionConfig: """Deserializes the IngestionConfig from a dictionary.""" @@ -655,6 +806,18 @@ def as_dict(self) -> dict: 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 + if self.connection_name is not None: body['connection_name'] = self.connection_name + if self.gateway_storage_catalog is not None: + body['gateway_storage_catalog'] = self.gateway_storage_catalog + if self.gateway_storage_name is not None: body['gateway_storage_name'] = self.gateway_storage_name + if self.gateway_storage_schema is not None: + 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.""" @@ -691,6 +854,15 @@ def as_dict(self) -> dict: if self.table_configuration: 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 + if self.ingestion_gateway_id is not None: body['ingestion_gateway_id'] = self.ingestion_gateway_id + if self.objects: body['objects'] = self.objects + if 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.""" @@ -719,6 +891,14 @@ def as_dict(self) -> dict: if self.prev_page_token is not None: 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 + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListPipelineEventsResponse: """Deserializes the ListPipelineEventsResponse from a dictionary.""" @@ -742,6 +922,13 @@ def as_dict(self) -> dict: if 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 + if self.statuses: body['statuses'] = self.statuses + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListPipelinesResponse: """Deserializes the ListPipelinesResponse from a dictionary.""" @@ -768,6 +955,14 @@ def as_dict(self) -> dict: if 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 + if self.prev_page_token is not None: body['prev_page_token'] = self.prev_page_token + if self.updates: body['updates'] = self.updates + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListUpdatesResponse: """Deserializes the ListUpdatesResponse from a dictionary.""" @@ -784,6 +979,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the ManualTrigger into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ManualTrigger: """Deserializes the ManualTrigger from a dictionary.""" @@ -809,6 +1009,12 @@ def as_dict(self) -> dict: if self.path is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NotebookLibrary: """Deserializes the NotebookLibrary from a dictionary.""" @@ -835,6 +1041,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -917,6 +1130,28 @@ def as_dict(self) -> dict: if self.update_id is not None: 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 + if self.cloud is not None: body['cloud'] = self.cloud + if self.cluster_id is not None: body['cluster_id'] = self.cluster_id + if self.dataset_name is not None: body['dataset_name'] = self.dataset_name + if self.flow_id is not None: body['flow_id'] = self.flow_id + if self.flow_name is not None: body['flow_name'] = self.flow_name + if self.host is not None: body['host'] = self.host + if self.maintenance_id is not None: body['maintenance_id'] = self.maintenance_id + if self.materialization_name is not None: body['materialization_name'] = self.materialization_name + if self.org_id is not None: body['org_id'] = self.org_id + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + if self.pipeline_name is not None: body['pipeline_name'] = self.pipeline_name + if self.region is not None: body['region'] = self.region + if self.request_id is not None: body['request_id'] = self.request_id + if self.table_id is not None: body['table_id'] = self.table_id + if self.uc_resource_id is not None: body['uc_resource_id'] = self.uc_resource_id + if self.update_id is not None: body['update_id'] = self.update_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Origin: """Deserializes the Origin from a dictionary.""" @@ -963,6 +1198,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineAccessControlRequest: """Deserializes the PipelineAccessControlRequest from a dictionary.""" @@ -1000,6 +1245,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineAccessControlResponse: """Deserializes the PipelineAccessControlResponse from a dictionary.""" @@ -1139,6 +1395,33 @@ def as_dict(self) -> dict: if 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 + if self.autoscale: body['autoscale'] = self.autoscale + 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.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 + if self.driver_node_type_id is not None: 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 + 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.label is not None: body['label'] = self.label + 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.spark_conf: body['spark_conf'] = self.spark_conf + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineCluster: """Deserializes the PipelineCluster from a dictionary.""" @@ -1187,6 +1470,14 @@ def as_dict(self) -> dict: if self.mode is not None: 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 + if self.min_workers is not None: body['min_workers'] = self.min_workers + if self.mode is not None: body['mode'] = self.mode + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineClusterAutoscale: """Deserializes the PipelineClusterAutoscale from a dictionary.""" @@ -1220,6 +1511,13 @@ def as_dict(self) -> dict: if self.metadata_file_path is not None: 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 + if self.metadata_file_path is not None: 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.""" @@ -1270,6 +1568,20 @@ def as_dict(self) -> dict: if self.timestamp is not None: 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 + if self.event_type is not None: body['event_type'] = self.event_type + if self.id is not None: body['id'] = self.id + if self.level is not None: body['level'] = self.level + if self.maturity_level is not None: body['maturity_level'] = self.maturity_level + if self.message is not None: body['message'] = self.message + if self.origin: body['origin'] = self.origin + if self.sequence: body['sequence'] = self.sequence + if self.timestamp is not None: body['timestamp'] = self.timestamp + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineEvent: """Deserializes the PipelineEvent from a dictionary.""" @@ -1311,6 +1623,16 @@ def as_dict(self) -> dict: if self.whl is not None: 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 + if self.jar is not None: body['jar'] = self.jar + if self.maven: body['maven'] = self.maven + if self.notebook: body['notebook'] = self.notebook + if self.whl is not None: body['whl'] = self.whl + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineLibrary: """Deserializes the PipelineLibrary from a dictionary.""" @@ -1338,6 +1660,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelinePermission: """Deserializes the PipelinePermission from a dictionary.""" @@ -1372,6 +1702,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelinePermissions: """Deserializes the PipelinePermissions from a dictionary.""" @@ -1395,6 +1733,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelinePermissionsDescription: """Deserializes the PipelinePermissionsDescription from a dictionary.""" @@ -1417,6 +1762,13 @@ def as_dict(self) -> dict: if self.pipeline_id is not None: 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 + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelinePermissionsRequest: """Deserializes the PipelinePermissionsRequest from a dictionary.""" @@ -1530,6 +1882,34 @@ def as_dict(self) -> dict: if self.trigger: 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 + if self.catalog is not None: body['catalog'] = self.catalog + if self.channel is not None: body['channel'] = self.channel + if self.clusters: body['clusters'] = self.clusters + if self.configuration: body['configuration'] = self.configuration + if self.continuous is not None: body['continuous'] = self.continuous + if self.deployment: body['deployment'] = self.deployment + if self.development is not None: body['development'] = self.development + if self.edition is not None: body['edition'] = self.edition + if self.filters: body['filters'] = self.filters + if self.gateway_definition: body['gateway_definition'] = self.gateway_definition + if self.id is not None: body['id'] = self.id + if self.ingestion_definition: body['ingestion_definition'] = self.ingestion_definition + if self.libraries: body['libraries'] = self.libraries + if self.name is not None: body['name'] = self.name + if self.notifications: body['notifications'] = self.notifications + if self.photon is not None: body['photon'] = self.photon + if self.restart_window: body['restart_window'] = self.restart_window + if self.schema is not None: body['schema'] = self.schema + if self.serverless is not None: body['serverless'] = self.serverless + if self.storage is not None: body['storage'] = self.storage + if self.target is not None: body['target'] = self.target + if self.trigger: body['trigger'] = self.trigger + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineSpec: """Deserializes the PipelineSpec from a dictionary.""" @@ -1612,6 +1992,19 @@ def as_dict(self) -> dict: if self.state is not None: 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 + if self.creator_user_name is not None: body['creator_user_name'] = self.creator_user_name + if self.health is not None: body['health'] = self.health + if self.latest_updates: body['latest_updates'] = self.latest_updates + if self.name is not None: body['name'] = self.name + if self.pipeline_id is not None: 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 + if self.state is not None: body['state'] = self.state + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineStateInfo: """Deserializes the PipelineStateInfo from a dictionary.""" @@ -1645,6 +2038,13 @@ def as_dict(self) -> dict: if self.manual: 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 + if self.manual: body['manual'] = self.manual + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PipelineTrigger: """Deserializes the PipelineTrigger from a dictionary.""" @@ -1679,6 +2079,16 @@ def as_dict(self) -> dict: if self.table_configuration: 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 + if self.destination_schema is not None: body['destination_schema'] = self.destination_schema + if self.destination_table is not None: body['destination_table'] = self.destination_table + if self.source_url is not None: body['source_url'] = self.source_url + if 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.""" @@ -1712,6 +2122,14 @@ def as_dict(self) -> dict: if self.time_zone_id is not None: 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 is not None: body['days_of_week'] = self.days_of_week + if self.start_hour is not None: body['start_hour'] = self.start_hour + if self.time_zone_id is not None: 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.""" @@ -1764,6 +2182,16 @@ def as_dict(self) -> dict: if self.table_configuration: 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 + if self.destination_schema is not None: body['destination_schema'] = self.destination_schema + if self.source_catalog is not None: body['source_catalog'] = self.source_catalog + if self.source_schema is not None: body['source_schema'] = self.source_schema + if 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.""" @@ -1789,6 +2217,13 @@ def as_dict(self) -> dict: if self.data_plane_id: 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 + if 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.""" @@ -1815,6 +2250,14 @@ def as_dict(self) -> dict: if 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 + if self.message is not None: body['message'] = self.message + if self.stack: body['stack'] = self.stack + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SerializedException: """Deserializes the SerializedException from a dictionary.""" @@ -1846,6 +2289,15 @@ def as_dict(self) -> dict: if self.method_name is not None: 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 + if self.file_name is not None: body['file_name'] = self.file_name + if self.line_number is not None: body['line_number'] = self.line_number + if self.method_name is not None: body['method_name'] = self.method_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StackFrame: """Deserializes the StackFrame from a dictionary.""" @@ -1890,6 +2342,17 @@ def as_dict(self) -> dict: if self.validate_only is not None: 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 + if self.full_refresh is not None: body['full_refresh'] = self.full_refresh + if 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 + if self.refresh_selection: body['refresh_selection'] = self.refresh_selection + if self.validate_only is not None: body['validate_only'] = self.validate_only + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StartUpdate: """Deserializes the StartUpdate from a dictionary.""" @@ -1921,6 +2384,12 @@ def as_dict(self) -> dict: if self.update_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StartUpdateResponse: """Deserializes the StartUpdateResponse from a dictionary.""" @@ -1935,6 +2404,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the StopPipelineResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StopPipelineResponse: """Deserializes the StopPipelineResponse from a dictionary.""" @@ -1978,6 +2452,18 @@ def as_dict(self) -> dict: if self.table_configuration: 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 + if self.destination_schema is not None: body['destination_schema'] = self.destination_schema + if self.destination_table is not None: body['destination_table'] = self.destination_table + if self.source_catalog is not None: body['source_catalog'] = self.source_catalog + if self.source_schema is not None: body['source_schema'] = self.source_schema + if self.source_table is not None: body['source_table'] = self.source_table + if 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.""" @@ -2016,6 +2502,16 @@ def as_dict(self) -> dict: if 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 + if self.salesforce_include_formula_fields is not None: + body['salesforce_include_formula_fields'] = self.salesforce_include_formula_fields + if self.scd_type is not None: body['scd_type'] = self.scd_type + if 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.""" @@ -2090,6 +2586,22 @@ def as_dict(self) -> dict: if self.validate_only is not None: 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 + if self.cluster_id is not None: body['cluster_id'] = self.cluster_id + if self.config: body['config'] = self.config + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.full_refresh is not None: body['full_refresh'] = self.full_refresh + if 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 + if self.refresh_selection: body['refresh_selection'] = self.refresh_selection + if self.state is not None: body['state'] = self.state + if self.update_id is not None: body['update_id'] = self.update_id + if self.validate_only is not None: body['validate_only'] = self.validate_only + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateInfo: """Deserializes the UpdateInfo from a dictionary.""" @@ -2149,6 +2661,14 @@ def as_dict(self) -> dict: if self.update_id is not None: 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 + if self.state is not None: body['state'] = self.state + if self.update_id is not None: body['update_id'] = self.update_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateStateInfo: """Deserializes the UpdateStateInfo from a dictionary.""" diff --git a/databricks/sdk/service/provisioning.py b/databricks/sdk/service/provisioning.py index d108f7984..c54120ad8 100755 --- a/databricks/sdk/service/provisioning.py +++ b/databricks/sdk/service/provisioning.py @@ -28,6 +28,12 @@ def as_dict(self) -> dict: if self.sts_role: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AwsCredentials: """Deserializes the AwsCredentials from a dictionary.""" @@ -60,6 +66,16 @@ def as_dict(self) -> dict: 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 + if self.key_arn is not None: body['key_arn'] = self.key_arn + if self.key_region is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AwsKeyInfo: """Deserializes the AwsKeyInfo from a dictionary.""" @@ -84,6 +100,13 @@ def as_dict(self) -> dict: if self.subscription_id is not None: 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 + if self.subscription_id is not None: body['subscription_id'] = self.subscription_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AzureWorkspaceInfo: """Deserializes the AzureWorkspaceInfo from a dictionary.""" @@ -104,6 +127,12 @@ def as_dict(self) -> dict: if self.gcp: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CloudResourceContainer: """Deserializes the CloudResourceContainer from a dictionary.""" @@ -133,6 +162,15 @@ def as_dict(self) -> dict: 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 + if self.key_arn is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateAwsKeyInfo: """Deserializes the CreateAwsKeyInfo from a dictionary.""" @@ -151,6 +189,12 @@ def as_dict(self) -> dict: if self.sts_role: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCredentialAwsCredentials: """Deserializes the CreateCredentialAwsCredentials from a dictionary.""" @@ -171,6 +215,13 @@ def as_dict(self) -> dict: if self.credentials_name is not None: 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 + if self.credentials_name is not None: body['credentials_name'] = self.credentials_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCredentialRequest: """Deserializes the CreateCredentialRequest from a dictionary.""" @@ -189,6 +240,12 @@ def as_dict(self) -> dict: if self.role_arn is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCredentialStsRole: """Deserializes the CreateCredentialStsRole from a dictionary.""" @@ -212,6 +269,14 @@ def as_dict(self) -> dict: if 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 + if self.gcp_key_info: body['gcp_key_info'] = self.gcp_key_info + if 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.""" @@ -231,6 +296,12 @@ def as_dict(self) -> dict: if self.kms_key_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateGcpKeyInfo: """Deserializes the CreateGcpKeyInfo from a dictionary.""" @@ -275,6 +346,17 @@ def as_dict(self) -> dict: if self.vpc_id is not None: 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 + if self.network_name is not None: body['network_name'] = self.network_name + if self.security_group_ids: body['security_group_ids'] = self.security_group_ids + if self.subnet_ids: body['subnet_ids'] = self.subnet_ids + if self.vpc_endpoints: body['vpc_endpoints'] = self.vpc_endpoints + if self.vpc_id is not None: body['vpc_id'] = self.vpc_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateNetworkRequest: """Deserializes the CreateNetworkRequest from a dictionary.""" @@ -302,6 +384,14 @@ def as_dict(self) -> dict: 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 + if self.storage_configuration_name is not None: + 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.""" @@ -332,6 +422,15 @@ def as_dict(self) -> dict: if self.vpc_endpoint_name is not None: 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 + if 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 + if self.vpc_endpoint_name is not None: 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.""" @@ -479,6 +578,34 @@ def as_dict(self) -> dict: if self.workspace_name is not None: 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 + if self.cloud is not None: body['cloud'] = self.cloud + if 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 + if self.custom_tags: body['custom_tags'] = self.custom_tags + if self.deployment_name is not None: body['deployment_name'] = self.deployment_name + if 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 + if self.is_no_public_ip_enabled is not None: + body['is_no_public_ip_enabled'] = self.is_no_public_ip_enabled + if self.location is not None: 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 + if self.network_id is not None: body['network_id'] = self.network_id + if self.pricing_tier is not None: 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 + if self.storage_configuration_id is not None: + 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 + if self.workspace_name is not None: body['workspace_name'] = self.workspace_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateWorkspaceRequest: """Deserializes the CreateWorkspaceRequest from a dictionary.""" @@ -529,6 +656,16 @@ def as_dict(self) -> dict: if self.credentials_name is not None: 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 + if self.aws_credentials: body['aws_credentials'] = self.aws_credentials + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.credentials_id is not None: body['credentials_id'] = self.credentials_id + if self.credentials_name is not None: body['credentials_name'] = self.credentials_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Credential: """Deserializes the Credential from a dictionary.""" @@ -556,6 +693,12 @@ def as_dict(self) -> dict: if self.project_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CustomerFacingGcpCloudResourceContainer: """Deserializes the CustomerFacingGcpCloudResourceContainer from a dictionary.""" @@ -592,6 +735,18 @@ def as_dict(self) -> dict: if 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 + if 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 + if self.customer_managed_key_id is not None: + body['customer_managed_key_id'] = self.customer_managed_key_id + if self.gcp_key_info: body['gcp_key_info'] = self.gcp_key_info + if 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.""" @@ -611,6 +766,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -659,6 +819,16 @@ def as_dict(self) -> dict: if self.customer_name is not None: 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 + if self.authoritative_user_full_name is not None: + body['authoritative_user_full_name'] = self.authoritative_user_full_name + if self.customer_name is not None: body['customer_name'] = self.customer_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExternalCustomerInfo: """Deserializes the ExternalCustomerInfo from a dictionary.""" @@ -678,6 +848,12 @@ def as_dict(self) -> dict: if self.kms_key_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GcpKeyInfo: """Deserializes the GcpKeyInfo from a dictionary.""" @@ -727,6 +903,16 @@ def as_dict(self) -> dict: if self.subnet_cidr is not None: 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 + if self.gke_cluster_service_ip_range is not None: + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GcpManagedNetworkConfig: """Deserializes the GcpManagedNetworkConfig from a dictionary.""" @@ -772,6 +958,17 @@ def as_dict(self) -> dict: if self.vpc_id is not None: 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 + if self.pod_ip_range_name is not None: 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 + if self.subnet_id is not None: body['subnet_id'] = self.subnet_id + if self.subnet_region is not None: body['subnet_region'] = self.subnet_region + if self.vpc_id is not None: body['vpc_id'] = self.vpc_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GcpNetworkInfo: """Deserializes the GcpNetworkInfo from a dictionary.""" @@ -812,6 +1009,16 @@ def as_dict(self) -> dict: if self.service_attachment_id is not None: 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 + if self.project_id is not None: body['project_id'] = self.project_id + if self.psc_connection_id is not None: body['psc_connection_id'] = self.psc_connection_id + if self.psc_endpoint_name is not None: body['psc_endpoint_name'] = self.psc_endpoint_name + if self.service_attachment_id is not None: 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.""" @@ -848,6 +1055,13 @@ def as_dict(self) -> dict: if self.master_ip_range is not None: 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 + if self.master_ip_range is not None: 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.""" @@ -940,6 +1154,24 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.error_messages: body['error_messages'] = self.error_messages + if 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 + if self.network_name is not None: body['network_name'] = self.network_name + if self.security_group_ids: body['security_group_ids'] = self.security_group_ids + if self.subnet_ids: body['subnet_ids'] = self.subnet_ids + if self.vpc_endpoints: body['vpc_endpoints'] = self.vpc_endpoints + if self.vpc_id is not None: body['vpc_id'] = self.vpc_id + if self.vpc_status is not None: body['vpc_status'] = self.vpc_status + if self.warning_messages: body['warning_messages'] = self.warning_messages + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Network: """Deserializes the Network from a dictionary.""" @@ -974,6 +1206,13 @@ def as_dict(self) -> dict: if self.error_type is not None: 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 + if self.error_type is not None: body['error_type'] = self.error_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NetworkHealth: """Deserializes the NetworkHealth from a dictionary.""" @@ -1001,6 +1240,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -1022,6 +1268,13 @@ def as_dict(self) -> dict: if self.warning_type is not None: 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 + if self.warning_type is not None: body['warning_type'] = self.warning_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NetworkWarning: """Deserializes the NetworkWarning from a dictionary.""" @@ -1099,6 +1352,20 @@ def as_dict(self) -> dict: if self.region is not None: 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 + if 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 + if self.private_access_settings_id is not None: + 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 + if self.public_access_enabled is not None: body['public_access_enabled'] = self.public_access_enabled + if self.region is not None: body['region'] = self.region + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PrivateAccessSettings: """Deserializes the PrivateAccessSettings from a dictionary.""" @@ -1119,6 +1386,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the ReplaceResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ReplaceResponse: """Deserializes the ReplaceResponse from a dictionary.""" @@ -1138,6 +1410,12 @@ def as_dict(self) -> dict: if self.bucket_name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RootBucketInfo: """Deserializes the RootBucketInfo from a dictionary.""" @@ -1173,6 +1451,18 @@ def as_dict(self) -> dict: 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 + if self.creation_time is not None: body['creation_time'] = self.creation_time + if 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 + if self.storage_configuration_name is not None: + 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.""" @@ -1199,6 +1489,13 @@ def as_dict(self) -> dict: if self.role_arn is not None: 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 + if self.role_arn is not None: body['role_arn'] = self.role_arn + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StsRole: """Deserializes the StsRole from a dictionary.""" @@ -1213,6 +1510,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -1280,6 +1582,26 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.credentials_id is not None: body['credentials_id'] = self.credentials_id + if 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 + if self.network_connectivity_config_id is not None: + body['network_connectivity_config_id'] = self.network_connectivity_config_id + if self.network_id is not None: 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 + if self.storage_configuration_id is not None: + 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 + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateWorkspaceRequest: """Deserializes the UpdateWorkspaceRequest from a dictionary.""" @@ -1349,6 +1671,19 @@ def as_dict(self) -> dict: if self.region is not None: 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 + if self.private_access_level is not None: 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 + if self.private_access_settings_name is not None: + 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 + if self.region is not None: body['region'] = self.region + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpsertPrivateAccessSettingsRequest: """Deserializes the UpsertPrivateAccessSettingsRequest from a dictionary.""" @@ -1420,6 +1755,22 @@ def as_dict(self) -> dict: if self.vpc_endpoint_name is not None: 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 + if self.aws_account_id is not None: 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 + if self.aws_vpc_endpoint_id is not None: 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 + if self.region is not None: body['region'] = self.region + if self.state is not None: body['state'] = self.state + if self.use_case is not None: body['use_case'] = self.use_case + if self.vpc_endpoint_id is not None: body['vpc_endpoint_id'] = self.vpc_endpoint_id + if self.vpc_endpoint_name is not None: 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.""" @@ -1597,6 +1948,42 @@ def as_dict(self) -> dict: 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 + if self.aws_region is not None: body['aws_region'] = self.aws_region + if self.azure_workspace_info: body['azure_workspace_info'] = self.azure_workspace_info + if self.cloud is not None: body['cloud'] = self.cloud + if 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 + if self.credentials_id is not None: body['credentials_id'] = self.credentials_id + if self.custom_tags: body['custom_tags'] = self.custom_tags + if self.deployment_name is not None: body['deployment_name'] = self.deployment_name + if 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 + if 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 + if self.location is not None: 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 + if self.network_id is not None: body['network_id'] = self.network_id + if self.pricing_tier is not None: 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 + if self.storage_configuration_id is not None: + 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 + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + if self.workspace_name is not None: body['workspace_name'] = self.workspace_name + if self.workspace_status is not None: body['workspace_status'] = self.workspace_status + if self.workspace_status_message is not None: + 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.""" diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index b00420a08..cb7861e88 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -43,6 +43,14 @@ def as_dict(self) -> dict: 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 + if self.ai21labs_api_key_plaintext is not None: + 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.""" @@ -76,6 +84,15 @@ def as_dict(self) -> dict: if self.usage_tracking_config: 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.guardrails: body['guardrails'] = self.guardrails + if self.inference_table_config: body['inference_table_config'] = self.inference_table_config + if self.rate_limits: body['rate_limits'] = self.rate_limits + if 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.""" @@ -111,6 +128,15 @@ def as_dict(self) -> dict: if 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 + if self.pii: body['pii'] = self.pii + if self.safety is not None: body['safety'] = self.safety + if 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.""" @@ -134,6 +160,12 @@ def as_dict(self) -> dict: if self.behavior is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AiGatewayGuardrailPiiBehavior: """Deserializes the AiGatewayGuardrailPiiBehavior from a dictionary.""" @@ -165,6 +197,13 @@ def as_dict(self) -> dict: if self.output: 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 + if self.output: body['output'] = self.output + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AiGatewayGuardrails: """Deserializes the AiGatewayGuardrails from a dictionary.""" @@ -198,6 +237,15 @@ def as_dict(self) -> dict: if self.table_name_prefix is not None: 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 + if self.enabled is not None: body['enabled'] = self.enabled + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.table_name_prefix is not None: 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.""" @@ -227,6 +275,14 @@ def as_dict(self) -> dict: if self.renewal_period is not None: 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 + if self.key is not None: body['key'] = self.key + if self.renewal_period is not None: body['renewal_period'] = self.renewal_period + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AiGatewayRateLimit: """Deserializes the AiGatewayRateLimit from a dictionary.""" @@ -260,6 +316,12 @@ def as_dict(self) -> dict: if self.enabled is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AiGatewayUsageTrackingConfig: """Deserializes the AiGatewayUsageTrackingConfig from a dictionary.""" @@ -312,6 +374,19 @@ def as_dict(self) -> dict: if self.bedrock_provider is not None: body['bedrock_provider'] = self.bedrock_provider.value 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 + if self.aws_access_key_id_plaintext is not None: + 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 + if self.aws_secret_access_key is not None: 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 + if self.bedrock_provider is not None: body['bedrock_provider'] = self.bedrock_provider + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AmazonBedrockConfig: """Deserializes the AmazonBedrockConfig from a dictionary.""" @@ -353,6 +428,14 @@ def as_dict(self) -> dict: 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 + if self.anthropic_api_key_plaintext is not None: + 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.""" @@ -386,6 +469,15 @@ def as_dict(self) -> dict: if self.table_name_prefix is not None: 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 + if self.enabled is not None: body['enabled'] = self.enabled + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.table_name_prefix is not None: 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.""" @@ -421,6 +513,16 @@ def as_dict(self) -> dict: if self.table_name_prefix is not None: 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 + if self.enabled is not None: body['enabled'] = self.enabled + if self.schema_name is not None: body['schema_name'] = self.schema_name + if self.state: body['state'] = self.state + if self.table_name_prefix is not None: 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.""" @@ -441,6 +543,12 @@ def as_dict(self) -> dict: if self.payload_table: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AutoCaptureState: """Deserializes the AutoCaptureState from a dictionary.""" @@ -458,6 +566,12 @@ def as_dict(self) -> dict: if self.logs is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BuildLogsResponse: """Deserializes the BuildLogsResponse from a dictionary.""" @@ -479,6 +593,13 @@ def as_dict(self) -> dict: if self.role is not None: 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 + if self.role is not None: body['role'] = self.role + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ChatMessage: """Deserializes the ChatMessage from a dictionary.""" @@ -518,6 +639,15 @@ def as_dict(self) -> dict: 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 + if self.cohere_api_key is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CohereConfig: """Deserializes the CohereConfig from a dictionary.""" @@ -560,6 +690,17 @@ def as_dict(self) -> dict: if 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 + if self.config: body['config'] = self.config + if self.name is not None: body['name'] = self.name + if self.rate_limits: body['rate_limits'] = self.rate_limits + if self.route_optimized is not None: body['route_optimized'] = self.route_optimized + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateServingEndpoint: """Deserializes the CreateServingEndpoint from a dictionary.""" @@ -601,6 +742,16 @@ def as_dict(self) -> dict: 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 + if self.databricks_api_token_plaintext is not None: + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DatabricksModelServingConfig: """Deserializes the DatabricksModelServingConfig from a dictionary.""" @@ -625,6 +776,14 @@ def as_dict(self) -> dict: if 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 + if self.data: body['data'] = self.data + if self.index: body['index'] = self.index + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DataframeSplitInput: """Deserializes the DataframeSplitInput from a dictionary.""" @@ -639,6 +798,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -663,6 +827,14 @@ def as_dict(self) -> dict: if self.object is not None: 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 + if self.index is not None: body['index'] = self.index + if self.object is not None: body['object'] = self.object + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EmbeddingsV1ResponseEmbeddingElement: """Deserializes the EmbeddingsV1ResponseEmbeddingElement from a dictionary.""" @@ -707,6 +879,16 @@ def as_dict(self) -> dict: if self.traffic_config: 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 + if self.name is not None: body['name'] = self.name + if self.served_entities: body['served_entities'] = self.served_entities + if self.served_models: body['served_models'] = self.served_models + if 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.""" @@ -746,6 +928,16 @@ def as_dict(self) -> dict: if self.traffic_config: 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 + if self.config_version is not None: body['config_version'] = self.config_version + if self.served_entities: body['served_entities'] = self.served_entities + if self.served_models: body['served_models'] = self.served_models + if 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.""" @@ -772,6 +964,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -812,6 +1011,17 @@ def as_dict(self) -> dict: if self.traffic_config: 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 + if self.config_version is not None: body['config_version'] = self.config_version + if self.served_entities: body['served_entities'] = self.served_entities + if self.served_models: body['served_models'] = self.served_models + if self.start_time is not None: body['start_time'] = self.start_time + if 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.""" @@ -843,6 +1053,13 @@ def as_dict(self) -> dict: if self.ready is not None: 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 + if self.ready is not None: body['ready'] = self.ready + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointState: """Deserializes the EndpointState from a dictionary.""" @@ -886,6 +1103,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointTag: """Deserializes the EndpointTag from a dictionary.""" @@ -902,6 +1126,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExportMetricsResponse: """Deserializes the ExportMetricsResponse from a dictionary.""" @@ -963,6 +1193,24 @@ def as_dict(self) -> dict: if self.task is not None: 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 + if self.amazon_bedrock_config: body['amazon_bedrock_config'] = self.amazon_bedrock_config + if self.anthropic_config: body['anthropic_config'] = self.anthropic_config + if self.cohere_config: body['cohere_config'] = self.cohere_config + if 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 + if self.name is not None: body['name'] = self.name + if self.openai_config: body['openai_config'] = self.openai_config + if self.palm_config: body['palm_config'] = self.palm_config + if self.provider is not None: body['provider'] = self.provider + if self.task is not None: body['task'] = self.task + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExternalModel: """Deserializes the ExternalModel from a dictionary.""" @@ -1015,6 +1263,14 @@ def as_dict(self) -> dict: if self.total_tokens is not None: 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 + if self.prompt_tokens is not None: body['prompt_tokens'] = self.prompt_tokens + if self.total_tokens is not None: body['total_tokens'] = self.total_tokens + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExternalModelUsageElement: """Deserializes the ExternalModelUsageElement from a dictionary.""" @@ -1046,6 +1302,15 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.docs is not None: body['docs'] = self.docs + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FoundationModel: """Deserializes the FoundationModel from a dictionary.""" @@ -1065,6 +1330,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the GetOpenApiResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetOpenApiResponse: """Deserializes the GetOpenApiResponse from a dictionary.""" @@ -1082,6 +1352,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetServingEndpointPermissionLevelsResponse: """Deserializes the GetServingEndpointPermissionLevelsResponse from a dictionary.""" @@ -1125,6 +1401,15 @@ def as_dict(self) -> dict: if self.region is not None: 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 + if self.private_key_plaintext is not None: body['private_key_plaintext'] = self.private_key_plaintext + if self.project_id is not None: body['project_id'] = self.project_id + if self.region is not None: body['region'] = self.region + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GoogleCloudVertexAiConfig: """Deserializes the GoogleCloudVertexAiConfig from a dictionary.""" @@ -1145,6 +1430,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListEndpointsResponse: """Deserializes the ListEndpointsResponse from a dictionary.""" @@ -1162,6 +1453,12 @@ def as_dict(self) -> dict: if self.query_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ModelDataPlaneInfo: """Deserializes the ModelDataPlaneInfo from a dictionary.""" @@ -1243,6 +1540,28 @@ def as_dict(self) -> dict: if self.openai_organization is not None: 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 + if self.microsoft_entra_client_secret is not None: + 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 + if self.microsoft_entra_tenant_id is not None: + 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 + if self.openai_api_key is not None: 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 + if self.openai_api_type is not None: body['openai_api_type'] = self.openai_api_type + if self.openai_api_version is not None: body['openai_api_version'] = self.openai_api_version + if self.openai_deployment_name is not None: + body['openai_deployment_name'] = self.openai_deployment_name + if self.openai_organization is not None: body['openai_organization'] = self.openai_organization + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> OpenAiConfig: """Deserializes the OpenAiConfig from a dictionary.""" @@ -1280,6 +1599,14 @@ def as_dict(self) -> dict: 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 + if self.palm_api_key_plaintext is not None: + 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.""" @@ -1306,6 +1633,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.delete_tags: body['delete_tags'] = self.delete_tags + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PatchServingEndpointTags: """Deserializes the PatchServingEndpointTags from a dictionary.""" @@ -1333,6 +1668,14 @@ def as_dict(self) -> dict: if self.status_message is not None: 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 + if self.status is not None: body['status'] = self.status + if self.status_message is not None: body['status_message'] = self.status_message + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PayloadTable: """Deserializes the PayloadTable from a dictionary.""" @@ -1367,6 +1710,15 @@ def as_dict(self) -> dict: if self.usage_tracking_config: 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.guardrails: body['guardrails'] = self.guardrails + if self.inference_table_config: body['inference_table_config'] = self.inference_table_config + if self.rate_limits: body['rate_limits'] = self.rate_limits + if 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.""" @@ -1388,6 +1740,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PutResponse: """Deserializes the PutResponse from a dictionary.""" @@ -1473,6 +1831,25 @@ def as_dict(self) -> dict: if self.temperature is not None: 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 + if self.dataframe_split: body['dataframe_split'] = self.dataframe_split + if self.extra_params: body['extra_params'] = self.extra_params + if self.input: body['input'] = self.input + if self.inputs: body['inputs'] = self.inputs + if self.instances: body['instances'] = self.instances + if self.max_tokens is not None: body['max_tokens'] = self.max_tokens + if self.messages: body['messages'] = self.messages + if self.n is not None: body['n'] = self.n + if self.name is not None: body['name'] = self.name + if self.prompt: body['prompt'] = self.prompt + if self.stop: body['stop'] = self.stop + if self.stream is not None: body['stream'] = self.stream + if self.temperature is not None: body['temperature'] = self.temperature + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryEndpointInput: """Deserializes the QueryEndpointInput from a dictionary.""" @@ -1543,6 +1920,20 @@ def as_dict(self) -> dict: if self.usage: 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 + if self.created is not None: body['created'] = self.created + if self.data: body['data'] = self.data + if self.id is not None: body['id'] = self.id + if self.model is not None: body['model'] = self.model + if self.object is not None: body['object'] = self.object + if self.predictions: body['predictions'] = self.predictions + if self.served_model_name is not None: body['served-model-name'] = self.served_model_name + if self.usage: body['usage'] = self.usage + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryEndpointResponse: """Deserializes the QueryEndpointResponse from a dictionary.""" @@ -1586,6 +1977,14 @@ def as_dict(self) -> dict: if self.renewal_period is not None: 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 + if self.key is not None: body['key'] = self.key + if self.renewal_period is not None: body['renewal_period'] = self.renewal_period + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RateLimit: """Deserializes the RateLimit from a dictionary.""" @@ -1624,6 +2023,13 @@ def as_dict(self) -> dict: if self.traffic_percentage is not None: 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 + if self.traffic_percentage is not None: body['traffic_percentage'] = self.traffic_percentage + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Route: """Deserializes the Route from a dictionary.""" @@ -1709,6 +2115,24 @@ def as_dict(self) -> dict: if self.workload_type is not None: body['workload_type'] = self.workload_type 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 + if self.entity_version is not None: body['entity_version'] = self.entity_version + if self.environment_vars: body['environment_vars'] = self.environment_vars + if 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 + if self.max_provisioned_throughput is not None: + body['max_provisioned_throughput'] = self.max_provisioned_throughput + if self.min_provisioned_throughput is not None: + body['min_provisioned_throughput'] = self.min_provisioned_throughput + if self.name is not None: body['name'] = self.name + if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled + if self.workload_size is not None: body['workload_size'] = self.workload_size + if self.workload_type is not None: body['workload_type'] = self.workload_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServedEntityInput: """Deserializes the ServedEntityInput from a dictionary.""" @@ -1815,6 +2239,28 @@ def as_dict(self) -> dict: if self.workload_type is not None: body['workload_type'] = self.workload_type 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 + if self.creator is not None: body['creator'] = self.creator + if self.entity_name is not None: body['entity_name'] = self.entity_name + if self.entity_version is not None: body['entity_version'] = self.entity_version + if self.environment_vars: body['environment_vars'] = self.environment_vars + if self.external_model: body['external_model'] = self.external_model + if 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 + if self.max_provisioned_throughput is not None: + body['max_provisioned_throughput'] = self.max_provisioned_throughput + if self.min_provisioned_throughput is not None: + body['min_provisioned_throughput'] = self.min_provisioned_throughput + if self.name is not None: body['name'] = self.name + if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled + if self.state: body['state'] = self.state + if self.workload_size is not None: body['workload_size'] = self.workload_size + if self.workload_type is not None: body['workload_type'] = self.workload_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServedEntityOutput: """Deserializes the ServedEntityOutput from a dictionary.""" @@ -1868,6 +2314,16 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.entity_version is not None: body['entity_version'] = self.entity_version + if self.external_model: body['external_model'] = self.external_model + if self.foundation_model: body['foundation_model'] = self.foundation_model + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServedEntitySpec: """Deserializes the ServedEntitySpec from a dictionary.""" @@ -1943,6 +2399,23 @@ def as_dict(self) -> dict: if self.workload_type is not None: 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 + if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn + if self.max_provisioned_throughput is not None: + body['max_provisioned_throughput'] = self.max_provisioned_throughput + if self.min_provisioned_throughput is not None: + body['min_provisioned_throughput'] = self.min_provisioned_throughput + if self.model_name is not None: body['model_name'] = self.model_name + if self.model_version is not None: body['model_version'] = self.model_version + if self.name is not None: body['name'] = self.name + if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled + if self.workload_size is not None: body['workload_size'] = self.workload_size + if self.workload_type is not None: body['workload_type'] = self.workload_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServedModelInput: """Deserializes the ServedModelInput from a dictionary.""" @@ -2051,6 +2524,22 @@ def as_dict(self) -> dict: if self.workload_type is not None: body['workload_type'] = self.workload_type 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 + if self.creator is not None: body['creator'] = self.creator + if 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 + if self.model_name is not None: body['model_name'] = self.model_name + if self.model_version is not None: body['model_version'] = self.model_version + if self.name is not None: body['name'] = self.name + if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled + if self.state: body['state'] = self.state + if self.workload_size is not None: body['workload_size'] = self.workload_size + if self.workload_type is not None: body['workload_type'] = self.workload_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServedModelOutput: """Deserializes the ServedModelOutput from a dictionary.""" @@ -2087,6 +2576,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.model_version is not None: body['model_version'] = self.model_version + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServedModelSpec: """Deserializes the ServedModelSpec from a dictionary.""" @@ -2119,6 +2616,14 @@ def as_dict(self) -> dict: 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 + if self.deployment_state_message is not None: + 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.""" @@ -2155,6 +2660,12 @@ def as_dict(self) -> dict: if self.logs is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServerLogsResponse: """Deserializes the ServerLogsResponse from a dictionary.""" @@ -2211,6 +2722,22 @@ def as_dict(self) -> dict: if self.task is not None: 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 + if self.config: body['config'] = self.config + if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp + if self.creator is not None: body['creator'] = self.creator + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.name is not None: body['name'] = self.name + if self.state: body['state'] = self.state + if self.tags: body['tags'] = self.tags + if self.task is not None: body['task'] = self.task + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServingEndpoint: """Deserializes the ServingEndpoint from a dictionary.""" @@ -2250,6 +2777,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServingEndpointAccessControlRequest: """Deserializes the ServingEndpointAccessControlRequest from a dictionary.""" @@ -2287,6 +2824,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServingEndpointAccessControlResponse: """Deserializes the ServingEndpointAccessControlResponse from a dictionary.""" @@ -2367,6 +2915,27 @@ def as_dict(self) -> dict: if self.task is not None: 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 + if self.config: body['config'] = self.config + if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp + if self.creator is not None: body['creator'] = self.creator + if 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 + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.name is not None: body['name'] = self.name + if self.pending_config: body['pending_config'] = self.pending_config + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.route_optimized is not None: body['route_optimized'] = self.route_optimized + if self.state: body['state'] = self.state + if self.tags: body['tags'] = self.tags + if self.task is not None: body['task'] = self.task + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServingEndpointDetailed: """Deserializes the ServingEndpointDetailed from a dictionary.""" @@ -2412,6 +2981,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermission: """Deserializes the ServingEndpointPermission from a dictionary.""" @@ -2445,6 +3022,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermissions: """Deserializes the ServingEndpointPermissions from a dictionary.""" @@ -2468,6 +3053,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermissionsDescription: """Deserializes the ServingEndpointPermissionsDescription from a dictionary.""" @@ -2490,6 +3082,13 @@ def as_dict(self) -> dict: if self.serving_endpoint_id is not None: 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 + if self.serving_endpoint_id is not None: 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.""" @@ -2509,6 +3108,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TrafficConfig: """Deserializes the TrafficConfig from a dictionary.""" @@ -2542,6 +3147,16 @@ def as_dict(self) -> dict: if self.text is not None: 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 + if self.index is not None: body['index'] = self.index + if self.logprobs is not None: body['logprobs'] = self.logprobs + if self.message: body['message'] = self.message + if self.text is not None: body['text'] = self.text + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> V1ResponseChoiceElement: """Deserializes the V1ResponseChoiceElement from a dictionary.""" diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index d6294b261..c3fba0ab3 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -24,6 +24,12 @@ def as_dict(self) -> dict: if self.access_policy_type is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingAccessPolicy: """Deserializes the AibiDashboardEmbeddingAccessPolicy from a dictionary.""" @@ -67,6 +73,15 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingAccessPolicySetting: """Deserializes the AibiDashboardEmbeddingAccessPolicySetting from a dictionary.""" @@ -86,6 +101,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingApprovedDomains: """Deserializes the AibiDashboardEmbeddingApprovedDomains from a dictionary.""" @@ -121,6 +142,15 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AibiDashboardEmbeddingApprovedDomainsSetting: """Deserializes the AibiDashboardEmbeddingApprovedDomainsSetting from a dictionary.""" @@ -157,6 +187,15 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AutomaticClusterUpdateSetting: """Deserializes the AutomaticClusterUpdateSetting from a dictionary.""" @@ -176,6 +215,12 @@ def as_dict(self) -> dict: if self.value is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> BooleanMessage: """Deserializes the BooleanMessage from a dictionary.""" @@ -210,6 +255,17 @@ def as_dict(self) -> dict: 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 + if self.enabled is not None: body['enabled'] = self.enabled + if self.enablement_details: body['enablement_details'] = self.enablement_details + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessage: """Deserializes the ClusterAutoRestartMessage from a dictionary.""" @@ -251,6 +307,17 @@ def as_dict(self) -> dict: 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 + if self.unavailable_for_disabled_entitlement is not None: + 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessageEnablementDetails: """Deserializes the ClusterAutoRestartMessageEnablementDetails from a dictionary.""" @@ -270,6 +337,12 @@ def as_dict(self) -> 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessageMaintenanceWindow: """Deserializes the ClusterAutoRestartMessageMaintenanceWindow from a dictionary.""" @@ -304,6 +377,14 @@ def as_dict(self) -> dict: if self.window_start_time: 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 + if self.frequency is not None: body['frequency'] = self.frequency + if 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.""" @@ -338,6 +419,13 @@ def as_dict(self) -> dict: if self.minutes is not None: 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 + if self.minutes is not None: body['minutes'] = self.minutes + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ClusterAutoRestartMessageMaintenanceWindowWindowStartTime: """Deserializes the ClusterAutoRestartMessageMaintenanceWindowWindowStartTime from a dictionary.""" @@ -361,6 +449,13 @@ def as_dict(self) -> dict: if self.is_enabled is not None: 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 + if self.is_enabled is not None: body['is_enabled'] = self.is_enabled + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ComplianceSecurityProfile: """Deserializes the ComplianceSecurityProfile from a dictionary.""" @@ -398,6 +493,15 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ComplianceSecurityProfileSetting: """Deserializes the ComplianceSecurityProfileSetting from a dictionary.""" @@ -445,6 +549,16 @@ def as_dict(self) -> dict: if self.slack: 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 + if self.generic_webhook: body['generic_webhook'] = self.generic_webhook + if self.microsoft_teams: body['microsoft_teams'] = self.microsoft_teams + if self.pagerduty: body['pagerduty'] = self.pagerduty + if self.slack: body['slack'] = self.slack + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Config: """Deserializes the Config from a dictionary.""" @@ -478,6 +592,14 @@ def as_dict(self) -> dict: if self.list_type is not None: 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 + if self.label is not None: body['label'] = self.label + if self.list_type is not None: body['list_type'] = self.list_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateIpAccessList: """Deserializes the CreateIpAccessList from a dictionary.""" @@ -499,6 +621,12 @@ def as_dict(self) -> dict: if self.ip_access_list: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateIpAccessListResponse: """Deserializes the CreateIpAccessListResponse from a dictionary.""" @@ -523,6 +651,13 @@ def as_dict(self) -> dict: if self.region is not None: 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 + if self.region is not None: body['region'] = self.region + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateNetworkConnectivityConfigRequest: """Deserializes the CreateNetworkConnectivityConfigRequest from a dictionary.""" @@ -544,6 +679,13 @@ def as_dict(self) -> dict: if self.display_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateNotificationDestinationRequest: """Deserializes the CreateNotificationDestinationRequest from a dictionary.""" @@ -571,6 +713,14 @@ def as_dict(self) -> dict: if self.lifetime_seconds is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.lifetime_seconds is not None: body['lifetime_seconds'] = self.lifetime_seconds + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateOboTokenRequest: """Deserializes the CreateOboTokenRequest from a dictionary.""" @@ -595,6 +745,13 @@ def as_dict(self) -> dict: if self.token_value is not None: 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 + if self.token_value is not None: body['token_value'] = self.token_value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateOboTokenResponse: """Deserializes the CreateOboTokenResponse from a dictionary.""" @@ -622,6 +779,15 @@ def as_dict(self) -> dict: if self.resource_id is not None: 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 + if self.network_connectivity_config_id is not None: + body['network_connectivity_config_id'] = self.network_connectivity_config_id + if self.resource_id is not None: body['resource_id'] = self.resource_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreatePrivateEndpointRuleRequest: """Deserializes the CreatePrivateEndpointRuleRequest from a dictionary.""" @@ -657,6 +823,13 @@ def as_dict(self) -> dict: if self.lifetime_seconds is not None: 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 + if self.lifetime_seconds is not None: body['lifetime_seconds'] = self.lifetime_seconds + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateTokenRequest: """Deserializes the CreateTokenRequest from a dictionary.""" @@ -678,6 +851,13 @@ def as_dict(self) -> dict: if self.token_value is not None: 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 + if self.token_value is not None: body['token_value'] = self.token_value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateTokenResponse: """Deserializes the CreateTokenResponse from a dictionary.""" @@ -704,6 +884,13 @@ def as_dict(self) -> dict: if self.is_enforced is not None: 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 + if self.is_enforced is not None: body['is_enforced'] = self.is_enforced + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CspEnablementAccount: """Deserializes the CspEnablementAccount from a dictionary.""" @@ -738,6 +925,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CspEnablementAccountSetting: """Deserializes the CspEnablementAccountSetting from a dictionary.""" @@ -780,6 +975,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.namespace: body['namespace'] = self.namespace + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DefaultNamespaceSetting: """Deserializes the DefaultNamespaceSetting from a dictionary.""" @@ -788,6 +991,66 @@ def from_dict(cls, d: Dict[str, any]) -> DefaultNamespaceSetting: setting_name=d.get('setting_name', None)) +@dataclass +class DeleteAibiDashboardEmbeddingAccessPolicySettingResponse: + """The etag is returned.""" + + etag: str + """etag used for versioning. The response is at least as fresh as the eTag provided. This is used + for optimistic concurrency control as a way to help prevent simultaneous writes of a setting + overwriting each other. It is strongly suggested that systems make use of the etag in the read + -> delete pattern to perform setting deletions in order to avoid race conditions. That is, get + an etag from a GET request, and pass it with the DELETE request to identify the rule set version + you are deleting.""" + + 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 + 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 + 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)) + + +@dataclass +class DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse: + """The etag is returned.""" + + etag: str + """etag used for versioning. The response is at least as fresh as the eTag provided. This is used + for optimistic concurrency control as a way to help prevent simultaneous writes of a setting + overwriting each other. It is strongly suggested that systems make use of the etag in the read + -> delete pattern to perform setting deletions in order to avoid race conditions. That is, get + an etag from a GET request, and pass it with the DELETE request to identify the rule set version + you are deleting.""" + + 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 + 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 + 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)) + + @dataclass class DeleteDefaultNamespaceSettingResponse: """The etag is returned.""" @@ -806,6 +1069,12 @@ def as_dict(self) -> dict: if self.etag is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteDefaultNamespaceSettingResponse: """Deserializes the DeleteDefaultNamespaceSettingResponse from a dictionary.""" @@ -830,6 +1099,12 @@ def as_dict(self) -> dict: if self.etag is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteDisableLegacyAccessResponse: """Deserializes the DeleteDisableLegacyAccessResponse from a dictionary.""" @@ -854,6 +1129,12 @@ def as_dict(self) -> dict: if self.etag is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteDisableLegacyDbfsResponse: """Deserializes the DeleteDisableLegacyDbfsResponse from a dictionary.""" @@ -878,6 +1159,12 @@ def as_dict(self) -> dict: if self.etag is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteDisableLegacyFeaturesResponse: """Deserializes the DeleteDisableLegacyFeaturesResponse from a dictionary.""" @@ -892,6 +1179,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteNetworkConnectivityConfigurationResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteNetworkConnectivityConfigurationResponse: """Deserializes the DeleteNetworkConnectivityConfigurationResponse from a dictionary.""" @@ -916,6 +1208,12 @@ def as_dict(self) -> dict: if self.etag is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeletePersonalComputeSettingResponse: """Deserializes the DeletePersonalComputeSettingResponse from a dictionary.""" @@ -930,6 +1228,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -954,6 +1257,12 @@ def as_dict(self) -> dict: if self.etag is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteRestrictWorkspaceAdminsSettingResponse: """Deserializes the DeleteRestrictWorkspaceAdminsSettingResponse from a dictionary.""" @@ -995,6 +1304,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DisableLegacyAccess: """Deserializes the DisableLegacyAccess from a dictionary.""" @@ -1029,6 +1346,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DisableLegacyDbfs: """Deserializes the DisableLegacyDbfs from a dictionary.""" @@ -1064,6 +1389,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DisableLegacyFeatures: """Deserializes the DisableLegacyFeatures from a dictionary.""" @@ -1072,6 +1405,270 @@ def from_dict(cls, d: Dict[str, any]) -> DisableLegacyFeatures: setting_name=d.get('setting_name', None)) +@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 @@ -1083,6 +1680,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EmailConfig: """Deserializes the EmailConfig from a dictionary.""" @@ -1097,6 +1700,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the Empty into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Empty: """Deserializes the Empty from a dictionary.""" @@ -1115,6 +1723,12 @@ def as_dict(self) -> dict: if self.is_enabled is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnhancedSecurityMonitoring: """Deserializes the EnhancedSecurityMonitoring from a dictionary.""" @@ -1151,6 +1765,15 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnhancedSecurityMonitoringSetting: """Deserializes the EnhancedSecurityMonitoringSetting from a dictionary.""" @@ -1172,6 +1795,12 @@ def as_dict(self) -> dict: if self.is_enforced is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EsmEnablementAccount: """Deserializes the EsmEnablementAccount from a dictionary.""" @@ -1205,6 +1834,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.etag is not None: body['etag'] = self.etag + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EsmEnablementAccountSetting: """Deserializes the EsmEnablementAccountSetting from a dictionary.""" @@ -1242,6 +1879,16 @@ def as_dict(self) -> dict: if self.token_type is not None: body['tokenType'] = 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 + if self.credential_eol_time is not None: body['credentialEolTime'] = self.credential_eol_time + if self.owner_id is not None: body['ownerId'] = self.owner_id + if self.scopes: body['scopes'] = self.scopes + if self.token_type is not None: body['tokenType'] = self.token_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExchangeToken: """Deserializes the ExchangeToken from a dictionary.""" @@ -1273,6 +1920,14 @@ def as_dict(self) -> dict: if self.token_type: body['tokenType'] = [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 + if self.scopes: body['scopes'] = self.scopes + if 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.""" @@ -1293,6 +1948,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExchangeTokenResponse: """Deserializes the ExchangeTokenResponse from a dictionary.""" @@ -1312,6 +1973,12 @@ def as_dict(self) -> dict: if self.ip_access_list: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> FetchIpAccessListResponse: """Deserializes the FetchIpAccessListResponse from a dictionary.""" @@ -1349,6 +2016,17 @@ def as_dict(self) -> dict: if self.username_set is not None: 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 + if self.password_set is not None: body['password_set'] = self.password_set + if self.url is not None: body['url'] = self.url + if self.url_set is not None: body['url_set'] = self.url_set + if self.username is not None: body['username'] = self.username + if self.username_set is not None: body['username_set'] = self.username_set + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GenericWebhookConfig: """Deserializes the GenericWebhookConfig from a dictionary.""" @@ -1371,6 +2049,12 @@ def as_dict(self) -> dict: if self.ip_access_list: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetIpAccessListResponse: """Deserializes the GetIpAccessListResponse from a dictionary.""" @@ -1389,6 +2073,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetIpAccessListsResponse: """Deserializes the GetIpAccessListsResponse from a dictionary.""" @@ -1406,6 +2096,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetTokenPermissionLevelsResponse: """Deserializes the GetTokenPermissionLevelsResponse from a dictionary.""" @@ -1424,6 +2120,12 @@ def as_dict(self) -> dict: if self.token_info: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetTokenResponse: """Deserializes the GetTokenResponse from a dictionary.""" @@ -1481,6 +2183,21 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.enabled is not None: body['enabled'] = self.enabled + if self.ip_addresses: body['ip_addresses'] = self.ip_addresses + if self.label is not None: body['label'] = self.label + if self.list_id is not None: body['list_id'] = self.list_id + if self.list_type is not None: body['list_type'] = self.list_type + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> IpAccessListInfo: """Deserializes the IpAccessListInfo from a dictionary.""" @@ -1508,6 +2225,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListIpAccessListResponse: """Deserializes the ListIpAccessListResponse from a dictionary.""" @@ -1529,6 +2252,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1551,6 +2281,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -1572,6 +2309,13 @@ def as_dict(self) -> dict: if 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 + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListNotificationDestinationsResponse: """Deserializes the ListNotificationDestinationsResponse from a dictionary.""" @@ -1598,6 +2342,14 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListNotificationDestinationsResult: """Deserializes the ListNotificationDestinationsResult from a dictionary.""" @@ -1617,6 +2369,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListPublicTokensResponse: """Deserializes the ListPublicTokensResponse from a dictionary.""" @@ -1636,6 +2394,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListTokensResponse: """Deserializes the ListTokensResponse from a dictionary.""" @@ -1667,6 +2431,13 @@ def as_dict(self) -> dict: if self.url_set is not None: 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 + if self.url_set is not None: body['url_set'] = self.url_set + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MicrosoftTeamsConfig: """Deserializes the MicrosoftTeamsConfig from a dictionary.""" @@ -1688,6 +2459,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NccAwsStableIpRule: """Deserializes the NccAwsStableIpRule from a dictionary.""" @@ -1745,7 +2522,23 @@ def as_dict(self) -> dict: if self.deactivated is not None: body['deactivated'] = self.deactivated if self.deactivated_at is not None: body['deactivated_at'] = self.deactivated_at if self.endpoint_name is not None: body['endpoint_name'] = self.endpoint_name - if self.group_id is not None: body['group_id'] = self.group_id.value + if self.group_id is not None: 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 + if self.resource_id is not None: body['resource_id'] = self.resource_id + if self.rule_id is not None: body['rule_id'] = self.rule_id + if self.updated_time is not None: 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 + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.deactivated is not None: body['deactivated'] = self.deactivated + if self.deactivated_at is not None: body['deactivated_at'] = self.deactivated_at + if self.endpoint_name is not None: body['endpoint_name'] = self.endpoint_name + if self.group_id is not None: 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 if self.resource_id is not None: body['resource_id'] = self.resource_id @@ -1820,6 +2613,14 @@ def as_dict(self) -> dict: if 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 + if self.target_region is not None: body['target_region'] = self.target_region + if 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.""" @@ -1849,6 +2650,13 @@ def as_dict(self) -> dict: if self.target_rules: 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 + if 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.""" @@ -1878,6 +2686,14 @@ def as_dict(self) -> 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 + if 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.""" @@ -1900,6 +2716,13 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NccEgressTargetRules: """Deserializes the NccEgressTargetRules from a dictionary.""" @@ -1947,6 +2770,19 @@ def as_dict(self) -> dict: if self.updated_time is not None: 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 + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.egress_config: body['egress_config'] = self.egress_config + if self.name is not None: body['name'] = self.name + if self.network_connectivity_config_id is not None: + body['network_connectivity_config_id'] = self.network_connectivity_config_id + if self.region is not None: body['region'] = self.region + if self.updated_time is not None: body['updated_time'] = self.updated_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NetworkConnectivityConfiguration: """Deserializes the NetworkConnectivityConfiguration from a dictionary.""" @@ -1983,6 +2819,15 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.destination_type is not None: body['destination_type'] = self.destination_type + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NotificationDestination: """Deserializes the NotificationDestination from a dictionary.""" @@ -2007,6 +2852,13 @@ def as_dict(self) -> dict: if self.integration_key_set is not None: 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 + if self.integration_key_set is not None: 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.""" @@ -2027,6 +2879,12 @@ def as_dict(self) -> dict: if self.workspace_id is not None: body['workspaceId'] = 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PartitionId: """Deserializes the PartitionId from a dictionary.""" @@ -2048,6 +2906,12 @@ def as_dict(self) -> dict: if self.value is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PersonalComputeMessage: """Deserializes the PersonalComputeMessage from a dictionary.""" @@ -2091,6 +2955,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if self.personal_compute: body['personal_compute'] = self.personal_compute + if self.setting_name is not None: body['setting_name'] = self.setting_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PersonalComputeSetting: """Deserializes the PersonalComputeSetting from a dictionary.""" @@ -2122,6 +2994,15 @@ def as_dict(self) -> dict: if self.token_id is not None: 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 + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.expiry_time is not None: body['expiry_time'] = self.expiry_time + if self.token_id is not None: body['token_id'] = self.token_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PublicTokenInfo: """Deserializes the PublicTokenInfo from a dictionary.""" @@ -2162,6 +3043,16 @@ def as_dict(self) -> dict: if self.list_type is not None: 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 + if self.ip_access_list_id is not None: body['ip_access_list_id'] = self.ip_access_list_id + if self.ip_addresses: body['ip_addresses'] = self.ip_addresses + if self.label is not None: body['label'] = self.label + if self.list_type is not None: body['list_type'] = self.list_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ReplaceIpAccessList: """Deserializes the ReplaceIpAccessList from a dictionary.""" @@ -2180,6 +3071,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the ReplaceResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ReplaceResponse: """Deserializes the ReplaceResponse from a dictionary.""" @@ -2196,6 +3092,12 @@ def as_dict(self) -> dict: if self.status is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestrictWorkspaceAdminsMessage: """Deserializes the RestrictWorkspaceAdminsMessage from a dictionary.""" @@ -2235,6 +3137,14 @@ def as_dict(self) -> dict: if self.setting_name is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestrictWorkspaceAdminsSetting: """Deserializes the RestrictWorkspaceAdminsSetting from a dictionary.""" @@ -2255,6 +3165,12 @@ def as_dict(self) -> dict: if self.token_id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RevokeTokenRequest: """Deserializes the RevokeTokenRequest from a dictionary.""" @@ -2269,6 +3185,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the RevokeTokenResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RevokeTokenResponse: """Deserializes the RevokeTokenResponse from a dictionary.""" @@ -2283,6 +3204,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the SetStatusResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetStatusResponse: """Deserializes the SetStatusResponse from a dictionary.""" @@ -2304,6 +3230,13 @@ def as_dict(self) -> dict: if self.url_set is not None: 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 + if self.url_set is not None: body['url_set'] = self.url_set + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SlackConfig: """Deserializes the SlackConfig from a dictionary.""" @@ -2321,6 +3254,12 @@ def as_dict(self) -> dict: if self.value is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StringMessage: """Deserializes the StringMessage from a dictionary.""" @@ -2351,6 +3290,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenAccessControlRequest: """Deserializes the TokenAccessControlRequest from a dictionary.""" @@ -2388,6 +3337,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenAccessControlResponse: """Deserializes the TokenAccessControlResponse from a dictionary.""" @@ -2441,6 +3401,20 @@ def as_dict(self) -> dict: if self.workspace_id is not None: 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 + if self.created_by_id is not None: body['created_by_id'] = self.created_by_id + if self.created_by_username is not None: body['created_by_username'] = self.created_by_username + if self.creation_time is not None: body['creation_time'] = self.creation_time + if self.expiry_time is not None: body['expiry_time'] = self.expiry_time + if self.last_used_day is not None: body['last_used_day'] = self.last_used_day + if self.owner_id is not None: body['owner_id'] = self.owner_id + if self.token_id is not None: body['token_id'] = self.token_id + if self.workspace_id is not None: body['workspace_id'] = self.workspace_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenInfo: """Deserializes the TokenInfo from a dictionary.""" @@ -2472,6 +3446,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenPermission: """Deserializes the TokenPermission from a dictionary.""" @@ -2503,6 +3485,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenPermissions: """Deserializes the TokenPermissions from a dictionary.""" @@ -2525,6 +3515,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenPermissionsDescription: """Deserializes the TokenPermissionsDescription from a dictionary.""" @@ -2543,6 +3540,12 @@ def as_dict(self) -> dict: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TokenPermissionsRequest: """Deserializes the TokenPermissionsRequest from a dictionary.""" @@ -2578,6 +3581,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateAibiDashboardEmbeddingAccessPolicySettingRequest: """Deserializes the UpdateAibiDashboardEmbeddingAccessPolicySettingRequest from a dictionary.""" @@ -2608,6 +3619,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest: """Deserializes the UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest from a dictionary.""" @@ -2638,6 +3657,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateAutomaticClusterUpdateSettingRequest: """Deserializes the UpdateAutomaticClusterUpdateSettingRequest from a dictionary.""" @@ -2668,6 +3695,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateComplianceSecurityProfileSettingRequest: """Deserializes the UpdateComplianceSecurityProfileSettingRequest from a dictionary.""" @@ -2698,6 +3733,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateCspEnablementAccountSettingRequest: """Deserializes the UpdateCspEnablementAccountSettingRequest from a dictionary.""" @@ -2735,6 +3778,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateDefaultNamespaceSettingRequest: """Deserializes the UpdateDefaultNamespaceSettingRequest from a dictionary.""" @@ -2765,6 +3816,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateDisableLegacyAccessRequest: """Deserializes the UpdateDisableLegacyAccessRequest from a dictionary.""" @@ -2795,6 +3854,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateDisableLegacyDbfsRequest: """Deserializes the UpdateDisableLegacyDbfsRequest from a dictionary.""" @@ -2825,6 +3892,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateDisableLegacyFeaturesRequest: """Deserializes the UpdateDisableLegacyFeaturesRequest from a dictionary.""" @@ -2855,6 +3930,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateEnhancedSecurityMonitoringSettingRequest: """Deserializes the UpdateEnhancedSecurityMonitoringSettingRequest from a dictionary.""" @@ -2885,6 +3968,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateEsmEnablementAccountSettingRequest: """Deserializes the UpdateEsmEnablementAccountSettingRequest from a dictionary.""" @@ -2924,6 +4015,16 @@ def as_dict(self) -> dict: if self.list_type is not None: 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 + if self.ip_access_list_id is not None: body['ip_access_list_id'] = self.ip_access_list_id + if self.ip_addresses: body['ip_addresses'] = self.ip_addresses + if self.label is not None: body['label'] = self.label + if self.list_type is not None: body['list_type'] = self.list_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateIpAccessList: """Deserializes the UpdateIpAccessList from a dictionary.""" @@ -2953,6 +4054,14 @@ def as_dict(self) -> dict: if self.id is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateNotificationDestinationRequest: """Deserializes the UpdateNotificationDestinationRequest from a dictionary.""" @@ -2983,6 +4092,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdatePersonalComputeSettingRequest: """Deserializes the UpdatePersonalComputeSettingRequest from a dictionary.""" @@ -2999,6 +4116,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -3027,6 +4149,14 @@ def as_dict(self) -> dict: if self.setting: 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 + 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]) -> UpdateRestrictWorkspaceAdminsSettingRequest: """Deserializes the UpdateRestrictWorkspaceAdminsSettingRequest from a dictionary.""" @@ -3292,6 +4422,33 @@ class AibiDashboardEmbeddingAccessPolicyAPI: def __init__(self, api_client): self._api = api_client + def delete(self, + *, + etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingAccessPolicySettingResponse: + """Delete the AI/BI dashboard embedding access policy. + + Delete the AI/BI dashboard embedding access policy, reverting back to the default. + + :param etag: str (optional) + etag used for versioning. The response is at least as fresh as the eTag provided. This is used for + optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting + each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern + to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET + request, and pass it with the DELETE request to identify the rule set version you are deleting. + + :returns: :class:`DeleteAibiDashboardEmbeddingAccessPolicySettingResponse` + """ + + query = {} + if etag is not None: query['etag'] = etag + headers = {'Accept': 'application/json', } + + res = self._api.do('DELETE', + '/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default', + query=query, + headers=headers) + return DeleteAibiDashboardEmbeddingAccessPolicySettingResponse.from_dict(res) + def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingAccessPolicySetting: """Retrieve the AI/BI dashboard embedding access policy. @@ -3354,6 +4511,34 @@ class AibiDashboardEmbeddingApprovedDomainsAPI: def __init__(self, api_client): self._api = api_client + def delete(self, + *, + etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse: + """Delete AI/BI dashboard embedding approved domains. + + Delete the list of domains approved to host embedded AI/BI dashboards, reverting back to the default + empty list. + + :param etag: str (optional) + etag used for versioning. The response is at least as fresh as the eTag provided. This is used for + optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting + each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern + to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET + request, and pass it with the DELETE request to identify the rule set version you are deleting. + + :returns: :class:`DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse` + """ + + query = {} + if etag is not None: query['etag'] = etag + headers = {'Accept': 'application/json', } + + res = self._api.do('DELETE', + '/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default', + query=query, + headers=headers) + return DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse.from_dict(res) + def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingApprovedDomainsSetting: """Retrieve the list of domains approved to host embedded AI/BI dashboards. diff --git a/databricks/sdk/service/sharing.py b/databricks/sdk/service/sharing.py index 13cba2ccf..000c85e2c 100755 --- a/databricks/sdk/service/sharing.py +++ b/databricks/sdk/service/sharing.py @@ -46,6 +46,15 @@ def as_dict(self) -> dict: if self.recipient_profile_str is not None: 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 + if self.comment is not None: body['comment'] = self.comment + if self.name is not None: body['name'] = self.name + if self.recipient_profile_str is not None: 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.""" @@ -102,6 +111,21 @@ def as_dict(self) -> dict: if self.sharing_code is not None: 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 + if self.comment is not None: 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 + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + if self.ip_access_list: body['ip_access_list'] = self.ip_access_list + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.properties_kvpairs: body['properties_kvpairs'] = self.properties_kvpairs + if self.sharing_code is not None: body['sharing_code'] = self.sharing_code + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateRecipient: """Deserializes the CreateRecipient from a dictionary.""" @@ -135,6 +159,14 @@ def as_dict(self) -> dict: if self.storage_root is not None: 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 + if self.name is not None: body['name'] = self.name + if self.storage_root is not None: body['storage_root'] = self.storage_root + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateShare: """Deserializes the CreateShare from a dictionary.""" @@ -151,6 +183,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -165,6 +202,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the GetActivationUrlInfoResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetActivationUrlInfoResponse: """Deserializes the GetActivationUrlInfoResponse from a dictionary.""" @@ -187,6 +229,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -205,6 +254,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> IpAccessList: """Deserializes the IpAccessList from a dictionary.""" @@ -227,6 +282,13 @@ def as_dict(self) -> dict: if 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 + if self.shares: body['shares'] = self.shares + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListProviderSharesResponse: """Deserializes the ListProviderSharesResponse from a dictionary.""" @@ -250,6 +312,13 @@ def as_dict(self) -> dict: if 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 + if self.providers: body['providers'] = self.providers + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListProvidersResponse: """Deserializes the ListProvidersResponse from a dictionary.""" @@ -273,6 +342,13 @@ def as_dict(self) -> dict: if 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 + if self.recipients: body['recipients'] = self.recipients + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListRecipientsResponse: """Deserializes the ListRecipientsResponse from a dictionary.""" @@ -296,6 +372,13 @@ def as_dict(self) -> dict: if 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 + if self.shares: body['shares'] = self.shares + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListSharesResponse: """Deserializes the ListSharesResponse from a dictionary.""" @@ -314,12 +397,41 @@ def as_dict(self) -> dict: 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 PartitionSpecificationPartition: + values: Optional[List[PartitionValue]] = None + """An array of partition values.""" + + def as_dict(self) -> dict: + """Serializes the PartitionSpecificationPartition 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 PartitionSpecificationPartition 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]) -> PartitionSpecificationPartition: + """Deserializes the PartitionSpecificationPartition from a dictionary.""" + return cls(values=_repeated_dict(d, 'values', PartitionValue)) + + @dataclass class PartitionValue: name: Optional[str] = None @@ -329,7 +441,7 @@ class PartitionValue: """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 + """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 @@ -346,6 +458,16 @@ def as_dict(self) -> dict: 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.""" @@ -356,7 +478,6 @@ def from_dict(cls, d: Dict[str, any]) -> PartitionValue: class PartitionValueOp(Enum): - """The operator to apply for the value.""" EQUAL = 'EQUAL' LIKE = 'LIKE' @@ -374,6 +495,7 @@ class Privilege(Enum): CREATE_EXTERNAL_TABLE = 'CREATE_EXTERNAL_TABLE' CREATE_EXTERNAL_VOLUME = 'CREATE_EXTERNAL_VOLUME' CREATE_FOREIGN_CATALOG = 'CREATE_FOREIGN_CATALOG' + CREATE_FOREIGN_SECURABLE = 'CREATE_FOREIGN_SECURABLE' CREATE_FUNCTION = 'CREATE_FUNCTION' CREATE_MANAGED_STORAGE = 'CREATE_MANAGED_STORAGE' CREATE_MATERIALIZED_VIEW = 'CREATE_MATERIALIZED_VIEW' @@ -425,6 +547,13 @@ def as_dict(self) -> dict: if 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 + if self.privileges: body['privileges'] = self.privileges + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PrivilegeAssignment: """Deserializes the PrivilegeAssignment from a dictionary.""" @@ -500,6 +629,26 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.cloud is not None: body['cloud'] = self.cloud + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: 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 + if self.metastore_id is not None: body['metastore_id'] = self.metastore_id + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if 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 + if self.region is not None: body['region'] = self.region + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ProviderInfo: """Deserializes the ProviderInfo from a dictionary.""" @@ -530,6 +679,12 @@ def as_dict(self) -> dict: if self.name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ProviderShare: """Deserializes the ProviderShare from a dictionary.""" @@ -623,6 +778,30 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.activation_url is not None: body['activation_url'] = self.activation_url + if self.authentication_type is not None: body['authentication_type'] = self.authentication_type + if self.cloud is not None: body['cloud'] = self.cloud + if self.comment is not None: body['comment'] = self.comment + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: 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 + if 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 + if self.name is not None: body['name'] = self.name + if self.owner is not None: body['owner'] = self.owner + if self.properties_kvpairs: body['properties_kvpairs'] = self.properties_kvpairs + if self.region is not None: body['region'] = self.region + if self.sharing_code is not None: body['sharing_code'] = self.sharing_code + if self.tokens: body['tokens'] = self.tokens + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RecipientInfo: """Deserializes the RecipientInfo from a dictionary.""" @@ -666,6 +845,15 @@ def as_dict(self) -> dict: 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 + if self.endpoint is not None: body['endpoint'] = self.endpoint + if self.share_credentials_version is not None: + 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.""" @@ -710,6 +898,18 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + if self.id is not None: body['id'] = self.id + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RecipientTokenInfo: """Deserializes the RecipientTokenInfo from a dictionary.""" @@ -746,6 +946,16 @@ def as_dict(self) -> dict: body['shareCredentialsVersion'] = 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 + if self.endpoint is not None: body['endpoint'] = self.endpoint + if self.expiration_time is not None: body['expirationTime'] = self.expiration_time + if self.share_credentials_version is not None: + body['shareCredentialsVersion'] = self.share_credentials_version + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RetrieveTokenResponse: """Deserializes the RetrieveTokenResponse from a dictionary.""" @@ -773,6 +983,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RotateRecipientToken: """Deserializes the RotateRecipientToken from a dictionary.""" @@ -793,6 +1011,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SecurablePropertiesKvPairs: """Deserializes the SecurablePropertiesKvPairs from a dictionary.""" @@ -849,6 +1073,21 @@ def as_dict(self) -> dict: if self.updated_by is not None: 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.created_by is not None: body['created_by'] = self.created_by + if self.name is not None: body['name'] = self.name + if self.objects: body['objects'] = self.objects + if self.owner is not None: body['owner'] = self.owner + if self.storage_location is not None: body['storage_location'] = self.storage_location + if self.storage_root is not None: body['storage_root'] = self.storage_root + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.updated_by is not None: body['updated_by'] = self.updated_by + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ShareInfo: """Deserializes the ShareInfo from a dictionary.""" @@ -880,6 +1119,13 @@ def as_dict(self) -> dict: if self.share_name is not None: 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 + if self.share_name is not None: body['share_name'] = self.share_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ShareToPrivilegeAssignment: """Deserializes the ShareToPrivilegeAssignment from a dictionary.""" @@ -962,6 +1208,25 @@ def as_dict(self) -> dict: if self.string_shared_as is not None: 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 + if self.added_by is not None: body['added_by'] = self.added_by + if self.cdf_enabled is not None: body['cdf_enabled'] = self.cdf_enabled + if self.comment is not None: body['comment'] = self.comment + if self.content is not None: body['content'] = self.content + if self.data_object_type is not None: 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 + if self.name is not None: body['name'] = self.name + if self.partitions: body['partitions'] = self.partitions + if self.shared_as is not None: body['shared_as'] = self.shared_as + if self.start_version is not None: body['start_version'] = self.start_version + if self.status is not None: body['status'] = self.status + if self.string_shared_as is not None: 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.""" @@ -1025,6 +1290,13 @@ def as_dict(self) -> dict: if self.data_object: 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 + if 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.""" @@ -1048,6 +1320,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdatePermissionsResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdatePermissionsResponse: """Deserializes the UpdatePermissionsResponse from a dictionary.""" @@ -1081,6 +1358,16 @@ def as_dict(self) -> dict: if self.recipient_profile_str is not None: 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 + if self.name is not None: body['name'] = self.name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.recipient_profile_str is not None: 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.""" @@ -1128,6 +1415,18 @@ def as_dict(self) -> dict: if self.properties_kvpairs: 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 + if self.expiration_time is not None: body['expiration_time'] = self.expiration_time + if self.ip_access_list: body['ip_access_list'] = self.ip_access_list + if self.name is not None: body['name'] = self.name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if 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.""" @@ -1148,6 +1447,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -1185,6 +1489,17 @@ def as_dict(self) -> dict: if 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 + if self.name is not None: body['name'] = self.name + if self.new_name is not None: body['new_name'] = self.new_name + if self.owner is not None: body['owner'] = self.owner + if self.storage_root is not None: body['storage_root'] = self.storage_root + if self.updates: body['updates'] = self.updates + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateShare: """Deserializes the UpdateShare from a dictionary.""" @@ -1225,6 +1540,15 @@ def as_dict(self) -> dict: if self.page_token is not None: body['page_token'] = self.page_token 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 + if self.max_results is not None: body['max_results'] = self.max_results + if self.name is not None: body['name'] = self.name + if self.page_token is not None: body['page_token'] = self.page_token + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateSharePermissions: """Deserializes the UpdateSharePermissions from a dictionary.""" diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index 390aee5ee..2c20a7aef 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -36,6 +36,14 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AccessControl: """Deserializes the AccessControl from a dictionary.""" @@ -118,6 +126,26 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if self.create_time is not None: body['create_time'] = self.create_time + if self.custom_body is not None: body['custom_body'] = self.custom_body + if self.custom_subject is not None: body['custom_subject'] = self.custom_subject + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + if self.lifecycle_state is not None: body['lifecycle_state'] = self.lifecycle_state + if self.notify_on_ok is not None: body['notify_on_ok'] = self.notify_on_ok + if self.owner_user_name is not None: body['owner_user_name'] = self.owner_user_name + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.query_id is not None: body['query_id'] = self.query_id + if self.seconds_to_retrigger is not None: body['seconds_to_retrigger'] = self.seconds_to_retrigger + if self.state is not None: body['state'] = self.state + if self.trigger_time is not None: body['trigger_time'] = self.trigger_time + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Alert: """Deserializes the Alert from a dictionary.""" @@ -161,6 +189,15 @@ def as_dict(self) -> dict: if self.threshold: 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 + if self.op is not None: body['op'] = self.op + if self.operand: body['operand'] = self.operand + if self.threshold: body['threshold'] = self.threshold + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertCondition: """Deserializes the AlertCondition from a dictionary.""" @@ -180,6 +217,12 @@ def as_dict(self) -> dict: if self.column: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertConditionOperand: """Deserializes the AlertConditionOperand from a dictionary.""" @@ -196,6 +239,12 @@ def as_dict(self) -> dict: if self.value: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertConditionThreshold: """Deserializes the AlertConditionThreshold from a dictionary.""" @@ -212,6 +261,12 @@ def as_dict(self) -> dict: if self.name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertOperandColumn: """Deserializes the AlertOperandColumn from a dictionary.""" @@ -234,6 +289,14 @@ def as_dict(self) -> dict: if self.string_value is not None: 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 + if self.double_value is not None: body['double_value'] = self.double_value + if self.string_value is not None: body['string_value'] = self.string_value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertOperandValue: """Deserializes the AlertOperandValue from a dictionary.""" @@ -297,6 +360,18 @@ def as_dict(self) -> dict: if 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 + if self.custom_body is not None: body['custom_body'] = self.custom_body + if self.custom_subject is not None: body['custom_subject'] = self.custom_subject + if self.empty_result_state is not None: body['empty_result_state'] = self.empty_result_state + if self.muted is not None: body['muted'] = self.muted + if self.op is not None: body['op'] = self.op + if self.value: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertOptions: """Deserializes the AlertOptions from a dictionary.""" @@ -382,6 +457,24 @@ def as_dict(self) -> dict: if self.user_id is not None: 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 + if self.data_source_id is not None: body['data_source_id'] = self.data_source_id + if self.description is not None: body['description'] = self.description + if self.id is not None: body['id'] = self.id + if self.is_archived is not None: body['is_archived'] = self.is_archived + if self.is_draft is not None: body['is_draft'] = self.is_draft + if self.is_safe is not None: body['is_safe'] = self.is_safe + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.query is not None: body['query'] = self.query + if self.tags: body['tags'] = self.tags + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.user_id is not None: body['user_id'] = self.user_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AlertQuery: """Deserializes the AlertQuery from a dictionary.""" @@ -434,6 +527,15 @@ def as_dict(self) -> dict: 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.""" @@ -451,6 +553,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CancelExecutionResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CancelExecutionResponse: """Deserializes the CancelExecutionResponse from a dictionary.""" @@ -473,6 +580,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Channel: """Deserializes the Channel from a dictionary.""" @@ -496,6 +610,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ChannelInfo: """Deserializes the ChannelInfo from a dictionary.""" @@ -547,6 +668,18 @@ def as_dict(self) -> dict: 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.""" @@ -612,6 +745,16 @@ def as_dict(self) -> dict: if self.rearm is not None: 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 + if self.options: body['options'] = self.options + if self.parent is not None: body['parent'] = self.parent + if self.query_id is not None: body['query_id'] = self.query_id + if self.rearm is not None: body['rearm'] = self.rearm + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateAlert: """Deserializes the CreateAlert from a dictionary.""" @@ -632,6 +775,12 @@ def as_dict(self) -> dict: if self.alert: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateAlertRequest: """Deserializes the CreateAlertRequest from a dictionary.""" @@ -683,6 +832,19 @@ def as_dict(self) -> dict: if self.seconds_to_retrigger is not None: 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 + if self.custom_body is not None: body['custom_body'] = self.custom_body + if self.custom_subject is not None: body['custom_subject'] = self.custom_subject + if self.display_name is not None: body['display_name'] = self.display_name + if self.notify_on_ok is not None: body['notify_on_ok'] = self.notify_on_ok + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.query_id is not None: body['query_id'] = self.query_id + if self.seconds_to_retrigger is not None: 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.""" @@ -706,6 +868,12 @@ def as_dict(self) -> dict: if self.query: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateQueryRequest: """Deserializes the CreateQueryRequest from a dictionary.""" @@ -762,6 +930,22 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.catalog is not None: body['catalog'] = self.catalog + if self.description is not None: body['description'] = self.description + if self.display_name is not None: body['display_name'] = self.display_name + if self.parameters: body['parameters'] = self.parameters + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.query_text is not None: body['query_text'] = self.query_text + if self.run_as_mode is not None: body['run_as_mode'] = self.run_as_mode + if self.schema is not None: body['schema'] = self.schema + if self.tags: body['tags'] = self.tags + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateQueryRequestQuery: """Deserializes the CreateQueryRequestQuery from a dictionary.""" @@ -788,6 +972,12 @@ def as_dict(self) -> dict: if self.visualization: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateVisualizationRequest: """Deserializes the CreateVisualizationRequest from a dictionary.""" @@ -823,6 +1013,16 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.query_id is not None: body['query_id'] = self.query_id + if self.serialized_options is not None: body['serialized_options'] = self.serialized_options + if self.serialized_query_plan is not None: body['serialized_query_plan'] = self.serialized_query_plan + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateVisualizationRequestVisualization: """Deserializes the CreateVisualizationRequestVisualization from a dictionary.""" @@ -924,6 +1124,25 @@ def as_dict(self) -> dict: if self.warehouse_type is not None: 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 + if self.channel: body['channel'] = self.channel + if self.cluster_size is not None: body['cluster_size'] = self.cluster_size + if self.creator_name is not None: body['creator_name'] = self.creator_name + if self.enable_photon is not None: body['enable_photon'] = self.enable_photon + if self.enable_serverless_compute is not None: + body['enable_serverless_compute'] = self.enable_serverless_compute + if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn + if self.max_num_clusters is not None: body['max_num_clusters'] = self.max_num_clusters + if self.min_num_clusters is not None: body['min_num_clusters'] = self.min_num_clusters + if self.name is not None: body['name'] = self.name + if self.spot_instance_policy is not None: body['spot_instance_policy'] = self.spot_instance_policy + if self.tags: body['tags'] = self.tags + if self.warehouse_type is not None: body['warehouse_type'] = self.warehouse_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateWarehouseRequest: """Deserializes the CreateWarehouseRequest from a dictionary.""" @@ -962,6 +1181,12 @@ def as_dict(self) -> dict: if self.id is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateWarehouseResponse: """Deserializes the CreateWarehouseResponse from a dictionary.""" @@ -999,6 +1224,17 @@ def as_dict(self) -> dict: if self.width is not None: 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 + if self.id is not None: body['id'] = self.id + if self.options: body['options'] = self.options + if self.text is not None: body['text'] = self.text + if self.visualization_id is not None: body['visualization_id'] = self.visualization_id + if self.width is not None: body['width'] = self.width + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateWidget: """Deserializes the CreateWidget from a dictionary.""" @@ -1090,6 +1326,29 @@ def as_dict(self) -> dict: if 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.dashboard_filters_enabled is not None: + body['dashboard_filters_enabled'] = self.dashboard_filters_enabled + if self.id is not None: body['id'] = self.id + if self.is_archived is not None: body['is_archived'] = self.is_archived + if self.is_draft is not None: body['is_draft'] = self.is_draft + if self.is_favorite is not None: body['is_favorite'] = self.is_favorite + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.parent is not None: body['parent'] = self.parent + if self.permission_tier is not None: body['permission_tier'] = self.permission_tier + if self.slug is not None: body['slug'] = self.slug + if self.tags: body['tags'] = self.tags + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.user: body['user'] = self.user + if self.user_id is not None: body['user_id'] = self.user_id + if self.widgets: body['widgets'] = self.widgets + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Dashboard: """Deserializes the Dashboard from a dictionary.""" @@ -1134,6 +1393,15 @@ def as_dict(self) -> dict: if 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 + if self.name is not None: body['name'] = self.name + if self.run_as_role is not None: body['run_as_role'] = self.run_as_role + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DashboardEditContent: """Deserializes the DashboardEditContent from a dictionary.""" @@ -1155,6 +1423,12 @@ def as_dict(self) -> dict: if self.moved_to_trash_at is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DashboardOptions: """Deserializes the DashboardOptions from a dictionary.""" @@ -1193,6 +1467,18 @@ def as_dict(self) -> dict: if 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 + if self.is_favorite is not None: body['is_favorite'] = self.is_favorite + if self.name is not None: body['name'] = self.name + if self.parent is not None: body['parent'] = self.parent + if self.run_as_role is not None: body['run_as_role'] = self.run_as_role + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DashboardPostContent: """Deserializes the DashboardPostContent from a dictionary.""" @@ -1253,6 +1539,20 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.name is not None: body['name'] = self.name + if self.pause_reason is not None: body['pause_reason'] = self.pause_reason + if self.paused is not None: body['paused'] = self.paused + if self.supports_auto_limit is not None: body['supports_auto_limit'] = self.supports_auto_limit + if self.syntax is not None: body['syntax'] = self.syntax + if self.type is not None: body['type'] = self.type + if self.view_only is not None: body['view_only'] = self.view_only + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DataSource: """Deserializes the DataSource from a dictionary.""" @@ -1287,6 +1587,13 @@ def as_dict(self) -> dict: if self.start is not None: 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 + if self.start is not None: body['start'] = self.start + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DateRange: """Deserializes the DateRange from a dictionary.""" @@ -1317,6 +1624,16 @@ def as_dict(self) -> dict: if self.start_day_of_week is not None: 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 + if self.dynamic_date_range_value is not None: + body['dynamic_date_range_value'] = self.dynamic_date_range_value + if self.precision is not None: body['precision'] = self.precision + if self.start_day_of_week is not None: 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.""" @@ -1368,6 +1685,14 @@ def as_dict(self) -> dict: if self.precision is not None: 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 + if self.dynamic_date_value is not None: body['dynamic_date_value'] = self.dynamic_date_value + if self.precision is not None: body['precision'] = self.precision + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DateValue: """Deserializes the DateValue from a dictionary.""" @@ -1390,6 +1715,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -1404,6 +1734,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteWarehouseResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteWarehouseResponse: """Deserializes the DeleteWarehouseResponse from a dictionary.""" @@ -1443,6 +1778,16 @@ def as_dict(self) -> dict: if self.rearm is not None: 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 + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.query_id is not None: body['query_id'] = self.query_id + if self.rearm is not None: body['rearm'] = self.rearm + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditAlert: """Deserializes the EditAlert from a dictionary.""" @@ -1547,6 +1892,26 @@ def as_dict(self) -> dict: if self.warehouse_type is not None: 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 + if self.channel: body['channel'] = self.channel + if self.cluster_size is not None: body['cluster_size'] = self.cluster_size + if self.creator_name is not None: body['creator_name'] = self.creator_name + if self.enable_photon is not None: body['enable_photon'] = self.enable_photon + if self.enable_serverless_compute is not None: + body['enable_serverless_compute'] = self.enable_serverless_compute + if self.id is not None: body['id'] = self.id + if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn + if self.max_num_clusters is not None: body['max_num_clusters'] = self.max_num_clusters + if self.min_num_clusters is not None: body['min_num_clusters'] = self.min_num_clusters + if self.name is not None: body['name'] = self.name + if self.spot_instance_policy is not None: body['spot_instance_policy'] = self.spot_instance_policy + if self.tags: body['tags'] = self.tags + if self.warehouse_type is not None: body['warehouse_type'] = self.warehouse_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditWarehouseRequest: """Deserializes the EditWarehouseRequest from a dictionary.""" @@ -1583,6 +1948,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the EditWarehouseResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EditWarehouseResponse: """Deserializes the EditWarehouseResponse from a dictionary.""" @@ -1599,6 +1969,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the Empty into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Empty: """Deserializes the Empty from a dictionary.""" @@ -1618,6 +1993,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointConfPair: """Deserializes the EndpointConfPair from a dictionary.""" @@ -1652,6 +2034,16 @@ def as_dict(self) -> dict: if self.summary is not None: 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 + if self.failure_reason: body['failure_reason'] = self.failure_reason + if self.message is not None: body['message'] = self.message + if self.status is not None: body['status'] = self.status + if self.summary is not None: body['summary'] = self.summary + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointHealth: """Deserializes the EndpointHealth from a dictionary.""" @@ -1780,6 +2172,32 @@ def as_dict(self) -> dict: if self.warehouse_type is not None: 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 + if self.channel: body['channel'] = self.channel + if self.cluster_size is not None: body['cluster_size'] = self.cluster_size + if self.creator_name is not None: body['creator_name'] = self.creator_name + if self.enable_photon is not None: body['enable_photon'] = self.enable_photon + if self.enable_serverless_compute is not None: + body['enable_serverless_compute'] = self.enable_serverless_compute + if self.health: body['health'] = self.health + if self.id is not None: body['id'] = self.id + if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn + if self.jdbc_url is not None: body['jdbc_url'] = self.jdbc_url + if self.max_num_clusters is not None: body['max_num_clusters'] = self.max_num_clusters + if self.min_num_clusters is not None: body['min_num_clusters'] = self.min_num_clusters + if self.name is not None: body['name'] = self.name + if self.num_active_sessions is not None: body['num_active_sessions'] = self.num_active_sessions + if self.num_clusters is not None: body['num_clusters'] = self.num_clusters + if 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 + if self.state is not None: body['state'] = self.state + if self.tags: body['tags'] = self.tags + if self.warehouse_type is not None: body['warehouse_type'] = self.warehouse_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointInfo: """Deserializes the EndpointInfo from a dictionary.""" @@ -1827,6 +2245,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointTagPair: """Deserializes the EndpointTagPair from a dictionary.""" @@ -1843,6 +2268,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointTags: """Deserializes the EndpointTags from a dictionary.""" @@ -1868,6 +2299,14 @@ def as_dict(self) -> dict: if 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 + if self.multi_values_options: body['multi_values_options'] = self.multi_values_options + if self.values: body['values'] = self.values + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EnumValue: """Deserializes the EnumValue from a dictionary.""" @@ -2009,6 +2448,22 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.catalog is not None: body['catalog'] = self.catalog + if self.disposition is not None: body['disposition'] = self.disposition + if self.format is not None: body['format'] = self.format + if self.on_wait_timeout is not None: body['on_wait_timeout'] = self.on_wait_timeout + if self.parameters: body['parameters'] = self.parameters + if self.row_limit is not None: body['row_limit'] = self.row_limit + if self.schema is not None: body['schema'] = self.schema + if self.statement is not None: body['statement'] = self.statement + if self.wait_timeout is not None: body['wait_timeout'] = self.wait_timeout + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExecuteStatementRequest: """Deserializes the ExecuteStatementRequest from a dictionary.""" @@ -2089,6 +2544,21 @@ def as_dict(self) -> dict: 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.""" @@ -2129,6 +2599,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetResponse: """Deserializes the GetResponse from a dictionary.""" @@ -2148,6 +2626,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetWarehousePermissionLevelsResponse: """Deserializes the GetWarehousePermissionLevelsResponse from a dictionary.""" @@ -2272,6 +2756,32 @@ def as_dict(self) -> dict: if self.warehouse_type is not None: 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 + if self.channel: body['channel'] = self.channel + if self.cluster_size is not None: body['cluster_size'] = self.cluster_size + if self.creator_name is not None: body['creator_name'] = self.creator_name + if self.enable_photon is not None: body['enable_photon'] = self.enable_photon + if self.enable_serverless_compute is not None: + body['enable_serverless_compute'] = self.enable_serverless_compute + if self.health: body['health'] = self.health + if self.id is not None: body['id'] = self.id + if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn + if self.jdbc_url is not None: body['jdbc_url'] = self.jdbc_url + if self.max_num_clusters is not None: body['max_num_clusters'] = self.max_num_clusters + if self.min_num_clusters is not None: body['min_num_clusters'] = self.min_num_clusters + if self.name is not None: body['name'] = self.name + if self.num_active_sessions is not None: body['num_active_sessions'] = self.num_active_sessions + if self.num_clusters is not None: body['num_clusters'] = self.num_clusters + if 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 + if self.state is not None: body['state'] = self.state + if self.tags: body['tags'] = self.tags + if self.warehouse_type is not None: body['warehouse_type'] = self.warehouse_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetWarehouseResponse: """Deserializes the GetWarehouseResponse from a dictionary.""" @@ -2358,6 +2868,22 @@ def as_dict(self) -> 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 + if self.config_param: body['config_param'] = self.config_param + if 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 + if 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 + if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn + if self.security_policy is not None: body['security_policy'] = self.security_policy + if 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.""" @@ -2433,6 +2959,22 @@ def as_dict(self) -> dict: if self.user: 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 + if self.id is not None: body['id'] = self.id + if self.last_triggered_at is not None: body['last_triggered_at'] = self.last_triggered_at + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.parent is not None: body['parent'] = self.parent + if self.query: body['query'] = self.query + if self.rearm is not None: body['rearm'] = self.rearm + if self.state is not None: body['state'] = self.state + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.user: body['user'] = self.user + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LegacyAlert: """Deserializes the LegacyAlert from a dictionary.""" @@ -2568,6 +3110,35 @@ def as_dict(self) -> dict: if 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 + if self.created_at is not None: body['created_at'] = self.created_at + if self.data_source_id is not None: body['data_source_id'] = self.data_source_id + if self.description is not None: body['description'] = self.description + if self.id is not None: body['id'] = self.id + if self.is_archived is not None: body['is_archived'] = self.is_archived + if self.is_draft is not None: body['is_draft'] = self.is_draft + if self.is_favorite is not None: body['is_favorite'] = self.is_favorite + if self.is_safe is not None: body['is_safe'] = self.is_safe + if 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 + if self.latest_query_data_id is not None: body['latest_query_data_id'] = self.latest_query_data_id + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.parent is not None: body['parent'] = self.parent + if self.permission_tier is not None: body['permission_tier'] = self.permission_tier + if self.query is not None: body['query'] = self.query + if self.query_hash is not None: body['query_hash'] = self.query_hash + if self.run_as_role is not None: body['run_as_role'] = self.run_as_role + if self.tags: body['tags'] = self.tags + if self.updated_at is not None: body['updated_at'] = self.updated_at + if self.user: body['user'] = self.user + if self.user_id is not None: body['user_id'] = self.user_id + if self.visualizations: body['visualizations'] = self.visualizations + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LegacyQuery: """Deserializes the LegacyQuery from a dictionary.""" @@ -2639,6 +3210,19 @@ def as_dict(self) -> dict: if self.updated_at is not None: 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 + if self.description is not None: body['description'] = self.description + if self.id is not None: body['id'] = self.id + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.query: body['query'] = self.query + if self.type is not None: body['type'] = self.type + if self.updated_at is not None: body['updated_at'] = self.updated_at + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> LegacyVisualization: """Deserializes the LegacyVisualization from a dictionary.""" @@ -2671,6 +3255,13 @@ def as_dict(self) -> dict: if 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 + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListAlertsResponse: """Deserializes the ListAlertsResponse from a dictionary.""" @@ -2748,6 +3339,25 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if self.create_time is not None: body['create_time'] = self.create_time + if self.custom_body is not None: body['custom_body'] = self.custom_body + if self.custom_subject is not None: body['custom_subject'] = self.custom_subject + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + if self.lifecycle_state is not None: body['lifecycle_state'] = self.lifecycle_state + if self.notify_on_ok is not None: body['notify_on_ok'] = self.notify_on_ok + if self.owner_user_name is not None: body['owner_user_name'] = self.owner_user_name + if self.query_id is not None: body['query_id'] = self.query_id + if self.seconds_to_retrigger is not None: body['seconds_to_retrigger'] = self.seconds_to_retrigger + if self.state is not None: body['state'] = self.state + if self.trigger_time is not None: body['trigger_time'] = self.trigger_time + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListAlertsResponseAlert: """Deserializes the ListAlertsResponseAlert from a dictionary.""" @@ -2791,6 +3401,14 @@ def as_dict(self) -> dict: if 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 + if self.next_page_token is not None: body['next_page_token'] = self.next_page_token + if self.res: body['res'] = self.res + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListQueriesResponse: """Deserializes the ListQueriesResponse from a dictionary.""" @@ -2812,6 +3430,13 @@ def as_dict(self) -> dict: if 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 + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListQueryObjectsResponse: """Deserializes the ListQueryObjectsResponse from a dictionary.""" @@ -2890,6 +3515,28 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.catalog is not None: body['catalog'] = self.catalog + if self.create_time is not None: body['create_time'] = self.create_time + if self.description is not None: body['description'] = self.description + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + if self.last_modifier_user_name is not None: + body['last_modifier_user_name'] = self.last_modifier_user_name + if self.lifecycle_state is not None: body['lifecycle_state'] = self.lifecycle_state + if self.owner_user_name is not None: body['owner_user_name'] = self.owner_user_name + if self.parameters: body['parameters'] = self.parameters + if self.query_text is not None: body['query_text'] = self.query_text + if self.run_as_mode is not None: body['run_as_mode'] = self.run_as_mode + if self.schema is not None: body['schema'] = self.schema + if self.tags: body['tags'] = self.tags + if self.update_time is not None: body['update_time'] = self.update_time + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListQueryObjectsResponseQuery: """Deserializes the ListQueryObjectsResponseQuery from a dictionary.""" @@ -2934,6 +3581,15 @@ def as_dict(self) -> dict: if 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 + if self.page is not None: body['page'] = self.page + if self.page_size is not None: body['page_size'] = self.page_size + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListResponse: """Deserializes the ListResponse from a dictionary.""" @@ -2956,6 +3612,13 @@ def as_dict(self) -> dict: if 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 + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListVisualizationsForQueryResponse: """Deserializes the ListVisualizationsForQueryResponse from a dictionary.""" @@ -2974,6 +3637,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListWarehousesResponse: """Deserializes the ListWarehousesResponse from a dictionary.""" @@ -2999,6 +3668,14 @@ def as_dict(self) -> dict: if self.suffix is not None: 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 + if self.separator is not None: body['separator'] = self.separator + if self.suffix is not None: body['suffix'] = self.suffix + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MultiValuesOptions: """Deserializes the MultiValuesOptions from a dictionary.""" @@ -3017,6 +3694,12 @@ def as_dict(self) -> dict: if self.value is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> NumericValue: """Deserializes the NumericValue from a dictionary.""" @@ -3060,6 +3743,15 @@ def as_dict(self) -> dict: if self.protocol is not None: 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 + if self.path is not None: body['path'] = self.path + if self.port is not None: body['port'] = self.port + if self.protocol is not None: body['protocol'] = self.protocol + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> OdbcParams: """Deserializes the OdbcParams from a dictionary.""" @@ -3114,6 +3806,18 @@ def as_dict(self) -> dict: if 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 + if self.multi_values_options: body['multiValuesOptions'] = self.multi_values_options + if self.name is not None: body['name'] = self.name + if self.query_id is not None: body['queryId'] = self.query_id + if self.title is not None: body['title'] = self.title + if self.type is not None: body['type'] = self.type + if self.value: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Parameter: """Deserializes the Parameter from a dictionary.""" @@ -3232,6 +3936,29 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.catalog is not None: body['catalog'] = self.catalog + if self.create_time is not None: body['create_time'] = self.create_time + if self.description is not None: body['description'] = self.description + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + if self.last_modifier_user_name is not None: + body['last_modifier_user_name'] = self.last_modifier_user_name + if self.lifecycle_state is not None: body['lifecycle_state'] = self.lifecycle_state + if self.owner_user_name is not None: body['owner_user_name'] = self.owner_user_name + if self.parameters: body['parameters'] = self.parameters + if self.parent_path is not None: body['parent_path'] = self.parent_path + if self.query_text is not None: body['query_text'] = self.query_text + if self.run_as_mode is not None: body['run_as_mode'] = self.run_as_mode + if self.schema is not None: body['schema'] = self.schema + if self.tags: body['tags'] = self.tags + if self.update_time is not None: body['update_time'] = self.update_time + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Query: """Deserializes the Query from a dictionary.""" @@ -3273,6 +4000,14 @@ def as_dict(self) -> dict: if 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 + if self.query_id is not None: body['query_id'] = self.query_id + if self.values: body['values'] = self.values + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryBackedValue: """Deserializes the QueryBackedValue from a dictionary.""" @@ -3324,6 +4059,19 @@ def as_dict(self) -> dict: if 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 + if self.description is not None: body['description'] = self.description + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.query is not None: body['query'] = self.query + if self.query_id is not None: body['query_id'] = self.query_id + if self.run_as_role is not None: body['run_as_role'] = self.run_as_role + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryEditContent: """Deserializes the QueryEditContent from a dictionary.""" @@ -3363,6 +4111,16 @@ def as_dict(self) -> dict: if 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 + if self.statement_ids: body['statement_ids'] = self.statement_ids + if self.statuses: body['statuses'] = self.statuses + if self.user_ids: body['user_ids'] = self.user_ids + if 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.""" @@ -3472,6 +4230,33 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.duration is not None: body['duration'] = self.duration + if self.endpoint_id is not None: body['endpoint_id'] = self.endpoint_id + if self.error_message is not None: 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 + if self.executed_as_user_name is not None: 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 + if self.is_final is not None: body['is_final'] = self.is_final + if self.lookup_key is not None: body['lookup_key'] = self.lookup_key + if self.metrics: body['metrics'] = self.metrics + if self.plans_state is not None: 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 + if self.query_id is not None: body['query_id'] = self.query_id + 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: body['query_text'] = self.query_text + if self.rows_produced is not None: body['rows_produced'] = self.rows_produced + if self.spark_ui_url is not None: body['spark_ui_url'] = self.spark_ui_url + if self.statement_type is not None: body['statement_type'] = self.statement_type + if self.status is not None: body['status'] = self.status + if self.user_id is not None: body['user_id'] = self.user_id + if self.user_name is not None: body['user_name'] = self.user_name + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryInfo: """Deserializes the QueryInfo from a dictionary.""" @@ -3522,6 +4307,15 @@ def as_dict(self) -> dict: if 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 + if self.page is not None: body['page'] = self.page + if self.page_size is not None: body['page_size'] = self.page_size + if self.results: body['results'] = self.results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryList: """Deserializes the QueryList from a dictionary.""" @@ -3605,8 +4399,38 @@ class QueryMetrics: write_remote_bytes: Optional[int] = None """Size pf persistent data written to cloud object storage in your cloud tenant, in bytes.""" - def as_dict(self) -> dict: - """Serializes the QueryMetrics into a dictionary suitable for use as a JSON request body.""" + 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 + if self.execution_time_ms is not None: body['execution_time_ms'] = self.execution_time_ms + if self.network_sent_bytes is not None: 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 + if self.photon_total_time_ms is not None: 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 + if self.pruned_bytes is not None: body['pruned_bytes'] = self.pruned_bytes + if self.pruned_files_count is not None: 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 + if self.read_bytes is not None: body['read_bytes'] = self.read_bytes + if self.read_cache_bytes is not None: body['read_cache_bytes'] = self.read_cache_bytes + if self.read_files_count is not None: body['read_files_count'] = self.read_files_count + if self.read_partitions_count is not None: body['read_partitions_count'] = self.read_partitions_count + if self.read_remote_bytes is not None: 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 + if self.result_from_cache is not None: body['result_from_cache'] = self.result_from_cache + if self.rows_produced_count is not None: body['rows_produced_count'] = self.rows_produced_count + if self.rows_read_count is not None: 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 + if self.task_total_time_ms is not None: 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 + if self.write_remote_bytes is not None: 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 if self.execution_time_ms is not None: body['execution_time_ms'] = self.execution_time_ms @@ -3685,6 +4509,15 @@ def as_dict(self) -> dict: if self.schema is not None: 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 + if self.moved_to_trash_at is not None: body['moved_to_trash_at'] = self.moved_to_trash_at + if self.parameters: body['parameters'] = self.parameters + if self.schema is not None: body['schema'] = self.schema + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryOptions: """Deserializes the QueryOptions from a dictionary.""" @@ -3734,6 +4567,19 @@ def as_dict(self) -> dict: if self.title is not None: 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 + if self.date_value: body['date_value'] = self.date_value + if self.enum_value: body['enum_value'] = self.enum_value + if self.name is not None: body['name'] = self.name + if self.numeric_value: body['numeric_value'] = self.numeric_value + if self.query_backed_value: body['query_backed_value'] = self.query_backed_value + if self.text_value: body['text_value'] = self.text_value + if self.title is not None: body['title'] = self.title + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryParameter: """Deserializes the QueryParameter from a dictionary.""" @@ -3791,6 +4637,19 @@ def as_dict(self) -> dict: if 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 + if self.description is not None: body['description'] = self.description + if self.name is not None: body['name'] = self.name + if self.options: body['options'] = self.options + if self.parent is not None: body['parent'] = self.parent + if self.query is not None: body['query'] = self.query + if self.run_as_role is not None: body['run_as_role'] = self.run_as_role + if self.tags: body['tags'] = self.tags + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryPostContent: """Deserializes the QueryPostContent from a dictionary.""" @@ -3858,6 +4717,13 @@ def as_dict(self) -> dict: 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 + if 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.""" @@ -3873,6 +4739,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the RestoreResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RestoreResponse: """Deserializes the RestoreResponse from a dictionary.""" @@ -3924,6 +4795,20 @@ def as_dict(self) -> dict: 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.""" @@ -3974,6 +4859,18 @@ def as_dict(self) -> dict: 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.""" @@ -4001,6 +4898,13 @@ def as_dict(self) -> dict: 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.""" @@ -4035,6 +4939,13 @@ def as_dict(self) -> dict: 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.""" @@ -4078,6 +4989,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetResponse: """Deserializes the SetResponse from a dictionary.""" @@ -4138,6 +5057,22 @@ def as_dict(self) -> 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 + if self.config_param: body['config_param'] = self.config_param + if 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 + if 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 + if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn + if self.security_policy is not None: body['security_policy'] = self.security_policy + if 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.""" @@ -4170,6 +5105,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the SetWorkspaceWarehouseConfigResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SetWorkspaceWarehouseConfigResponse: """Deserializes the SetWorkspaceWarehouseConfigResponse from a dictionary.""" @@ -4192,6 +5132,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the StartWarehouseResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StartWarehouseResponse: """Deserializes the StartWarehouseResponse from a dictionary.""" @@ -4233,6 +5178,14 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.type is not None: body['type'] = self.type + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StatementParameterListItem: """Deserializes the StatementParameterListItem from a dictionary.""" @@ -4262,6 +5215,15 @@ def as_dict(self) -> dict: 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.""" @@ -4306,6 +5268,13 @@ def as_dict(self) -> 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.""" @@ -4329,6 +5298,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the StopWarehouseResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> StopWarehouseResponse: """Deserializes the StopWarehouseResponse from a dictionary.""" @@ -4345,6 +5319,12 @@ def as_dict(self) -> dict: if self.message is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Success: """Deserializes the Success from a dictionary.""" @@ -4375,6 +5355,14 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.parameters: body['parameters'] = self.parameters + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TerminationReason: """Deserializes the TerminationReason from a dictionary.""" @@ -4486,6 +5474,12 @@ def as_dict(self) -> dict: if self.value is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TextValue: """Deserializes the TextValue from a dictionary.""" @@ -4507,6 +5501,13 @@ def as_dict(self) -> dict: if self.start_time_ms is not None: 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 + if self.start_time_ms is not None: 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.""" @@ -4524,6 +5525,12 @@ def as_dict(self) -> dict: if self.new_owner is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> TransferOwnershipObjectId: """Deserializes the TransferOwnershipObjectId from a dictionary.""" @@ -4549,6 +5556,14 @@ def as_dict(self) -> dict: if self.update_mask is not None: 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 + if self.id is not None: body['id'] = self.id + if self.update_mask is not None: body['update_mask'] = self.update_mask + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateAlertRequest: """Deserializes the UpdateAlertRequest from a dictionary.""" @@ -4602,6 +5617,19 @@ def as_dict(self) -> dict: if self.seconds_to_retrigger is not None: 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 + if self.custom_body is not None: body['custom_body'] = self.custom_body + if self.custom_subject is not None: body['custom_subject'] = self.custom_subject + if self.display_name is not None: body['display_name'] = self.display_name + if self.notify_on_ok is not None: body['notify_on_ok'] = self.notify_on_ok + if self.owner_user_name is not None: body['owner_user_name'] = self.owner_user_name + if self.query_id is not None: body['query_id'] = self.query_id + if self.seconds_to_retrigger is not None: 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.""" @@ -4634,6 +5662,14 @@ def as_dict(self) -> dict: if self.update_mask is not None: 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 + if self.query: body['query'] = self.query + if self.update_mask is not None: body['update_mask'] = self.update_mask + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateQueryRequest: """Deserializes the UpdateQueryRequest from a dictionary.""" @@ -4692,6 +5728,22 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.catalog is not None: body['catalog'] = self.catalog + if self.description is not None: body['description'] = self.description + if self.display_name is not None: body['display_name'] = self.display_name + if self.owner_user_name is not None: body['owner_user_name'] = self.owner_user_name + if self.parameters: body['parameters'] = self.parameters + if self.query_text is not None: body['query_text'] = self.query_text + if self.run_as_mode is not None: body['run_as_mode'] = self.run_as_mode + if self.schema is not None: body['schema'] = self.schema + if self.tags: body['tags'] = self.tags + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateQueryRequestQuery: """Deserializes the UpdateQueryRequestQuery from a dictionary.""" @@ -4716,6 +5768,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateResponse: """Deserializes the UpdateResponse from a dictionary.""" @@ -4741,6 +5798,14 @@ def as_dict(self) -> dict: if self.visualization: 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 + if self.update_mask is not None: body['update_mask'] = self.update_mask + if self.visualization: body['visualization'] = self.visualization + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateVisualizationRequest: """Deserializes the UpdateVisualizationRequest from a dictionary.""" @@ -4774,6 +5839,15 @@ def as_dict(self) -> dict: if self.type is not None: 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 + if self.serialized_options is not None: body['serialized_options'] = self.serialized_options + if self.serialized_query_plan is not None: body['serialized_query_plan'] = self.serialized_query_plan + if self.type is not None: body['type'] = self.type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateVisualizationRequestVisualization: """Deserializes the UpdateVisualizationRequestVisualization from a dictionary.""" @@ -4799,6 +5873,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.id is not None: body['id'] = self.id + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> User: """Deserializes the User from a dictionary.""" @@ -4846,6 +5928,19 @@ def as_dict(self) -> dict: if self.update_time is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.id is not None: body['id'] = self.id + if self.query_id is not None: body['query_id'] = self.query_id + if self.serialized_options is not None: body['serialized_options'] = self.serialized_options + if self.serialized_query_plan is not None: body['serialized_query_plan'] = self.serialized_query_plan + if self.type is not None: body['type'] = self.type + if self.update_time is not None: body['update_time'] = self.update_time + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Visualization: """Deserializes the Visualization from a dictionary.""" @@ -4883,6 +5978,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WarehouseAccessControlRequest: """Deserializes the WarehouseAccessControlRequest from a dictionary.""" @@ -4920,6 +6025,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WarehouseAccessControlResponse: """Deserializes the WarehouseAccessControlResponse from a dictionary.""" @@ -4947,6 +6063,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WarehousePermission: """Deserializes the WarehousePermission from a dictionary.""" @@ -4981,6 +6105,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WarehousePermissions: """Deserializes the WarehousePermissions from a dictionary.""" @@ -5004,6 +6136,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WarehousePermissionsDescription: """Deserializes the WarehousePermissionsDescription from a dictionary.""" @@ -5026,6 +6165,13 @@ def as_dict(self) -> dict: if self.warehouse_id is not None: 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 + if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WarehousePermissionsRequest: """Deserializes the WarehousePermissionsRequest from a dictionary.""" @@ -5050,6 +6196,13 @@ def as_dict(self) -> dict: if self.warehouse_type is not None: 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 + if self.warehouse_type is not None: body['warehouse_type'] = self.warehouse_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WarehouseTypePair: """Deserializes the WarehouseTypePair from a dictionary.""" @@ -5090,6 +6243,15 @@ def as_dict(self) -> dict: if self.width is not None: 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 + if self.options: body['options'] = self.options + if self.visualization: body['visualization'] = self.visualization + if self.width is not None: body['width'] = self.width + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Widget: """Deserializes the Widget from a dictionary.""" @@ -5136,6 +6298,18 @@ def as_dict(self) -> dict: if self.updated_at is not None: 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 + if self.description is not None: body['description'] = self.description + if self.is_hidden is not None: body['isHidden'] = self.is_hidden + if self.parameter_mappings: body['parameterMappings'] = self.parameter_mappings + if self.position: body['position'] = self.position + if self.title is not None: body['title'] = self.title + if self.updated_at is not None: body['updated_at'] = self.updated_at + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WidgetOptions: """Deserializes the WidgetOptions from a dictionary.""" @@ -5178,6 +6352,16 @@ def as_dict(self) -> dict: if self.size_y is not None: body['sizeY'] = 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 + if self.col is not None: body['col'] = self.col + if self.row is not None: body['row'] = self.row + if self.size_x is not None: body['sizeX'] = self.size_x + if self.size_y is not None: body['sizeY'] = self.size_y + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WidgetPosition: """Deserializes the WidgetPosition from a dictionary.""" diff --git a/databricks/sdk/service/vectorsearch.py b/databricks/sdk/service/vectorsearch.py index d6c28b840..f1e6aeaa3 100755 --- a/databricks/sdk/service/vectorsearch.py +++ b/databricks/sdk/service/vectorsearch.py @@ -29,6 +29,12 @@ def as_dict(self) -> dict: if self.name is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ColumnInfo: """Deserializes the ColumnInfo from a dictionary.""" @@ -50,6 +56,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateEndpoint: """Deserializes the CreateEndpoint from a dictionary.""" @@ -93,6 +106,17 @@ def as_dict(self) -> dict: if self.primary_key is not None: 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 + if 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 + if self.index_type is not None: body['index_type'] = self.index_type + if self.name is not None: body['name'] = self.name + if self.primary_key is not None: body['primary_key'] = self.primary_key + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateVectorIndexRequest: """Deserializes the CreateVectorIndexRequest from a dictionary.""" @@ -116,6 +140,12 @@ def as_dict(self) -> dict: if self.vector_index: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateVectorIndexResponse: """Deserializes the CreateVectorIndexResponse from a dictionary.""" @@ -139,6 +169,13 @@ def as_dict(self) -> dict: if self.success_row_count is not None: 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 + if self.success_row_count is not None: 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.""" @@ -171,6 +208,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -194,6 +238,13 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteDataVectorIndexResponse: """Deserializes the DeleteDataVectorIndexResponse from a dictionary.""" @@ -209,6 +260,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteEndpointResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteEndpointResponse: """Deserializes the DeleteEndpointResponse from a dictionary.""" @@ -223,6 +279,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteIndexResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteIndexResponse: """Deserializes the DeleteIndexResponse from a dictionary.""" @@ -272,6 +333,18 @@ def as_dict(self) -> dict: if self.source_table is not None: 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 + if 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 + if self.embedding_writeback_table is not None: + body['embedding_writeback_table'] = self.embedding_writeback_table + if self.pipeline_type is not None: body['pipeline_type'] = self.pipeline_type + if self.source_table is not None: body['source_table'] = self.source_table + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeltaSyncVectorIndexSpecRequest: """Deserializes the DeltaSyncVectorIndexSpecRequest from a dictionary.""" @@ -325,6 +398,18 @@ def as_dict(self) -> dict: if self.source_table is not None: 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 + if 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 + if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id + if self.pipeline_type is not None: body['pipeline_type'] = self.pipeline_type + if self.source_table is not None: body['source_table'] = self.source_table + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeltaSyncVectorIndexSpecResponse: """Deserializes the DeltaSyncVectorIndexSpecResponse from a dictionary.""" @@ -363,6 +448,14 @@ def as_dict(self) -> dict: if self.schema_json is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DirectAccessVectorIndexSpec: """Deserializes the DirectAccessVectorIndexSpec from a dictionary.""" @@ -389,6 +482,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EmbeddingSourceColumn: """Deserializes the EmbeddingSourceColumn from a dictionary.""" @@ -411,6 +512,13 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EmbeddingVectorColumn: """Deserializes the EmbeddingVectorColumn from a dictionary.""" @@ -461,6 +569,21 @@ def as_dict(self) -> dict: if self.num_indexes is not None: 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 + if self.creator is not None: body['creator'] = self.creator + if self.endpoint_status: body['endpoint_status'] = self.endpoint_status + if self.endpoint_type is not None: body['endpoint_type'] = self.endpoint_type + if self.id is not None: body['id'] = self.id + if self.last_updated_timestamp is not None: + body['last_updated_timestamp'] = self.last_updated_timestamp + if self.last_updated_user is not None: body['last_updated_user'] = self.last_updated_user + if self.name is not None: body['name'] = self.name + if self.num_indexes is not None: body['num_indexes'] = self.num_indexes + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointInfo: """Deserializes the EndpointInfo from a dictionary.""" @@ -492,6 +615,13 @@ def as_dict(self) -> dict: if self.state is not None: 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 + if self.state is not None: body['state'] = self.state + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> EndpointStatus: """Deserializes the EndpointStatus from a dictionary.""" @@ -528,6 +658,13 @@ def as_dict(self) -> dict: if self.next_page_token is not None: 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 + if self.next_page_token is not None: 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.""" @@ -545,6 +682,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListValue: """Deserializes the ListValue from a dictionary.""" @@ -566,6 +709,13 @@ def as_dict(self) -> dict: if 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 + if 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.""" @@ -590,6 +740,13 @@ def as_dict(self) -> dict: if self.value: 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 + if self.value: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MapStringValueEntry: """Deserializes the MapStringValueEntry from a dictionary.""" @@ -628,6 +785,16 @@ def as_dict(self) -> dict: if self.primary_key is not None: 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 + if self.endpoint_name is not None: body['endpoint_name'] = self.endpoint_name + if self.index_type is not None: body['index_type'] = self.index_type + if self.name is not None: body['name'] = self.name + if self.primary_key is not None: body['primary_key'] = self.primary_key + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MiniVectorIndex: """Deserializes the MiniVectorIndex from a dictionary.""" @@ -672,6 +839,14 @@ def as_dict(self) -> dict: if self.page_token is not None: 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 + if self.index_name is not None: body['index_name'] = self.index_name + if self.page_token is not None: body['page_token'] = self.page_token + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryVectorIndexNextPageRequest: """Deserializes the QueryVectorIndexNextPageRequest from a dictionary.""" @@ -724,6 +899,19 @@ def as_dict(self) -> dict: if self.score_threshold is not None: 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 + if self.filters_json is not None: body['filters_json'] = self.filters_json + if self.index_name is not None: body['index_name'] = self.index_name + if self.num_results is not None: body['num_results'] = self.num_results + if self.query_text is not None: body['query_text'] = self.query_text + if self.query_type is not None: body['query_type'] = self.query_type + if self.query_vector: body['query_vector'] = self.query_vector + if self.score_threshold is not None: body['score_threshold'] = self.score_threshold + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryVectorIndexRequest: """Deserializes the QueryVectorIndexRequest from a dictionary.""" @@ -758,6 +946,14 @@ def as_dict(self) -> dict: if self.result: 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 + if self.next_page_token is not None: body['next_page_token'] = self.next_page_token + if self.result: body['result'] = self.result + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> QueryVectorIndexResponse: """Deserializes the QueryVectorIndexResponse from a dictionary.""" @@ -783,6 +979,13 @@ def as_dict(self) -> dict: if self.row_count is not None: 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 + if self.row_count is not None: body['row_count'] = self.row_count + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResultData: """Deserializes the ResultData from a dictionary.""" @@ -806,6 +1009,13 @@ def as_dict(self) -> dict: if 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 + if self.columns: body['columns'] = self.columns + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ResultManifest: """Deserializes the ResultManifest from a dictionary.""" @@ -833,6 +1043,14 @@ def as_dict(self) -> dict: if self.num_results is not None: 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 + if self.last_primary_key is not None: body['last_primary_key'] = self.last_primary_key + if self.num_results is not None: body['num_results'] = self.num_results + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ScanVectorIndexRequest: """Deserializes the ScanVectorIndexRequest from a dictionary.""" @@ -858,6 +1076,13 @@ def as_dict(self) -> dict: if self.last_primary_key is not None: 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 + if self.last_primary_key is not None: 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.""" @@ -875,6 +1100,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Struct: """Deserializes the Struct from a dictionary.""" @@ -889,6 +1120,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the SyncIndexResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SyncIndexResponse: """Deserializes the SyncIndexResponse from a dictionary.""" @@ -912,6 +1148,13 @@ def as_dict(self) -> dict: if self.success_row_count is not None: 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 + if self.success_row_count is not None: 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.""" @@ -944,6 +1187,13 @@ def as_dict(self) -> dict: if self.inputs_json is not None: 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 + if self.inputs_json is not None: body['inputs_json'] = self.inputs_json + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpsertDataVectorIndexRequest: """Deserializes the UpsertDataVectorIndexRequest from a dictionary.""" @@ -967,6 +1217,13 @@ def as_dict(self) -> dict: if self.status is not None: 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 + if self.status is not None: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpsertDataVectorIndexResponse: """Deserializes the UpsertDataVectorIndexResponse from a dictionary.""" @@ -999,6 +1256,17 @@ def as_dict(self) -> dict: if self.struct_value: 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 + if self.list_value: body['list_value'] = self.list_value + if self.null_value is not None: body['null_value'] = self.null_value + if self.number_value is not None: body['number_value'] = self.number_value + if self.string_value is not None: body['string_value'] = self.string_value + if 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.""" @@ -1052,6 +1320,19 @@ def as_dict(self) -> dict: if self.status: 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 + if 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 + if self.endpoint_name is not None: body['endpoint_name'] = self.endpoint_name + if self.index_type is not None: body['index_type'] = self.index_type + if self.name is not None: body['name'] = self.name + if self.primary_key is not None: body['primary_key'] = self.primary_key + if self.status: body['status'] = self.status + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> VectorIndex: """Deserializes the VectorIndex from a dictionary.""" @@ -1090,6 +1371,15 @@ def as_dict(self) -> dict: if self.ready is not None: 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 + if self.indexed_row_count is not None: body['indexed_row_count'] = self.indexed_row_count + if self.message is not None: body['message'] = self.message + if self.ready is not None: body['ready'] = self.ready + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> VectorIndexStatus: """Deserializes the VectorIndexStatus from a dictionary.""" diff --git a/databricks/sdk/service/workspace.py b/databricks/sdk/service/workspace.py index 29380d4f3..eb5418987 100755 --- a/databricks/sdk/service/workspace.py +++ b/databricks/sdk/service/workspace.py @@ -29,6 +29,13 @@ def as_dict(self) -> dict: if self.principal is not None: 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 + if self.principal is not None: body['principal'] = self.principal + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AclItem: """Deserializes the AclItem from a dictionary.""" @@ -57,6 +64,13 @@ def as_dict(self) -> dict: if self.resource_id is not None: 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 + if self.resource_id is not None: body['resource_id'] = self.resource_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> AzureKeyVaultSecretScopeMetadata: """Deserializes the AzureKeyVaultSecretScopeMetadata from a dictionary.""" @@ -91,6 +105,14 @@ def as_dict(self) -> dict: if self.personal_access_token is not None: 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 + if self.git_username is not None: body['git_username'] = self.git_username + if self.personal_access_token is not None: 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.""" @@ -119,6 +141,14 @@ def as_dict(self) -> dict: if self.git_username is not None: 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 + if self.git_provider is not None: body['git_provider'] = self.git_provider + if self.git_username is not None: body['git_username'] = self.git_username + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateCredentialsResponse: """Deserializes the CreateCredentialsResponse from a dictionary.""" @@ -154,6 +184,15 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.provider is not None: body['provider'] = self.provider + if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateRepoRequest: """Deserializes the CreateRepoRequest from a dictionary.""" @@ -198,6 +237,18 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.head_commit_id is not None: body['head_commit_id'] = self.head_commit_id + if self.id is not None: body['id'] = self.id + if self.path is not None: body['path'] = self.path + if self.provider is not None: body['provider'] = self.provider + if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateRepoResponse: """Deserializes the CreateRepoResponse from a dictionary.""" @@ -234,6 +285,16 @@ def as_dict(self) -> dict: if self.scope_backend_type is not None: 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 + if self.initial_manage_principal is not None: + body['initial_manage_principal'] = self.initial_manage_principal + if self.scope is not None: body['scope'] = self.scope + if self.scope_backend_type is not None: 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.""" @@ -252,6 +313,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the CreateScopeResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CreateScopeResponse: """Deserializes the CreateScopeResponse from a dictionary.""" @@ -278,6 +344,14 @@ def as_dict(self) -> dict: if self.git_username is not None: 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 + if self.git_provider is not None: body['git_provider'] = self.git_provider + if self.git_username is not None: body['git_username'] = self.git_username + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> CredentialInfo: """Deserializes the CredentialInfo from a dictionary.""" @@ -303,6 +377,13 @@ def as_dict(self) -> dict: if self.recursive is not None: 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 + if self.recursive is not None: body['recursive'] = self.recursive + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Delete: """Deserializes the Delete from a dictionary.""" @@ -324,6 +405,13 @@ def as_dict(self) -> dict: if self.scope is not None: 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 + if self.scope is not None: body['scope'] = self.scope + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteAcl: """Deserializes the DeleteAcl from a dictionary.""" @@ -338,6 +426,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteAclResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteAclResponse: """Deserializes the DeleteAclResponse from a dictionary.""" @@ -352,6 +445,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteCredentialsResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteCredentialsResponse: """Deserializes the DeleteCredentialsResponse from a dictionary.""" @@ -366,6 +464,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteRepoResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteRepoResponse: """Deserializes the DeleteRepoResponse from a dictionary.""" @@ -380,6 +483,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteResponse: """Deserializes the DeleteResponse from a dictionary.""" @@ -397,6 +505,12 @@ def as_dict(self) -> dict: if self.scope is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteScope: """Deserializes the DeleteScope from a dictionary.""" @@ -411,6 +525,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteScopeResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteScopeResponse: """Deserializes the DeleteScopeResponse from a dictionary.""" @@ -432,6 +551,13 @@ def as_dict(self) -> dict: if self.scope is not None: 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 + if self.scope is not None: body['scope'] = self.scope + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteSecret: """Deserializes the DeleteSecret from a dictionary.""" @@ -446,6 +572,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the DeleteSecretResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> DeleteSecretResponse: """Deserializes the DeleteSecretResponse from a dictionary.""" @@ -478,6 +609,13 @@ def as_dict(self) -> dict: if self.file_type is not None: 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 + if self.file_type is not None: body['file_type'] = self.file_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ExportResponse: """Deserializes the ExportResponse from a dictionary.""" @@ -504,6 +642,14 @@ def as_dict(self) -> dict: if self.git_username is not None: 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 + if self.git_provider is not None: body['git_provider'] = self.git_provider + if self.git_username is not None: body['git_username'] = self.git_username + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetCredentialsResponse: """Deserializes the GetCredentialsResponse from a dictionary.""" @@ -523,6 +669,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetRepoPermissionLevelsResponse: """Deserializes the GetRepoPermissionLevelsResponse from a dictionary.""" @@ -564,6 +716,18 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.head_commit_id is not None: body['head_commit_id'] = self.head_commit_id + if self.id is not None: body['id'] = self.id + if self.path is not None: body['path'] = self.path + if self.provider is not None: body['provider'] = self.provider + if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetRepoResponse: """Deserializes the GetRepoResponse from a dictionary.""" @@ -591,6 +755,13 @@ def as_dict(self) -> dict: if self.value is not None: 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 + if self.value is not None: body['value'] = self.value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetSecretResponse: """Deserializes the GetSecretResponse from a dictionary.""" @@ -608,6 +779,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> GetWorkspaceObjectPermissionLevelsResponse: """Deserializes the GetWorkspaceObjectPermissionLevelsResponse from a dictionary.""" @@ -657,6 +834,16 @@ def as_dict(self) -> dict: if self.path is not None: 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 + if self.format is not None: body['format'] = self.format + if self.language is not None: body['language'] = self.language + if self.overwrite is not None: body['overwrite'] = self.overwrite + if self.path is not None: body['path'] = self.path + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Import: """Deserializes the Import from a dictionary.""" @@ -697,6 +884,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the ImportResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ImportResponse: """Deserializes the ImportResponse from a dictionary.""" @@ -723,6 +915,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListAclsResponse: """Deserializes the ListAclsResponse from a dictionary.""" @@ -740,6 +938,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListCredentialsResponse: """Deserializes the ListCredentialsResponse from a dictionary.""" @@ -762,6 +966,13 @@ def as_dict(self) -> dict: if 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 + if self.repos: body['repos'] = self.repos + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListReposResponse: """Deserializes the ListReposResponse from a dictionary.""" @@ -779,6 +990,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListResponse: """Deserializes the ListResponse from a dictionary.""" @@ -796,6 +1013,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListScopesResponse: """Deserializes the ListScopesResponse from a dictionary.""" @@ -813,6 +1036,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ListSecretsResponse: """Deserializes the ListSecretsResponse from a dictionary.""" @@ -831,6 +1060,12 @@ def as_dict(self) -> dict: if self.path is not None: 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> Mkdirs: """Deserializes the Mkdirs from a dictionary.""" @@ -845,6 +1080,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the MkdirsResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> MkdirsResponse: """Deserializes the MkdirsResponse from a dictionary.""" @@ -894,6 +1134,19 @@ def as_dict(self) -> dict: if self.size is not None: 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 + if self.language is not None: body['language'] = self.language + if self.modified_at is not None: body['modified_at'] = self.modified_at + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + if self.path is not None: body['path'] = self.path + if self.resource_id is not None: body['resource_id'] = self.resource_id + if self.size is not None: body['size'] = self.size + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> ObjectInfo: """Deserializes the ObjectInfo from a dictionary.""" @@ -941,6 +1194,14 @@ def as_dict(self) -> dict: if self.scope is not None: 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 + if self.principal is not None: body['principal'] = self.principal + if self.scope is not None: body['scope'] = self.scope + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PutAcl: """Deserializes the PutAcl from a dictionary.""" @@ -957,6 +1218,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the PutAclResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PutAclResponse: """Deserializes the PutAclResponse from a dictionary.""" @@ -986,6 +1252,15 @@ def as_dict(self) -> dict: if self.string_value is not None: 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 + if self.key is not None: body['key'] = self.key + if self.scope is not None: body['scope'] = self.scope + if self.string_value is not None: body['string_value'] = self.string_value + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PutSecret: """Deserializes the PutSecret from a dictionary.""" @@ -1003,6 +1278,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the PutSecretResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> PutSecretResponse: """Deserializes the PutSecretResponse from a dictionary.""" @@ -1033,6 +1313,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoAccessControlRequest: """Deserializes the RepoAccessControlRequest from a dictionary.""" @@ -1070,6 +1360,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoAccessControlResponse: """Deserializes the RepoAccessControlResponse from a dictionary.""" @@ -1117,6 +1418,18 @@ def as_dict(self) -> dict: if self.url is not None: 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 + if self.head_commit_id is not None: body['head_commit_id'] = self.head_commit_id + if self.id is not None: body['id'] = self.id + if self.path is not None: body['path'] = self.path + if self.provider is not None: body['provider'] = self.provider + if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout + if self.url is not None: body['url'] = self.url + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoInfo: """Deserializes the RepoInfo from a dictionary.""" @@ -1146,6 +1459,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoPermission: """Deserializes the RepoPermission from a dictionary.""" @@ -1180,6 +1501,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoPermissions: """Deserializes the RepoPermissions from a dictionary.""" @@ -1202,6 +1531,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoPermissionsDescription: """Deserializes the RepoPermissionsDescription from a dictionary.""" @@ -1224,6 +1560,13 @@ def as_dict(self) -> dict: if self.repo_id is not None: 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 + if self.repo_id is not None: body['repo_id'] = self.repo_id + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> RepoPermissionsRequest: """Deserializes the RepoPermissionsRequest from a dictionary.""" @@ -1253,6 +1596,14 @@ def as_dict(self) -> dict: 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 + if self.last_updated_timestamp is not None: + 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.""" @@ -1278,6 +1629,14 @@ def as_dict(self) -> dict: if self.name is not None: 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 + if self.keyvault_metadata: body['keyvault_metadata'] = self.keyvault_metadata + if self.name is not None: body['name'] = self.name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SecretScope: """Deserializes the SecretScope from a dictionary.""" @@ -1301,6 +1660,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparseCheckout: """Deserializes the SparseCheckout from a dictionary.""" @@ -1322,6 +1687,12 @@ def as_dict(self) -> dict: if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> SparseCheckoutUpdate: """Deserializes the SparseCheckoutUpdate from a dictionary.""" @@ -1360,6 +1731,15 @@ def as_dict(self) -> dict: if self.personal_access_token is not None: 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 + if self.git_provider is not None: body['git_provider'] = self.git_provider + if self.git_username is not None: body['git_username'] = self.git_username + if self.personal_access_token is not None: 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.""" @@ -1377,6 +1757,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateCredentialsResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateCredentialsResponse: """Deserializes the UpdateCredentialsResponse from a dictionary.""" @@ -1409,6 +1794,15 @@ def as_dict(self) -> dict: if self.tag is not None: 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 + if self.repo_id is not None: body['repo_id'] = self.repo_id + if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout + if self.tag is not None: body['tag'] = self.tag + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateRepoRequest: """Deserializes the UpdateRepoRequest from a dictionary.""" @@ -1426,6 +1820,11 @@ def as_dict(self) -> dict: body = {} return body + def as_shallow_dict(self) -> dict: + """Serializes the UpdateRepoResponse into a shallow dictionary of its immediate attributes.""" + body = {} + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> UpdateRepoResponse: """Deserializes the UpdateRepoResponse from a dictionary.""" @@ -1456,6 +1855,16 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WorkspaceObjectAccessControlRequest: """Deserializes the WorkspaceObjectAccessControlRequest from a dictionary.""" @@ -1493,6 +1902,17 @@ def as_dict(self) -> dict: if self.user_name is not None: 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 + if self.display_name is not None: body['display_name'] = self.display_name + if self.group_name is not None: body['group_name'] = self.group_name + if self.service_principal_name is not None: + body['service_principal_name'] = self.service_principal_name + if self.user_name is not None: body['user_name'] = self.user_name + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WorkspaceObjectAccessControlResponse: """Deserializes the WorkspaceObjectAccessControlResponse from a dictionary.""" @@ -1520,6 +1940,14 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if 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 + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WorkspaceObjectPermission: """Deserializes the WorkspaceObjectPermission from a dictionary.""" @@ -1554,6 +1982,14 @@ def as_dict(self) -> dict: if self.object_type is not None: 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 + if self.object_id is not None: body['object_id'] = self.object_id + if self.object_type is not None: body['object_type'] = self.object_type + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WorkspaceObjectPermissions: """Deserializes the WorkspaceObjectPermissions from a dictionary.""" @@ -1577,6 +2013,13 @@ def as_dict(self) -> dict: if self.permission_level is not None: 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 + if self.permission_level is not None: body['permission_level'] = self.permission_level + return body + @classmethod def from_dict(cls, d: Dict[str, any]) -> WorkspaceObjectPermissionsDescription: """Deserializes the WorkspaceObjectPermissionsDescription from a dictionary.""" @@ -1603,6 +2046,14 @@ def as_dict(self) -> dict: if self.workspace_object_type is not None: 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 + if self.workspace_object_id is not None: body['workspace_object_id'] = self.workspace_object_id + if self.workspace_object_type is not None: 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.""" diff --git a/docs/dbdataclasses/catalog.rst b/docs/dbdataclasses/catalog.rst index 19b245b25..5b5fbb379 100644 --- a/docs/dbdataclasses/catalog.rst +++ b/docs/dbdataclasses/catalog.rst @@ -193,8 +193,6 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:class:: ColumnTypeName - Name of type (INT, STRUCT, MAP, etc.). - .. py:attribute:: ARRAY :value: "ARRAY" @@ -549,6 +547,10 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: WORKDAY_RAAS_FORMAT :value: "WORKDAY_RAAS_FORMAT" +.. autoclass:: DatabricksGcpServiceAccount + :members: + :undoc-members: + .. autoclass:: DatabricksGcpServiceAccountRequest :members: :undoc-members: @@ -718,11 +720,11 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: -.. autoclass:: GcpServiceAccountKey +.. autoclass:: GenerateTemporaryServiceCredentialAzureOptions :members: :undoc-members: -.. autoclass:: GenerateTemporaryServiceCredentialAzureOptions +.. autoclass:: GenerateTemporaryServiceCredentialGcpOptions :members: :undoc-members: @@ -1122,6 +1124,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: CREATE_FOREIGN_CATALOG :value: "CREATE_FOREIGN_CATALOG" + .. py:attribute:: CREATE_FOREIGN_SECURABLE + :value: "CREATE_FOREIGN_SECURABLE" + .. py:attribute:: CREATE_FUNCTION :value: "CREATE_FUNCTION" diff --git a/docs/dbdataclasses/cleanrooms.rst b/docs/dbdataclasses/cleanrooms.rst new file mode 100644 index 000000000..762c454bf --- /dev/null +++ b/docs/dbdataclasses/cleanrooms.rst @@ -0,0 +1,155 @@ +Clean Rooms +=========== + +These dataclasses are used in the SDK to represent API requests and responses for services in the ``databricks.sdk.service.cleanrooms`` module. + +.. py:currentmodule:: databricks.sdk.service.cleanrooms +.. autoclass:: CleanRoom + :members: + :undoc-members: + +.. py:class:: CleanRoomAccessRestricted + + .. py:attribute:: CSP_MISMATCH + :value: "CSP_MISMATCH" + + .. py:attribute:: NO_RESTRICTION + :value: "NO_RESTRICTION" + +.. autoclass:: CleanRoomAsset + :members: + :undoc-members: + +.. py:class:: CleanRoomAssetAssetType + + .. py:attribute:: FOREIGN_TABLE + :value: "FOREIGN_TABLE" + + .. py:attribute:: NOTEBOOK_FILE + :value: "NOTEBOOK_FILE" + + .. py:attribute:: TABLE + :value: "TABLE" + + .. py:attribute:: VIEW + :value: "VIEW" + + .. py:attribute:: VOLUME + :value: "VOLUME" + +.. autoclass:: CleanRoomAssetForeignTable + :members: + :undoc-members: + +.. autoclass:: CleanRoomAssetForeignTableLocalDetails + :members: + :undoc-members: + +.. autoclass:: CleanRoomAssetNotebook + :members: + :undoc-members: + +.. py:class:: CleanRoomAssetStatusEnum + + .. py:attribute:: ACTIVE + :value: "ACTIVE" + + .. py:attribute:: PERMISSION_DENIED + :value: "PERMISSION_DENIED" + +.. autoclass:: CleanRoomAssetTable + :members: + :undoc-members: + +.. autoclass:: CleanRoomAssetTableLocalDetails + :members: + :undoc-members: + +.. autoclass:: CleanRoomAssetView + :members: + :undoc-members: + +.. autoclass:: CleanRoomAssetViewLocalDetails + :members: + :undoc-members: + +.. autoclass:: CleanRoomAssetVolumeLocalDetails + :members: + :undoc-members: + +.. autoclass:: CleanRoomCollaborator + :members: + :undoc-members: + +.. autoclass:: CleanRoomNotebookTaskRun + :members: + :undoc-members: + +.. autoclass:: CleanRoomOutputCatalog + :members: + :undoc-members: + +.. py:class:: CleanRoomOutputCatalogOutputCatalogStatus + + .. py:attribute:: CREATED + :value: "CREATED" + + .. py:attribute:: NOT_CREATED + :value: "NOT_CREATED" + + .. py:attribute:: NOT_ELIGIBLE + :value: "NOT_ELIGIBLE" + +.. autoclass:: CleanRoomRemoteDetail + :members: + :undoc-members: + +.. py:class:: CleanRoomStatusEnum + + .. py:attribute:: ACTIVE + :value: "ACTIVE" + + .. py:attribute:: DELETED + :value: "DELETED" + + .. py:attribute:: FAILED + :value: "FAILED" + + .. py:attribute:: PROVISIONING + :value: "PROVISIONING" + +.. autoclass:: CollaboratorJobRunInfo + :members: + :undoc-members: + +.. autoclass:: ComplianceSecurityProfile + :members: + :undoc-members: + +.. autoclass:: CreateCleanRoomOutputCatalogResponse + :members: + :undoc-members: + +.. autoclass:: DeleteCleanRoomAssetResponse + :members: + :undoc-members: + +.. autoclass:: DeleteResponse + :members: + :undoc-members: + +.. autoclass:: ListCleanRoomAssetsResponse + :members: + :undoc-members: + +.. autoclass:: ListCleanRoomNotebookTaskRunsResponse + :members: + :undoc-members: + +.. autoclass:: ListCleanRoomsResponse + :members: + :undoc-members: + +.. autoclass:: UpdateCleanRoomRequest + :members: + :undoc-members: diff --git a/docs/dbdataclasses/dashboards.rst b/docs/dbdataclasses/dashboards.rst index 3d07ed346..22a3ea95d 100644 --- a/docs/dbdataclasses/dashboards.rst +++ b/docs/dbdataclasses/dashboards.rst @@ -17,6 +17,59 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: DASHBOARD_VIEW_BASIC :value: "DASHBOARD_VIEW_BASIC" +.. py:class:: DataType + + .. py:attribute:: DATA_TYPE_ARRAY + :value: "DATA_TYPE_ARRAY" + + .. py:attribute:: DATA_TYPE_BIG_INT + :value: "DATA_TYPE_BIG_INT" + + .. py:attribute:: DATA_TYPE_BINARY + :value: "DATA_TYPE_BINARY" + + .. py:attribute:: DATA_TYPE_BOOLEAN + :value: "DATA_TYPE_BOOLEAN" + + .. py:attribute:: DATA_TYPE_DATE + :value: "DATA_TYPE_DATE" + + .. py:attribute:: DATA_TYPE_DECIMAL + :value: "DATA_TYPE_DECIMAL" + + .. py:attribute:: DATA_TYPE_DOUBLE + :value: "DATA_TYPE_DOUBLE" + + .. py:attribute:: DATA_TYPE_FLOAT + :value: "DATA_TYPE_FLOAT" + + .. py:attribute:: DATA_TYPE_INT + :value: "DATA_TYPE_INT" + + .. py:attribute:: DATA_TYPE_INTERVAL + :value: "DATA_TYPE_INTERVAL" + + .. py:attribute:: DATA_TYPE_MAP + :value: "DATA_TYPE_MAP" + + .. py:attribute:: DATA_TYPE_SMALL_INT + :value: "DATA_TYPE_SMALL_INT" + + .. py:attribute:: DATA_TYPE_STRING + :value: "DATA_TYPE_STRING" + + .. py:attribute:: DATA_TYPE_STRUCT + :value: "DATA_TYPE_STRUCT" + + .. py:attribute:: DATA_TYPE_TIMESTAMP + :value: "DATA_TYPE_TIMESTAMP" + + .. py:attribute:: DATA_TYPE_TINY_INT + :value: "DATA_TYPE_TINY_INT" + + .. py:attribute:: DATA_TYPE_VOID + :value: "DATA_TYPE_VOID" + .. autoclass:: DeleteScheduleResponse :members: :undoc-members: @@ -246,6 +299,14 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: QuerySchema + :members: + :undoc-members: + +.. autoclass:: QuerySchemaColumn + :members: + :undoc-members: + .. autoclass:: Result :members: :undoc-members: diff --git a/docs/dbdataclasses/index.rst b/docs/dbdataclasses/index.rst index 987bee7f5..3ecb9c13f 100644 --- a/docs/dbdataclasses/index.rst +++ b/docs/dbdataclasses/index.rst @@ -8,6 +8,7 @@ Dataclasses apps billing catalog + cleanrooms compute dashboards files diff --git a/docs/dbdataclasses/jobs.rst b/docs/dbdataclasses/jobs.rst index 3aa0db043..374c48351 100644 --- a/docs/dbdataclasses/jobs.rst +++ b/docs/dbdataclasses/jobs.rst @@ -28,6 +28,81 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. 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:: 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:: 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:: ClusterInstance :members: :undoc-members: diff --git a/docs/dbdataclasses/settings.rst b/docs/dbdataclasses/settings.rst index 7d556f8ad..572a0d6c4 100644 --- a/docs/dbdataclasses/settings.rst +++ b/docs/dbdataclasses/settings.rst @@ -215,6 +215,14 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: DeleteAibiDashboardEmbeddingAccessPolicySettingResponse + :members: + :undoc-members: + +.. autoclass:: DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse + :members: + :undoc-members: + .. autoclass:: DeleteDefaultNamespaceSettingResponse :members: :undoc-members: @@ -276,6 +284,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:: EmailConfig :members: :undoc-members: diff --git a/docs/dbdataclasses/sharing.rst b/docs/dbdataclasses/sharing.rst index 650811e08..2db59fcbe 100644 --- a/docs/dbdataclasses/sharing.rst +++ b/docs/dbdataclasses/sharing.rst @@ -62,14 +62,16 @@ These dataclasses are used in the SDK to represent API requests and responses fo :members: :undoc-members: +.. autoclass:: PartitionSpecificationPartition + :members: + :undoc-members: + .. autoclass:: PartitionValue :members: :undoc-members: .. py:class:: PartitionValueOp - The operator to apply for the value. - .. py:attribute:: EQUAL :value: "EQUAL" @@ -108,6 +110,9 @@ These dataclasses are used in the SDK to represent API requests and responses fo .. py:attribute:: CREATE_FOREIGN_CATALOG :value: "CREATE_FOREIGN_CATALOG" + .. py:attribute:: CREATE_FOREIGN_SECURABLE + :value: "CREATE_FOREIGN_SECURABLE" + .. py:attribute:: CREATE_FUNCTION :value: "CREATE_FUNCTION" diff --git a/docs/workspace/cleanrooms/clean_room_assets.rst b/docs/workspace/cleanrooms/clean_room_assets.rst new file mode 100644 index 000000000..fe282543a --- /dev/null +++ b/docs/workspace/cleanrooms/clean_room_assets.rst @@ -0,0 +1,94 @@ +``w.clean_room_assets``: Assets +=============================== +.. currentmodule:: databricks.sdk.service.cleanrooms + +.. py:class:: CleanRoomAssetsAPI + + Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the + clean room. + + .. py:method:: create(clean_room_name: str [, asset: Optional[CleanRoomAsset]]) -> CleanRoomAsset + + Create an asset. + + Create a clean room asset —share an asset like a notebook or table into the clean room. For each UC + asset that is added through this method, the clean room owner must also have enough privilege on the + asset to consume it. The privilege must be maintained indefinitely for the clean room to be able to + access the asset. Typically, you should use a group as the clean room owner. + + :param clean_room_name: str + Name of the clean room. + :param asset: :class:`CleanRoomAsset` (optional) + Metadata of the clean room asset + + :returns: :class:`CleanRoomAsset` + + + .. py:method:: delete(clean_room_name: str, asset_type: CleanRoomAssetAssetType, asset_full_name: str) + + Delete an asset. + + Delete a clean room asset - unshare/remove the asset from the clean room + + :param clean_room_name: str + Name of the clean room. + :param asset_type: :class:`CleanRoomAssetAssetType` + The type of the asset. + :param asset_full_name: str + The fully qualified name of the asset, it is same as the name field in CleanRoomAsset. + + + + + .. py:method:: get(clean_room_name: str, asset_type: CleanRoomAssetAssetType, asset_full_name: str) -> CleanRoomAsset + + Get an asset. + + Get the details of a clean room asset by its type and full name. + + :param clean_room_name: str + Name of the clean room. + :param asset_type: :class:`CleanRoomAssetAssetType` + The type of the asset. + :param asset_full_name: str + The fully qualified name of the asset, it is same as the name field in CleanRoomAsset. + + :returns: :class:`CleanRoomAsset` + + + .. py:method:: list(clean_room_name: str [, page_token: Optional[str]]) -> Iterator[CleanRoomAsset] + + List assets. + + :param clean_room_name: str + Name of the clean room. + :param page_token: str (optional) + Opaque pagination token to go to next page based on previous query. + + :returns: Iterator over :class:`CleanRoomAsset` + + + .. py:method:: update(clean_room_name: str, asset_type: CleanRoomAssetAssetType, name: str [, asset: Optional[CleanRoomAsset]]) -> CleanRoomAsset + + Update an asset. + + Update a clean room asset. For example, updating the content of a notebook; changing the shared + partitions of a table; etc. + + :param clean_room_name: str + Name of the clean room. + :param asset_type: :class:`CleanRoomAssetAssetType` + The type of the asset. + :param name: str + A fully qualified name that uniquely identifies the asset within the clean room. This is also the + name displayed in the clean room UI. + + For UC securable assets (tables, volumes, etc.), the format is + *shared_catalog*.*shared_schema*.*asset_name* + + For notebooks, the name is the notebook file name. + :param asset: :class:`CleanRoomAsset` (optional) + Metadata of the clean room asset + + :returns: :class:`CleanRoomAsset` + \ No newline at end of file diff --git a/docs/workspace/cleanrooms/clean_room_task_runs.rst b/docs/workspace/cleanrooms/clean_room_task_runs.rst new file mode 100644 index 000000000..dcf59037c --- /dev/null +++ b/docs/workspace/cleanrooms/clean_room_task_runs.rst @@ -0,0 +1,25 @@ +``w.clean_room_task_runs``: Task Runs +===================================== +.. currentmodule:: databricks.sdk.service.cleanrooms + +.. py:class:: CleanRoomTaskRunsAPI + + Clean room task runs are the executions of notebooks in a clean room. + + .. py:method:: list(clean_room_name: str [, notebook_name: Optional[str], page_size: Optional[int], page_token: Optional[str]]) -> Iterator[CleanRoomNotebookTaskRun] + + List notebook task runs. + + List all the historical notebook task runs in a clean room. + + :param clean_room_name: str + Name of the clean room. + :param notebook_name: str (optional) + Notebook name + :param page_size: int (optional) + The maximum number of task runs to return + :param page_token: str (optional) + Opaque pagination token to go to next page based on previous query. + + :returns: Iterator over :class:`CleanRoomNotebookTaskRun` + \ No newline at end of file diff --git a/docs/workspace/cleanrooms/clean_rooms.rst b/docs/workspace/cleanrooms/clean_rooms.rst new file mode 100644 index 000000000..0d1468399 --- /dev/null +++ b/docs/workspace/cleanrooms/clean_rooms.rst @@ -0,0 +1,94 @@ +``w.clean_rooms``: Clean Rooms +============================== +.. currentmodule:: databricks.sdk.service.cleanrooms + +.. py:class:: 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. + + .. py:method:: create( [, clean_room: Optional[CleanRoom]]) -> CleanRoom + + Create a clean room. + + Create a new clean room with the specified collaborators. This method is asynchronous; the returned + name field inside the clean_room field can be used to poll the clean room status, using the + :method:cleanrooms/get method. When this method returns, the cluster will be in a PROVISIONING state. + The cluster will be usable once it enters an ACTIVE state. + + The caller must be a metastore admin or have the **CREATE_CLEAN_ROOM** privilege on the metastore. + + :param clean_room: :class:`CleanRoom` (optional) + + :returns: :class:`CleanRoom` + + + .. py:method:: create_output_catalog(clean_room_name: str [, output_catalog: Optional[CleanRoomOutputCatalog]]) -> CreateCleanRoomOutputCatalogResponse + + Create an output catalog. + + Create the output catalog of the clean room. + + :param clean_room_name: str + Name of the clean room. + :param output_catalog: :class:`CleanRoomOutputCatalog` (optional) + + :returns: :class:`CreateCleanRoomOutputCatalogResponse` + + + .. py:method:: delete(name: str) + + Delete a clean room. + + Delete a clean room. After deletion, the clean room will be removed from the metastore. If the other + collaborators have not deleted the clean room, they will still have the clean room in their metastore, + but it will be in a DELETED state and no operations other than deletion can be performed on it. + + :param name: str + Name of the clean room. + + + + + .. py:method:: get(name: str) -> CleanRoom + + Get a clean room. + + Get the details of a clean room given its name. + + :param name: str + + :returns: :class:`CleanRoom` + + + .. py:method:: list( [, page_size: Optional[int], page_token: Optional[str]]) -> Iterator[CleanRoom] + + List clean rooms. + + Get a list of all clean rooms of the metastore. Only clean rooms the caller has access to are + returned. + + :param page_size: int (optional) + Maximum number of clean rooms to return (i.e., the page length). Defaults to 100. + :param page_token: str (optional) + Opaque pagination token to go to next page based on previous query. + + :returns: Iterator over :class:`CleanRoom` + + + .. py:method:: update(name: str [, clean_room: Optional[CleanRoom]]) -> CleanRoom + + Update a clean room. + + Update a clean room. The caller must be the owner of the clean room, have **MODIFY_CLEAN_ROOM** + privilege, or be metastore admin. + + When the caller is a metastore admin, only the __owner__ field can be updated. + + :param name: str + Name of the clean room. + :param clean_room: :class:`CleanRoom` (optional) + + :returns: :class:`CleanRoom` + \ No newline at end of file diff --git a/docs/workspace/cleanrooms/index.rst b/docs/workspace/cleanrooms/index.rst new file mode 100644 index 000000000..a979ac201 --- /dev/null +++ b/docs/workspace/cleanrooms/index.rst @@ -0,0 +1,12 @@ + +Clean Rooms +=========== + +Manage clean rooms and their assets and task runs + +.. toctree:: + :maxdepth: 1 + + clean_room_assets + clean_room_task_runs + clean_rooms \ No newline at end of file diff --git a/docs/workspace/files/files.rst b/docs/workspace/files/files.rst index db20b2192..f1bd70317 100644 --- a/docs/workspace/files/files.rst +++ b/docs/workspace/files/files.rst @@ -64,8 +64,8 @@ Download a file. - Downloads a file of up to 5 GiB. The file contents are the response body. This is a standard HTTP file - download, not a JSON RPC. + Downloads a file. The file contents are the response body. This is a standard HTTP file download, not + a JSON RPC. It supports the Range and If-Unmodified-Since HTTP headers. :param file_path: str The absolute path of the file. diff --git a/docs/workspace/index.rst b/docs/workspace/index.rst index d9ca84197..667f6c18f 100644 --- a/docs/workspace/index.rst +++ b/docs/workspace/index.rst @@ -9,6 +9,7 @@ These APIs are available from WorkspaceClient apps/index catalog/index + cleanrooms/index compute/index dashboards/index files/index diff --git a/docs/workspace/jobs/jobs.rst b/docs/workspace/jobs/jobs.rst index e9e63bb20..b7d677f03 100644 --- a/docs/workspace/jobs/jobs.rst +++ b/docs/workspace/jobs/jobs.rst @@ -218,8 +218,8 @@ :param queue: :class:`QueueSettings` (optional) The queue settings of the job. :param run_as: :class:`JobRunAs` (optional) - Write-only setting. Specifies the user, service principal or group that the job/pipeline runs as. If - not specified, the job/pipeline runs as the user who created the job/pipeline. + Write-only setting. Specifies the user or service principal that the job runs as. If not specified, + the job runs as the user who created the job. Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown. :param schedule: :class:`CronSchedule` (optional) diff --git a/docs/workspace/settings/aibi_dashboard_embedding_access_policy.rst b/docs/workspace/settings/aibi_dashboard_embedding_access_policy.rst index 1480fc978..00d12fa36 100644 --- a/docs/workspace/settings/aibi_dashboard_embedding_access_policy.rst +++ b/docs/workspace/settings/aibi_dashboard_embedding_access_policy.rst @@ -7,6 +7,22 @@ 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). + .. py:method:: delete( [, etag: Optional[str]]) -> DeleteAibiDashboardEmbeddingAccessPolicySettingResponse + + Delete the AI/BI dashboard embedding access policy. + + Delete the AI/BI dashboard embedding access policy, reverting back to the default. + + :param etag: str (optional) + etag used for versioning. The response is at least as fresh as the eTag provided. This is used for + optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting + each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern + to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET + request, and pass it with the DELETE request to identify the rule set version you are deleting. + + :returns: :class:`DeleteAibiDashboardEmbeddingAccessPolicySettingResponse` + + .. py:method:: get( [, etag: Optional[str]]) -> AibiDashboardEmbeddingAccessPolicySetting Retrieve the AI/BI dashboard embedding access policy. diff --git a/docs/workspace/settings/aibi_dashboard_embedding_approved_domains.rst b/docs/workspace/settings/aibi_dashboard_embedding_approved_domains.rst index 09b12056e..d793e9a7c 100644 --- a/docs/workspace/settings/aibi_dashboard_embedding_approved_domains.rst +++ b/docs/workspace/settings/aibi_dashboard_embedding_approved_domains.rst @@ -7,6 +7,23 @@ 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. + .. py:method:: delete( [, etag: Optional[str]]) -> DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse + + Delete AI/BI dashboard embedding approved domains. + + Delete the list of domains approved to host embedded AI/BI dashboards, reverting back to the default + empty list. + + :param etag: str (optional) + etag used for versioning. The response is at least as fresh as the eTag provided. This is used for + optimistic concurrency control as a way to help prevent simultaneous writes of a setting overwriting + each other. It is strongly suggested that systems make use of the etag in the read -> delete pattern + to perform setting deletions in order to avoid race conditions. That is, get an etag from a GET + request, and pass it with the DELETE request to identify the rule set version you are deleting. + + :returns: :class:`DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse` + + .. py:method:: get( [, etag: Optional[str]]) -> AibiDashboardEmbeddingApprovedDomainsSetting Retrieve the list of domains approved to host embedded AI/BI dashboards. diff --git a/docs/workspace/sql/dashboards.rst b/docs/workspace/sql/dashboards.rst index 97ea1014d..f22c7c96b 100644 --- a/docs/workspace/sql/dashboards.rst +++ b/docs/workspace/sql/dashboards.rst @@ -1,5 +1,5 @@ -``w.dashboards``: Dashboards -============================ +``w.dashboards``: Dashboards (legacy) +===================================== .. currentmodule:: databricks.sdk.service.sql .. py:class:: DashboardsAPI